[issue25769] Crash due to using weakref referent without acquiring a strong reference

2015-11-29 Thread lplatypus
lplatypus added the comment: I think the fix for this is simply a matter of using Py_INCREF/Py_DECREF around usage of the referent. This should only be necessary for nontrivial usages where the GIL might be released. Here is a patch. -- keywords: +patch Added file: http

[issue25769] Crash due to using weakref referent without acquiring a strong reference

2015-11-29 Thread lplatypus
New submission from lplatypus: I have encountered some crashes in a multithreaded application which appear to be due to a bug in weakref_richcompare in Objects/weakref.c (I am using Python 2.7.9, but the same weakref code exists in 3.5 and hg default branch too) weakref_richcompare ends with

[issue7890] equal unicode/str objects can have unequal hash

2010-02-09 Thread lplatypus
lplatypus added the comment: Okay thanks, but in that case might I suggest that this limitation be mentioned in the documentation for sys.setdefaultencoding? It currently reads as if any available encoding is acceptable. Perhaps even a warning or exception should be produced when calling it

[issue7890] equal unicode/str objects can have unequal hash

2010-02-08 Thread lplatypus
New submission from lplatypus : The documentation for the hash() function says: "Numeric values that compare equal have the same hash value (even if they are of different types, as is the case for 1 and 1.0)" This can be violated when comparing a unicode object with its str equivale

[issue6853] system proxy not used for https (on windows)

2009-09-06 Thread lplatypus
New submission from lplatypus : On Windows, the urllib2 module (renamed to urllib.request in python 3) does not use the system web proxy for https URLs in the case where "Use the same proxy for all protocols" is selected in the Internet Explorer proxy settings. Attached is a pat

[issue5223] infinite recursion in PyErr_WriteUnraisable

2009-03-08 Thread lplatypus
lplatypus added the comment: Hi amaury, I am copying you into this issue because I think it was introduced in your revision 65320 when you added a call to PyErr_WriteUnraisable from PyErr_GivenExceptionMatches in Python/errors.c. Any thoughts on on this issue or how to fix it would be very

[issue5223] infinite recursion in PyErr_WriteUnraisable

2009-02-11 Thread lplatypus
lplatypus added the comment: sorry I meant revision 65320 ___ Python tracker <http://bugs.python.org/issue5223> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue5223] infinite recursion in PyErr_WriteUnraisable

2009-02-11 Thread lplatypus
lplatypus added the comment: I believe that this problem was introduced in subversion revision 65319. ___ Python tracker <http://bugs.python.org/issue5223> ___ ___ Pytho

[issue5223] infinite recursion in PyErr_WriteUnraisable

2009-02-11 Thread lplatypus
New submission from lplatypus : Here is an example of pure Python code which can cause the interpreter to crash. I can reproduce the problem in 2.6.0 and 2.6.1 but not in 2.5.2. The __getattr__ function in this example is interesting in that it involves infinite recursion, but then the

[issue4024] float(0.0) singleton

2008-10-03 Thread lplatypus
lplatypus <[EMAIL PROTECTED]> added the comment: No it won't distinguish between +0.0 and -0.0 in its present form, because these two have the same value according to the C equality operator. This should be easy to adjust, eg we could exclude -0.0 by changing the comparison if (

[issue4024] float(0.0) singleton

2008-10-02 Thread lplatypus
New submission from lplatypus <[EMAIL PROTECTED]>: Here is a patch to make PyFloat_FromDouble(0.0) always return the same float instance. This is similar to the existing optimization in PyInt_FromLong(x) for small x. My own motivation is that the patch reduces memory by several meg