[issue25782] CPython hangs on error __context__ set to the error itself

2017-04-18 Thread larsonreever

larsonreever added the comment:

My patch works for your example too.  Since it checks for loops in __context__ 
setter, you shouldn't be able to create complicated loops. However, since 
PyException_SetContext and PyException_SetCause are public APIs, and their 
return type is 'void', I can't raise an error when a C code introduces a cycle, 
in that case, the exc->cause/exc->context will be set to NULL.(I came to this 
bug via the ExitStack + subprocess issue27122 which merely has a suggested 
workaround patch as a band aid that might help until this is fixed) 
Thanks: http://driverwhiz.com/device-drivers

--
nosy: +larsonreever

___
Python tracker 
<http://bugs.python.org/issue25782>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2017-04-17 Thread larsonreever

larsonreever added the comment:

Otherwise, py8601 (https://bitbucket.org/micktwomey/pyiso8601/) looks pretty 
popular and well maintained (various committers, started in 2012, last commit 
in 2016).  I don't think that we should add the iso8601 module to the stdlib, 
but merge iso8601 "features" into the datetime module.  The iso8601 module 
supports Python 2.7 and so has to implement its own timezone classes. The 
datetime module now has datetime.timezone since Python 3.2 for fixed timezone. 
To me it's the finest, the most elegant, and no other one can claim to be more 
robust since it's probably the #1 iso parsing functions used in python. Have a 
look at 
https://docs.djangoproject.com/en/1.9/_modules/django/utils/dateparse/#parse_datetime.

--
nosy: +larsonreever

___
Python tracker 
<http://bugs.python.org/issue15873>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com