[issue14657] Avoid two importlib copies

2012-04-24 Thread Brett Cannon
Brett Cannon added the comment: Modules/getpath.c seems to be where the C code does it when getting paths for sys.path. So it would be possible to use that same algorithm to set some sys attribute (e.g. in_checkout or something) much like sys.gettotalrefcount is optional and only shown when b

[issue11618] Locks broken wrt timeouts on Windows

2012-04-24 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: Here is a new patch. I've factored out the NT condittion variable code into thread_nt_cv.h which is now used by both thread_nt.h and ceval_gil.h -- Added file: http://bugs.python.org/file25351/ntlocks.patch

[issue14657] Avoid two importlib copies

2012-04-24 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Otherwise some directory structure check could be done (e.g. find > importlib/_bootstrap.py off of sys.path, and then see > if ../Modules/Setup or something also exists that would never show up > in an installed CPython). Well, the directory structure check *

[issue14579] Possible vulnerability in the utf-16 decoder after error handling

2012-04-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch, which took into account the Martin suggestions. -- title: Vulnerability in the utf-16 decoder after error handling -> Possible vulnerability in the utf-16 decoder after error handling Added file: http://bugs.python.org/file25352/utf1

[issue14579] Vulnerability in the utf-16 decoder after error handling

2012-04-24 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- title: Possible vulnerability in the utf-16 decoder after error handling -> Vulnerability in the utf-16 decoder after error handling ___ Python tracker

[issue14664] Skipping a test mixin gives metaclass error

2012-04-24 Thread Antoine Pitrou
New submission from Antoine Pitrou : Seen on a buildbot: test test_multiprocessing crashed -- Traceback (most recent call last): File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/test/regrtest.py", line 1229, in runtest_inner the_package = __import__(abstest, globals(), lo

[issue14657] Avoid two importlib copies

2012-04-24 Thread Brett Cannon
Brett Cannon added the comment: That's why I was thinking of tying into Modules/getpath.c because I assume that would work cross-platform. Is that incorrect? -- ___ Python tracker

[issue14657] Avoid two importlib copies

2012-04-24 Thread Antoine Pitrou
Antoine Pitrou added the comment: > That's why I was thinking of tying into Modules/getpath.c because I > assume that would work cross-platform. Is that incorrect? Windows uses PC/getpathp.c, not Modules/getpath.c (with tons of duplicate code)... So you would have to tie into both :) -

[issue14664] Skipping a test mixin gives metaclass error

2012-04-24 Thread Michael Foord
Michael Foord added the comment: Patch looks good - thanks. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue14657] Avoid two importlib copies

2012-04-24 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Brett Cannon wrote: > > Modules/getpath.c seems to be where the C code does it when getting paths for > sys.path. So it would be possible to use that same algorithm to set some sys > attribute (e.g. in_checkout or something) much like sys.gettotalrefcount

[issue14657] Avoid two importlib copies

2012-04-24 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Adding more cruft to getpath.c or similar routines is just going to > slow down startup time even more... The code is already there. -- ___ Python tracker _

[issue14660] Implement PEP 420: Implicit Namespace Packages

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

[issue14127] add st_*time_ns fields to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds

2012-04-24 Thread Larry Hastings
Larry Hastings added the comment: Attached is round 1 of my patch adding the ns= parameter to utime, futimes, and lutimes. Some notes: * I admit the "see utime for use of times and ns" documentation dodge (for both Doc and docstring) is lazy. Yet I'm still hoping to get away with it. * I

[issue14339] Optimizing bin, oct and hex

2012-04-24 Thread STINNER Victor
STINNER Victor added the comment: 2.100 -v = PyUnicode_DecodeASCII(p, &buffer[sz] - p, NULL); ... 2.104 +assert(p == PyUnicode_1BYTE_DATA(v)); 2.105 return v; 2.106 } You may call assert(_PyUnicode_CheckConsistency(v, 1)) to ensure that the newly created string is "consi

[issue14127] add st_*time_ns fields to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds

2012-04-24 Thread STINNER Victor
STINNER Victor added the comment: > I removed futimens because it's now extraneous. futimens() has nice feature: it is possible to only update atime only update mtime, or use "now" as the new atime and/or mtime. 3882 If *_nsec is specified as UTIME_NOW, the timestamp is updated to t

[issue14127] add st_*time_ns fields to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds

2012-04-24 Thread Larry Hastings
Larry Hastings added the comment: > futimens() has nice feature: it is possible to only update atime > only update mtime, or use "now" as the new atime and/or mtime. YAGNI. Worst case, you can use call futimes twice, once with no args, then fstat() it to get the current-ish time and rewrite t

[issue14665] faulthandler prints tracebacks in reverse order

2012-04-24 Thread Antoine Pitrou
New submission from Antoine Pitrou : Python usually prints traceback from the outer to the inner function: the inner frame is printed last. But faulthandler prints the inner frame first and the outer frame last. -- components: Extension Modules messages: 159223 nosy: haypo, pitrou prio

[issue14657] Avoid two importlib copies

2012-04-24 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Antoine Pitrou wrote: > >> Adding more cruft to getpath.c or similar routines is just going to >> slow down startup time even more... > > The code is already there. Code to detect whether you're running off a checkout vs. a normal installation by looking

[issue14657] Avoid two importlib copies

2012-04-24 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Code to detect whether you're running off a checkout vs. a normal > installation by looking at even more directories ? I don't > see any in getpath.c (and that's good). Look for "pybuilddir.txt". -- ___ Python tra

[issue14632] Race condition in WatchedFileHandler leads to unhandled exception

2012-04-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset 15a33d7d2b50 by Vinay Sajip in branch '2.7': Issue #14632: Updated WatchedFileHandler to deal with race condition. Thanks to John Mulligan for the problem report and patch. http://hg.python.org/cpython/rev/15a33d7d2b50 New changeset 5de7c3d64f2a b

[issue14665] faulthandler prints tracebacks in reverse order

2012-04-24 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here is a patch. -- keywords: +patch nosy: +ncoghlan Added file: http://bugs.python.org/file25355/reverse_frames.patch ___ Python tracker ___ _

[issue14632] Race condition in WatchedFileHandler leads to unhandled exception

2012-04-24 Thread Vinay Sajip
Vinay Sajip added the comment: I will leave this open for a few days and see if the buildbots throw up anything. -- resolution: -> fixed ___ Python tracker ___ ___

[issue14665] faulthandler prints tracebacks in reverse order

2012-04-24 Thread STINNER Victor
STINNER Victor added the comment: faulthandler has to be as simple as possible because Python internal state may be completly corrupted. faulthandler was written to display the traceback on bugs like invalid memory read or write. I chose to print the traceback as it is stored in memory (from

[issue14666] test_sendall_interrupted hangs on FreeBSD with a zombi multiprocessing thread

2012-04-24 Thread STINNER Victor
New submission from STINNER Victor : [233/364] test_multiprocessing ... [265/364] test_typechecks [266/364] test_socket Timeout (1:00:00)! Thread 0x000807235000: File "/usr/home/buildbot/buildarea/3.x.krah-freebsd/build/Lib/socket.py", line 135 in accept File "/usr/home/buildbot/buildar

[issue14666] test_sendall_interrupted hangs on FreeBSD with a zombi multiprocessing thread

2012-04-24 Thread STINNER Victor
STINNER Victor added the comment: There was a similar issue: #11753, but it was a bug in the faulthandler module. Here it looks like a bug in TestSocketSharing of test_socket which uses multiprocessing. -- ___ Python tracker

[issue14666] test_sendall_interrupted hangs on FreeBSD with a zombi multiprocessing thread

2012-04-24 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ah, this is because of the new daemon thread in ResourceSharer. That thread is never stopped and could receive signals while tests expect them to be delivered to the main thread. Either we add a (private?) facility to stop that thread, or we block signal del

[issue14605] Make import machinery explicit

2012-04-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset 8aa4737d67d2 by Marc-Andre Lemburg in branch 'default': Issue #14605: Rename _SourcelessFileLoader to SourcelessFileLoader http://hg.python.org/cpython/rev/8aa4737d67d2 -- ___ Python tracker

[issue14666] test_sendall_interrupted hangs on FreeBSD with a zombi multiprocessing thread

2012-04-24 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- components: +Library (Lib) stage: -> needs patch type: -> behavior ___ Python tracker ___ ___ Python-

[issue14666] test_sendall_interrupted hangs on FreeBSD with a zombi multiprocessing thread

2012-04-24 Thread Antoine Pitrou
Antoine Pitrou added the comment: The pthread_sigmask() solution would allow the use of multiprocessing all the while keeping deterministic signal delivery. -- ___ Python tracker _

[issue14369] make __closure__ writable

2012-04-24 Thread Richard Oudkerk
Richard Oudkerk added the comment: The patch causes crashes. If I define def cell(o): def f(): o return f.__closure__[0] def f(): a = 1 b = 2 def g(): return a + b return g g = f() then I find g.__closure__ = None; g() -> crash

[issue14605] Make import machinery explicit

2012-04-24 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Brett Cannon wrote: > > I documented it explicitly so people can use it if they so choose (e.g. look > at sys._getframe()). If you want to change this that's fine, but I am > personally not going to put the effort in to rename the class, update the > tes

[issue14605] Make import machinery explicit

2012-04-24 Thread R. David Murray
R. David Murray added the comment: Hmm. Some at least of the buildbots have failed to build after that patch: ./python ./Python/freeze_importlib.py \ ./Lib/importlib/_bootstrap.py Python/importlib.h make: ./python: Command not found make: *** [Python/importlib.h] Error 127 program finished

[issue14369] make __closure__ writable

2012-04-24 Thread Yury Selivanov
Yury Selivanov added the comment: > The patch causes crashes. Yes, that's known. First, we need to check, that we can only write tuple of cell objects or None in __closure__ (that's easy to add). Secondly, perhaps, we can check __closure__ correctness each time we start evaluating a code

[issue14127] add st_*time_ns fields to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds

2012-04-24 Thread Larry Hastings
Larry Hastings added the comment: Second round of my patch, incorporating nearly all of Victor's suggestions. Thanks, Victor! -- Added file: http://bugs.python.org/file25356/larry.utime.ns.2.patch ___ Python tracker

[issue14605] Make import machinery explicit

2012-04-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset e30196bfc11d by Marc-Andre Lemburg in branch 'default': Issue #14605: Revert renaming of _SourcelessFileLoader, since it caused http://hg.python.org/cpython/rev/e30196bfc11d -- ___ Python tracker

[issue14666] test_sendall_interrupted hangs on FreeBSD with a zombi multiprocessing thread

2012-04-24 Thread Richard Oudkerk
Richard Oudkerk added the comment: This patch adds a ResourceSharer.stop() method. This is called from tearDownClass() in the unittest. -- keywords: +patch Added file: http://bugs.python.org/file25357/mp_resource_sharer_stop.patch ___ Python tracke

[issue14605] Make import machinery explicit

2012-04-24 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: R. David Murray wrote: > > R. David Murray added the comment: > > Hmm. Some at least of the buildbots have failed to build after that patch: > > ./python ./Python/freeze_importlib.py \ > ./Lib/importlib/_bootstrap.py Python/importlib.h > make: ./pyt

[issue14667] No IDLE

2012-04-24 Thread James Lu
New submission from James Lu : No IDLE 3.26 need badly! High prriority -- components: IDLE files: python.exe messages: 159243 nosy: James.Lu priority: normal severity: normal status: open title: No IDLE type: resource usage versions: Python 3.2 Added file: http://bugs.python.org/file2535

[issue14605] Make import machinery explicit

2012-04-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset a2cf07135e4f by Marc-Andre Lemburg in branch 'default': Issue #14605: Rename _SourcelessFileLoader to SourcelessFileLoader. http://hg.python.org/cpython/rev/a2cf07135e4f -- ___ Python tracker

[issue14605] Make import machinery explicit

2012-04-24 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Marc-Andre Lemburg wrote: > Looking further I found this line in the Makefile: > > > # Importlib > > Python/importlib.h: $(srcdir)/Lib/importlib/_bootstrap.py > $(srcdir)/Python/

[issue14605] Make import machinery explicit

2012-04-24 Thread Eric V. Smith
Changes by Eric V. Smith : -- nosy: +eric.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyt

[issue14605] Make import machinery explicit

2012-04-24 Thread Brett Cannon
Brett Cannon added the comment: You can see a little discussion in http://bugs.python.org/issue14642, but it has been discussed elsewhere and the automatic rebuilding was preferred (but it is not a requirement to build as importlib.h is in hg). --

[issue14657] Avoid two importlib copies

2012-04-24 Thread Brett Cannon
Brett Cannon added the comment: That solves the "I'm in a checkout" problem but it doesn't tell you necessarily where the Lib directory is if you e.g. build from within another directory like Python/, which places the executable and pybuilddir.txt in the current directory. Now obviously you

[issue14605] Make import machinery explicit

2012-04-24 Thread Brett Cannon
Brett Cannon added the comment: I found out why runpy was giving back an absolute file path for __file__; because pkgutil was doing that through its ImpLoader, unlike what import does by default which is just taking what path it has and appending file names (and thus not making anything absol

[issue14605] Make import machinery explicit

2012-04-24 Thread Brett Cannon
Changes by Brett Cannon : -- assignee: brett.cannon -> ncoghlan stage: -> patch review ___ Python tracker ___ ___ Python-bugs-list ma

[issue14443] Distutils test failure

2012-04-24 Thread Nick Coghlan
Nick Coghlan added the comment: To answer my last question: plenty of people. Even within Fedora itself there are parallel python 2 and python 3 RPM stacks. -- ___ Python tracker _

[issue14443] Distutils test failure

2012-04-24 Thread Nick Coghlan
Nick Coghlan added the comment: It occurs to me there's a way to check my theory: if we update the failing test to explicitly check the magic cookie in at least one of the precompiled pyc files (rather than just expecting the files' existence), then it should also start failing on the 2.7 RHE

[issue14443] Distutils test failure

2012-04-24 Thread Éric Araujo
Éric Araujo added the comment: The most likely cause is that some code was updated to use pycache directories but other code that computes paths still uses the old way; this happened for bdist_wininst too. I’ll have a look at the code and reply to your questions tomorrow. I’ll also add link

[issue14665] faulthandler prints tracebacks in reverse order

2012-04-24 Thread Nick Coghlan
Nick Coghlan added the comment: Victor's argument makes sense to me. What I'd be inclined to do is shout at the reader a bit in the traceback header by making it: Traceback (most recent call FIRST): And put a comment in the source code with the gist of what Victor wrote above (i.e. inter

[issue14605] Make import machinery explicit

2012-04-24 Thread Nick Coghlan
Nick Coghlan added the comment: Yeah, I was actually going to suggest forcing an absolute path for __main__.__file__ in runpy if you didn't want to do it in importlib itself. I'm much happier with that approach than changing the tests, so the updated patch looks good to me. -- _

[issue14605] Make import machinery explicit

2012-04-24 Thread Nick Coghlan
Changes by Nick Coghlan : -- assignee: ncoghlan -> brett.cannon stage: patch review -> commit review ___ Python tracker ___ ___ Python

[issue14667] No IDLE

2012-04-24 Thread Martin v . Löwis
Martin v. Löwis added the comment: Please structure your bug report as follows: 1. this is what you did 2. this is what happened 3. this is what you want to happen instead -- nosy: +loewis ___ Python tracker

[issue14667] No IDLE

2012-04-24 Thread James Lu
James Lu added the comment: 1,looked for python IDLE 2.NO python #.use text editor (hard) james On Wed, Apr 25, 2012 at 2:17 AM, Martin v. Löwis wrote: > > Martin v. Löwis added the comment: > > Please structure your bug report as follows: > > 1. this is what you did > 2. this is what happene

[issue14667] No IDLE

2012-04-24 Thread Martin v . Löwis
Martin v. Löwis added the comment: 1. how did you look (what operating system, what mouse clicks?) 2. did you not find Python, or did you find Python, and it did not work? -- ___ Python tracker ___

[issue14579] Vulnerability in the utf-16 decoder after error handling

2012-04-24 Thread Kurt Seifried
Kurt Seifried added the comment: Please use CVE-2012-2135 for this issue as per http://www.openwall.com/lists/oss-security/2012/04/25/3 -- nosy: +kseifr...@redhat.com ___ Python tracker __

[issue14579] Vulnerability in the utf-16 decoder after error handling

2012-04-24 Thread Huzaifa Sidhpurwala
Huzaifa Sidhpurwala added the comment: I have not tried the patch yet, but modifying the reproducer yields a different crash. This one seems to be a heap-based buffer overflow which is slightly more serious. In the reproducer, you just need to replace ascii() with str(). Again works on pytho

[issue3561] Windows installer should add Python and Scripts directories to the PATH environment variable

2012-04-24 Thread Martin v . Löwis
Martin v. Löwis added the comment: Brian: The patch is fine, please apply. -- stage: patch review -> commit review ___ Python tracker ___

<    1   2