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 georgefischhof
Recipients docs@python, georgefischhof
Date 2016-11-16.15:00:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1479308435.4.0.112292626323.issue28714@psf.upfronthosting.co.za>
In-reply-to
Content
Hi There, 

I used configparser.ConfigParser.write() to update a config file.
And I found that my config wa duplicated.

The file was opened with mode 'r+' 
I figured out that write (I mean the write method of configparser) writes at actual file position.

I issued a file.seek(0) command before write and the result was good.


So I think documentaion should advice to user to reopen the file with mode 'w' or to issue a file.seek(0) command before using the ConfigParser.write()


I used the following python version on windows:
Python 3.5.1 (v3.5.1:37a07cee5969, Dec  6 2015, 01:38:48) [MSC v.1900 32 bit (Intel)] on win32

affected documentation:
https://docs.python.org/3.5/library/configparser.html#configparser.ConfigParser.write

Best Regards,
George Fischhof
History
Date User Action Args
2016-11-16 15:00:35georgefischhofsetrecipients: + georgefischhof, docs@python
2016-11-16 15:00:35georgefischhofsetmessageid: <1479308435.4.0.112292626323.issue28714@psf.upfronthosting.co.za>
2016-11-16 15:00:35georgefischhoflinkissue28714 messages
2016-11-16 15:00:35georgefischhofcreate