From 2cfabee9c872199aa5ec43da0b65aefaddeeb794 Mon Sep 17 00:00:00 2001 From: Phillip Cloud Date: Thu, 13 Jun 2013 20:09:36 -0400 Subject: [PATCH] BUG: fix unicode -> str cast in tslib This should use format since calling str on a unicode string is a *bad* idea because it may or may not repr correctly. --- pandas/tslib.pyx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandas/tslib.pyx b/pandas/tslib.pyx index ec11de7392680..9b611032455ae 100644 --- a/pandas/tslib.pyx +++ b/pandas/tslib.pyx @@ -465,7 +465,8 @@ cdef class _Timestamp(datetime): elif op == 3: return True else: - raise TypeError('Cannot compare Timestamp with %s' % str(other)) + raise TypeError('Cannot compare Timestamp with ' + '{0!r}'.format(other.__class__.__name__)) self._assert_tzawareness_compat(other)