Skip to content

Commit

Permalink
work on Python 3.10 (fixes https://bugs.python.org/issue12178)
Browse files Browse the repository at this point in the history
  • Loading branch information
xflr6 committed Jan 11, 2021
1 parent 7f10b99 commit 1677f82
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Improvements

bpo-12178_
broken round-trip with ``escapechar`` if your data contains a literal escape
character
character (fixed in Python 3.10)

bpo-31590_
broken round-trip with ``escapechar`` and embedded newlines under Python 2
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,6 @@
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
],
)
4 changes: 3 additions & 1 deletion tests/test_stdlib_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import csv
import io
import sys

import pytest

Expand Down Expand Up @@ -64,7 +65,8 @@ def test_csv_roundtrip(py2, quoting, quotechar, escapechar, doublequote, value):
if quoting != csv.QUOTE_NONE and escapechar is not None and escapechar in value:
# writer fails to escape escapechar
assert row != expected
pytest.xfail(reason='https://bugs.python.org/issue12178')
if sys.version_info < (3, 10):
pytest.xfail(reason='https://bugs.python.org/issue12178')
elif py2 and quoting == csv.QUOTE_NONE and escapechar is not None and '\n' in value:
# reader fails to recognize escaped newline
assert row != expected
Expand Down
5 changes: 4 additions & 1 deletion tests/test_workarounds.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@

from __future__ import unicode_literals

import sys

import pytest

from csv23._workarounds import issue12178, issue31590


@pytest.mark.xfail(reason='https://bugs.python.org/issue12178')
@pytest.mark.xfail(sys.version_info < (3, 10),
reason='https://bugs.python.org/issue12178')
def test_issue12178():
assert not issue12178()

Expand Down

0 comments on commit 1677f82

Please sign in to comment.