Skip to content

Various py3k test failures in tests.io.test_html with US-ASCII preferred encoding #16525

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
neirbowj opened this issue May 28, 2017 · 0 comments · Fixed by #16526
Closed

Various py3k test failures in tests.io.test_html with US-ASCII preferred encoding #16525

neirbowj opened this issue May 28, 2017 · 0 comments · Fixed by #16526
Labels
IO HTML read_html, to_html, Styler.apply, Styler.applymap Testing pandas testing functions or related to the test suite Unicode Unicode strings
Milestone

Comments

@neirbowj
Copy link
Contributor

Code Sample, a copy-pastable example if possible

>>> import locale
>>> locale.getpreferredencoding()
'US-ASCII'
>>> open('/usr/local/lib/python3.4/site-packages/pandas/tests/io/data/spam.html').read()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.4/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 21552: ordinal not in range(128)
>>>

Problem description

Three tests, test_string_io, test_string, and test_file_like, all open spam.html without specifying the encoding, and then attempt to read it. This causes the tests to terminate prematurely with an error.

Expected Output

All three tests should pass since the code under test is not responsible for determining the file encoding.

Output of pd.show_versions()

INSTALLED VERSIONS ------------------ commit: None python: 3.4.6.final.0 python-bits: 64 OS: FreeBSD OS-release: 10.3-STABLE machine: amd64 processor: amd64 byteorder: little LC_ALL: None LANG: None LOCALE: None.None

pandas: 0.20.1
pytest: 3.1.0
pip: None
setuptools: 32.1.0
Cython: None
numpy: 1.11.2
scipy: 0.19.0
xarray: None
IPython: None
sphinx: None
patsy: None
dateutil: 2.6.0
pytz: 2016.10
blosc: None
bottleneck: 1.0.0
tables: 3.4.2
numexpr: 2.6.2
feather: None
matplotlib: None
openpyxl: 2.4.7
xlrd: 1.0.0
xlwt: None
xlsxwriter: 0.9.6
lxml: 3.6.0
bs4: 4.5.1
html5lib: 0.9999999
sqlalchemy: 1.1.10
pymysql: 0.7.11.None
psycopg2: 2.7.1 (dt dec pq3 ext lo64)
jinja2: 2.9.5
s3fs: None
pandas_gbq: None
pandas_datareader: None

@jreback jreback added IO HTML read_html, to_html, Styler.apply, Styler.applymap Testing pandas testing functions or related to the test suite Unicode Unicode strings labels May 29, 2017
@jreback jreback added this to the 0.20.2 milestone May 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO HTML read_html, to_html, Styler.apply, Styler.applymap Testing pandas testing functions or related to the test suite Unicode Unicode strings
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants