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

BUG: unicode(x) causes stack overflow when x is a 0-d index #4963

Closed
immerrr opened this issue Sep 24, 2013 · 3 comments
Closed

BUG: unicode(x) causes stack overflow when x is a 0-d index #4963

immerrr opened this issue Sep 24, 2013 · 3 comments
Labels
Duplicate Report Duplicate issue or pull request

Comments

@immerrr
Copy link
Contributor

immerrr commented Sep 24, 2013

The issue can be reproduced at current 'master' as follows:

$ python
Python 2.7.3 (default, Jul  5 2013, 08:39:51) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas
>>> pandas.__version__
'0.12.0-21-g3dab215'
>>> unicode(pandas.Index([0]).max())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "pandas/core/index.py", line 151, in __unicode__
    prepr = com.pprint_thing(self, escape_chars=('\t', '\r', '\n'),quote_strings=True)
  File "pandas/core/common.py", line 2067, in pprint_thing
    result = as_escaped_unicode(thing)
  File "pandas/core/common.py", line 2028, in as_escaped_unicode
    result = unicode(thing)  # we should try this first
  File "pandas/core/index.py", line 151, in __unicode__
    prepr = com.pprint_thing(self, escape_chars=('\t', '\r', '\n'),quote_strings=True)
  File "pandas/core/common.py", line 2067, in pprint_thing
    result = as_escaped_unicode(thing)
  File "pandas/core/common.py", line 2028, in as_escaped_unicode
    result = unicode(thing)  # we should try this first
  File "pandas/core/index.py", line 151, in __unicode__
    prepr = com.pprint_thing(self, escape_chars=('\t', '\r', '\n'),quote_strings=True)
  File "pandas/core/common.py", line 2067, in pprint_thing
    result = as_escaped_unicode(thing)
  File "pandas/core/common.py", line 2028, in as_escaped_unicode
    result = unicode(thing)  # we should try this first
  ...
  <snipped a lot of repeating backtrace entries>
  ...
  File "pandas/core/index.py", line 151, in __unicode__
    prepr = com.pprint_thing(self, escape_chars=('\t', '\r', '\n'),quote_strings=True)
  File "pandas/core/common.py", line 2067, in pprint_thing
    result = as_escaped_unicode(thing)
  File "pandas/core/common.py", line 2028, in as_escaped_unicode
    result = unicode(thing)  # we should try this first
RuntimeError: maximum recursion depth exceeded
@jreback
Copy link
Contributor

jreback commented Sep 24, 2013

this is already a known issue, see #4551

has nothing to do with unicode, rather how max is defined

try this:

Index([0]).to_series().max()

@jreback jreback closed this as completed Sep 24, 2013
@immerrr
Copy link
Contributor Author

immerrr commented Sep 24, 2013

Oh, sorry. Was looking for "index overflow" keywords in issues, and didn't find that one.

@jreback
Copy link
Contributor

jreback commented Sep 24, 2013

np...thanks for the report......!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate Report Duplicate issue or pull request
Projects
None yet
Development

No branches or pull requests

2 participants