[issue10486] http.server doesn't set all CGI environment variables

2012-04-16 Thread Glenn Linderman
Glenn Linderman added the comment: Reading the CGI 1.1 spec, it says: The QUERY_STRING value provides the query-string part of the Script-URI. (See section 3.3). The server MUST set this variable; if the Script-URI does not include a query component, the QUERY_STRING MUST be defin

[issue13959] Re-implement parts of imp in pure Python

2012-04-16 Thread Eric Snow
Eric Snow added the comment: This is a mostly-working sketch of find_module() in imp.py. I've run out of time tonight, but wanted to get it up in case it's useful to anyone else (a.k.a Brett). If nobody's touched it before then, I'll finish it up tomorrow. -- Added file: http://bugs

[issue14592] old-style (level=-1) importing broken after importlib changes

2012-04-16 Thread Stefan Behnel
Stefan Behnel added the comment: Hmm, interesting - it stripped the command from my e-mail. I was doing this: >>> __import__("sys", level=1) Traceback (most recent call last): File "", line 1, in SystemError: error return without exception set -- ___

[issue14592] old-style (level=-1) importing broken after importlib changes

2012-04-16 Thread Stefan Behnel
Stefan Behnel added the comment: > Yeah, the fix is dead-simple, import with level=1 and if that fails import > with level=0. With one caveat: relative imports don't work outside of packages, so the importing code has to know when it's in a package or not. Otherwise, the relative import would

[issue2771] Test issue

2012-04-16 Thread Ezio Melotti
Ezio Melotti added the comment: Testing links: http://bugs.python.org/issue2771 http://bugs.python.org/issue2771. http://bugs.python.org/issue2771, http://bugs.python.org/issue2771; http://bugs.python.org/issue2771: http://bugs.python.org/issue2771! (http://bugs.python.org/issue2771) [http://bug

[issue14603] List comprehension in zipfile.namelist

2012-04-16 Thread Ezio Melotti
Ezio Melotti added the comment: Fixed, thanks for the patch! -- assignee: -> ezio.melotti nosy: +ezio.melotti resolution: -> fixed stage: -> committed/rejected status: open -> closed ___ Python tracker

[issue14603] List comprehension in zipfile.namelist

2012-04-16 Thread Roundup Robot
Roundup Robot added the comment: New changeset cac63f6ad252 by Ezio Melotti in branch 'default': #14603: use a listcomp in ZipFile.namelist. http://hg.python.org/cpython/rev/cac63f6ad252 -- nosy: +python-dev ___ Python tracker

[issue14602] Python build fails on OS X with "$MACOSX_DEPLOYMENT_TARGET mismatch"

2012-04-16 Thread Ned Deily
Changes by Ned Deily : -- assignee: -> ronaldoussoren components: -Devguide stage: -> committed/rejected title: OSX Build Target -> Python build fails on OS X with "$MACOSX_DEPLOYMENT_TARGET mismatch" versions: -Python 2.7 ___ Python tracker

[issue14602] OSX Build Target

2012-04-16 Thread Ned Deily
Ned Deily added the comment: The problem you are seeing is due to two separate issues. (1) The first time you build Python 3 in a particular build directory, the Abstract Syntax Definition Language (asdl) parser build step may be unnecessarily run by "make" if the time stamps of the source f

[issue14603] List comprehension in zipfile.namelist

2012-04-16 Thread Dum Dum
New submission from Dum Dum : Use list comprehension in namelist() method of zipfile module. -- components: Library (Lib) files: zipfile.patch keywords: patch messages: 158524 nosy: Dum.Dum priority: normal severity: normal status: open title: List comprehension in zipfile.namelist type:

[issue14600] Change ImportError reference handling, naming

2012-04-16 Thread Brian Curtin
Brian Curtin added the comment: How about this patch? Adds NULL checking and merges PyErr_SetExcWithArgsKwargs inside PyErr_SetImportError since it's not needed by itself. Docs are also updated in line with these changes. -- Added file: http://bugs.python.org/file25248/issue14600.diff

[issue13959] Re-implement parts of imp in pure Python

2012-04-16 Thread Roundup Robot
Roundup Robot added the comment: New changeset 3b5b4b4bb43c by Brett Cannon in branch 'default': Issue #13959: Re-implement imp.load_source() in imp.py. http://hg.python.org/cpython/rev/3b5b4b4bb43c -- ___ Python tracker

[issue14602] OSX Build Target

2012-04-16 Thread Martin v . Löwis
Martin v. Löwis added the comment: Please understand that the bug tracker is not a place to ask questions; use python-l...@python.org for that. To still answer your last question: newbie OSX developers are advised to prefer released versions of Python, as they will have build issues fixed tha

[issue14599] Windows test_import failure

2012-04-16 Thread Roundup Robot
Roundup Robot added the comment: New changeset 00a07720a570 by Brett Cannon in branch 'default': Issue #14599: Fix an import caching race condition. http://hg.python.org/cpython/rev/00a07720a570 -- ___ Python tracker

[issue14599] Windows test_import failure

2012-04-16 Thread Brett Cannon
Brett Cannon added the comment: I think the failure is from a cache race condition. Hopefully the invalidate_caches() call will fix things. -- ___ Python tracker ___ __

[issue14599] Windows test_import failure

2012-04-16 Thread Roundup Robot
Roundup Robot added the comment: New changeset eae7cc54d28b by Brett Cannon in branch 'default': Issue #14599: Make test_reprlib robust against import cache race http://hg.python.org/cpython/rev/eae7cc54d28b -- nosy: +python-dev ___ Python tracker <

[issue14583] try/except import fails --without-threads

2012-04-16 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : -- nosy: +Arfrever ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue14600] Change ImportError reference handling, naming

2012-04-16 Thread Antoine Pitrou
Antoine Pitrou added the comment: Oh, and is PyErr_SetExcWithArgsKwargs still useful? -- ___ Python tracker ___ ___ Python-bugs-list

[issue14600] Change ImportError reference handling, naming

2012-04-16 Thread Antoine Pitrou
Antoine Pitrou added the comment: Looks good on the principle. Implementation is a bit weird: you don't need to check name and path for NULL-ness? -- ___ Python tracker ___ ___

[issue14601] PEP sources not available as documented

2012-04-16 Thread Tshepang Lekhonkhobe
Changes by Tshepang Lekhonkhobe : -- nosy: +tshepang ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue14601] PEP sources not available as documented

2012-04-16 Thread STINNER Victor
STINNER Victor added the comment: The templates have been fixed 1 year ago, when we moved from SVN to HG. I suppose that the bot has an old local copy of the template (Python scripts to compile reST to HTML). But who owns the robot? :-) -- nosy: +haypo, loewis ___

[issue8212] A tp_dealloc of a subclassed class cannot resurrect an object

2012-04-16 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: Here is a patch with the suggested change. I put _PyObject_ResurrectFromDealloc into typeobject.c since it seems more at home there than in object.c, but I'm not sure. Also note that other types, that were calling _PyIOBase_finalize() from their tp_dea

[issue14586] TypeError: truncate() takes no keyword arguments

2012-04-16 Thread Georg Brandl
Georg Brandl added the comment: The patch is wrong: PyArg_ParseTupleAndKeywords already handles the correct assignment of positional and keyword args, and raises exceptions accordingly. Did you test that code? The question is also: why only truncate()? There are several other fileio_* metho

[issue14602] OSX Build Target

2012-04-16 Thread Andrew Thompson
Changes by Andrew Thompson : -- assignee: -> ronaldoussoren components: +Macintosh nosy: +ronaldoussoren type: -> compile error ___ Python tracker ___ _

[issue14602] OSX Build Target

2012-04-16 Thread Andrew Thompson
New submission from Andrew Thompson : I could not get Python3 to build on my OSX 10.6.8 box as per the instructions on the website (or those in the README). It "configures" , but does not "make" : IOError: $MACOSX_DEPLOYMENT_TARGET mismatch: now "10.4" but "10.5" during configure make:

[issue9141] Allow objects to decide if they can be collected by GC

2012-04-16 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: I've stumbled upon further cases of this problem, and a possible serious bug in python 3. the _PyIOBase_finalize() will invoke a "close" method on the object if the object isn't closed. This is the same as the object having a __del__ method. Yet, th

[issue14586] TypeError: truncate() takes no keyword arguments

2012-04-16 Thread Guy Taylor
Guy Taylor added the comment: Sorry had not refreshed the page to pick up the last comment. After reading more the cpython code I get what you are saying now. Not a fan of that syntax but consistency is best. This is my first time working with cpython directly, I have only worked on small pyt

[issue8212] A tp_dealloc of a subclassed class cannot resurrect an object

2012-04-16 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: __del__ methods are never invoked from GC. All objects that have finalizers, and all objects reachable from them _must_ be put in gc.garbage. If I'm not mistaken, this is a fundamental rule of python's gc module and it is not because of the unknown or

[issue14586] TypeError: truncate() takes no keyword arguments

2012-04-16 Thread Guy Taylor
Guy Taylor added the comment: Looking through cpython and trying to form a patch I found several differing interpretations of truncate: Lib/_pyio.py def truncate(self, pos=None): Modules/_io/fileio.c PyDoc_STRVAR(truncate_doc, "truncate([size: int]) ..."); A first semi-working patch is att

[issue14601] PEP sources not available as documented

2012-04-16 Thread Jim Jewett
New submission from Jim Jewett : PEP 12 states: """ To get the source this (or any) PEP, look at the top of the HTML page and click on the date & time on the "Last-Modified" line. It is a link to the source text in the Python repository. """ Unfortunately, the link actually goes to SVN, which

[issue8212] A tp_dealloc of a subclassed class cannot resurrect an object

2012-04-16 Thread Antoine Pitrou
Antoine Pitrou added the comment: > static int > _textiowrapper_clear(textio *self) > { > if (self->ok && _PyIOBase_finalize((PyObject *) self) < 0) > return -1; > > This shows something scary: During a GC run, it is possible to invoke > the "close()" method on a textio object. T

[issue8212] A tp_dealloc of a subclassed class cannot resurrect an object

2012-04-16 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: Incidentally, Looking at this, I noticed code such as: (textio.c) static int _textiowrapper_clear(textio *self) { if (self->ok && _PyIOBase_finalize((PyObject *) self) < 0) return -1; This shows something scary: During a GC run, it is poss

[issue14599] Windows test_import failure

2012-04-16 Thread Brian Curtin
Brian Curtin added the comment: Not sure why test_extension_import_fail is failing - not seeing that here. -- ___ Python tracker ___

[issue14592] old-style (level=-1) importing broken after importlib changes

2012-04-16 Thread Brett Cannon
Brett Cannon added the comment: Yeah, the fix is dead-simple, import with level=1 and if that fails import with level=0. I plan to cover this specific issue in the "What's New" for Python 3.3. -- ___ Python tracker

[issue14599] Windows test_import failure

2012-04-16 Thread Brett Cannon
Brett Cannon added the comment: Issue #14581 covers the .PY failure (still looking for input on that one). The path failure is from http://hg.python.org/cpython/rev/f341b99bb370 which Brian committed. The test_reprlib failure is because of a race condition where an importlib.invalidate_cache

[issue13476] Simple exclusion filter for unittest autodiscovery

2012-04-16 Thread Gustavo Arzola
Gustavo Arzola added the comment: I use netatalk so that I can edit my projects on my laptop (Mac) but run them on my server (Linux). Netatalk creates all kinds of .AppleDouble sub-directories that contain files with the same names as the parents, but generally hold icon, desktop location, a

[issue14600] Change ImportError reference handling, naming

2012-04-16 Thread Brian Curtin
New submission from Brian Curtin : Antoine mentioned in email that the reference handling should be changed, so here's a shot at it. I also condensed and renamed the convenience functions - I was paying too much attention to the surrounding conventions and made this harder than it had to be.

[issue14551] imp.load_source docs removed from python3 docs...is this correct?

2012-04-16 Thread Brett Cannon
Brett Cannon added the comment: Well, I want backwards-compatibility *now*, not forever. And no, it is not an obvious API as you are asking for what loaders are supposed to do; load a module, which is why the one-liner I gave you works today. Finder simply find a loader that can load somethin

[issue14087] multiprocessing.Condition.wait_for missing

2012-04-16 Thread Antoine Pitrou
Antoine Pitrou added the comment: Charles-François, will you take this one? :) -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue14586] TypeError: truncate() takes no keyword arguments

2012-04-16 Thread R. David Murray
R. David Murray added the comment: I think you misunderstand the way that python arguments work. If you have a function so: def func(size=None): Then func(0) and func(size=0) are equivalent, and func(0, size=0) is a TypeError because you've provided two arguments instead of just one. The

[issue13579] string.Formatter doesn't understand the a conversion specifier

2012-04-16 Thread Éric Araujo
Éric Araujo added the comment: To be exact, the specifier is "a", without "!" which is a delimiter. :) -- nosy: +eric.araujo title: string.Formatter doesn't understand the !a conversion specifier -> string.Formatter doesn't understand the a conversion specifier ___

[issue14586] TypeError: truncate() takes no keyword arguments

2012-04-16 Thread Guy Taylor
Guy Taylor added the comment: @murray The thing I would be worried at in both supporting truncate(0) and truncate(size=0) would be truncate(0, size=1). This could throw an exception but causes the need for extra sanity checks and introduces ambiguity in the otherwise 'only one way to do somet

[issue14580] imp.reload can fail for sub-modules

2012-04-16 Thread Jim Jewett
Jim Jewett added the comment: (Note that the two patches are not cumulative; both would need to be applied.) -- nosy: +Jim.Jewett stage: -> patch review ___ Python tracker ___

[issue14592] old-style (level=-1) importing broken after importlib changes

2012-04-16 Thread Stefan Behnel
Stefan Behnel added the comment: It turns out that it wasn't all that hard to work around. Calling __import__ twice seems to do the trick. It's more overhead, but if people want speed, they can just be explicit about what kind of import they actually mean. So I wouldn't mind considering this

[issue4130] Intel icc 9.1 does not support __int128_t used by ctypes

2012-04-16 Thread Alex Leach
Alex Leach added the comment: Thanks for the assurance. I found it strange because compilation only fails when building shared binaries. My static build of Python-2.7.3, with icc seems to work fine, except for this libffi issue. Turns out I needed dejagnu to run the tests in libffi's `make ch

[issue14551] imp.load_source docs removed from python3 docs...is this correct?

2012-04-16 Thread R. David Murray
R. David Murray added the comment: Well, if you want backward compatibility, you pretty much have to keep it as is, don't you? This is the only time I've used load_source, and it was used because we didn't want to bother mucking with the path but did want to load the module whose file system

[issue14599] Windows test_import failure

2012-04-16 Thread R. David Murray
New submission from R. David Murray : Not sure which revision triggered this, so opening a new bug: http://www.python.org/dev/buildbot/all/builders/x86%20XP-4%203.x/builds/6381/steps/test/logs/stdio There's also a test_reprlib failure, no idea if it is related. -- keywords: buildbot me

[issue14567] http.server query string handling is incorrect and inefficient

2012-04-16 Thread Jim Jewett
Changes by Jim Jewett : -- title: http.server query string handling incorrect and inefficient -> http.server query string handling is incorrect and inefficient ___ Python tracker __

[issue14593] PyErr_SetFromImportErrorWithNameAndPath lacks error checking

2012-04-16 Thread Eric Snow
Changes by Eric Snow : -- nosy: +eric.snow ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.o

[issue14551] imp.load_source docs removed from python3 docs...is this correct?

2012-04-16 Thread Brett Cannon
Brett Cannon added the comment: To help refine this, so you would expect all of the usual import stuff (e.g. sys.modules use, generating bytecode, etc.), you just want a short-circuit to the loading when you happen to already know the name and desired file path? Basically I want to kill off t

[issue14304] Implement utf-8-bmp codec

2012-04-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Sorry, the mail daemon has eaten a piece of example. >>> '\u0410\u0433\u043e\u0432!\U0001' 'Агов!\U0001' -- ___ Python tracker ___ _

[issue14304] Implement utf-8-bmp codec

2012-04-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: May be I did not correctly understand the problem, but I can assume, that this patch solves it. 'Агов!\U0001' -- keywords: +patch Added file: http://bugs.python.org/file25244/idle_escape_nonbmp.patch ___ Pytho

[issue14598] _cursesmodule.c fails with ncurses-5.9 on Linux

2012-04-16 Thread Roumen Petrov
Roumen Petrov added the comment: extracted as separate patch -- keywords: +patch Added file: http://bugs.python.org/file25243/0001-CROSS-properly-detect-WINDOW-_flags-for-different-nc.patch ___ Python tracker ___

[issue14598] _cursesmodule.c fails with ncurses-5.9 on Linux

2012-04-16 Thread Roumen Petrov
Roumen Petrov added the comment: you could find how to resolve in last patch attached to issue 3754 -- nosy: +rpetrov ___ Python tracker ___

[issue14597] Cannot unload dll in ctypes until script exits

2012-04-16 Thread R. David Murray
R. David Murray added the comment: Current default will become 3.3. 3.1 has been out for a while :) Your thought sounds reasonable, though Martin may have further input. Would you are to propose a patch? Otherwise most like nothing will happen with this issue. 3.3 Beta is scheduled for mid

[issue14597] Cannot unload dll in ctypes until script exits

2012-04-16 Thread Pat Lynch
Pat Lynch added the comment: Just to update:- I've run this pretty extensively on multiple systems (XP x86 & Win7 64-bit) and it appears to behave as expected (haven't checked it on Linux). I have that code being called in 100s of unit tests. For python 3.1, would it make sense to add it as a

[issue14598] _cursesmodule.c fails with ncurses-5.9 on Linux

2012-04-16 Thread Peter Häring
New submission from Peter Häring : I need to define NCURSES_INTERNALS in py_curses.h before ncurses.h is included, even on my Linux system with ncurses-5.9. See the same issue for cygwin: 14438 -- components: Extension Modules messages: 158481 nosy: phaering priority: normal severity:

[issue14594] document imp.load_dynamic()

2012-04-16 Thread Eric Snow
Changes by Eric Snow : -- nosy: +eric.snow ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.o

[issue14592] old-style (level=-1) importing broken after importlib changes

2012-04-16 Thread Eric Snow
Changes by Eric Snow : -- nosy: +eric.snow ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.o

[issue14551] imp.load_source docs removed from python3 docs...is this correct?

2012-04-16 Thread Antoine Pitrou
Antoine Pitrou added the comment: > The one-liner is an adequate substitute, but feels like a step > backward for this particular use case. That is, load_source is a > *convenience* function, from my POV :) Agreed with David. -- ___ Python tracker

[issue14596] struct.unpack memory leak

2012-04-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The proposed patch uses a more compact encoding format of large structures. -- keywords: +patch Added file: http://bugs.python.org/file25242/struct_repeat.patch ___ Python tracker

[issue14551] imp.load_source docs removed from python3 docs...is this correct?

2012-04-16 Thread R. David Murray
R. David Murray added the comment: The one-liner is "good enough", but... The use case is indeed loading a module from an arbitrary file without having to worry about sys.path, etc. For that load_source is intuitive. The one-liner is an adequate substitute, but feels like a step backward fo

[issue11750] Mutualize win32 functions

2012-04-16 Thread sbt
sbt added the comment: s/_win32/_winapi/g -- Added file: http://bugs.python.org/file25241/winapi_module.patch ___ Python tracker ___

[issue14591] Value returned by random.random() out of valid range

2012-04-16 Thread Mark Dickinson
Mark Dickinson added the comment: Patch looks good to me. There's one other subtle bug in random_jumpahead, which is that it's not guaranteed that the resulting state is nonzero. The way to fix this is to add a line like the one near the end of the 'init_by_array' function. mt[0] = 0x80

[issue14437] _io build fails on cygwin

2012-04-16 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Yes, the 2.7.3 branch was cut long before the fix (end of February) so it was not included. -- ___ Python tracker ___ __

[issue13959] Re-implement parts of imp in pure Python

2012-04-16 Thread Brett Cannon
Brett Cannon added the comment: >From Eric Smith on python-dev: > +suffix, mode, type_ = details > +if mode and (not mode.startswith(('r', 'U'))) or '+' in mode: > +raise ValueError('invalid file open mode {!r}'.format(mode)) Should this be: if mode and (not mode.startswith(('r

[issue14551] imp.load_source docs removed from python3 docs...is this correct?

2012-04-16 Thread Brett Cannon
Brett Cannon added the comment: David, did you find load_source() convenient because you could specify the file to use for the module's source? Did you actually like the file object argument? Just trying to gauge if some new API is needed on a loader of if the one-liner I proposed is good eno

[issue14583] try/except import fails --without-threads

2012-04-16 Thread Brett Cannon
Brett Cannon added the comment: Just to clarify the failure for the bug history, somehow multiprocessing is not ending up in sys.modules as expected. It changed from a SystemError to a KeyError because I started to properly check a PyDict_GetItem() return value instead of blindly assuming som

[issue14594] document imp.load_dynamic()

2012-04-16 Thread Brett Cannon
Brett Cannon added the comment: I'm fine w/ documenting load_dynamic() and leaving it as-is since importlib uses the function itself (plus the frozen/builtin functions, although the frozen stuff might be simplified since they can probably just return the bytes for the frozen module instead of

[issue14304] Implement utf-8-bmp codec

2012-04-16 Thread Martin v . Löwis
Martin v. Löwis added the comment: > But I think that it is too specific problem and too specific > solution. It would be better if IDLE itself escapes the string in the > most appropriate way. That is not implementable correctly. If you think otherwise, please submit a patch. If not, please tr

[issue14592] old-style (level=-1) importing broken after importlib changes

2012-04-16 Thread Brett Cannon
Brett Cannon added the comment: I should also mention that the support for -1 indexing in Python 3 was weird because support was partially removed, but some 'if' checks only did ``< 1`` and so negative indices didn't trigger an error. -- ___ Python

[issue2193] Cookie Colon Name Bug

2012-04-16 Thread Senthil Kumaran
Senthil Kumaran added the comment: I tested setting cookies with ":" in the cookie name in both firefox and google-chrome. They both seem to allow and store the cookie with ":" in them. Firefox sent a request header like this: Set-Cookie test:value=solution:is:he the cookie with name con

[issue14304] Implement utf-8-bmp codec

2012-04-16 Thread Andrew Svetlov
Andrew Svetlov added the comment: The way is named 'codec'. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue14592] old-style (level=-1) importing broken after importlib changes

2012-04-16 Thread Brett Cannon
Brett Cannon added the comment: What Benjamin said. PEP 328 should have done away with relative imports, but somehow the __import__() function itself was not updated even though its docs were changed to say that index defaulted to 0. So this isn't actually a regressions because of importlib b

[issue11750] Mutualize win32 functions

2012-04-16 Thread Antoine Pitrou
Antoine Pitrou added the comment: > > How about _windowsapi or _winapi then, to ensure there are no clashes? > > I don't have any strong feelings, but I would prefer _winapi. Ditto here. -- ___ Python tracker __

[issue14452] SysLogHandler sends invalid messages when using unicode

2012-04-16 Thread Roundup Robot
Roundup Robot added the comment: New changeset 603301cfb194 by Vinay Sajip in branch 'default': Closes #14452: brought tests in line with removal of BOM insertion code. http://hg.python.org/cpython/rev/603301cfb194 -- status: open -> closed ___ Pytho

[issue11750] Mutualize win32 functions

2012-04-16 Thread sbt
sbt added the comment: > How about _windowsapi or _winapi then, to ensure there are no clashes? I don't have any strong feelings, but I would prefer _winapi. -- ___ Python tracker

[issue14596] struct.unpack memory leak

2012-04-16 Thread Mark Dickinson
Mark Dickinson added the comment: > Or perhaps not care at all? That's also possible. :-) IMO, Robert's use-case doesn't really match the intended use-case for struct (parsing structures of values laid out like a C-struct ). There the caching makes sense. -- _

[issue14437] _io build fails on cygwin

2012-04-16 Thread Alexey Luchko
Alexey Luchko added the comment: Final 2.7.3 didn't get the fix. Checked http://python.org/ftp/python/2.7.3/Python-2.7.3.tar.xz -- ___ Python tracker ___ ___

[issue14304] Implement utf-8-bmp codec

2012-04-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Example: >>> '\u0100' 'Ā' >>> '\u0100\U0001' '\u0100\U0001' >>> print('\u0100') Ā >>> print('\u0100\U0001') Traceback (most recent call last): File "", line 1, in print('\u0100\U0001') UnicodeEncodeError: 'UCS-2' codec can't encode char

[issue14087] multiprocessing.Condition.wait_for missing

2012-04-16 Thread sbt
sbt added the comment: New patch which calculates endtime outside loop. -- Added file: http://bugs.python.org/file25240/cond_wait_for.patch ___ Python tracker ___ __

[issue14452] SysLogHandler sends invalid messages when using unicode

2012-04-16 Thread R. David Murray
R. David Murray added the comment: This appears to be failing on the buildbots: http://www.python.org/dev/buildbot/all/builders/x86%20OpenIndiana%203.x/builds/3358/steps/test/logs/stdio http://www.python.org/dev/buildbot/all/builders/x86%20Gentoo%20Non-Debug%203.x/builds/2037/steps/test/logs/st

[issue14594] document imp.load_dynamic()

2012-04-16 Thread R. David Murray
R. David Murray added the comment: Yeah, they really need to be documented in order for us to document them as deprecated if we decide we really want to remove them later. "Obsolete" is not, I think, the same as "deprecated". -- ___ Python tracker

[issue14596] struct.unpack memory leak

2012-04-16 Thread Robert Elsner
Robert Elsner added the comment: Well I stumbled across this leak while reading big files. And what is the point of having a fast C-level unpack when it can not be used with big files? I am not adverse to the idea of caching the format string but if the cache grows beyond a reasonable size, it s

[issue14432] Bug in generator if the generator in created in a C thread

2012-04-16 Thread Andrew Suffield
Andrew Suffield added the comment: I think I've tripped over a variation on this theme using pyqt and 2.7: When working in a QThread, the PyGILState_Ensure call when transitioning control from Qt to python will frequently allocate a new thread state - because every time control returns to the

[issue14597] Cannot unload dll in ctypes until script exits

2012-04-16 Thread Pat Lynch
Pat Lynch added the comment: ok, that's fair enough if most usage of ctypes is from people accessing system libraries :) I wouldn't have thought my usage was that weird though (given the strength of using python for unit testing). In local tests, adding a function CDLL::ForceUnloadDll (which

[issue14596] struct.unpack memory leak

2012-04-16 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Perhaps the best quick fix would be to only cache small > PyStructObjects, for some value of 'small'. (Total size < a few > hundred bytes, perhaps.) Or perhaps not care at all? Is there a use case for huge repeat counts? (limiting cacheability could decrease

[issue8212] A tp_dealloc of a subclassed class cannot resurrect an object

2012-04-16 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Ok, that sounds reasonable, particularly in light of that > _NewReference stuff. I'll work out a different patch then. But I > think the API must be public, since it would need to work from > extension modules. Needing to work from (stdlib) extension module

[issue14596] struct.unpack memory leak

2012-04-16 Thread Mark Dickinson
Mark Dickinson added the comment: Perhaps the best quick fix would be to only cache small PyStructObjects, for some value of 'small'. (Total size < a few hundred bytes, perhaps.) -- ___ Python tracker __

[issue14569] pystate.c #ifdef ordering problem

2012-04-16 Thread Jim Jewett
Jim Jewett added the comment: On Fri, Apr 13, 2012 at 6:19 AM, Antoine Pitrou added the comment: > I don't think you need anyone's permission to commit such a fix :) Well, *I* would, since I don't have commit privs, and don't currently have a C dev environment with which to test. But I figur

[issue8212] A tp_dealloc of a subclassed class cannot resurrect an object

2012-04-16 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: Ok, that sounds reasonable, particularly in light of that _NewReference stuff. I'll work out a different patch then. But I think the API must be public, since it would need to work from extension modules. So: if a c type decides that it wants to liv

[issue14597] Cannot unload dll in ctypes until script exits

2012-04-16 Thread Martin v . Löwis
Martin v. Löwis added the comment: In principle, it should be possible (but perhaps not desirable, see below) to call FreeLibrary in a CDLL's __del__. However, since this would be a new feature, it can't go into 2.7. Patches are welcome; make sure to support both FreeLIbrary and dlclose. The

[issue14452] SysLogHandler sends invalid messages when using unicode

2012-04-16 Thread Roundup Robot
Roundup Robot added the comment: New changeset af46a001d5ec by Vinay Sajip in branch '2.7': Issue #14452: remove BOM insertion code. http://hg.python.org/cpython/rev/af46a001d5ec New changeset 89ab589f6fa7 by Vinay Sajip in branch '3.2': Closes #14452: remove BOM insertion code. http://hg.pytho

[issue14597] Cannot unload dll in ctypes until script exits

2012-04-16 Thread Pat Lynch
Pat Lynch added the comment: thanks for the very quick response. Since LoadLibrary is called in the constructor, why can't FreeLibrary be called in the destructor? or at least expose a function to unload that calls FreeLibrary? http://msdn.microsoft.com/en-us/library/windows/desktop/ms683152%

[issue14339] Optimizing bin, oct and hex

2012-04-16 Thread Mark Dickinson
Mark Dickinson added the comment: > There is a guarantee that the shortest form must always be used. Okay, sounds good. Thanks. -- ___ Python tracker ___ _

[issue14597] Cannot unload dll in ctypes until script exits

2012-04-16 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +brian.curtin, meador.inge, tim.golden ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue14588] PEP 3115 compliant dynamic class creation

2012-04-16 Thread Éric Araujo
Changes by Éric Araujo : -- nosy: +eric.araujo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

[issue8212] A tp_dealloc of a subclassed class cannot resurrect an object

2012-04-16 Thread Antoine Pitrou
Antoine Pitrou added the comment: Urg, that's a horrible hack. How about instead having an API function to resurrect an object from a tp_dealloc? That way the iobase_dealloc code would be written: if (_PyIOBase_finalize((PyObject *) self) < 0) { _PyObject_ResurrectFromDealloc(self

[issue14597] Cannot unload dll in ctypes until script exits

2012-04-16 Thread R. David Murray
R. David Murray added the comment: In general it is difficult to impossible to get Python2 to unload modules before the interpreter shuts down. See issue 9072. I'm not savvy enough with the C stuff to know if the fact that you loaded it via ctypes changes anything, but I doubt it. Note tha

[issue14596] struct.unpack memory leak

2012-04-16 Thread Mark Dickinson
Mark Dickinson added the comment: > It appears the storage of Struct instances is rather inefficient when > there's a repeat code such as "<48L" Right. Repeat counts aren't directly supported in the underlying PyStructObject; a format string containing repeat counts is effectively 'compile

  1   2   >