Skip to content

BUG: test_clipboard fails #12807

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
BastiaanBergman opened this issue Apr 5, 2016 · 1 comment
Closed

BUG: test_clipboard fails #12807

BastiaanBergman opened this issue Apr 5, 2016 · 1 comment
Labels
Compat pandas objects compatability with Numpy or Python functions Output-Formatting __repr__ of pandas objects, to_string
Milestone

Comments

@BastiaanBergman
Copy link

nosetests pandas/io/tests/test_clipboard.py
fails on Windows 7 Professional SP1

Code Sample

nosetests pandas/io/tests/test_clipboard.py

Output

.EE.
======================================================================
ERROR: test_round_trip_frame (pandas.io.tests.test_clipboard.TestClipboard)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\...\pandas\io\tests\test_clipboard.py", line 81, in test_rou
nd_trip_frame
    self.check_round_trip_frame(dt)
  File "C:\...\pandas\io\tests\test_clipboard.py", line 68, in check_ro
und_trip_frame
    result = read_clipboard()
  File "C:\...\pandas\io\clipboard.py", line 36, in read_clipboard
    lines = text[:10000].split('\n')[:-1][:10]
TypeError: 'NoneType' object has no attribute '__getitem__'

======================================================================
ERROR: test_round_trip_frame_sep (pandas.io.tests.test_clipboard.TestClipboard)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\...\pandas\io\tests\test_clipboard.py", line 73, in test_rou
nd_trip_frame_sep
    self.check_round_trip_frame(dt, sep=',')
  File "C:\...\pandas\io\tests\test_clipboard.py", line 69, in check_ro
und_trip_frame
    tm.assert_frame_equal(data, result, check_dtype=False)
  File "C:\...\pandas\util\testing.py", line 1164, in assert_frame_equa
l
    obj='DataFrame.iloc[:, {0}]'.format(i))
  File "C:\...\pandas\util\testing.py", line 1047, in assert_series_equ
al
    check_less_precise, obj='{0}'.format(obj))
  File "pandas\src\testing.pyx", line 58, in pandas._testing.assert_almost_equal (pandas\src\testing.c:3809)
    cpdef assert_almost_equal(a, b, bint check_less_precise=False,
  File "pandas\src\testing.pyx", line 147, in pandas._testing.assert_almost_equal (pandas\src\testing.c:2685)
    raise_assert_detail(obj, msg, lobj, robj)
  File "C:\...\pandas\util\testing.py", line 912, in raise_assert_detai
l
    [right]: {3}""".format(obj, message, left, right)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf1' in position 9: ordinal not in range(128)
----------------------------------------------------------------------
Ran 4 tests in 0.132s
FAILED (errors=2)

output of pd.show_versions()

>>> pd.show_versions()

INSTALLED VERSIONS
------------------
commit: 6f246d5022dec8c9d85e4103ec8dc89f8d981502
python: 2.7.11.final.0
python-bits: 64
OS: Windows
OS-release: 7
machine: AMD64
processor: Intel64 Family 6 Model 69 Stepping 1, GenuineIntel
byteorder: little
LC_ALL: None
LANG: None

pandas: 0.18.0+80.g6f246d5
nose: 1.3.7
pip: 8.1.1
setuptools: 20.3
Cython: 0.23.4
numpy: 1.10.4
scipy: None
statsmodels: None
xarray: None
IPython: None
sphinx: None
patsy: None
dateutil: 2.5.1
pytz: 2016.2
blosc: None
bottleneck: None
tables: None
numexpr: None
matplotlib: None
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: None
boto: None
pandas_datareader: None
>>>
@jreback jreback added Output-Formatting __repr__ of pandas objects, to_string Compat pandas objects compatability with Numpy or Python functions labels Apr 5, 2016
@jreback jreback added this to the Next Major Release milestone Apr 5, 2016
@jreback
Copy link
Contributor

jreback commented Apr 5, 2016

yeah, we can't repro on Travis though. But I get 1 of these failures locally (on macosx)

@jreback jreback modified the milestones: 0.19.2, Next Major Release Nov 18, 2016
jorisvandenbossche pushed a commit to jorisvandenbossche/pandas that referenced this issue Dec 14, 2016
vendered updated version of Pyperclip

closes pandas-dev#13747
closes pandas-dev#14362
closes pandas-dev#12807
closes pandas-dev#12529

Author: Ajay Saxena <[email protected]>
Author: Ajay Saxena <[email protected]>

Closes pandas-dev#14599 from aileronajay/master and squashes the following commits:

2aafb66 [Ajay Saxena] moved comment inside test and added github issue labels to test
b74fbc1 [Ajay Saxena] ignore lint test for pyperclip files
9db42d8 [Ajay Saxena] whatsnew conflict
1dca292 [Ajay Saxena] conflict resolution
98b61e8 [Ajay Saxena] merge conflict
cedb690 [Ajay Saxena] merge conflict in whats new file
7af95da [Ajay Saxena] merging lastest changes
ac8ae60 [Ajay Saxena] skip clipboard test if clipboard primitives are absent
b03ed56 [Ajay Saxena] changed whatsnew file
c0aafd7 [Ajay Saxena] Merge branch 'test_branch'
9946fb7 [Ajay Saxena] Merge branch 'master' of https://github.com/pandas-dev/pandas into test_branch
ed1375f [Ajay Saxena] Merge branch 'test_branch'
0665fd4 [Ajay Saxena] fixed linting and test case as per code review
d202fd0 [Ajay Saxena] added test for valid encoding, modified setup.py so that pandas/util/clipboard can be found
dd57ae3 [Ajay Saxena] code review changes and read clipboard invalid encoding test
71d58d0 [Ajay Saxena] testing encoding in kwargs to to_clipboard and test case for the same
02f87b0 [Ajay Saxena] removed duplicate files
825bbe2 [Ajay Saxena] all files related to pyperclip are under pandas.util.clipboard
c5a87d8 [Ajay Saxena] Merge branch 'test_branch' of https://github.com/aileronajay/pandas into test_branch
f708c2e [Ajay Saxena] Merge branch 'master' of https://github.com/aileronajay/pandas
d565b1f [Ajay Saxena] updated pyperclip to the latest version
14d94a0 [Ajay Saxena] changed the pandas util clipboard file to return unicode if the python version is 2, else str
66d8ebf [Ajay Saxena] removed the disabled tag for clipboard test so that we can check if they pass after this change
edb8553 [Ajay Saxena] refactored the new unicode test to be in sync with the rest of the file
c83d000 [Ajay Saxena] added test case for unicode round trip
fb922d6 [Ajay Saxena] changes for GH 13747

(cherry picked from commit 4a1a330)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compat pandas objects compatability with Numpy or Python functions Output-Formatting __repr__ of pandas objects, to_string
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants