[issue7736] os.listdir hangs since opendir() and closedir() do not release GIL

2010-01-20 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +loewis ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7736 ___ ___ Python-bugs-list mailing

[issue7736] os.listdir hangs since opendir() and closedir() do not release GIL

2010-01-20 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Releasing the GIL when calling C library functions (e.g. opendir()) is not a requirement, it's just an optimization for slightly better multi-threading. Also, as shown in the backtrace, PyGILState_Ensure() is called which should only try to

[issue3599] test_pydoc after test_urllib2 causes exception in Popen.__del__

2010-01-20 Thread Yinon Ehrlich
Yinon Ehrlich yino...@users.sourceforge.net added the comment: I saw this error in my scripts when using Python 2.5 on Ubuntu. When imported trunk version instead of Python2.5 one, it disappeared. So it's fixed in subprocess - def __del__ -- nosy: +Yinon

[issue5115] Extend subprocess.kill to be able to kill process groups

2010-01-20 Thread Thomas Guettler
Changes by Thomas Guettler guet...@thomas-guettler.de: -- nosy: +guettli ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5115 ___ ___

[issue5879] multiprocessing - example pool of http servers fails on windows socket has no attribute fromfd

2010-01-20 Thread Jeong-Min Lee
Changes by Jeong-Min Lee false...@gmail.com: -- nosy: +falsetru ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5879 ___ ___ Python-bugs-list

[issue7736] os.listdir hangs since opendir() and closedir() do not release GIL

2010-01-20 Thread Nikolaus Rath
Nikolaus Rath nikol...@rath.org added the comment: In this simple example, FUSE does not fork and does not start any threads. Note that PyGILState_Ensure() cannot do anything here. What happens is this: - call_hello.py calls FUSE in a new thread, releasing the GIL. - FUSE mounts the file

[issue7736] os.listdir hangs since opendir() and closedir() do not release GIL

2010-01-20 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Ah, thanks for the explanation. Yes indeed the patch looks ok for the job. You should just be aware that similar problems may appear with other system calls. I don't think we have ever considered that common C calls such as opendir() could call

[issue7736] os.listdir hangs since opendir() and closedir() do not release GIL

2010-01-20 Thread Nikolaus Rath
Nikolaus Rath nikol...@rath.org added the comment: I have used both of them in the past, but in the end I wrote my own bindings (currently only available as part of the http://code.google.com/p/s3ql source code, but I intend to factor it out at some point), since neither fuse.py

[issue7710] Inconsistent Exception for int() conversion

2010-01-20 Thread Mark Dickinson
Changes by Mark Dickinson dicki...@gmail.com: -- nosy: +mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7710 ___ ___ Python-bugs-list

[issue7736] os.listdir hangs since opendir() and closedir() do not release GIL

2010-01-20 Thread Nikolaus Rath
Nikolaus Rath nikol...@rath.org added the comment: On 01/20/2010 07:19 AM, Antoine Pitrou wrote: Ah, thanks for the explanation. Yes indeed the patch looks ok for the job. You should just be aware that similar problems may appear with other system calls. I don't think we have ever considered

[issue7736] os.listdir hangs since opendir() and closedir() do not release GIL

2010-01-20 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Well, now that I know what to look for, tracking down more of these problems should be significantly faster and easier. Are you generally going to accept similar patches for other unprotected syscalls? Until now the rule of thumb was to

[issue7743] Additional potential string - float conversion issues.

2010-01-20 Thread Mark Dickinson
New submission from Mark Dickinson dicki...@gmail.com: 1. Another potential crash caused by Python/dtoa.c: if the bigcomp functionality is disabled by replacing #define STRTOD_DIGLIM 40 with #define STRTOD_DIGLIM 4000, then the following string causes a crash: s =

[issue7743] Additional potential string - float conversion issues.

2010-01-20 Thread Eric Smith
Changes by Eric Smith e...@trueblade.com: -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7743 ___ ___ Python-bugs-list mailing

[issue7743] Additional potential string - float conversion issues.

2010-01-20 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Okay, it's not that difficult to trigger (2). With the bigcomp functionality disabled as above: AssertionError: Incorrectly rounded str-float conversion for

[issue7736] os.listdir hangs since opendir() and closedir() do not release GIL

2010-01-20 Thread Marcin Bachry
Marcin Bachry hegel...@gmail.com added the comment: Still, I'd be extremly grateful if someone could tell me the trick how to create a backtrace in such a deadlock situation Sorry, I should have mentioned that. In order to get backtrace you let the process freeze, attach gdb to it (it will

[issue2015] Possible optimisations in kwargs handling

2010-01-20 Thread Brian Curtin
Brian Curtin cur...@acm.org added the comment: This was handled in r65241 as a result of #1819. -- nosy: +brian.curtin resolution: - fixed stage: - committed/rejected status: open - closed superseder: - Speed hack for function calls with named parameters

[issue1479611] speed up function calls

2010-01-20 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- keywords: +needs review stage: - patch review versions: +Python 2.7 -Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1479611 ___

[issue7744] Allow site.addsitedir insert to beginning of sys.path

2010-01-20 Thread Chris Lasher
New submission from Chris Lasher chris.las...@gmail.com: Would it be possible to add an extra option to site.addsitedir so that it left-appends (inserts at the beginning of the list rather than the end of the list) to sys.path the new path? The use case for this is that sometimes the user has

[issue7744] Allow site.addsitedir insert to beginning of sys.path

2010-01-20 Thread Chris Lasher
Chris Lasher chris.las...@gmail.com added the comment: One correction: by beginning of sys.path, what I really mean is, the portion of sys.path after the initial ''. I forgot that '', the empty path, should always be at the start of sys.path to ensure that packages and modules in the current

[issue5115] Extend subprocess.kill to be able to kill process groups

2010-01-20 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: I suspect that on Windows, TerminateJobObject won't work with a handle returned by CreateProcess. TerminateJobObject works with CreateJobObject and AssignProcessToJobObject. The following code (from your patch) should call

[issue7745] Remove isatty check when setting sys.std[in|out|err] encoding to that of locale

2010-01-20 Thread Brian Curtin
Changes by Brian Curtin cur...@acm.org: -- keywords: +needs review priority: - normal stage: - test needed type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7745 ___

[issue7739] time.strftime may hung while trying to open /etc/localtime but does not release GIL

2010-01-20 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: It appears that the stall happens due to time.strftime call, which internally opens a file ('/etc/localtime') In the GNU libc, strftime() calls tzset() and tzset() uses a lock to be thread safe. Yes, releasing the GIL before

[issue7720] Errors in tests and C implementation of raw FileIO

2010-01-20 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: IOTest.test_destructor() is already fixed in Python trunk (future 2.7) by r73394 (Issue #6215: backport the 3.1 io lib). I don't think that it would be possible to backport the 3.1 io lib in Python 2.6. Would it possible to

[issue7745] Remove isatty check when setting sys.std[in|out|err] encoding to that of locale

2010-01-20 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: As discussed on python-dev, this patch should probably be rejected. -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7745 ___

[issue7708] test_xmlrpc fails with non-ascii path

2010-01-20 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: SimpleXMLRPCRequestHandler.do_POST() writes the traceback in the HTTP header X-traceback. But an HTTP header value is ASCII only, whereas a traceback can contain any character (eg. an non-ASCII character from a directory name for

[issue7739] time.strftime may hung while trying to open /etc/localtime but does not release GIL

2010-01-20 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: Removed file: http://bugs.python.org/file15954/unnamed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7739 ___

[issue7739] time.strftime may hung while trying to open /etc/localtime but does not release GIL

2010-01-20 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Here you have a patch releasing the GIL for the call to strftime(). -- keywords: +patch Added file: http://bugs.python.org/file15959/time_strftime_gil.patch ___ Python tracker

[issue7739] time.strftime may hung while trying to open /etc/localtime but does not release GIL

2010-01-20 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: time_tzset() might also release the GIL, but: - i hope that multithreaded programs don't call regulary tzset() in different threads - time_tzset() calls tzset() and inittimezone() - inittimezone() modify the time module

[issue4722] _winreg.QueryValue fault while reading mangled registry values

2010-01-20 Thread Brian Curtin
Changes by Brian Curtin cur...@acm.org: Removed file: http://bugs.python.org/file15265/issue4722_20091104_v1.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4722 ___

[issue4722] _winreg.QueryValue fault while reading mangled registry values

2010-01-20 Thread Brian Curtin
Brian Curtin cur...@acm.org added the comment: On Windows 7, I see the issue as both a regular user and one with admin privileges. The patch (updated to fix tab/space difference) seems to do the trick. Gabriel, which OS are you on that this works differently based on the user privileges?

[issue7727] xmlrpc library returns string which contain null ( \x00 )

2010-01-20 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Marshaller.dump_string() encodes a byte string in string.../string using the escape() function. A byte string can be encoded in base64 using base64.../base64. It's described in the XML-RPC specification, but I don't know if all

[issue7727] xmlrpc library returns string which contain null ( \x00 )

2010-01-20 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Here is an example of patch using the following test: all(32 = ord(byte) = 127 for byte in value) I don't know how much slower is the patch, but at least it doesn't raise an ExpatError: not well-formed (invalid token):

[issue7727] xmlrpc library returns string which contain null ( \x00 )

2010-01-20 Thread Steven Hartland
Steven Hartland steven.hartl...@multiplay.co.uk added the comment: One thing that springs to mind is how valid is that when applied to utf8 data? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7727

[issue7668] test_httpservers fails with non-ascii path

2010-01-20 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: CGIHTTPServerTestCase creates .py files with sys.executable in a shebang: - cgi_file1 = \ #!%s ... with open(self.file1_path, 'w') as file1: file1.write(cgi_file1 % sys.executable) - The shebang have to be the first

[issue7667] test_doctest fails with non-ascii path

2010-01-20 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: There are 2 different issues: * doctest.DocTestRunner.report_failure() raise an unicode error if the source line type is unicode: _failure_header() should convert the line to bytes using ASCII with backslashreplace error handler

[issue7746] Nit: Extra comma in itertools doc

2010-01-20 Thread Justin Lebar
New submission from Justin Lebar star...@gmail.com: At http://docs.python.org/3.1/library/itertools.html, For instance, SML provides a tabulation tool: tabulate(f) which produces a sequence f(0), f(1), But, this effect can be achieved in Python by combining map() and count() to form

[issue7747] Function variable wrongly reported unassigned

2010-01-20 Thread Adrian May
New submission from Adrian May adrian.alexander@gmail.com: Hi folks, The attached program says: $ ./bug.py a None b Traceback (most recent call last): File ./bug.py, line 49, in module print number(s) File ./bug.py, line 34, in foo while eat != None: UnboundLocalError: local

[issue7747] Function variable wrongly reported unassigned

2010-01-20 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: This is not a bug, see http://docs.python.org/faq/programming.html#why-am-i-getting-an-unboundlocalerror-when-the-variable-has-a-value -- nosy: +ezio.melotti resolution: - invalid stage: - committed/rejected status: open - closed