[ python-Bugs-1194181 ] bz2.BZ2File doesn't handle modes correctly

SourceForge.net noreply at sourceforge.net
Tue May 3 04:39:06 CEST 2005


Bugs item #1194181, was opened at 2005-05-02 22:39
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1194181&group_id=5470

Category: Python Library
Group: Python 2.4
Status: Open
Resolution: None
Priority: 8
Submitted By: Bob Ippolito (etrepum)
Assigned to: Nobody/Anonymous (nobody)
Summary: bz2.BZ2File doesn't handle modes correctly

Initial Comment:
I've noticed that if I specify a file mode of 'U' to bz2.BZ2File, it will 
erase my file.  That's bad.  Specifying 'rU' works as expected.  
Basically, it assumes that you want a writable file unless it sees an 
'r' in the mode, or no mode is given.  Ugh.

I've attached a patch that fixes this on CVS HEAD, it looks like it 
should apply cleanly to 2.4 as well.  This is a backport candidate if 
I've ever seen one.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1194181&group_id=5470


More information about the Python-bugs-list mailing list