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

Timestamp repr error with tzoffset tz #2443

Closed
wesm opened this issue Dec 6, 2012 · 4 comments
Closed

Timestamp repr error with tzoffset tz #2443

wesm opened this issue Dec 6, 2012 · 4 comments
Assignees
Labels
Milestone

Comments

@wesm
Copy link
Member

wesm commented Dec 6, 2012

e.g.

result = Timestamp('2002-06-28T01:00:00.000000000+0100')

from http://stackoverflow.com/questions/13703720/converting-between-datetime-timestamp-and-datetime64

@changhiskhan
Copy link
Contributor

What's the error? That it prints out both +0100 and the tzoffset?

@wesm
Copy link
Member Author

wesm commented Dec 7, 2012

dateutil 2.1:

In [1]: result = Timestamp('2002-06-28T01:00:00.000000000+0100')

In [2]: result
Out[2]: ---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-2-a5b1e83cd027> in <module>()
----> 1 result

/home/wesm/epd/lib/python2.7/site-packages/IPython/core/displayhook.pyc in __call__(self, result)
    237             self.start_displayhook()
    238             self.write_output_prompt()
--> 239             format_dict = self.compute_format_data(result)
    240             self.write_format_data(format_dict)
    241             self.update_user_ns(result)

/home/wesm/epd/lib/python2.7/site-packages/IPython/core/displayhook.pyc in compute_format_data(self, result)
    149             MIME type representation of the object.
    150         """
--> 151         return self.shell.display_formatter.format(result)
    152 
    153     def write_format_data(self, format_dict):

/home/wesm/epd/lib/python2.7/site-packages/IPython/core/formatters.pyc in format(self, obj, include, exclude)
    124                     continue
    125             try:
--> 126                 data = formatter(obj)
    127             except:
    128                 # FIXME: log the exception

/home/wesm/epd/lib/python2.7/site-packages/IPython/core/formatters.pyc in __call__(self, obj)
    445                 type_pprinters=self.type_printers,
    446                 deferred_pprinters=self.deferred_printers)
--> 447             printer.pretty(obj)
    448             printer.flush()
    449             return stream.getvalue()

/home/wesm/epd/lib/python2.7/site-packages/IPython/lib/pretty.pyc in pretty(self, obj)
    343                 if cls in self.type_pprinters:
    344                     # printer registered in self.type_pprinters
--> 345                     return self.type_pprinters[cls](obj, self, cycle)
    346                 else:
    347                     # deferred printer

/home/wesm/epd/lib/python2.7/site-packages/IPython/lib/pretty.pyc in _repr_pprint(obj, p, cycle)
    612 def _repr_pprint(obj, p, cycle):
    613     """A pprint that just redirects to the normal repr function."""
--> 614     p.text(repr(obj))
    615 
    616 

/home/wesm/code/pandas/pandas/tslib.so in pandas.tslib.Timestamp.__repr__ (pandas/tslib.c:3899)()

/home/wesm/epd/lib/python2.7/site-packages/python_dateutil-2.1-py2.7.egg/dateutil/tz.pyc in inner_func(*args, **kwargs)
     37             return myfunc(*args, **kwargs)
     38         else:
---> 39             return myfunc(*args, **kwargs).encode()
     40     return inner_func
     41 

AttributeError: 'NoneType' object has no attribute 'encode'

@changhiskhan
Copy link
Contributor

oh ok, i'm still on 1.5

@wesm
Copy link
Member Author

wesm commented Dec 7, 2012

Gotcha. I'm about to push fix

@ghost ghost assigned wesm Dec 7, 2012
@wesm wesm closed this as completed in 7461b45 Dec 7, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants