[Zope-Checkins] CVS: Packages/OFS - Image.py:1.145.2.10
Florent Guillaume
fg at nuxeo.com
Fri Nov 5 10:01:24 EST 2004
Update of /cvs-repository/Packages/OFS
In directory cvs.zope.org:/tmp/cvs-serv7075/lib/python/OFS
Modified Files:
Tag: Zope-2_7-branch
Image.py
Log Message:
Collector #934: Image and File objects are now always internally
split into small Pdata chunks even when initialized from a string.
=== Packages/OFS/Image.py 1.145.2.9 => 1.145.2.10 ===
--- Packages/OFS/Image.py:1.145.2.9 Tue Nov 2 12:24:58 2004
+++ Packages/OFS/Image.py Fri Nov 5 10:00:53 2004
@@ -479,8 +479,10 @@
if type(file) is StringType:
size=len(file)
if size < n: return file, size
- return Pdata(file), size
- elif isinstance(file, FileUpload) and not file:
+ # Big string: cut it into smaller chunks
+ file = StringIO(file)
+
+ if isinstance(file, FileUpload) and not file:
raise ValueError, 'File not specified'
if hasattr(file, '__class__') and file.__class__ is Pdata:
More information about the Zope-Checkins
mailing list