New submission from Sebastian Bank:
ConfigParser parses section lines containing square brackets like '[spam [eggs]
spam]' up to the first instead of the last occurrence of ']' preventing
roundtrips:
s = StringIO()
c1 = ConfigParser()
c1.add_section('spam [eggs]')
c1.write(s)
s.seek(0
Sebastian Bank added the comment:
If this is the intended behaviuour, I guess ConfigParser should warn the user
if he supplies a section name with a ']' (prevent failed roundtrips).
See http://bugs.python.org/issue23301
The current behaviour looks like the opposite of Postel's law
Sebastian Bank added the comment:
Terry: I am not so sure about that interpretation. Do we agree that the
INI-files are the data/message? ConfigParser refuses to accept dirty INI-Files
(with ']' in section names) but will produce this kind of files.
I we see the arguments given to ConfigParser
New submission from Sebastian Bank:
Under Python 2.7.11 (Win 7), saving of the IDLE shell output produces no file
if the output contains non-ASCII characters, e.g. after doing (before this, it
does work):
>>> print u'sp\xe4m'
späm
>>>
When saving (generally), the
Sebastian Bank added the comment:
AFAIU, this change broke the following usage of subprocess on Windows
(re-using a subprocess.STARTUPINFO instance to hide the command window):
import os, subprocess
STARTUPINFO = subprocess.STARTUPINFO()
STARTUPINFO.dwFlags
Sebastian Bank <sebastian.b...@uni-leipzig.de> added the comment:
I am not sure about the design vs. code bug distinction, but what makes me
think this should be fixed is primarily the broken round-trip (already
mentioned above):
>>> import io, csv
>>> def roun
Sebastian Bank <sebastian.b...@uni-leipzig.de> added the comment:
https://bugs.python.org/issue15927#msg309811 gives sme code examples
illustrating why I think this should be backported (and also the documentation
should be changed for both Python 2 and 3).
--
nosy:
Sebastian Bank <sebastian.b...@uni-leipzig.de> added the comment:
Hi, is there something we can do to get this going? As the issue breaks
round-trip, it currently requires work-arounds like this:
https://github.com/cldf/csvw/blob/1324550266c821ef32d1e79c124191e93aefbfa8/csvw/dsv.py#L
Sebastian Bank <sebastian.b...@uni-leipzig.de> added the comment:
To be complete, the docs of Dialect.escapechar should probably also say that it
is used to escape itself.
However, note that csw.writer currently only does this with csv.QUOTE_NONE
(breaking round-trip otherwise:
Sebastian Bank added the comment:
Perfect, thanks for the quick fix.
--
___
Python tracker
<https://bugs.python.org/issue34044>
___
___
Python-bugs-list mailin
New submission from Sebastian Bank :
AFAIU, the change for https://bugs.python.org/issue19764 broke the following
usage of subprocess on Windows (re-using a subprocess.STARTUPINFO instance to
hide the command window):
import os, subprocess
STARTUPINFO = subprocess.STARTUPINFO
Sebastian Bank added the comment:
Thanks Eryk. Done: https://bugs.python.org/issue34044
--
___
Python tracker
<https://bugs.python.org/issue19764>
___
___
Pytho
Change by Sebastian Bank :
--
nosy: +xflr6
___
Python tracker
<https://bugs.python.org/issue37549>
___
___
Python-bugs-list mailing list
Unsubscribe:
Sebastian Bank added the comment:
Thanks Tal.
AFAICT there was an undocumented change in behaviour related to this fix.
Python 3.9 quotes values with escapechar:
```
import csv
import io
kwargs = {'escapechar': '\\'}
value = 'spam\\eggs'
print(value)
with io.StringIO() as buf
Sebastian Bank added the comment:
IIUC there is no way to work around this from client/downstream code (to get
the olf 3.6 to 3.9 behaviour), so this might break assertions on the output of
`csv.writer` for users of `escapechar` whenever the data to be written contains
the escapcechar (e.g
New submission from Sebastian Bank :
AFAICT there was an undocumented change in behaviour related to the fix of
https://bugs.python.org/issue12178 (also reported in
https://bugs.python.org/issue12178#msg397440):
Python 3.9 quotes values with escapechar:
```
import csv
import io
kwargs
Sebastian Bank added the comment:
The 3.9 behaviour is write: "spam\eggs"
The 3.10 behaviour is write: spam\\eggs
I think at least the change in csv.QUOTE_MINIMAL behviour should be documented
(maybe adding hint to avoid the `escapechar` option for consist
17 matches
Mail list logo