|
From: Michael F. <fuz...@vo...> - 2006-02-02 18:38:51
|
Aaron Bentley wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Fuzzyman wrote: > >> Aaron Bentley wrote: >> >> Michael Foord wrote: >> | I would really appreciate it if you could check this out and try and >> | break it. Unicode is notoriously fiddly to get right ! >> >> This all looks good. I will try converting bzr to the latest version >> soon, and let you know. >> >> >>> Great. >>> > > I have done this, and I was rather surprised that the output of > cfg_obj.write() is a list of unicode strings, rather than a list of > bytestrings. > > Ok - so if an encoding is specified, then ``write()`` should always return byte strings. That is what is called an 'over-sight'. :-) Will be fixed. > We need to supply our own file objects, so we've been using the lines > output from cfg_obj.write() up to this point. The StringIO support > looks awkward, but probably doable to me. (Am I right that the public > member for the StringIO is ConfigObj.filename?) > > Yes. > My preference would be the ability to specify a file object to > cfg_obj.write(). > So you'd like to be able to pass a file like object to ``write()``... hmmm... Again, this is something that you used to be able to do with ConfigObj 3, but I removed to reduce the level of complexity. To be symmetric with initialisation, you ought then be able to pass in a filename as well. Seeing as you can already achieve this just be setting the ``filename`` attribute (which ok sounds a little weird for this purpose), I decided not to do it. Hmmm... I guess it wouldn't hurt being able to pass an optional file object to write, it's just that the API keeps growing... Nicola, do you have any take on this ? All the best, Fuzzyman http://www.voidspace.org.uk/python/index.shtml > Aaron > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.1 (GNU/Linux) > Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org > > iD8DBQFD4kxA0F+nu1YWqI0RAgoLAJ9HlNNJ0bTOm4xPEL3NXzeGzEvAeQCdEJw5 > FSyN2JEIBcKvT3lPHW2Zo/E= > =gKuf > -----END PGP SIGNATURE----- > > |