Modify

Opened 14 years ago

Closed 14 years ago

Last modified 9 years ago

#8751 closed defect (fixed)

Form update failure: HTTP request argument is not JSON serializable

Reported by: didley@… Owned by: Steffen Hoffmann
Priority: normal Component: TracFormsPlugin
Severity: normal Keywords: json interference
Cc: Trac Release: 0.12

Description

After installing TracForms-03 [10143] I got this error

<tracflexwiki.core.TracFlexWikiNode instance at 0x046EB328> is not JSON serializable

Protocoll of installing:

copying tracforms\htdocs\tracforms.css -> build\lib\tracforms\htdocs
creating build\lib\tracforms\locale
creating build\lib\tracforms\locale\de
creating build\lib\tracforms\locale\de\LC_HANNES
copying tracforms\locale\de\LC_HANNES\tracforms.mo -> build\lib\tracforms\locale\de\LC_HANNES
copying tracforms\locale\.placeholder -> build\lib\tracforms\locale
creating build\lib\tracforms\templates
copying tracforms\templates\form.html -> build\lib\tracforms\templates
copying tracforms\templates\switch.html -> build\lib\tracforms\templates
creating build\bdist.win32
creating build\bdist.win32\egg
creating build\bdist.win32\egg\tracforms
copying build\lib\tracforms\api.py -> build\bdist.win32\egg\tracforms
copying build\lib\tracforms\compat.py -> build\bdist.win32\egg\tracforms
copying build\lib\tracforms\environment.py -> build\bdist.win32\egg\tracforms
copying build\lib\tracforms\errors.py -> build\bdist.win32\egg\tracforms
copying build\lib\tracforms\formdb.py -> build\bdist.win32\egg\tracforms
creating build\bdist.win32\egg\tracforms\htdocs
copying build\lib\tracforms\htdocs\tracforms.css -> build\bdist.win32\egg\tracforms\htdocs
creating build\bdist.win32\egg\tracforms\locale
copying build\lib\tracforms\locale\.placeholder -> build\bdist.win32\egg\tracforms\locale
creating build\bdist.win32\egg\tracforms\locale\de
creating build\bdist.win32\egg\tracforms\locale\de\LC_HANNES
copying build\lib\tracforms\locale\de\LC_HANNES\tracforms.mo -> build\bdist.win32\egg\tracforms\lo
cale\de\LC_HANNES
copying build\lib\tracforms\macros.py -> build\bdist.win32\egg\tracforms
copying build\lib\tracforms\model.py -> build\bdist.win32\egg\tracforms
creating build\bdist.win32\egg\tracforms\templates
copying build\lib\tracforms\templates\form.html -> build\bdist.win32\egg\tracforms\templates
copying build\lib\tracforms\templates\switch.html -> build\bdist.win32\egg\tracforms\templates
copying build\lib\tracforms\tracdb.py -> build\bdist.win32\egg\tracforms
copying build\lib\tracforms\util.py -> build\bdist.win32\egg\tracforms
copying build\lib\tracforms\web_ui.py -> build\bdist.win32\egg\tracforms
copying build\lib\tracforms\__init__.py -> build\bdist.win32\egg\tracforms
byte-compiling build\bdist.win32\egg\tracforms\api.py to api.pyc
byte-compiling build\bdist.win32\egg\tracforms\compat.py to compat.pyc
byte-compiling build\bdist.win32\egg\tracforms\environment.py to environment.pyc
byte-compiling build\bdist.win32\egg\tracforms\errors.py to errors.pyc
byte-compiling build\bdist.win32\egg\tracforms\formdb.py to formdb.pyc
byte-compiling build\bdist.win32\egg\tracforms\macros.py to macros.pyc
byte-compiling build\bdist.win32\egg\tracforms\model.py to model.pyc
byte-compiling build\bdist.win32\egg\tracforms\tracdb.py to tracdb.pyc
byte-compiling build\bdist.win32\egg\tracforms\util.py to util.pyc
byte-compiling build\bdist.win32\egg\tracforms\web_ui.py to web_ui.pyc
byte-compiling build\bdist.win32\egg\tracforms\__init__.py to __init__.pyc
creating build\bdist.win32\egg\EGG-INFO
copying TracForms.egg-info\PKG-INFO -> build\bdist.win32\egg\EGG-INFO
copying TracForms.egg-info\SOURCES.txt -> build\bdist.win32\egg\EGG-INFO
copying TracForms.egg-info\dependency_links.txt -> build\bdist.win32\egg\EGG-INFO
copying TracForms.egg-info\entry_points.txt -> build\bdist.win32\egg\EGG-INFO
copying TracForms.egg-info\requires.txt -> build\bdist.win32\egg\EGG-INFO
copying TracForms.egg-info\top_level.txt -> build\bdist.win32\egg\EGG-INFO
copying TracForms.egg-info\zip-safe -> build\bdist.win32\egg\EGG-INFO
creating dist
creating 'dist\TracForms-0.3-py2.5.egg' and adding 'build\bdist.win32\egg' to it
removing 'build\bdist.win32\egg' (and everything under it)
Processing TracForms-0.3-py2.5.egg
Copying TracForms-0.3-py2.5.egg to c:\programme\python25\lib\site-packages
Removing tracforms 0.3dev from easy-install.pth file
Adding TracForms 0.3 to easy-install.pth file

Installed c:\programme\python25\lib\site-packages\tracforms-0.3-py2.5.egg
Processing dependencies for TracForms==0.3
Searching for trac==0.12.2
Best match: trac 0.12.2
Processing trac-0.12.2-py2.5.egg
trac 0.12.2 is already the active version in easy-install.pth
Installing trac-admin-script.py script to C:\Programme\Python25\Scripts
Installing trac-admin.exe script to C:\Programme\Python25\Scripts
Installing trac-admin.exe.manifest script to C:\Programme\Python25\Scripts
Installing tracd-script.py script to C:\Programme\Python25\Scripts
Installing tracd.exe script to C:\Programme\Python25\Scripts
Installing tracd.exe.manifest script to C:\Programme\Python25\Scripts

Using c:\programme\python25\lib\site-packages\trac-0.12.2-py2.5.egg
Searching for Genshi==0.6
Best match: Genshi 0.6
Processing genshi-0.6-py2.5.egg
genshi 0.6 is already the active version in easy-install.pth

Using c:\programme\python25\lib\site-packages\genshi-0.6-py2.5.egg
Searching for setuptools==0.6c11
Best match: setuptools 0.6c11
Processing setuptools-0.6c11-py2.5.egg
setuptools 0.6c11 is already the active version in easy-install.pth
Installing easy_install-script.py script to C:\Programme\Python25\Scripts
Installing easy_install.exe script to C:\Programme\Python25\Scripts
Installing easy_install.exe.manifest script to C:\Programme\Python25\Scripts
Installing easy_install-2.5-script.py script to C:\Programme\Python25\Scripts
Installing easy_install-2.5.exe script to C:\Programme\Python25\Scripts
Installing easy_install-2.5.exe.manifest script to C:\Programme\Python25\Scripts

Using c:\programme\python25\lib\site-packages\setuptools-0.6c11-py2.5.egg
Finished processing dependencies for TracForms==0.3

A upgrade of the database have I done also. All other topics with trac semms to work fine. Using tracforms and I get the above message.

didley

Attachments (0)

Change History (9)

comment:1 Changed 14 years ago by Steffen Hoffmann

Keywords: json interference added

This sound like the plugin is interfering with FlexibleWikiPlugin.

Did you already try with FlexibleWikiPlugin (temorary) disabled? If not, do so and report back. Anyway I've used FlexibleWikiPlugin too, only stopped before most of TracFormsPlugin's recent development. And I've seen strings similar to

'tracflexwiki.core.TracFlexWikiNode instance at <hex number>'

in old form history. So maybe we'll need to filter this out.

comment:2 Changed 14 years ago by Steffen Hoffmann

Status: newassigned

Confirmed. FlexibleWikiPlugin adds an alien node argument JSON can't cope with.

After testing a special regexp I started wondering, what other plugins could produce similar or other side-effects too. So finally I moved to sanitizing of the whole args dict.

Please check, if the following solution works for you too.

comment:3 Changed 14 years ago by Steffen Hoffmann

(In [10147]) TracFormsPlugin: Sanitize form update request arguments, refs #8751.

To prevent side-effects such as that reported for FlexibleWikiPlugin let's check all arguments prior to attempting JSON serialization.

comment:4 Changed 14 years ago by didley@…

I turned off FlexibleWikiPlugin and TracFormsPlugin works.

I did use [10147] and TracFormsPlugin works.

I turned on FlexibleWikiPlugin and TracFormsPlugin produces the same error.

I compared api.py in [10147] with api.py if I download it from https://trac-hacks.org/browser/tracformsplugin/tags/tracforms-0.3. In https://trac-hacks.org/browser/tracformsplugin/tags/tracforms-0.3 the changes are not made. So I changed api.py by my self like [10147] and after this Tracformsplugin is working with FlexibleWikiPlugin.

I don't know why I get from download https://trac-hacks.org/browser/tracformsplugin/tags/tracforms-0.3 a different api.py as from [10147].

Many thanx

didley

comment:5 in reply to:  4 Changed 14 years ago by Steffen Hoffmann

Replying to didley@gmx.de:

I turned off FlexibleWikiPlugin and TracFormsPlugin works.

Good to know.

I did use [10147] and TracFormsPlugin works.

Perfect, thanks for the confirmation.

I turned on FlexibleWikiPlugin and TracFormsPlugin produces the same error. ![...] I don't know why I get from download https://trac-hacks.org/browser/tracformsplugin/tags/tracforms-0.3 a different api.py as from [10147].

I do know very well: Since [10147] is only about trunk (currently '0.4dev'), there's no way this could be in the 0.3 release. I've left the last stable release unchanged by now intentionally. But I'll push out a 0.3.1 release with this and some more fixes soonish. Ok?

comment:6 Changed 14 years ago by Steffen Hoffmann

Summary: NOT JSON serializableForm update fails because an HTTP request argument is not JSON serializable

Improve the issue title

comment:7 Changed 14 years ago by Steffen Hoffmann

Summary: Form update fails because an HTTP request argument is not JSON serializableForm update failure: HTTP request argument is not JSON serializable

Another editorial change

comment:8 Changed 14 years ago by didley@…

That's very well for me.

comment:9 Changed 14 years ago by Steffen Hoffmann

Resolution: fixed
Status: assignedclosed

(In [10175]) TracFormsPlugin: Maintenance release version 0.3.1, closes #8751.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Steffen Hoffmann.
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.