Ulrich Eckhardt <eckha...@satorlaser.com> added the comment: 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. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue4829> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com