[Checkins] SVN: z3c.extfile/trunk/ fix bug, version bump,
see CHANGES.txt
Bernd Dorn
bernd.dorn at lovelysystems.com
Wed Apr 23 07:45:04 EDT 2008
Log message for revision 85634:
fix bug, version bump, see CHANGES.txt
Changed:
U z3c.extfile/trunk/CHANGES.txt
U z3c.extfile/trunk/setup.py
U z3c.extfile/trunk/src/z3c/extfile/hashdir.py
-=-
Modified: z3c.extfile/trunk/CHANGES.txt
===================================================================
--- z3c.extfile/trunk/CHANGES.txt 2008-04-23 07:19:30 UTC (rev 85633)
+++ z3c.extfile/trunk/CHANGES.txt 2008-04-23 11:45:02 UTC (rev 85634)
@@ -2,6 +2,13 @@
Changes for z3c.extfile
=======================
+0.2.0a3 (2008-04-23)
+====================
+
+- if path in hashdir utility is given as unicode, keep the path
+ unicode and convert only digests of files to strings. Fixes a bug
+ reported by Yuang Hong.
+
0.2.0a2 (2008-02-16)
====================
Modified: z3c.extfile/trunk/setup.py
===================================================================
--- z3c.extfile/trunk/setup.py 2008-04-23 07:19:30 UTC (rev 85633)
+++ z3c.extfile/trunk/setup.py 2008-04-23 11:45:02 UTC (rev 85634)
@@ -2,7 +2,7 @@
setup(
name = "z3c.extfile",
- version = "0.2.0a2",
+ version = "0.2.0a3",
author = "Zope Contributors",
author_email = "zope3-dev at zope.org",
description = "Large file handling for zope3",
Modified: z3c.extfile/trunk/src/z3c/extfile/hashdir.py
===================================================================
--- z3c.extfile/trunk/src/z3c/extfile/hashdir.py 2008-04-23 07:19:30 UTC (rev 85633)
+++ z3c.extfile/trunk/src/z3c/extfile/hashdir.py 2008-04-23 11:45:02 UTC (rev 85634)
@@ -3,7 +3,7 @@
import stat
import tempfile
import shutil
-from types import StringType
+from types import StringTypes, UnicodeType
import interfaces
from zope import interface
from persistent import Persistent
@@ -60,8 +60,10 @@
return os.listdir(self.var)
def getPath(self, digest):
- if type(digest) != StringType or len(digest) != 40:
+ if type(digest) not in StringTypes or len(digest) != 40:
raise ValueError, repr(digest)
+ if type(self.var) is UnicodeType:
+ digest = unicode(digest)
path = os.path.join(self.var, digest)
if not os.path.isfile(path):
raise KeyError, digest
@@ -82,7 +84,7 @@
def __init__(self, name, bufsize=-1):
self.name = name
- self.digest = os.path.split(self.name)[1]
+ self.digest = str(os.path.split(self.name)[1])
self.bufsize=bufsize
self._v_len = None
self._v_file = None
More information about the Checkins
mailing list