Ticket #5617 (closed Feature Request: fixed)
ExtendedPathIndex needs to accept unicode object
| Reported by: | dpollard | Owned by: | |
|---|---|---|---|
| Priority: | minor | Milestone: | 2.1.4 |
| Component: | Infrastructure | Keywords: | unicode, ExtendedPathIndex |
| Cc: |
Description
A large number of folders and Archetypes objects were created programmatically in Plone 2.1.3 on Zope 2.7.8 but could not be accessed because of a runtime ValueError, invalid literal for int()
The path of the object somehow has been created as a unicode object and ExtendedPathIndex expects a string or casts the object to int. Adding a test for a unicode object has solved the problem:
--- ExtendedPathIndex.py 2006-07-04 11:38:22.000000000 +0100 +++ ExtendedPathIndex.py.orig 2006-07-04 11:37:52.000000000 +0100 @@ -211,7 +211,7 @@
level < 0 not implemented yet """
- if isinstance(path, str) or isinstance(path, unicode):
+ if isinstance(path, str):
startlevel = default_level
else:
startlevel = int(path[1])

(In [10191]) Relaxed a check for path only allowing strings so far. Now we except all basestrings. This closes #5617. Converted log infrastructure to use Python's logging module instead zLOG. Cleaned up HISTORY.txt.