Message397859
Test sample:
```
import csv
from io import StringIO
def csv_text():
return StringIO("a|b\nc| 'd\ne|' f")
with csv_text() as input_file:
print('The following text is going to be parsed:')
print(input_file.read())
print()
with csv_text() as input_file:
dialect_params = [
'delimiter',
'quotechar',
'escapechar',
'lineterminator',
'quoting',
'doublequote',
'skipinitialspace'
]
dialect = csv.Sniffer().sniff(input_file.read())
print('The following dialect has been detected:')
for dialect_param in dialect_params:
print(f'- {dialect_param}: {repr(getattr(dialect, dialect_param))}')
print()
with csv_text() as input_file:
print('Parsed csv text:')
for entry in csv.reader(input_file, dialect=dialect):
print(f'- {entry}')
print()
```
Actual output:
```
The following text is going to be parsed:
a|b
c| 'd
e|' f
The following dialect has been detected:
- delimiter: ' '
- quotechar: "'"
- escapechar: None
- lineterminator: '\r\n'
- quoting: 0
- doublequote: False
- skipinitialspace: False
Parsed csv text:
- ['a|b']
- ['c|', 'd\ne|', 'f']
```
Expected output:
```
The following text is going to be parsed:
a|b
c| 'd
e|' f
The following dialect has been detected:
- delimiter: '|'
- quotechar: '"'
- escapechar: None
- lineterminator: '\r\n'
- quoting: 0
- doublequote: False
- skipinitialspace: False
Parsed csv text:
- ['a', 'b']
- ['c', " 'd"]
- ['e', "' f"]
``` |
|
Date |
User |
Action |
Args |
2021-07-20 07:36:23 | pt12lol | set | recipients:
+ pt12lol |
2021-07-20 07:36:23 | pt12lol | set | messageid: <1626766583.9.0.796790901287.issue44677@roundup.psfhosted.org> |
2021-07-20 07:36:23 | pt12lol | link | issue44677 messages |
2021-07-20 07:36:23 | pt12lol | create | |
|