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 tcourbon
Recipients georg.brandl, tcourbon
Date 2009-10-11.13:09:33
SpamBayes Score 1.0023748e-09
Marked as misclassified No
Message-id <1255266575.87.0.417277827864.issue7103@psf.upfronthosting.co.za>
In-reply-to
Content
When ran in python 3.1.1 (hand compiled, fedora 11), the first example
of configparser module fail with :
Traceback (most recent call last):
  File "test1.py", line 22, in <module>
    config.write(configfile)
  File "/usr/local/lib/python3.1/configparser.py", line 394, in write
    fp.write("[%s]\n" % section)
TypeError: write() argument 1 must be bytes or buffer, not str

This can be solved by replacing :
with open('example.cfg', 'wb') as configfile:

by :
with open('example.cfg', 'w') as configfile:

Patch attached.

Cheer !
Thomas
History
Date User Action Args
2009-10-11 13:09:36tcourbonsetrecipients: + tcourbon, georg.brandl
2009-10-11 13:09:35tcourbonsetmessageid: <1255266575.87.0.417277827864.issue7103@psf.upfronthosting.co.za>
2009-10-11 13:09:34tcourbonlinkissue7103 messages
2009-10-11 13:09:33tcourboncreate