Ticket #9086 (closed defect: fixed)

Opened 2 years ago

Last modified 8 months ago

not python2.6 compatible - not stable in trac0.12.2

Reported by: anonymous Assigned to: rjollos
Priority: normal Component: StractisticsPlugin
Severity: normal Keywords: trac0.12 python2.6 simplejson json
Cc: jan.kowalleck@gfk.com, kstyanos@gmail.com Trac Release: 0.12

Description

you are writing "If your python < 2.6, it requires simplejson" - but the source you are offering requires simplejson anyway, undepending any version of pyton.

you are writing about compatibility to trac0.12 on the projects site "2011-01-10: Trac 0.11 and 0.12 (trunk) compatible versions are now available. The Trac 0.10 version is no longer supported. " - this is not given; the plugin runs unstable and causes Internal Server Error from time to time or even "No handler matched request to /stractistics"

i took http://trac-hacks.org/changeset/latest/stractisticsplugin?old_path=/&filename=stractisticsplugin&format=zip as you wrote on the project's page, and compiled the trunk to an .egg to get this run in trac0.12.2 i made some changes to the trunc/stractistics/web_ui.py :

### this is line 33
# from http://stackoverflow.com/questions/712791/json-and-simplejson-module-differences-in-python
try: import simplejson as json
except ImportError: import json

# changed any "simplejson" in this file to "json"

i installed as a plugin into the trac-folder running python 2.6

Attachments

Change History

09/10/12 21:25:26 changed by rjollos

  • status changed from new to assigned.
  • cc changed from jan.kowalleck@gfk.com to jan.kowalleck@gfk.com, kstyanos@gmail.com.
  • owner changed from dagomez to rjollos.

Yes, the fix you propose is correct. I will commit the change shortly.

09/10/12 22:10:49 changed by rjollos

  • status changed from assigned to closed.
  • resolution set to fixed.

(In [11967]) Fixes #9086:

  • JSON package is used when available (Python 2.6+), otherwise SimpleJSON is used.
  • Removed unused imports.
  • Added a changelog.
  • Modified package entry point.
  • Converted tabs to spaces. The source code consistently uses spaces now.

09/10/12 22:12:20 changed by rjollos

Please report back if you are able to test the latest version of the trunk. Thanks!

09/10/12 22:15:12 changed by rjollos

#10290 closed as a duplicate.

09/15/12 21:59:27 changed by rjollos

The simplejson/json fix is the same as that used in /tracworkflowadminplugin/0.12/tracworkflowadmin/web_ui.py@11594. I think this is a good pattern to follow.

try: 
    import json 
except ImportError: 
    import simplejson as json 

09/16/12 10:44:27 changed by rjollos

  • keywords changed from trac0.12 python2.6 to trac0.12 python2.6 simplejson json.

Add/Change #9086 (not python2.6 compatible - not stable in trac0.12.2)




Change Properties
Action