Skip to content
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

LC_ALL and python2 #129

Open
wavexx opened this issue Sep 14, 2015 · 3 comments
Open

LC_ALL and python2 #129

wavexx opened this issue Sep 14, 2015 · 3 comments

Comments

@wavexx
Copy link
Member

wavexx commented Sep 14, 2015

When running tabview as a module in ipython, I get the following:

<ipython-input-20-0e05cb7859ca> in <module>()
----> 1 tv(r)

/usr/local/lib/python2.7/dist-packages/tabview/tabview.py in view(data, enc, start_pos, column_width, column_gap, trunc_char, column_widths, search_str, double_width, delimiter)
   1214     """
   1215     if sys.version_info.major < 3:
-> 1216         lc_all = locale.getlocale(locale.LC_ALL)
   1217         locale.setlocale(locale.LC_ALL, '')
   1218     else:

/usr/lib/python2.7/locale.pyc in getlocale(category)
    559     localename = _setlocale(category)
    560     if category == LC_ALL and ';' in localename:
--> 561         raise TypeError, 'category LC_ALL is not supported'
    562     return _parse_localename(localename)
    563 
@wavexx
Copy link
Member Author

wavexx commented Sep 14, 2015

I think we need to set/restore only LC_CTYPE here.

@firecat53
Copy link
Collaborator

Hrm, I can't reproduce this...works fine for me in ipython2 and ipython3 using the sample files from the project.

In [1]: import tabview.tabview as t
In [2]: t.view("sample/test_latin-1.csv")
Out[2]: 0
In [7]: locale.getlocale(locale.LC_ALL)
Out[7]: (None, None)

Is there anything odd in your environment at all?

Scott

@wavexx
Copy link
Member Author

wavexx commented Sep 14, 2015

On 14/09/15 21:31, Scott Hansen wrote:

Hrm, I can't reproduce this...works fine for me in ipython2 and ipython3
using the sample files from the project.

|In [1]: import tabview.tabview as t In [2]:
t.view("sample/test_latin-1.csv") Out[2]: 0 In [7]:
locale.getlocale(locale.LC_ALL) Out[7]: (None, None) |

Is there anything odd in your environment at all?

Hrrm, indeed. It happens only when I load matplotlib as well.

Here's the minimal example that triggers this behavior for me:

import matplotlib.pyplot as plt
plt.close(plt.figure())
import tabview as t
t.view([[1]])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants