Modify

Opened 13 years ago

Closed 12 years ago

Last modified 12 years ago

#9086 closed defect (fixed)

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

Reported by: anonymous Owned by: Ryan J Ollos
Priority: normal Component: StractisticsPlugin
Severity: normal Keywords: trac0.12 python2.6 simplejson json
Cc: jan.kowalleck@…, kstyanos@… 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 (0)

Change History (6)

comment:1 Changed 12 years ago by Ryan J Ollos

Cc: kstyanos@… added
Owner: changed from dagomez to Ryan J Ollos
Status: newassigned

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

comment:2 Changed 12 years ago by Ryan J Ollos

Resolution: fixed
Status: assignedclosed

(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.

comment:3 Changed 12 years ago by Ryan J Ollos

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

comment:4 Changed 12 years ago by Ryan J Ollos

#10290 closed as a duplicate.

comment:5 Changed 12 years ago by Ryan J Ollos

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 

comment:6 Changed 12 years ago by Ryan J Ollos

Keywords: simplejson json added

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.