This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eckhardt
Recipients eckhardt, jszakmeister
Date 2009-06-02.09:46:03
SpamBayes Score 4.112039e-06
Marked as misclassified No
Message-id <1243935966.21.0.526616193866.issue4829@psf.upfronthosting.co.za>
In-reply-to
Content
Good catch, it just took me a while to actually figure out myself where
the bug is. Try the following instead:

  import io
  io.FileIO('foo.text', 'w++')

This will yield "ValueError: Must have exactly one of read/write/append
mode" with 2.6 on win32. I haven't tested on the latest 2.x or 3.x
branches, but looking at the 2.7 branch, I see the faulty code is still
there.

BTW:
Using io.open('foo.text', 'w++') yields "ValueError: invalid mode:
'w++'", I would have expected the same error as for io.FileIO() above.
Using open('foo.text', 'w++') works.
Using open('foo.text', 'ww++') yields "IOError: [Errno 22] invalid mode
('ww++') or filename: 'foo.text')".

In other words, Python 2.6 is behaving a bit inconsistent here. The
patch only fixes one of those issues, the others and the necessary unit
tests remain.
History
Date User Action Args
2009-06-02 09:46:06eckhardtsetrecipients: + eckhardt, jszakmeister
2009-06-02 09:46:06eckhardtsetmessageid: <1243935966.21.0.526616193866.issue4829@psf.upfronthosting.co.za>
2009-06-02 09:46:04eckhardtlinkissue4829 messages
2009-06-02 09:46:04eckhardtcreate