[issue4443] Python/pystate.c:561 :PyGILState: The assertion 'autoInterpreterState' has failed

2008-11-27 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment: The assertion is clear if you open the source code (Python/pystate.c, line 561): assert(autoInterpreterState); /* Py_Initialize() hasn't been called! */ Does your code make sure that the python interpreter is initialized? -- n

[issue4444] unittest - use contexts to assert exceptions

2008-11-27 Thread David Leonard
New submission from David Leonard <[EMAIL PROTECTED]>: Patch to allow unit tests to test for exceptions through a 'with' statement. Resulting (failing) test would look like this: import unittest class T(unittest.TestCase): def runTest(self): with self.assertRaises(KeyError):

[issue4438] Add an easy way to __import___ submodules

2008-11-27 Thread Mart Sõmermaa
Mart Sõmermaa <[EMAIL PROTECTED]> added the comment: Corrections and clarifications: * I'd say labeling the patch naive and "breaking things" was misleading (there was a breakage that resulted from stale files with incorrect permissions from my previous build of Python 2.6; after a make distcle

[issue4445] String allocations waste 3 bytes of memory on average.

2008-11-27 Thread Mark Dickinson
Mark Dickinson <[EMAIL PROTECTED]> added the comment: Updated patch: fix overflow checks to use offsetof instead of sizeof as well. Added file: http://bugs.python.org/file12141/string_alloc.patch ___ Python tracker <[EMAIL PROTECTED]>

[issue4445] String allocations waste 3 bytes of memory on average.

2008-11-27 Thread Mark Dickinson
Changes by Mark Dickinson <[EMAIL PROTECTED]>: Removed file: http://bugs.python.org/file12140/string_alloc.patch ___ Python tracker <[EMAIL PROTECTED]> ___

[issue4426] UTF7 decoding is far too strict

2008-11-27 Thread Nick Barnes
Nick Barnes <[EMAIL PROTECTED]> added the comment: I'll try to get to this next week. Right now I'm snowed under. I don't promise to do any refactoring. ___ Python tracker <[EMAIL PROTECTED]> ___

[issue4443] Python/pystate.c:561 :PyGILState: The assertion 'autoInterpreterState' has failed

2008-11-27 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment: > Py_Initialize(); > Py_Main(7, arg1); > Py_Finalize(); This seems correct... unless two threads run this function at the same time. Can you ensure that this is not the case? It seems to me that a simple call to system("python /ho

[issue4443] Python/pystate.c:561 :PyGILState: The assertion 'autoInterpreterState' has failed

2008-11-27 Thread LuisC
LuisC <[EMAIL PROTECTED]> added the comment: Hi Amaury, thanks for you response... This is my code sniped gboolean gui_file_copy_to_journal(char const *uri) { g_printerr("SAVING PYTHON JOURNAL!...%s\n", uri); char * arg1[7]; arg1[0] = "python"; arg1[1]

[issue4445] String allocations waste 3 bytes of memory on average.

2008-11-27 Thread Mark Dickinson
New submission from Mark Dickinson <[EMAIL PROTECTED]>: There are a number of places in Objects/stringobject.c where memory is allocated for a string of length n using: PyObject_MALLOC(sizeof(PyStringObject) + n) On my computer (OS X 10.5.5/Intel), and, I suspect, on most common platforms, th

[issue4446] Distutils Metadata Documentation Missing "platforms" Keyword

2008-11-27 Thread Simon Cross
New submission from Simon Cross <[EMAIL PROTECTED]>: The section on Additional meta-data in Doc/distutils/setupscript.rst is missing any reference to the setup() "platforms" keyword. I've attached a patch which fills in the basics but there are some outstanding questions: - Does note (4) about

[issue4444] unittest - use contexts to assert exceptions

2008-11-27 Thread Steve Purcell
Steve Purcell <[EMAIL PROTECTED]> added the comment: I like this change, since assertRaises can be a bit messy when passing it a local function. I'd suggest modifying the patch such that the AssertRaisesContext class is also used when callableObj is provided, which would eliminate the duplic

[issue4443] Python/pystate.c:561 :PyGILState: The assertion 'autoInterpreterState' has failed

2008-11-27 Thread LuisC
LuisC <[EMAIL PROTECTED]> added the comment: Thank you so much. It do worked! I don't think two threads to be running the same function because the messages are displayed only once. Yes it seems to be a better way it worked, thank you again. Regards, Luis Carrión Tata Consultancy Services Co

[issue4443] Python/pystate.c:561 :PyGILState: The assertion 'autoInterpreterState' has failed

2008-11-27 Thread Amaury Forgeot d'Arc
Changes by Amaury Forgeot d'Arc <[EMAIL PROTECTED]>: -- resolution: -> invalid status: open -> closed ___ Python tracker <[EMAIL PROTECTED]> ___ __

[issue4336] Fix performance issues in xmlrpclib

2008-11-27 Thread Kristján Valur Jónsson
Kristján Valur Jónsson <[EMAIL PROTECTED]> added the comment: I like the suggestion of having endheaders() accept any extra data. I have uploaded a new patch which implements this idea. It simplifies things a lot. The issue with the read buffer size is still open. I have sent an email to pyt

[issue4445] String allocations waste 3 bytes of memory on average.

2008-11-27 Thread Raymond Hettinger
Raymond Hettinger <[EMAIL PROTECTED]> added the comment: +1 on the idea. -1 on the current patch. Can you encapsulate this in a simpler macro? I find the proposed replacement to be cryptic and error-prone (i.e. hard to mentally verify its correctness and somewhat likely to be screwed-up by a f

[issue4435] Sphinx does not show failed doctests in quiet mode

2008-11-27 Thread Georg Brandl
Georg Brandl <[EMAIL PROTECTED]> added the comment: Please submit Sphinx bugs in its own tracker: http://bitbucket.org/birkenfeld/sphinx/issues -- resolution: -> invalid status: open -> closed ___ Python tracker <[EMAIL PROTECTED]>

[issue4436] Sphinx latex writer crashes when encountering deep section levels

2008-11-27 Thread Georg Brandl
Georg Brandl <[EMAIL PROTECTED]> added the comment: Please submit Sphinx bugs in its own tracker: http://bitbucket.org/birkenfeld/sphinx/issues (Yes, I know there was still a Sphinx component -- I've removed that now.) -- resolution: -> invalid status: open -> closed _

[issue4446] Distutils Metadata Documentation Missing "platforms" Keyword

2008-11-27 Thread Georg Brandl
Changes by Georg Brandl <[EMAIL PROTECTED]>: -- assignee: georg.brandl -> loewis nosy: +loewis ___ Python tracker <[EMAIL PROTECTED]> ___ __

[issue4434] Embedding into a shared library fails

2008-11-27 Thread rb
rb <[EMAIL PROTECTED]> added the comment: What is the purpose of linking to the static library if you're still going to depend on shared objects in lib-dynload? ___ Python tracker <[EMAIL PROTECTED]> _

[issue4010] configure options don't trickle down to distutils

2008-11-27 Thread Akira Kitada
Akira Kitada <[EMAIL PROTECTED]> added the comment: I'm having similar problem with distutils. http://mail.python.org/pipermail/python-dev/2008-November/083670.html Is there any reason customize_compiler - only get CPPFLAGS in env, not ones from sysconfig? - doesn't get OPT from from sysconfig,

[issue4447] exec inside a function

2008-11-27 Thread David M. Beazley
New submission from David M. Beazley <[EMAIL PROTECTED]>: Is the following code valid Python 3 or not? def foo(): x = 1 exec("x = 42") print(x)# Prints 1 (exec has no effect) I know there are a variety of issues surrounding exec(), function bodies, and other matters. Just wo

[issue4447] exec inside a function

2008-11-27 Thread Georg Brandl
Georg Brandl <[EMAIL PROTECTED]> added the comment: It is "valid" Python 3 and the lack of an effect on the local is correct. >From Python 3 on, "exec" is a function and therefore lacks the special magic properties it had in Python 2 that made it possible execute the code "as if it just was writ

[issue4434] Embedding into a shared library fails

2008-11-27 Thread John Levon
John Levon <[EMAIL PROTECTED]> added the comment: Besides, .so files should always declare their dependencies. ___ Python tracker <[EMAIL PROTECTED]> ___ ___

[issue4447] exec inside a function

2008-11-27 Thread David M. Beazley
David M. Beazley <[EMAIL PROTECTED]> added the comment: For what it's worth, I hope this behavior gets well-documented. Thanks. ___ Python tracker <[EMAIL PROTECTED]> ___ _

[issue4445] String allocations waste 3 bytes of memory on average.

2008-11-27 Thread Raymond Hettinger
Raymond Hettinger <[EMAIL PROTECTED]> added the comment: Suggestion: #define PyStringObject_SIZE (offsetof(PyStringObject, ob_sval) + 1) /* Inline PyObject_NewVar */ - op = (PyStringObject *)PyObject_MALLOC(sizeof(PyStringObject) + size); /* Inline PyObject_NewVar */ +

[issue4376] Nested ctypes 'BigEndianStructure' fails

2008-11-27 Thread Thomas Heller
Thomas Heller <[EMAIL PROTECTED]> added the comment: Currently, the _fields_ of ctypes Structures with non-native byte order can only contain simple types (like int, char, but not pointers), and arrays of those. Since this is all Python code (in Lib/ctypes/endian.py) it should be possible to ext

[issue4376] Nested ctypes 'BigEndianStructure' fails

2008-11-27 Thread Thomas Heller
Thomas Heller <[EMAIL PROTECTED]> added the comment: Correction: >> Since this is all Python code (in Lib/ctypes/_endian.py) it should be ___ Python tracker <[EMAIL PROTECTED]> ___

[issue4309] ctypes documentation

2008-11-27 Thread Gabriel Genellina
Changes by Gabriel Genellina <[EMAIL PROTECTED]>: -- nosy: +gagenellina ___ Python tracker <[EMAIL PROTECTED]> ___ ___ Python-bugs-list

[issue4022] 2.6 dependent on c:\python26\ on windows

2008-11-27 Thread Gabriel Genellina
Changes by Gabriel Genellina <[EMAIL PROTECTED]>: -- nosy: +gagenellina ___ Python tracker <[EMAIL PROTECTED]> ___ ___ Python-bugs-list

[issue4315] On some Python builds, exec in a function can't create shadows of variables if these are declared "global" in another function of the same module

2008-11-27 Thread Gabriel Genellina
Changes by Gabriel Genellina <[EMAIL PROTECTED]>: -- nosy: +gagenellina ___ Python tracker <[EMAIL PROTECTED]> ___ ___ Python-bugs-list

[issue4438] Add an easy way to __import___ submodules

2008-11-27 Thread Mart Sõmermaa
Mart Sõmermaa <[EMAIL PROTECTED]> added the comment: See also http://mail.python.org/pipermail/python-dev/2008-November/083727.html ___ Python tracker <[EMAIL PROTECTED]> ___ __

[issue4448] should socket readline() use default_bufsize instead of _rbufsize?

2008-11-27 Thread Gregory P. Smith
New submission from Gregory P. Smith <[EMAIL PROTECTED]>: From Kristján Valur Jónsson (kristjan at ccpgames.com) on python-dev: http://mail.python.org/pipermail/python-dev/2008-November/083724.html I came across this in socket.c: # _rbufsize is the suggested recv buffer size

[issue1529142] Allowing multiple instances of IDLE with sub-processes

2008-11-27 Thread Weeble
Weeble <[EMAIL PROTECTED]> added the comment: Is this ever likely to make it into IDLE? Running without a subprocess in Windows appears to interact badly with the multiprocessing library (attempting to spawn a process just creates a new IDLE window). I couldn't figure out how to apply the patc

[issue4434] Embedding into a shared library fails

2008-11-27 Thread Ralf Schmitt
Ralf Schmitt <[EMAIL PROTECTED]> added the comment: Yes, there is no purpose in linking with a static library when the dynamically loaded modules still depend on the shared library. And yes, the dynamically loaded libraries should declare their dependencies. My point is they do *not* depend on th

[issue4434] Embedding into a shared library fails

2008-11-27 Thread Ralf Schmitt
Ralf Schmitt <[EMAIL PROTECTED]> added the comment: Linking with the static library really works. You have to link with '-Xlinker -export-dynamic' however on linux in order to make the symbols from the static library visible. (just in case if I haven't been clear..) _

[issue4073] distutils build_scripts and install_data commands need 2to3 support

2008-11-27 Thread Lars Immisch
Changes by Lars Immisch <[EMAIL PROTECTED]>: -- nosy: +larsimmisch ___ Python tracker <[EMAIL PROTECTED]> ___ ___ Python-bugs-list maili

[issue4448] should socket readline() use default_bufsize instead of _rbufsize?

2008-11-27 Thread Guido van Rossum
Guido van Rossum <[EMAIL PROTECTED]> added the comment: You meant socket.py. This is an extremely subtle area. I would be very wary of changing this -- there is a use case where headers are read from the socket using readline() but the rest of the data is read directly from the socket, and this