[issue19991] configparser instances cannot be pretty printed

2022-03-19 Thread Irit Katriel


Irit Katriel  added the comment:

It's not just that it can't be pretty printed - it doesn't even have __str__ or 
__repr__.

I think the only thing we have now it write, which can do this:

>>> config = configparser.ConfigParser()
>>> config['DEFAULT'] = {'ServerAliveInterval': '45','Compression': 
>>> 'yes','CompressionLevel': '9'}
>>> f = io.StringIO()
>>> config.write(f)
>>> f.getvalue()
'[DEFAULT]\nserveraliveinterval = 45\ncompression = yes\ncompressionlevel = 
9\n\n'
>>> pprint.pprint(f.getvalue())
('[DEFAULT]\n'
 'serveraliveinterval = 45\n'
 'compression = yes\n'
 'compressionlevel = 9\n'
 '\n')
>>>


Is this enough, or should something be added?

--
nosy: +iritkatriel

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19991] configparser instances cannot be pretty printed

2013-12-15 Thread Andrei Kucharavy

New submission from Andrei Kucharavy:

ConfigParser seems to share a lot of behavior with a dict, but cannot be pretty 
printed.

--
messages: 206267
nosy: Andrei.Kucharavy
priority: normal
severity: normal
status: open
title: configparser instances cannot be pretty printed
type: enhancement
versions: Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19991
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19991] configparser instances cannot be pretty printed

2013-12-15 Thread R. David Murray

R. David Murray added the comment:

Without looking at the details, I would guess that doing anything about this 
should have issue 7434 as a prereq.  But  Ɓukasz will have a more informed 
opinion.

--
nosy: +lukasz.langa, r.david.murray
versions: +Python 3.5 -Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19991
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com