[issue18116] getpass.getpass() triggers ResourceWarning

2013-06-02 Thread Vajrasky Kok
Vajrasky Kok added the comment: I isolate the bug. It happens in these lines: # Always try reading and writing directly on the tty first. fd = os.open('/dev/tty', os.O_RDWR|os.O_NOCTTY) tty = os.fdopen(fd, 'w+', 1) So to produce the bug more specifically, you can try

[issue18116] getpass.getpass() triggers ResourceWarning

2013-06-02 Thread Vajrasky Kok
Vajrasky Kok added the comment: I have investigated this problem and come up with the patch to fix the problem. This patch does the job. Caution: only for Python 3.4. But translating this patch to Python 3.3 should be straightforward. I hope this patch could be the foundation for better

[issue18116] getpass.getpass() triggers ResourceWarning

2013-06-02 Thread Vajrasky Kok
Vajrasky Kok added the comment: Sorry, My previous patch breaks the test. This one should pass the test and fix the bug. Still, there are ugly code in the patch that I hope better programmers could fix. -- Added file:

[issue18117] Missing symlink:Currnet after Mac OS X 3.3.2 package installation

2013-06-02 Thread Gavan Schneider
New submission from Gavan Schneider: There is a missing symlink. Context: Installed package: http://www.python.org/ftp/python/3.3.2/python-3.3.2-macosx10.6.dmg with no apparent problems onto a 'clean' system, i.e., no other python packages other than OS X 10.8.3 defaults. Found the following

[issue18117] Missing symlink:Current after Mac OS X 3.3.2 package installation

2013-06-02 Thread Gavan Schneider
Changes by Gavan Schneider pythonbug-...@snkmail.com: -- title: Missing symlink:Currnet after Mac OS X 3.3.2 package installation - Missing symlink:Current after Mac OS X 3.3.2 package installation ___ Python tracker rep...@bugs.python.org

[issue16427] Faster hash implementation

2013-06-02 Thread Lukas Lueg
Lukas Lueg added the comment: I was investigating a callgrind dump of my code, showing how badly unicode_hash() was affecting my performance. Using google's cityhash instead of the builtin algorithm to hash unicode objects improves overall performance by about 15 to 20 percent for my case -

[issue16427] Faster hash implementation

2013-06-02 Thread Antoine Pitrou
Antoine Pitrou added the comment: I was investigating a callgrind dump of my code, showing how badly unicode_hash() was affecting my performance. Can you tell us about your use case? There are several CityHash variants, which one did you use? CityHash64? --

[issue18111] Add a default argument to min max

2013-06-02 Thread Raymond Hettinger
Raymond Hettinger added the comment: I'm -1 on expanding this API further. It already is pushing the limits with the dual signature and with the key-function. Many languages have min/max functions. AFAICT, none of them have an API with a default argument. This suggests that this isn't an

[issue16427] Faster hash implementation

2013-06-02 Thread Lukas Lueg
Lukas Lueg added the comment: It's a cache sitting between an informix db and and an internal web service. Stuff comes out of db, processed, json'ifed, cached and put on the wire. 10**6s of strings pass this process per request if uncached... I use CityHash64WithSeed, the seed being cpython's

[issue18118] curses utf8 output broken

2013-06-02 Thread helmut
New submission from helmut: Consider the test case below. #!/usr/bin/python # -*- encoding: utf8 -*- import curses def wrapped(screen): screen.addstr(0, 0, ä) screen.addstr(0, 1, ö) screen.addstr(0, 2, ü) screen.getch() if __name__ == __main__: curses.wrapper(wrapped)

[issue18119] urllib.FancyURLopener does not treat URL fragments correctly

2013-06-02 Thread Shuhei Takahashi
New submission from Shuhei Takahashi: When urllib.FancyURLopener encounters 302 redirection to a URL with fragments, it sends wrong URL to servers. For example, if we run: urllib.urlopen('http://example.com/foo') and the server responds like following. HTTP/1.1 302 Found Location:

[issue18111] Add a default argument to min max

2013-06-02 Thread R. David Murray
R. David Murray added the comment: That's a good point about the __lt__. It occurred to me as well just before I read your post :). Raymond, do any other languages have an iterator protocol as a core language feature? It's the fact that it is in Python, and that it is not simple to LBYL

[issue18111] Add a default argument to min max

2013-06-02 Thread R. David Murray
R. David Murray added the comment: Oh, and I don't think Haskell counts, since you'd expect them to stick strictly to the mathematical definition, with no consideration of practicality :) Note that I'm not saying I'm +1 on adding this (I haven't decided), I'm just trying to clarify the

[issue18118] curses utf8 output broken in Python2

2013-06-02 Thread R. David Murray
R. David Murray added the comment: I believe this is one of a class of bugs that are fixed in Python3, and that are unlikely to be fixed in Python2. I'll defer to Victor, though, who made a number of curses unicode fixes in Python3. -- nosy: +haypo, r.david.murray title: curses utf8

[issue18111] Add a default argument to min max

2013-06-02 Thread Stefan Krah
Stefan Krah added the comment: I'd use foldl() in functional languages, where the default is part of foldl() and not of max(). Translated to Python, I'm thinking of: it = iter([328, 28, 2989, 22]) functools.reduce(max, it, next(it, None)) 2989 I agree with Raymond that a default arg in

[issue17998] internal error in regular expression engine

2013-06-02 Thread Matthias Klose
Matthias Klose added the comment: what's the status on this one? Can the proposed patch be applied until the decision whether to backout the original change, or not? -- nosy: +doko, georg.brandl, larry priority: normal - release blocker ___ Python

[issue17998] internal error in regular expression engine

2013-06-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I'm working on tests. No need to rush. -- stage: patch review - test needed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17998 ___

[issue17991] ctypes.c_char gives a misleading error when passed a one-character unicode string

2013-06-02 Thread Shriramana Sharma
Shriramana Sharma added the comment: I came upon this too. In Python 2 it used to expect a one character string. Apparently the same error message has been carried forward to Python 3 too, though now the actual expected input is either a one character bytes type and not a str type, or an int

[issue16427] Faster hash implementation

2013-06-02 Thread Lukas Lueg
Lukas Lueg added the comment: Here are some benchmarks for a arm7l on a rk30-board. CityHash was compiled with -mcpu=native -O3. CityHash is around half as fast as the native algorithm for small strings and way, way slower on larger ones. My guess would be that the complex arithmetic in

[issue16427] Faster hash implementation

2013-06-02 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here are some benchmarks for a arm7l on a rk30-board. CityHash was compiled with -mcpu=native -O3. The results look unbelievable. If you take Length 10 ** 4, it means arm7l is able to hash 20 GB/s using the default unicode hash function. (did you disable

[issue18117] Missing symlink:Current after Mac OS X 3.3.2 package installation

2013-06-02 Thread Ned Deily
Ned Deily added the comment: That behavior of the OS X installer is by design. Currently, the Current link is only set for Python 2 installations, not Python 3 ones. While that may have made sense in the early days of Python 3 (assuming there would be mixed installations of both Python 3 and

[issue16427] Faster hash implementation

2013-06-02 Thread Lukas Lueg
Lukas Lueg added the comment: The 10**4-case is an error (see insane %), I've never been able to reproduce. Having done more tests with fixed cpu frequency and other daemons' process priority reduced, cityhash always comes out much slower on arm7l. --

[issue18120] multiprocessing: garbage collector fails to GC Pipe() end when spawning child process

2013-06-02 Thread spresse1
New submission from spresse1: [Code demonstrating issue attached] When overloading multiprocessing.Process and using pipes, a reference to a pipe spawned in the parent is not properly garbage collected in the child. This causes the write end of the pipe to be held open with no reference to

[issue18120] multiprocessing: garbage collector fails to GC Pipe() end when spawning child process

2013-06-02 Thread Matthias Lee
Changes by Matthias Lee matthias.a@gmail.com: -- nosy: +madmaze ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18120 ___ ___ Python-bugs-list

[issue18120] multiprocessing: garbage collector fails to GC Pipe() end when spawning child process

2013-06-02 Thread spresse1
spresse1 added the comment: Now also tested with source-built python 3.3.2. Issue still exists, same example files. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18120 ___

[issue18121] antigravity leaks subprocess.Popen object

2013-06-02 Thread Christian Heimes
New submission from Christian Heimes: $ ./python Python 3.4.0a0 (default:801567d6302c+, May 23 2013, 14:22:00) [GCC 4.7.2] on linux Type help, copyright, credits or license for more information. import gc gc.set_debug(gc.DEBUG_UNCOLLECTABLE) import antigravity Fontconfig warning:

[issue17967] urllib2.open failed to access a url when a perent directory of the url is permission denied

2013-06-02 Thread Roundup Robot
Roundup Robot added the comment: New changeset e9d0fb934b46 by Senthil Kumaran in branch '2.7': Fix #17967 - Fix related to regression on Windows. http://hg.python.org/cpython/rev/e9d0fb934b46 New changeset f5906026a7e9 by Senthil Kumaran in branch '3.3': Fix #17967 - Fix related to regression

[issue17967] urllib2.open failed to access a url when a perent directory of the url is permission denied

2013-06-02 Thread Senthil Kumaran
Changes by Senthil Kumaran sent...@uthcode.com: -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17967 ___ ___

[issue18120] multiprocessing: garbage collector fails to GC Pipe() end when spawning child process

2013-06-02 Thread Richard Oudkerk
Richard Oudkerk added the comment: The way to deal with this is to pass the write end of the pipe to the child process so that the child process can explicitly close it -- there is no reason to expect garbage collection to make this happen automatically. You don't explain the difference

[issue18120] multiprocessing: garbage collector fails to GC Pipe() end when spawning child process

2013-06-02 Thread spresse1
spresse1 added the comment: The difference is that nonfunctional.py does not pass the write end of the parent's pipe to the child. functional.py does, and closes it immediately after breaking into a new process. This is what you mentioned to me as a workaround. Corrected code (for

[issue18122] RuntimeError: not holding the import lock

2013-06-02 Thread Armin Rigo
New submission from Armin Rigo: A new bug, introduced in recent Python 2.7 (2.7.3 passes, 2.7 trunk fails): With the attached x.py, running python -c 'import x' fails with RuntimeError: not holding the import lock. It occurs when doing a fork() while holding the import lock, if the child

[issue18123] fnmatchicase for case insensitive file search

2013-06-02 Thread anatoly techtonik
New submission from anatoly techtonik: http://docs.python.org/2/library/glob.html and http://docs.python.org/2/library/fnmatch.html both lack ability to do case-insensitive search for filenames. Due to this difference, scripts that work ok on Windows start produce surprises on Linux.

[issue18118] curses utf8 output broken in Python2

2013-06-02 Thread STINNER Victor
STINNER Victor added the comment: Is your Python curses module linked to libncurses.so.5 or libncursesw.so.5? Example: $ ldd /usr/lib/python2.7/lib-dynload/_cursesmodule.so |grep curses libncursesw.so.5 = /lib/libncursesw.so.5 (0x00375000) libncursesw has a much better support of

[issue18118] curses utf8 output broken in Python2

2013-06-02 Thread helmut
helmut added the comment: All reproducers confirmed that their _cursessomething.so is linked against libncursesw.so.5. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18118 ___

[issue18122] RuntimeError: not holding the import lock

2013-06-02 Thread Amaury Forgeot d'Arc
Changes by Amaury Forgeot d'Arc amaur...@gmail.com: -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18122 ___ ___ Python-bugs-list

[issue18120] multiprocessing: garbage collector fails to GC Pipe() end when spawning child process

2013-06-02 Thread Richard Oudkerk
Richard Oudkerk added the comment: The write end of that pipe goes out of scope and has no references in the child thread. Therefore, per my understanding, it should be garbage collected (in the child thread). Where am I wrong about this? The function which starts the child process by

[issue18118] curses utf8 output broken in Python2

2013-06-02 Thread STINNER Victor
STINNER Victor added the comment: uäöü encoded to utf-8 gives '\xc3\xa4\xc3\xb6\xc3\xbc' \303\303\303\274 is '\xc3\xc3\xc3\xbc'. I guess that curses considers that '\xc3\xa4' is a string of 2 characters: screen.addstr(0, 1, ö) replaces the second character, '\xa4'. I suppose that

[issue18120] multiprocessing: garbage collector fails to GC Pipe() end when spawning child process

2013-06-02 Thread spresse1
spresse1 added the comment: So you're telling me that when I spawn a new child process, I have to deal with the entirety of my parent process's memory staying around forever? I would have expected this to call to fork(), which gives the child plenty of chance to clean up, then call exec()

[issue18117] Missing symlink:Current after Mac OS X 3.3.2 package installation

2013-06-02 Thread Gavan Schneider
Gavan Schneider added the comment: Appreciate the comment about potential problems with mixed installations of python3 and python2. And note that along these lines there is no attempt by the installer to symlink python - python3 (which could have nasty side effects if the full path was not

[issue18120] multiprocessing: garbage collector fails to GC Pipe() end when spawning child process

2013-06-02 Thread Richard Oudkerk
Richard Oudkerk added the comment: So you're telling me that when I spawn a new child process, I have to deal with the entirety of my parent process's memory staying around forever? With a copy-on-write implementation of fork() this quite likely to use less memory than starting a fresh

[issue18123] fnmatchicase for case insensitive file search

2013-06-02 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' g.rod...@gmail.com: -- nosy: +giampaolo.rodola ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18123 ___ ___

[issue18121] antigravity leaks subprocess.Popen object

2013-06-02 Thread Richard Oudkerk
Richard Oudkerk added the comment: Presumably this is caused by the fact that Popen.__del__() ressurects self by appending self to _active if the process is still alive. On Windows this is unnecessary. On Unix it would be more sensible to just append the *pid* to _active. -- nosy:

[issue18121] antigravity leaks subprocess.Popen object

2013-06-02 Thread R. David Murray
R. David Murray added the comment: See also issue 5993. -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18121 ___ ___

[issue18120] multiprocessing: garbage collector fails to GC Pipe() end when spawning child process

2013-06-02 Thread spresse1
spresse1 added the comment: So you're telling me that when I spawn a new child process, I have to deal with the entirety of my parent process's memory staying around forever? With a copy-on-write implementation of fork() this quite likely to use less memory than starting a fresh process

[issue18123] fnmatchicase for case insensitive file search

2013-06-02 Thread anatoly techtonik
anatoly techtonik added the comment: https://gist.github.com/techtonik/5694830 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18123 ___ ___

[issue18120] multiprocessing: garbage collector fails to GC Pipe() end when spawning child process

2013-06-02 Thread Richard Oudkerk
Richard Oudkerk added the comment: What I'm still trying to grasp is why Python explicitly leaves the parent processes info around in the child. It seems like there is no benefit (besides, perhaps, speed) and that this choice leads to non-intuitive behavior - like this. The Windows

[issue18120] multiprocessing: garbage collector fails to GC Pipe() end when spawning child process

2013-06-02 Thread spresse1
spresse1 added the comment: I'm actually a nix programmer by trade, so I'm pretty familiar with that behavior =p However, I'm also used to inheriting some way to refer to these fds, so that I can close them. Perhaps I've just missed somewhere a call to ask the process for a list of open

[issue2053] IDLE - standardize dialogs

2013-06-02 Thread Terry J. Reedy
Terry J. Reedy added the comment: The patch does two things. 1. It replaces the existing direct rebinding of messagebox functions as methods, such as self.showerror = tkMessageBox.showerror with binding of a double wrapping of the functions. The middle layer is useless and only serves to

[issue18111] Add a default argument to min max

2013-06-02 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thanks Stephan. I'm going to close this one. The case for adding it is too weak and isn't worth making the API more complex. If someone wants a default with an iterable of arbitrary size including zero, there are already a number of ways to do it (using

[issue18111] Add a default argument to min max

2013-06-02 Thread Julian Berman
Julian Berman added the comment: I don't really care to push this much harder, but I'll just repeat that I've already made an argument against catching the exception. Calling this making the API too complex also seems quite silly to me. It's a thing that someone looking for would find and

[issue18124] Broken build on target machine with incorrect hostname (non-ascii)

2013-06-02 Thread Dmi Baranov
New submission from Dmi Baranov: As a part of issue #18109 $ echo hât | sudo tee /proc/sys/kernel/hostname $ hostname #Yes, I know about RFC952;-) hât $ locale LANG=en_US.UTF-8 LANGUAGE= LC_CTYPE=en_US.UTF-8 LC_NUMERIC=en_US.UTF-8 LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8

[issue18109] os.uname() crashes if hostname contains non-ascii characters

2013-06-02 Thread Dmi Baranov
Dmi Baranov added the comment: Thanks Charles - I'm reproduced Dominik's issue at default branch: $ python -c 'import os, sys;print(sys.version);print(os.uname())' 3.4.0a0 (default:adfec512fb32, Jun 3 2013, 08:09:43) [GCC 4.6.3] Traceback (most recent call last): File string, line 1, in

[issue18122] RuntimeError: not holding the import lock

2013-06-02 Thread Dmi Baranov
Dmi Baranov added the comment: Looks like old history from issue 7242 -- nosy: +dmi.baranov, gregory.p.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18122 ___