[IPython-dev] Random crashes when doing conversion

Ian Bell ian.h.bell@gmail....
Mon Feb 24 17:46:13 CST 2014


So one workaround is to go into jsonutil.py and comment out the if m:
branch so that it reads:

def parse_date(s):
    """parse an ISO8601 date string

    If it is None or not a valid ISO8601 timestamp,
    it will be returned unmodified.
    Otherwise, it will return a datetime object.
    """
    if s is None:
        return s
    m = ISO8601_PAT.match(s)
#     if m:
#         # FIXME: add actual timezone support
#         # this just drops the timezone info
#         notz = m.groups()[0]
#         return datetime.strptime(notz, ISO8601)
    return s

It's a hack, but I was getting warnings like

File
"C:\Python27\lib\site-packages\ipython-2.0.0_dev-py2.7.egg\IPython\utils\jsonutil.py",
line 79, in parse_date
    return datetime.strptime(notz, ISO8601)
AttributeError: _strptime

which is weird because strptime is getting called, not _strptime.  In any
case, commenting out this block does allow my compilation to run.

I wonder if my datetime is out of date.  This should ideally fail in a more
elegant way though.



On Sun, Feb 23, 2014 at 4:08 AM, Ian Bell <ian.h.bell@gmail.com> wrote:

> Will do, here's an example of one that fails:
> https://github.com/ibell/coolprop/blob/master/Web/FluidTemplate.ipynb
>
>
> On Sun, Feb 23, 2014 at 3:53 AM, Brian Granger <ellisonbg@gmail.com>wrote:
>
>> I am guessing that this is problem with runipy, not IPython, so you
>> might follow up with the runipy developer. But to help all debug this,
>> can you share one of the notebooks that has this problem?
>>
>> On Sat, Feb 22, 2014 at 8:50 AM, Ian Bell <ian.h.bell@gmail.com> wrote:
>> > I am using the most excellent runipy script to generate HTML
>> documentation
>> > from a large set of dynamically generated notebooks.  More on that theme
>> > soon!
>> >
>> > I am getting random crashes (not repeatable) along the lines of that
>> shown
>> > below.  I can't seem to see any pattern.  I'll convert a few files, then
>> > this error.  Or sometimes I can convert ~10 files, and then it crashes.
>>  I
>> > have 114 notebooks to convert, so just converting 10 isn't quite
>> cutting it
>> >
>> > Ian
>> >
>> > Traceback (most recent call last):
>> >   File "C:\Python27\lib\site-packages\zmq\eventloop\zmqstream.py", line
>> 401,
>> > in _run_callback
>> >     callback(*args, **kwargs)
>> >   File
>> >
>> "C:\Python27\lib\site-packages\zmq\eventloop\minitornado\stack_context.py",
>> > line 241, in wrapped
>> >     callback(*args, **kwargs)
>> >   File
>> >
>> "C:\Python27\lib\site-packages\ipython-2.0.0_dev-py2.7.egg\IPython\kernel\channels.py",
>> > line 170, in _handle_recv
>> >     self.call_handlers(self.session.unserialize(smsg))
>> >   File
>> >
>> "C:\Python27\lib\site-packages\ipython-2.0.0_dev-py2.7.egg\IPython\kernel\zmq\session.py",
>> > line 822, in unserialize
>> >     message['header'] = extract_dates(header)
>> >   File
>> >
>> "C:\Python27\lib\site-packages\ipython-2.0.0_dev-py2.7.egg\IPython\utils\jsonutil.py",
>> > line 87, in extract_dates
>> >     new_obj[k] = extract_dates(v)
>> >   File
>> >
>> "C:\Python27\lib\site-packages\ipython-2.0.0_dev-py2.7.egg\IPython\utils\jsonutil.py",
>> > line 92, in extract_dates
>> >     obj = parse_date(obj)
>> >   File
>> >
>> "C:\Python27\lib\site-packages\ipython-2.0.0_dev-py2.7.egg\IPython\utils\jsonutil.py",
>> > line 79, in parse_date
>> >     return datetime.strptime(notz, ISO8601)
>> > AttributeError: _strptime
>> >
>> >
>> > _______________________________________________
>> > IPython-dev mailing list
>> > IPython-dev@scipy.org
>> > http://mail.scipy.org/mailman/listinfo/ipython-dev
>> >
>>
>>
>>
>> --
>> Brian E. Granger
>> Cal Poly State University, San Luis Obispo
>> bgranger@calpoly.edu and ellisonbg@gmail.com
>> _______________________________________________
>> IPython-dev mailing list
>> IPython-dev@scipy.org
>> http://mail.scipy.org/mailman/listinfo/ipython-dev
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-dev/attachments/20140225/511ab25f/attachment.html 


More information about the IPython-dev mailing list