Issue Details (XML | Word | Printable)

Key: MODPYTHON-25
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Nicolas Lehuen
Reporter: Bruno Desthuilliers
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
mod_python

apply_fs_data() does not work with "new style" objects

Created: 03/Mar/05 02:52 AM   Updated: 05/Mar/06 01:43 PM
Return to search
Component/s: None
Affects Version/s: 3.1.3
Fix Version/s: 3.2.7

Time Tracking:
Not Specified

Environment: gentoo-linux, apache 2, python 2.3.4

Resolution Date: 03/Mar/05 05:35 AM


 Description  « Hide
util.py v.1.21, apply_fs_data()

Trying to publish instances of a new style class, you get an exception
(UnboundLocalError: local variable 'fc' referenced before assignment)
pointing to util.py, line 356

What happens is that the test line 336 doesn't work for new style classes, letting the code fallback to line 356 without fc being defined.

The fix is pretty trivial: rewrite line 336 as:
    if type(obj) is InstanceType or isinstance(obj, object):

Which leads to a second fix: the first arg of the function is named 'object', which seems sensible, but is also the name of the new style classes base class, so s/object/obj/ in that code is also needed.



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
There are no subversion log entries for this issue yet.