Out of date with a PSL httplib change

Reported by Plone Forge on 2007-09-04
2
Affects Status Importance Assigned to Milestone
Zope 2
Medium
Unassigned

Bug Description

The code in HTTP(httplib.HTTP):getreply is out of date with changes (a long time ago) to the Python standard library httplib at line 33: self.sock should be self._conn.sock.

Also there is a really ugly assumption in Resource:put that filesnames are 7-bit ASCII which is not true on modern filesystems: they could be latin1 or utf-8 for example. The assumption is that if the thing given to the first argument of put doesn't match isbin=re.compile(r'[\000-\006\177-\277]') then then it might be a filename, and it calls os.stat on what could be a very large string full of control characters to see if it's a filename to be opened, which may provoke OSErrors on some OSs.

I think this method should be deprecated, and 2 new methods putFile and putBytes should replace it without the binary assumption code, even if it means changing all of the code that calls this method (probably not many occurences).

Plone Forge (ploneforge) wrote :
Changed in zope2:
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments