[issue2799] Remove _PyUnicode_AsString(), rework _PyUnicode_AsStringAndSize(), add PyUnicode_AsChar()

2010-12-07 Thread Julian Andres Klode
Julian Andres Klode added the comment: The problem I see here is that there is no public way to simply get a C string from a unicode object similar to PyBytes_AsString() for bytes. That's bad because we don't want to rewrite the whole code to duplicate strings all the time and

[issue6483] Modules are not deallocated correctly if m_size = -1

2010-04-20 Thread Julian Andres Klode
Julian Andres Klode added the comment: This bug still exists in Python 3.1.2. -- ___ Python tracker <http://bugs.python.org/issue6483> ___ ___ Python-bugs-list m

[issue6446] import_spam() in extending python can fail without setting the error.

2009-07-09 Thread Julian Andres Klode
New submission from Julian Andres Klode : The given example function initspam fails if an Based on some experience with my own code, I have found out that the function import_spam() fails when the module is not importable. In this case, it returns 0, although it should return -1 when an error

[issue6483] Modules are not deallocated correctly if m_size = -1

2009-07-14 Thread Julian Andres Klode
New submission from Julian Andres Klode : The documentation states that m_size should be -1 if no additional memory is needed. But this causes the objects inside the module to not be deallocated at all. The attached module (test) stores an object of a type 'Test', which prints "

[issue6483] Modules are not deallocated correctly if m_size = -1

2009-07-15 Thread Julian Andres Klode
Julian Andres Klode added the comment: I believe this may be related to Python/import.c (l. 592): def->m_base.m_copy = PyDict_Copy(dict); It creates a copy of the module dictionary, but the reference count of this copy is not decreased when the module object is deallocated, thus caus