You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! Seems configparser is broken in recent versions of py3k. Please also check older
versions of python.
$ python3 ./cfgexample.py
Traceback (most recent call last):
File "./cfgexample.py", line 9, in <module>
config.write(configfile)
File "/usr/local/py3k/lib/python3.2/configparser.py", line 394, in write
fp.write("[%s]\n"% section)
TypeError: must be bytes or buffer, not str
$ cat ./cfgexample.py
import configparser
I've built this version of python:
$ hg head
changeset: 4765:488e143fad23
branch: py3k
tag: tip
user: tarek.ziade
date: Tue Sep 22 12:08:13 2009 +0200
summary: [svn r75013] Merged revisions 74812 via svnmerge from
It seems that nobody updated the documentation to say that configparser
operates on text files. The example is also wrong, it should open the
file in 'w' mode, not 'wb'.
Fixed in r75016.
PS: please use more expressive titles for issues in the future.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: