[issue12309] os.environ was modified by test_packaging
New submission from STINNER Victor victor.stin...@haypocalc.com: [ 20/356] test_packaging (...) Warning -- os.environ was modified by test_packaging Seen on x86 Tiger buildbot: http://www.python.org/dev/buildbot/all/builders/x86%20Tiger%203.x/builds/2723/steps/test/logs/stdio There is also a resource warning: .../Lib/packaging/pypi/simple.py:86: ResourceWarning: unclosed socket.socket object, fd=14, family=2, type=1, proto=6 return wrapped(self, *args, **kwargs) -- components: Tests messages: 138058 nosy: haypo, tarek priority: normal severity: normal status: open title: os.environ was modified by test_packaging versions: Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12309 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11898] Sending binary data with a POST request in httplib can cause Unicode exceptions
Ion Scerbatiuc delinha...@gmail.com added the comment: Hello again, After some digging I found that the real problem was because the provided URL was a unicode string and the concatenation was failing. Maybe this is not a big deal, but I think we should least do a proper assertion for the provided URL or some other checks, because the error encountered is at least confusing. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11898 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12309] os.environ was modified by test_packaging
Changes by Nadeem Vawda nadeem.va...@gmail.com: -- nosy: +nadeem.vawda ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12309 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12310] Segfault in test_multiprocessing
New submission from STINNER Victor victor.stin...@haypocalc.com: test_multiprocessing segfaults in a loop. The crash occurs in _Condition.release() on waiter.release(), called from Queue._finalize_close(). Possible related changes: - a5c8b6ebe895: new sigwait() test using thread (issue #8407) - 6d6099f7fe89: add sentinels to multiprocessing (issue #9205) Example of a crash: [333/356/1] test_multiprocessing Fatal Python error: Segmentation fault Thread 0x01cde800: File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/threading.py, line 237 in wait File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/multiprocessing/queues.py, line 252 in _feed File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/threading.py, line 690 in run File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/threading.py, line 737 in _bootstrap_inner File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/threading.py, line 710 in _bootstrap Current thread 0xa000d000: File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/threading.py, line 298 in notify File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/multiprocessing/queues.py, line 227 in _finalize_close File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/multiprocessing/util.py, line 202 in __call__ File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/multiprocessing/process.py, line 270 in _bootstrap File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/multiprocessing/forking.py, line 133 in __init__ File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/multiprocessing/process.py, line 134 in start File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/multiprocessing/pool.py, line 220 in _repopulate_pool File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/multiprocessing/pool.py, line 157 in __init__ File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/multiprocessing/__init__.py, line 231 in Pool File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_multiprocessing.py, line 2186 in test_main File ./Lib/test/regrtest.py, line 1043 in runtest_inner File ./Lib/test/regrtest.py, line 841 in runtest File ./Lib/test/regrtest.py, line 668 in main File ./Lib/test/regrtest.py, line 1618 in module There are approximatively 698 crashes in last tests on x86 Tiger 3.x! http://www.python.org/dev/buildbot/all/builders/x86%20Tiger%203.x/builds/2722/steps/test/logs/stdio Most occured on Queue._finalize_close() - _Condition.release() - waiter.release(). -- messages: 138060 nosy: haypo, pitrou priority: normal severity: normal status: open title: Segfault in test_multiprocessing ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12310 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8407] expose pthread_sigmask(), pthread_kill(), sigpending() and sigwait() in the signal module
STINNER Victor victor.stin...@haypocalc.com added the comment: The test hangs on FreeBSD 8.2: (...) See also #12310 which may be related. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8407 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12311] memory leak with self-referencing dict
New submission from Albert Zeyer alb...@googlemail.com: The attached Python script leaks memory. It is clear that there is a reference circle (`__dict__` references `self`) but `gc.collect()` should find this. -- components: Interpreter Core files: py_dict_refcount_test.py messages: 138062 nosy: Albert.Zeyer priority: normal severity: normal status: open title: memory leak with self-referencing dict type: resource usage versions: Python 3.2 Added file: http://bugs.python.org/file22311/py_dict_refcount_test.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12311 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12311] memory leak with self-referencing dict
Albert Zeyer alb...@googlemail.com added the comment: Whoops, looks like a duplicate of #1469629. -- resolution: - duplicate status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12311 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12310] Segfault in test_multiprocessing
STINNER Victor victor.stin...@haypocalc.com added the comment: a5c8b6ebe895: new sigwait() test using thread (issue #8407) 6d6099f7fe89: add sentinels to multiprocessing (issue #9205) The first segfaults occured in build #2719 (cedceeb45030): http://www.python.org/dev/buildbot/all/builders/x86%20Tiger%203.x/builds/2719 In the timeline, 6d6099f7fe89 cedceeb45030 a5c8b6ebe895, so the change is more likely coming from 6d6099f7fe89. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12310 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9205] Parent process hanging in multiprocessing if children terminate unexpectedly
STINNER Victor victor.stin...@haypocalc.com added the comment: test_multiprocessing crashs ~700 times on Mac OS X Tiger, regression likely introduced by this issue (6d6099f7fe89): I created issue #12310 for that. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9205 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8407] expose pthread_sigmask(), pthread_kill(), sigpending() and sigwait() in the signal module
Charles-François Natali neolo...@free.fr added the comment: I just noticed something funny: signal_sigwait doesn't release the GIL, which means that it's pretty much useless :-) sigwait() is not useless: the signal is not necessary send by another thread. The signal can be send by alarm(), from a child process, by an user, by the kernel. If it doesn't release the GIL, it is useless. The common usage pattern for sigwait() is to create a dedicated thread for signals management. If this thread calls sigwait without releasing the GIL, the whole process is suspended, which is definitely not what you want. Also, test_sigwait doesn't block the signal before calling sigwait: it happens to work because there's only one thread, but it's undefined behaviour. test_sigwait() test pass on all 3.x buildbots (some don't have sigwait(), the test is skipped). Sometimes, test_sigwait() is executed with 2 threads, the main thread and Tkinter event loop thread, and the signal is not blocked in any thread. It's mere luck: def test_sigwait(self): old_handler = signal.signal(signal.SIGALRM, self.handler) self.addCleanup(signal.signal, signal.SIGALRM, old_handler) signal.alarm(1) self.assertEqual(signal.sigwait([signal.SIGALRM]), signal.SIGALRM) Comment out the first two lines that change the signal handler, and the test will be killed by SIGALRM's default handler (Alarm clock). I tested on Linux, and if a the signal isn't blocked before calling sigwait: - if a custom signal handler is installed, then it is not called - if the default signal handler is in place, then it's called (and with SIGALRM the process gets killed) This is a typical example of what POSIX calls undefined behavior. If pthread_sigmask is called before sigwait, then it works as expected. If we really wanted to test this properly, the way to go would be to fork() a child process (that way we're sure there's only one thread), have it block and sigwait() SIGUSR1 without touching the handler, send it SIGUSR1, and check its return code. Patch attached. -- Added file: http://bugs.python.org/file22312/test_sigwait.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8407 ___--- cpython-302424b84b07/Lib/test/test_signal.py2011-06-01 04:39:38.0 +0200 +++ cpython/Lib/test/test_signal.py 2011-06-10 10:47:33.521906867 +0200 @@ -601,11 +601,24 @@ @unittest.skipUnless(hasattr(signal, 'sigwait'), 'need signal.sigwait()') def test_sigwait(self): -old_handler = signal.signal(signal.SIGALRM, self.handler) -self.addCleanup(signal.signal, signal.SIGALRM, old_handler) - -signal.alarm(1) -self.assertEqual(signal.sigwait([signal.SIGALRM]), signal.SIGALRM) +# sigwait must be called with the signal blocked: since the current +# process might have several threads running, we fork() a child process +# to have a single thread. +signum = signal.SIGUSR1 +pid = os.fork() +if pid == 0: +# child: block and wait the signal +signal.pthread_sigmask(signal.SIG_BLOCK, [signum]) +res = signal.sigwait([signum]) +if res == signum: +os._exit(0) +os._exit(1) +else: +# parent: let the child some time to wait, send him the signal, and +# check it correcty received it +time.sleep(0.5) +os.kill(pid, signum) +self.assertEqual(os.waitpid(pid, 0), (pid, 0)) @unittest.skipUnless(hasattr(signal, 'pthread_sigmask'), 'need signal.pthread_sigmask()') ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12310] Segfault in test_multiprocessing
Antoine Pitrou pit...@free.fr added the comment: Victor, how can there be hundreds of crashes? Isn't the process supposed to terminate when a crash occurs? There are several crashes in test_signal, so it's not only test_multiprocessing: Thread 0xa000d000: File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_signal.py, line 172 in test_main File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/unittest/case.py, line 407 in _executeTestPart File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/unittest/case.py, line 462 in run File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/unittest/case.py, line 514 in __call__ File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/unittest/suite.py, line 105 in run File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/unittest/suite.py, line 67 in __call__ File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/unittest/suite.py, line 105 in run File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/unittest/suite.py, line 67 in __call__ File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/support.py, line 1166 in run File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/support.py, line 1254 in _run_suite File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/support.py, line 1280 in run_unittest File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_signal.py, line 687 in test_main File ./Lib/test/regrtest.py, line 1043 in runtest_inner File ./Lib/test/regrtest.py, line 841 in runtest File ./Lib/test/regrtest.py, line 668 in main File ./Lib/test/regrtest.py, line 1618 in module Fatal Python error: Segmentation fault Thread 0xa000d000: File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_signal.py, line 248 in test_wakeup_fd_early File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/unittest/case.py, line 407 in _executeTestPart File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/unittest/case.py, line 462 in run File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/unittest/case.py, line 514 in __call__ File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/unittest/suite.py, line 105 in run File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/unittest/suite.py, line 67 in __call__ File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/unittest/suite.py, line 105 in run File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/unittest/suite.py, line 67 in __call__ File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/support.py, line 1166 in run File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/support.py, line 1254 in _run_suite File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/support.py, line 1280 in run_unittest File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_signal.py, line 687 in test_main File ./Lib/test/regrtest.py, line 1043 in runtest_inner File ./Lib/test/regrtest.py, line 841 in runtest File ./Lib/test/regrtest.py, line 668 in main File ./Lib/test/regrtest.py, line 1618 in module Fatal Python error: Segmentation fault Thread 0xa000d000: File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_signal.py, line 372 in readpipe_interrupted File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_signal.py, line 394 in test_siginterrupt_on File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/unittest/case.py, line 407 in _executeTestPart File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/unittest/case.py, line 462 in run File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/unittest/case.py, line 514 in __call__ File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/unittest/suite.py, line 105 in run File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/unittest/suite.py, line 67 in __call__ File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/unittest/suite.py, line 105 in run File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/unittest/suite.py, line 67 in __call__ File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/support.py, line 1166 in run File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/support.py, line 1254 in _run_suite File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/support.py, line 1280 in run_unittest File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_signal.py, line 687 in test_main File ./Lib/test/regrtest.py, line 1043 in runtest_inner File ./Lib/test/regrtest.py, line 841 in runtest File ./Lib/test/regrtest.py, line 668 in main File ./Lib/test/regrtest.py, line 1618 in module Fatal Python error: Segmentation fault Thread 0xa000d000: File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_signal.py, line 495 in test_itimer_prof File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/unittest/case.py, line 407 in _executeTestPart File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/unittest/case.py, line 462 in run File
[issue12009] netrc module crashes if netrc file has comment lines
R. David Murray rdmur...@bitdance.com added the comment: lexer.instream.readline(): no, we can't just call that without the seek, because reading the token that started with # may have caused the line to be consumed already. I've expanded the comment to explain this. cygwin: I'd add a comment if I knew what that was for. This was copied from the existing tests. order of assertEqual args: this reversed style was the existing style in the test file, but since we are doing a full refactor anyway I've consistently reversed them in the updated patch. Should I apply these to the current branches (including 3.1) or is it easier for you to do it in your release clones? If you do it, note that the test patch doesn't apply cleanly to 3.x, but that's only because of a couple of PEP8ifications (a space was removed from between the name and the '(' in a couple function calls in 3.x), which should be easy enough to adjust by hand in order to apply the patch. -- Added file: http://bugs.python.org/file22313/netrc-comment-fix.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12009 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12310] Segfault in test_multiprocessing
STINNER Victor victor.stin...@haypocalc.com added the comment: Victor, how can there be hundreds of crashes? Isn't the process supposed to terminate when a crash occurs? Yes, a process does terminate on SIGSEGV, but multiprocessing creates subprocesses: I suppose that crashes occur in child processes. For test_signal, I have to investigate this. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12310 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12291] file written using marshal in 3.2 can be read by 2.7, but not 3.2 or 3.3
Vinay Sajip vinay_sa...@yahoo.co.uk added the comment: Attached is an improved patch: 1. It's against the 3.2 branch, rather than default. 2. It has an added multiple load test in test_marshal.py. 3. There's more error checking for an EOF condition. 4. I've removed tab chars and used /* C89 comments */. Of course it's not as fast as the 2.x version, since that had a limitation on only being able to load from file objects, and a fast path for PyFile using stdio calls directly. Hard to compete with that! Suggestions for improvements gratefully received :-) -- keywords: +needs review Added file: http://bugs.python.org/file22314/marshal-patch2.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12291 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12291] file written using marshal in 3.2 can be read by 2.7, but not 3.2 or 3.3
Changes by Vinay Sajip vinay_sa...@yahoo.co.uk: -- stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12291 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11416] netrc module does not handle multiple entries for a single host
R. David Murray rdmur...@bitdance.com added the comment: This should not be applied until after the patch for #12009 is applied, at which point the test will need to be adjusted. #12009 completely refactors the netrc test suite. I wonder if the 'hosts' attribute should be deprecated, but let's leave that discussion for another day :) Since this requires an API change, it is a feature and can only go into 3.3. I've adjusted 'versions' accordingly. -- type: behavior - feature request versions: -Python 2.7, Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11416 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8407] expose pthread_sigmask(), pthread_kill(), sigpending() and sigwait() in the signal module
Roundup Robot devnull@devnull added the comment: New changeset a17710e27ea2 by Victor Stinner in branch 'default': Issue #8407: Make signal.sigwait() tests more reliable http://hg.python.org/cpython/rev/a17710e27ea2 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8407 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8407] expose pthread_sigmask(), pthread_kill(), sigpending() and sigwait() in the signal module
STINNER Victor victor.stin...@haypocalc.com added the comment: neologix Patch attached. I wrote a different patch based on your patch. The main change is that I chose to keep signal.alarm(1) instead of sending the signal from the parent process to the child process, because I don't think that time.sleep(0.5) is a reliable synchronization code to wait until the child process is waiting in sigwait(). test_sigwait_thread() uses time.sleep(1) to wait until the main thread is waiting in sigwait(), but it is not mandatory because the signal is already blocked in the thread. I wrote test_sigwait_thread() to ensure that sigwait() releases the GIL, not to check that if a thread raises a signal while sigwait() is waiting, sigwait() does correctly receive it. We may use time.sleep() in test_sigwait() if the signal is blocked in the parent process before the fork() (and unblocked in the parent process after the fork, but before sending the signal to the child process), but I think that signal.alarm() is more reliable and simple. -- test_sigwait(_thread) was the last known bug of this issue, so let's close it. Reopen it if you see other bugs in pthread_sigmask(), pthread_kill(), sigpending() and sigwait() functions, or maybe better: open new issues because this issue has a too long history! See issue #12303 for sigwaitinfo() and sigtimedwait(), and issue #12304 for signalfd. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8407 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12310] Segfault in test_multiprocessing
STINNER Victor victor.stin...@haypocalc.com added the comment: Le vendredi 10 juin 2011 à 09:40 +, Antoine Pitrou a écrit : There are several crashes in test_signal Commit a17710e27ea2 should fix some (all?) test_signal crashes. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12310 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12287] ossaudiodev: stack corruption with FD = FD_SETSIZE
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: I don't understand if socket file descriptors are different than (classic) file descriptors. On Windows, sockets are completely independent from file descriptors. A socket id can be large (typically over 1000), fortunately a fd_set is not indexed by descriptors; FD_SET just appends the socket descriptor to the array; there is a limit of 64 sockets, but no limit on the value of a descriptor. -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12287 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8407] expose pthread_sigmask(), pthread_kill(), sigpending() and sigwait() in the signal module
Roundup Robot devnull@devnull added the comment: New changeset 37a87b709403 by Victor Stinner in branch 'default': Issue #8407: write error message on sigwait test failure http://hg.python.org/cpython/rev/37a87b709403 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8407 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8407] expose pthread_sigmask(), pthread_kill(), sigpending() and sigwait() in the signal module
Roundup Robot devnull@devnull added the comment: New changeset 60b1ab4d0cd4 by Victor Stinner in branch 'default': Issue #8407: skip sigwait() tests if pthread_sigmask() is missing http://hg.python.org/cpython/rev/60b1ab4d0cd4 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8407 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12281] bytes.decode('mbcs', 'ignore') does replace undecodable bytes on Windows Vista or later
STINNER Victor victor.stin...@haypocalc.com added the comment: Version 2 of my patch (mbcs2.patch): - patch also the encoder: fix ignore/replace depending on the Windows version, support any error handler: encode character per character if encoding in strict mode fails - Add PyUnicode_DecodeCodePageStateful() and PyUnicode_EncodeCodePage() functions - Expose these functions as codecs.code_page_decode() and codecs.code_page_encode() The encoder raises a RuntimeError(recursive call) (ugly message!) if the result of the error handler is a Unicode string that cannot be encoded to the code page. More TODO: - write tests using codecs.code_page_decode() and codecs.code_page_encode() - Fix FIXME (e.g. support surrogates in the encoder) -- Added file: http://bugs.python.org/file22315/mbcs2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12281 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12281] bytes.decode('mbcs', 'ignore') does replace undecodable bytes on Windows Vista or later
STINNER Victor victor.stin...@haypocalc.com added the comment: Example on Windows Vista with ANSI=cp932: import codecs codecs.code_page_encode(1252, '\xe9') (b'\xe9', 1) codecs.mbcs_encode('\xe9') ... UnicodeEncodeError: 'mbcs' codec can't encode characters in position 0--1: invalid character codecs.code_page_encode(932, '\xe9') ... UnicodeEncodeError: 'cp932' codec can't encode characters in position 0--1: invalid character codecs.code_page_encode(932, '\xe9', 'replace') (b'e', 1) codecs.code_page_encode(932, '\xe9', 'ignore') (b'', 8) codecs.code_page_encode(932, '\xe9', 'backslashreplace') (b'\\xe9', 8) You can use a code page different than the ANSI code page. The encoding name is generated from the code page number: cp%u % code_page, or mbcs if code_page == CP_ACP. (Oops, I forgot a printf() in mbcs2.patch) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12281 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12281] bytes.decode('mbcs', 'ignore') does replace undecodable bytes on Windows Vista or later
STINNER Victor victor.stin...@haypocalc.com added the comment: Decode examples, ANSI=cp932: codecs.code_page_decode(1252, b'\x80') ('\u20ac', 1) codecs.code_page_decode(932, b'\x82') ... UnicodeDecodeError: 'mbcs' codec can't decode bytes in position 0--1: No mapping for the Unicode character exists in the target code page. codecs.code_page_decode(932, b'\x82', 'replace') ('・', 1) codecs.code_page_decode(932, b'\x82', 'ignore') ('', 0) Oh, the encoding name is wrong in the decoding errors. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12281 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10801] zipfile.ZipFile().extractall() header mismatch for non-ASCII characters
Roundup Robot devnull@devnull added the comment: New changeset 33b7428e65b4 by Victor Stinner in branch '3.1': Issue #10801: Fix test_unicode_filenames() of test_zipfile http://hg.python.org/cpython/rev/33b7428e65b4 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10801 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12312] is ok
New submission from tanushree tanushree.gho...@gmail.com: thank u very much for registering me . -- messages: 138082 nosy: tanushree.gho...@gmail.com priority: normal severity: normal status: open title: is ok ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12312 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12312] is ok
Changes by Brian Curtin br...@python.org: -- resolution: - invalid stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12312 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7969] shutil.copytree error handling non-standard and partially broken
Éric Araujo mer...@netwok.org added the comment: Thanks for the patch. Have you had a chance to investigate Terry’s question? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7969 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11975] Fix referencing of built-in types (list, int, ...)
Éric Araujo mer...@netwok.org added the comment: When I said “I don’t like the idea of built-in functions being displayed as ‘builtins.int’”, I was thinking about the output of “.. function:: int” in combination with the module directive. I don’t know if using currentmodule instead of module would be better. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11975 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10191] scripts files are not RECORDed.
Éric Araujo mer...@netwok.org added the comment: OK, I'll test it too. Thanks. In case you’re not sure how to test my patch, see http://docs.python.org/devguide/faq#how-do-i-apply-a-patch and http://docs.python.org/devguide/runtests I looked sources of packaging. That use packaging.utils.copy_tree. When I reported that problem, install_scripts used backport.shutil.copytree. Ah, I see a comment in the code that copy_tree should be replaced by shutil.copytree, so we need to get the test anyway to make sure changing the code later will not cause a regression. Maybe problem is fixed, because it reterned copied file lists. Indeed. Is that fixies applied to distutils2? distutils2 will be recreated as a backport of packaging. IOW, the packaging module in the 3.3 stdlib is the distutils2 project. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10191 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12298] Sphinx glitch in library/functions
Éric Araujo mer...@netwok.org added the comment: memoryview and frozenset do have a small entry in library/functions, and the links at the top of the file are meant to jump to entries in the same file. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12298 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12169] Factor out common code for d2 commands register, upload and upload_docs
Éric Araujo mer...@netwok.org added the comment: Thanks for your contribution. Unfortunately, I used “distutils2” as a familiar name for what is now known as the packaging module, in the 3.3 standard library. This document should help you find the right codebase to work from: http://wiki.python.org/moin/Distutils/Contributing Regarding the new location of the moved code, I think the util module would be a better choice than command. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12169 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11975] Fix referencing of built-in types (list, int, ...)
Georg Brandl ge...@python.org added the comment: Why is any module directive needed anyway? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11975 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12298] Sphinx glitch in library/functions
Georg Brandl ge...@python.org added the comment: Well, then a different way of linking to them must be used. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12298 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12298] Sphinx glitch in library/functions
Éric Araujo mer...@netwok.org added the comment: Certainly. I tried using `.memoryview` without success. How would you do it? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12298 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12298] Sphinx glitch in library/functions
Georg Brandl ge...@python.org added the comment: You can put an anchor and use :ref:. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12298 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12302] packaging test command needs access to .dist-info
Éric Araujo mer...@netwok.org added the comment: while running the test command (pysetup run test)? Yes, that’s the correct invocation. The use case: [...] I agree with the need. I’ve added a dep on the bug requesting the addition of a build_distinfo command; once it is done, this bug will be solved, since test runs build and places the build lib in sys.path (which also enables running tests on code converted by 2to3 at build time). The function that finds the configuration uses sysconfig paths (sysconfig.get_paths) which rely on the packaging database (PEP 376 API now in packaging.database). sysconfig does rely on packaging. To find the default config, or resource in packaging terms, I'm using the packaging.database.get_file_path, which requires the distribution metadata (dist-info) be available within the Python path This however is correct. I'd like to know where this RESOURCES file came from? I don't recall, nor see mention of it in PEP 376. This is the implementation of the discussion originally started in https://bitbucket.org/tarek/distutils2/src/6c3d67ed3adb/docs/design/wiki.rst I think it was originally intended to be a new PEP, but during distutils2 sprints it was directly coded. Resources replace data_files. I would also have expected to find something in packaging.command.install_distinfo command related to this file. It’s subtle; grep for RESOURCES and you’ll find it. The list of files is built by install_data and written by install_distinfo. If you want to learn more about this code, go to a distutils2 repo and look at the log. -- assignee: tarek - eric.araujo dependencies: +Add build_distinfo command to packaging title: test command is not loading the distribution metadata - packaging test command needs access to .dist-info ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12302 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2057] difflib: add patch capability
Éric Araujo mer...@netwok.org added the comment: A productive thing to do would be to ask feedback on python-ideas for this new feature. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2057 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12302] packaging test command needs access to .dist-info
Éric Araujo mer...@netwok.org added the comment: Typo: sysconfig does *not* rely on packaging. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12302 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12298] Sphinx glitch in library/functions
Éric Araujo mer...@netwok.org added the comment: Sounds like the easiest solution that could work, thanks. I’m on it. -- assignee: docs@python - eric.araujo status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12298 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8407] expose pthread_sigmask(), pthread_kill(), sigpending() and sigwait() in the signal module
Changes by Tres Seaver tsea...@agendaless.com: -- nosy: -tseaver ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8407 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12313] make install misses packaging module
New submission from Éric Araujo mer...@netwok.org: Here’s a patch adding Lib/packaging subdirectories to Makefile.pre.in. Because of our extensive tests for pypi-related code, the list is huge. Maybe it should use a call to find(1) instead of using a fragile manually-maintained list, so I’m asking here. -- components: Installation files: add-packaging-makefile.pre.in.diff keywords: patch messages: 138096 nosy: eric.araujo priority: normal severity: normal stage: patch review status: open title: make install misses packaging module type: behavior versions: Python 3.3 Added file: http://bugs.python.org/file22316/add-packaging-makefile.pre.in.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12313 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12222] All pysetup commands should respect exit codes
Éric Araujo mer...@netwok.org added the comment: Here’s a patch adding “return 1” after all errors, unifying the use of logging and cleaning up a few things (like moving KeyboardInterrupt handling from the _run function up to the main function). -- keywords: +patch Added file: http://bugs.python.org/file22317/p7g-run-cleanup.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12222] All pysetup commands should respect exit codes
Éric Araujo mer...@netwok.org added the comment: BTW, some functions do not explicitly return 0, but this is okay: they will return None, which is a boolean false value, which is understood as 0 by sys.exit. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12309] os.environ was modified by test_packaging
Éric Araujo mer...@netwok.org added the comment: If you don’t add the distutils2 component or our name to the nosy field, we can’t react quickly :) I don’t know our networking code enough to track down the socket-related resource warnings; I’ll look into the os.environ issue. -- assignee: - eric.araujo nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12309 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10897] UNIX mmap unnecessarily dup() file descriptor
Antoine Pitrou pit...@free.fr added the comment: Well, I agree on the principle, but it is a change in behaviour and would probably break some user code... Perhaps by adding some new argument to the mmap constructor? (dup_fd = True) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10897 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12314] regrtest checks (os.environ, sys.path, etc.) are hard to use
New submission from Éric Araujo mer...@netwok.org: When regrtest tells me that os.environ was modified by test_packaging, it’s very hard to find which test is responsible. The -vv output is hard to read: it prints four dictionaries, which I have to visually delineate, copy, paste, pretty-print and diff to find what’s changed. Then I edit the source code of regrtest so that it fails earlier, or I add a debug print in the packaging.util code that touches os.environ. I’d like regrtest to tell me what exactly was changed, and where. For the first request, I think each checked object could use a type-specific method, for example _compare_dict would see if any value was changed and if keys are different, and print only that info. -- components: Tests messages: 138101 nosy: eric.araujo priority: normal severity: normal status: open title: regrtest checks (os.environ, sys.path, etc.) are hard to use versions: Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12314 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12309] os.environ was modified by test_packaging
Changes by Éric Araujo mer...@netwok.org: -- dependencies: +regrtest checks (os.environ, sys.path, etc.) are hard to use ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12309 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12248] __dir__ semantics changed in Python 2.7.2
Benjamin Peterson benja...@python.org added the comment: I look at it this way: If I was browsing the 2.7 code and saw that type check, would I remove it in the bugfix release? No. I'm going to mark this resolved. Thanks everyone. -- resolution: - works for me status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12248 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9344] please add posix.getgrouplist()
Antoine Pitrou pit...@free.fr added the comment: Nit: when a patch gets committed and the issue closed, the preferred resolution is fixed ;) (see http://docs.python.org/devguide/triaging.html#resolution) -- resolution: accepted - fixed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9344 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12305] Building PEPs doesn't work on Python 3
Éric Araujo mer...@netwok.org added the comment: I started to work on this some months ago, so I can review your patch. Before you start, it’s probably worth asking on python-dev or pydotorg whether the machines that build and host the PEPs have Python 3 installed. I can ask on your behalf if you don’t feel confident enough to post on python-dev; feel free to reply through the core-mentorship list. -- components: +None nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12305 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9344] please add posix.getgrouplist()
Ross Lagerwall rosslagerw...@gmail.com added the comment: Nit: when a patch gets committed and the issue closed, the preferred resolution is fixed ;) (see http://docs.python.org/devguide/triaging.html#resolution) Sure, I will try remember that. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9344 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12218] Removing wsgiref.egg-info
Roundup Robot devnull@devnull added the comment: New changeset c12401a83a13 by Éric Araujo in branch 'default': Remove *.egg-info from Makefile.pre.in (follow-up to d615eb7bce33, #12218) http://hg.python.org/cpython/rev/c12401a83a13 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12218 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12246] Warn when trying to install third-party module from an uninstalled checkout
Roundup Robot devnull@devnull added the comment: New changeset ff58eec3336b by Éric Araujo in branch 'default': Don’t try to install something when running from uninstalled source (#12246). http://hg.python.org/cpython/rev/ff58eec3336b -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12246 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12246] Warn when trying to install third-party module from an uninstalled checkout
Éric Araujo mer...@netwok.org added the comment: Fixed. Welcome to Misc/ACKS ! -- resolution: - fixed stage: commit review - committed/rejected status: open - closed type: behavior - feature request ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12246 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12314] regrtest checks (os.environ, sys.path, etc.) are hard to use
R. David Murray rdmur...@bitdance.com added the comment: Improvements are welcome, the whole thing was a QnD hack that has been evolving over time...maybe there's some way to reuse unittest's assertEqual machinery? I also wonder if the whole environment-changed thing should be moved into unittest so it could wrap around individual test methods. -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12314 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12314] regrtest checks (os.environ, sys.path, etc.) are hard to use
Changes by R. David Murray rdmur...@bitdance.com: -- stage: - needs patch type: - feature request ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12314 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12314] regrtest checks (os.environ, sys.path, etc.) are hard to use
Éric Araujo mer...@netwok.org added the comment: maybe there's some way to reuse unittest's assertEqual machinery? Hum, I think the diff functionality is cleanly separated in a (private) method, so we could get diff for free. I also wonder if the whole environment-changed thing should be moved into unittest so it could wrap around individual test methods. Yeah, I was thinking about a WatchfulTestRunner that would perform the same checks. It annoys me to have two diverging sets of features to run tests: either checks with regrtest, or failfast, discovery and granularity with unittest. -- nosy: +ezio.melotti, michael.foord ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12314 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12306] zlib: Expose zlibVersion to query runtime version of zlib
Antoine Pitrou pit...@free.fr added the comment: Good idea, and thanks for posting a patch! This is a new feature, so 3.3-only. Also, you'll need to update the docs (Doc/library/zlib.rst, presumably) to add the new module method/attribute (with a suitable versionadded tag). Nitpicking: - zlibVersion isn't PEP8-compliant - semantically it should probably be a module-level attribute, rather than a method; after all it's kind of a constant; perhaps ZLIB_RUNTIME_VERSION? Also, I see that ZLIB_VERSION itself isn't documented, it would be nice to have a separate patch to fix that. -- nosy: +pitrou stage: - patch review versions: -Python 2.7, Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12306 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12168] SysLogHandler incorrectly appends \000 to messages
Éric Araujo mer...@netwok.org added the comment: Should this new attribute be documented? -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12168 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11610] Improving property to accept abstract methods
Changes by Éric Araujo mer...@netwok.org: -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11610 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9788] atexit and execution order
Éric Araujo mer...@netwok.org added the comment: Here’s a patch. -- keywords: +needs review, patch resolution: accepted - stage: needs patch - patch review versions: +Python 3.3 -Python 3.1 Added file: http://bugs.python.org/file22318/doc-atexit-order-undefined.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9788 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8887] “pydoc str” works but not “pydoc str.translate”
Éric Araujo mer...@netwok.org added the comment: I added tests to cover non-existing attributes and updated the code to follow your clever suggestion. -- Added file: http://bugs.python.org/file22319/fix-pydoc-str.translate-3.2.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8887 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8982] argparse docs cross reference Namespace as a class but the Namespace class is not documented
Changes by Éric Araujo mer...@netwok.org: Removed file: http://bugs.python.org/file21723/fix-argparse-class-directive.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8982 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8982] argparse docs cross reference Namespace as a class but the Namespace class is not documented
Éric Araujo mer...@netwok.org added the comment: Patch refreshed. If I get no negative feedback, I’ll commit it next week. -- Added file: http://bugs.python.org/file22320/fix-argparse-class-directive.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8982 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12197] non-blocking SSL write fails if a partial write was issued
Antoine Pitrou pit...@free.fr added the comment: I don't see any discrepancy here (with Python 3.3). Under both Linux and Windows, the client thread prints: ERR [Errno 3] _ssl.c:1126: The operation did not complete (write) done The only difference is that the server thread receives 128KB under Linux, and 48KB under Windows. I think the main variation comes not from OpenSSL, but from the OS's thread scheduling algorithms. If you do a large write, you have to be prepared to get an error, because the buffers may be too small. I agree it might seem strange that OpenSSL returns an error rather than the number of sent bytes, and this behaviour could actually be changed at the OpenSSL level (see http://www.openssl.org/docs/ssl/SSL_write.html) by allowing people to use the SSL_MODE_ENABLE_PARTIAL_WRITE option. However, doing so by default could break existing code which assumes that writes either fail or succeed completely. issue8240 talks about a slightly related request. -- title: non-blocking SSL write in Windows sends large data but raises exception - non-blocking SSL write fails if a partial write was issued type: behavior - feature request versions: +Python 3.3 -Python 2.6, Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12197 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12306] zlib: Expose zlibVersion to query runtime version of zlib
Changes by Éric Araujo mer...@netwok.org: -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12306 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5243] Missing dependency in distutils build
Éric Araujo mer...@netwok.org added the comment: Now something I don't understand is how reportlab distribution is doing to copy the compiled extensions when install is called. I think clib stuff is installed in the right python directory and the ext install step then just finds them. Yep, the install* commands just copy all files from the build dir to the install dir. The patch is straightforward and the test looks good. However, I worry about backward compatibility. For projects without C libs, this won’t change anything; for projects already having a workaround, what will happen? While this is clearly a bug, I’m not sure fixing the existing behavior is okay in distutils. For packaging (distutils2), I will commit this shortly. -- resolution: accepted - stage: - patch review versions: +Python 3.3 -Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5243 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12053] Add prefetch() for Buffered IO (experiment)
Antoine Pitrou pit...@free.fr added the comment: I started a draft in python. I am attaching the _pyio version along with tests. I will continue work on the C implementation and eventually documentation if this is well received. It seems straightforward, I am interested to see what you guys think. Thank you. I think performance measurements are prematurate until we have an optimized C implementation anyway. I think ultimately we also want a default implementation of read(), peek() and read1() which uses prefetch(), so that BufferedReader implementations only have to implement prefetch(). (care must be taken to avoid infinite loops) That said, I think the python-dev mailing-list needs to be convinced of the usefulness of prefetch() (if it was only me, there wouldn't be any problem :-)). Perhaps you want to run another discussion there. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12053 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8240] ssl.SSLSocket.write may fail on non-blocking sockets
Antoine Pitrou pit...@free.fr added the comment: See issue12197 for a related request. -- versions: +Python 3.3 -Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8240 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12167] test_packaging reference leak
Antoine Pitrou pit...@free.fr added the comment: Is someone investigating this? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12167 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12009] netrc module crashes if netrc file has comment lines
Roundup Robot devnull@devnull added the comment: New changeset cb3a77b0f8dd by Benjamin Peterson in branch '2.7': fix regression in netrc comment handling (closes #12009) http://hg.python.org/cpython/rev/cb3a77b0f8dd New changeset 6993910be426 by Benjamin Peterson in branch '2.7': merge 2.7.2 release branch with fix for #12009 http://hg.python.org/cpython/rev/6993910be426 New changeset 8625ce7da152 by Benjamin Peterson in branch '3.1': fix regression in netrc comment handling (closes #12009) http://hg.python.org/cpython/rev/8625ce7da152 New changeset 6b93cbb69e49 by Benjamin Peterson in branch '3.2': merge 3.1 (#12009) http://hg.python.org/cpython/rev/6b93cbb69e49 New changeset 734831b62549 by Benjamin Peterson in branch 'default': merge 3.2 (#12009) http://hg.python.org/cpython/rev/734831b62549 -- nosy: +python-dev resolution: - fixed stage: commit review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12009 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11553] Docs for: import, packages, site.py, .pth files
Éric Araujo mer...@netwok.org added the comment: Thanks for the detailed review. I’d like to work on a number of them. I think I’ll open focused bug reports and make this one depend on them; this will let interested people see the new bugs and possibly give feedback. The Language Reference is way too complicated for the mainstream case. Well, it is not a user guide, but a language reference. Its scope is different from the library reference. Exactly what variants of arguments are possible, and what are their effects? Does http://docs.python.org/dev/library/functions#__import__ help? Does http://docs.python.org/dev/library/importlib ? What are the interactions with package features, such as whether or not modules have been explicitly imported into package __init_.py? Ah, that’s a common issue. I’ll look into the turorial and docs for import and make a patch. Details of package structure have evidently changed over Python versions. I don’t think so. Current docs are unclear on points such as: -- is __init__.py needed on subpackage directories? Yes, it always has. I think there was some discussion about removing them in py3k, but this was rejected. -- the __all__ variable: Does it act generally to limit visibility of a module or package's attributes, or does pertain only to the 'from...import *' statement? Both. http://docs.python.org/dev/genindex-_ leads me to http://docs.python.org/dev/reference/simple_stmts#index-44 and http://docs.python.org/dev/c-api/import#index-0 The doc is there; I however agree that the tutorial or libref could have the same info. Language Reference Grammar issue: the grammar shown for the import statement shows: [snip] I have no inkling on that one; I’ll create another bug and ask the import experts. Really 'module' is not quite right here either since it's used to mean module-or-package. A package is a type of module. site.py: I think I’ll focus first on my work about improving the site.rst documentation, then open another bug to synchronize the docstrings. Seriously misleading discussion of .pth files. [snip] Agreed. I believe this section dates back to the pre-package days, where projects like PIL had a module, a .pth file and a directory with modules on sys.path. The docstring (or other docs) should make clear that .pth files are ONLY processed within site-package directories (ie: only by site.py) I’ll add a section about the “site directories” in the docs. They’re defined in site.py or by users calling site.addsitedir. In addsitepackages(), the library directory for Windows (the else clause) is shown as lower-case 'lib' instead of 'Lib'. I don’t see any else clause in the 2.7 or 3.3 code. Otherwise you’re right. Tutorial [snip] All valid points. Standard Library Reference site This page may simply be importing the docstring from site.py? In any case it repeats the ommissions and errors noted above for site.py. We don’t use docstring extraction in CPython. Code and docs are updated alongside, or like here, get oudated in parallel. sys Could helpfully point to a discussion of the typical items to be found in sys.path under normal circumstances Hm, this would be very platform-specific. What use cases would that help? pkgutil I’ll have to read again the code and PEPs to comment on that one. 'Installing Python Modules' document Windows has no concept of a user’s home directory, and so on. The author probably meant that there was no $HOME environment variable, ~ shortcut and all that. Even though Windows assigns a directory for each user, it’s not quite a home dir, but the parent of a settings dir, a documents dir, etc. (Just like on Mac OS X, there is a UNIX-style home dir, but the tools present another directory for users’ documents, IIRC.) For Windows suggests 'prefix' (default: C:\Python) as an installation directory. This is indeed one of the possible 'site-package' directories, but surely it is deprecated in favor of C:\Python\Lib\site-packages, which this section does not mention. Don’t confuse the prefix and the install dir. The directory for Python modules is computed as prefix + Lib/site-packages. Does not mention user-specific site-package directories. That’s #10745. I documented it in http://docs.python.org/dev/packaging/commandref#install-dist but it’s not done for distutils docs yet. 'Modifying Python's Search Path' [snip] (a) .pth files are only processed in site-package directories. Yes. I’ll probably link to the site docs after we write out a clean section on .pth files. There are other parts of the distutils docs that duplicate information found in docs.python.org/dev/using, for example; I’ll remove them from the packaging (distutils2) docs. (b) Clarifying an additional point of confusion [...] We don’t over-explain every implication in the docs; see
[issue11553] Docs for: import, packages, site.py, .pth files
Changes by Éric Araujo mer...@netwok.org: -- dependencies: +Better document user site-packages in site module doc, setup.py install --user option undocumented ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11553 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9788] atexit and execution order
Charles-François Natali neolo...@free.fr added the comment: I don't think the order should be defined. I disagree. The C standard explicitely states that the functions are called in LIFO order (which is the natural order in this case). The current implementation guarantees LIFO order, I think it should be documented. -- nosy: +neologix ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9788 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12167] test_packaging reference leak
Éric Araujo mer...@netwok.org added the comment: I’m afraid I don’t understand enough to fix this. I looked at test_simple_built in test_command_bdist_dumb and found no C code involved. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12167 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12167] test_packaging reference leak
Antoine Pitrou pit...@free.fr added the comment: I’m afraid I don’t understand enough to fix this. I looked at test_simple_built in test_command_bdist_dumb and found no C code involved. It means that either packaging or test_packaging keeps references to more and more objects. You don't need to know C, but you have to investigate. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12167 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12167] test_packaging reference leak
Éric Araujo mer...@netwok.org added the comment: Ah, it’s just refcounting issues? I can probably use the gc module to find them, and add del statements where appropriate to release objects. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12167 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12279] Add build_distinfo command to packaging
Changes by Michael Mulich michael.mul...@gmail.com: -- nosy: +michael.mulich ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12279 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12168] SysLogHandler incorrectly appends \000 to messages
Roundup Robot devnull@devnull added the comment: New changeset 3cf5d61fd6d7 by Vinay Sajip in branch '3.2': Documented change for Issue #12168. http://hg.python.org/cpython/rev/3cf5d61fd6d7 New changeset 6658b9b9f5f3 by Vinay Sajip in branch 'default': Merged documentation change for Issue #12168. http://hg.python.org/cpython/rev/6658b9b9f5f3 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12168 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11898] Sending binary data with a POST request in httplib can cause Unicode exceptions
Terry J. Reedy tjre...@udel.edu added the comment: Ion, as you perhaps noticed, posting a message 'subscribes' you (puts you on the nosy list). One can also add oneself as nosy with the little button under it without saying anything. This should be reopened because we do not change error classes in bugfix releases (ie, future 2.7.x releases) because that can break code -- unless the error class is contrary to the doc and we decide the doc is right. Even as a new feature, a change is dubious and carefully to be considered. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11898 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12315] Improve http.client.HTTPResponse.read documentation
New submission from harobed steph...@harobed.org: This is a patch to improve http.client.HTTPResponse.read documentation. What do you think about ? -- assignee: docs@python components: Documentation files: improve_http.client_documentation.patch keywords: patch messages: 138129 nosy: docs@python, harobed priority: normal severity: normal status: open title: Improve http.client.HTTPResponse.read documentation versions: Python 3.3 Added file: http://bugs.python.org/file22321/improve_http.client_documentation.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12315 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1590864] Function-level import in os triggering an threaded import deadlock
Bryan Schmersal bryan.schmer...@gmail.com added the comment: I have a module that I was using on 2.5 that uses subprocess.Popen to monitor the output from some external programs in several different threads. Of course, subprocess.Popen uses os.fork. When I upgraded to 2.7 which includes this fix, this module ran into a deadlock since the fork is being executed from within an import. One could argue that my approach is poor style but one of the goals of this module is simplicity for the usersthey simply need to import it to get the functionality of the module. Was this a desired side-effect? -- nosy: +Bryan.Schmersal ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1590864 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12246] Warn when trying to install third-party module from an uninstalled checkout
Tshepang Lekhonkhobe tshep...@gmail.com added the comment: On Fri, 2011-06-10 at 16:46 +, Éric Araujo wrote: Éric Araujo mer...@netwok.org added the comment: Fixed. Welcome to Misc/ACKS ! loveliness :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12246 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12310] Segfault in test_multiprocessing
STINNER Victor victor.stin...@haypocalc.com added the comment: It looks like the sentinel doesn't handle fatal death of the child process: test test_multiprocessing crashed -- Traceback (most recent call last): File ./Lib/test/regrtest.py, line 1043, in runtest_inner File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_multiprocessing.py, line 2189, in test_main ManagerMixin.manager.start() File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/multiprocessing/managers.py, line 531, in start self._address = reader.recv() File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/multiprocessing/connection.py, line 273, in recv buf = self._recv_bytes(sentinels=sentinels) File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/multiprocessing/connection.py, line 430, in _recv_bytes buf = self._recv(4, sentinels) File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/multiprocessing/connection.py, line 413, in _recv raise EOFError EOFError -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12310 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11610] Improved support for abstract base classes with descriptors
Darren Dale dsdal...@gmail.com added the comment: I posted the following at python-dev (http://mail.python.org/pipermail/python-dev/2011-June/111837.html): I would like to try to address some shortfalls with the way python deals with abstract base classes containing descriptors. I originally was just concerned with improving support for defining abstract properties with the decorator syntax and converting between abstract and concrete properties, but recently realized that the problem extends to descriptors in general. ABCs First, a bit of background may be in order. An abstract base class is defined by specifying its metaclass as ABCMeta (or a subclass thereof):: class MyABC(metaclass=ABCMeta): @abstractmethod def foo(self): pass When trying to instantiate MyABC or any of its subclasses, ABCMeta inspects the current class namespace for items tagged with __isabstractmethod__=True:: class ABCMeta(type): #[...] def __new__(mcls, name, bases, namespace): cls = super().__new__(mcls, name, bases, namespace) # Compute set of abstract method names abstracts = {name for name, value in namespace.items() if getattr(value, __isabstractmethod__, False)} ABCMeta then checks if any of the base classes define any items tagged with __isabstractmethod__ and whether they remain abstract in the current class namespace:: for base in bases: for name in getattr(base, __abstractmethods__, set()): value = getattr(cls, name, None) if getattr(value, __isabstractmethod__, False): abstracts.add(name) cls.__abstractmethods__ = frozenset(abstracts) In Objects/typeobject.c, __abstractmethods__ is actually a descriptor, and setting it gives the type a chance to set an internal flag specifying if it has any abstract methods defined. When object_new is called in typeobject.c, the flag is checked and an error is raised if any abstract methods were identified. Issues with ABCs and descriptors In order for this scheme to work, ABCMeta needs to identify all of the abstract methods, but there are some limitations when we consider descriptors. For example, Python's property is a composite object, whose behavior is defined by the getter, setter, and deleter methods with which it is composed. Since there is already an @abstractmethod decorator, I would have suspected that defining abstract properties would be intuitive:: class MyABC(metaclass=ABCMeta): @abstractmethod def _get_foo(self): pass @abstractmethod def _set_foo(self, val): pass foo = property(_get_foo, _set_foo) @property @abstractmethod def bar(self): pass @bar.setter @abstractmethod def bar(self, val): pass Ideally, one would want the flexibility of defining a concrete getter and an abstract setter, for example. However, ABCMeta does not inspect the descriptors of a class to see if they contain any abstract methods. It only inspects the descriptor itself for a True __isabstractmethod__ attribute. This places the burdon on every descriptor implementation to provide its own support for ABC compatibility. For example, support for abstract properties was attempted by adding abstractproperty to the abc module. abstractproperty subclasses the property builtin (as opposed to the relationship between every other abstract and concrete class in the python language). Here is the definition of abstractproperty, in its entirety (modulo docstrings):: class abstractproperty(property): __isabstractmethod__ = True A number of problems manifest with this approach, and I think they all can be traced to the fact that the abstractedness of a descriptor is currently not dependent upon the abstractedness of the methods with which it is composed. The documentation for abstractproperty doesn't suggest using @abstractmethod:: class C(metaclass=ABCMeta): def getx(self): ... def setx(self, value): ... x = abstractproperty(getx, setx) which leads to Issue #1: What is abstract about C.x? How does a subclass of C know whether it needs to override the getter or setter? Issue #2: The decorator syntax cannot be used to convert an abstract property into a concrete one. (This relates to Issue #1: how would a descriptor even know when such a conversion would be appropriate?) Running the following code:: from abc import ABCMeta, abstractmethod, abstractproperty class AbstractFoo(metaclass=ABCMeta): @abstractproperty def bar(self): return 1 @bar.setter def bar(self, val): pass class ConcreteFoo(AbstractFoo): @AbstractFoo.bar.getter def bar(self): return 1 @bar.setter def
[issue11610] Improved support for abstract base classes with descriptors
Darren Dale dsdal...@gmail.com added the comment: Here is an improved patch, which includes feedback from python-dev. make test runs without failures, however test_abc.py prints deprecation warnings for abstractproperty. I'm not familiar with the protocol here, do we continue to include unit tests for deprecated features until they are removed? -- Added file: http://bugs.python.org/file22322/abc_descriptors.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11610 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11610] Improved support for abstract base classes with descriptors
Changes by Darren Dale dsdal...@gmail.com: Removed file: http://bugs.python.org/file22322/abc_descriptors.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11610 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11610] Improved support for abstract base classes with descriptors
Changes by Darren Dale dsdal...@gmail.com: Added file: http://bugs.python.org/file22323/abc_descriptors.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11610 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12287] ossaudiodev: stack corruption with FD = FD_SETSIZE
Charles-François Natali neolo...@free.fr added the comment: Two patches attached: - a patch checking that the ossaudiodev object isn't closed - a patch adding _PyIsSelectable_fd() -- Added file: http://bugs.python.org/file22324/is_selectable.diff Added file: http://bugs.python.org/file22325/oss_check_closed.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12287 ___diff -r e572a97a1bd1 Include/fileobject.h --- a/Include/fileobject.h Fri Jun 10 19:05:16 2011 +0100 +++ b/Include/fileobject.h Fri Jun 10 23:35:14 2011 +0200 @@ -44,6 +44,15 @@ #endif #endif /* Py_LIMITED_API */ +#ifdef HAVE_SELECT +/* A routine to check if a file descriptor can be select()-ed. */ +#ifdef Py_SOCKET_FD_CAN_BE_GE_FD_SETSIZE + #define _PyIsSelectable_fd(FD) (1) +#else + #define _PyIsSelectable_fd(FD) (((FD) = 0) ((FD) FD_SETSIZE)) +#endif +#endif /* HAVE_SELECT */ + #ifdef __cplusplus } #endif diff -r e572a97a1bd1 Modules/_ssl.c --- a/Modules/_ssl.cFri Jun 10 19:05:16 2011 +0100 +++ b/Modules/_ssl.cFri Jun 10 23:35:14 2011 +0200 @@ -1022,10 +1022,8 @@ #endif /* Guard against socket too large for select*/ -#ifndef Py_SOCKET_FD_CAN_BE_GE_FD_SETSIZE -if (s-sock_fd = FD_SETSIZE) +if (!_PyIsSelectable_fd(s-sock_fd)) return SOCKET_TOO_LARGE_FOR_SELECT; -#endif /* Construct the arguments to select */ tv.tv_sec = (int)s-sock_timeout; diff -r e572a97a1bd1 Modules/ossaudiodev.c --- a/Modules/ossaudiodev.c Fri Jun 10 19:05:16 2011 +0100 +++ b/Modules/ossaudiodev.c Fri Jun 10 23:35:14 2011 +0200 @@ -425,6 +425,11 @@ if (!PyArg_ParseTuple(args, y#:write, cp, size)) return NULL; +if (!_PyIsSelectable_fd(self-fd)) { +PyErr_SetString(PyExc_ValueError, +file descriptor out of range for select); +return NULL; +} /* use select to wait for audio device to be available */ FD_ZERO(write_set_fds); FD_SET(self-fd, write_set_fds); diff -r e572a97a1bd1 Modules/selectmodule.c --- a/Modules/selectmodule.cFri Jun 10 19:05:16 2011 +0100 +++ b/Modules/selectmodule.cFri Jun 10 23:35:14 2011 +0200 @@ -110,7 +110,7 @@ #if defined(_MSC_VER) max = 0; /* not used for Win32 */ #else /* !_MSC_VER */ -if (v 0 || v = FD_SETSIZE) { +if (!_PyIsSelectable_fd(v)) { PyErr_SetString(PyExc_ValueError, filedescriptor out of range in select()); goto finally; @@ -160,13 +160,6 @@ for (j = 0; fd2obj[j].sentinel = 0; j++) { fd = fd2obj[j].fd; if (FD_ISSET(fd, set)) { -#ifndef _MSC_VER -if (fd FD_SETSIZE) { -PyErr_SetString(PyExc_SystemError, - filedescriptor out of range returned in select()); -goto finally; -} -#endif o = fd2obj[j].obj; fd2obj[j].obj = NULL; /* transfer ownership */ diff -r e572a97a1bd1 Modules/socketmodule.c --- a/Modules/socketmodule.cFri Jun 10 19:05:16 2011 +0100 +++ b/Modules/socketmodule.cFri Jun 10 23:35:14 2011 +0200 @@ -469,18 +469,14 @@ #include sys/poll.h #endif -#ifdef Py_SOCKET_FD_CAN_BE_GE_FD_SETSIZE -/* Platform can select file descriptors beyond FD_SETSIZE */ -#define IS_SELECTABLE(s) 1 -#elif defined(HAVE_POLL) +#ifdef HAVE_POLL /* Instead of select(), we'll use poll() since poll() works on any fd. */ #define IS_SELECTABLE(s) 1 /* Can we call select() with this socket without a buffer overrun? */ #else -/* POSIX says selecting file descriptors beyond FD_SETSIZE - has undefined behaviour. If there's no timeout left, we don't have to - call select, so it's a safe, little white lie. */ -#define IS_SELECTABLE(s) ((s)-sock_fd FD_SETSIZE || s-sock_timeout = 0.0) +/* If there's no timeout left, we don't have to call select, so it's a safe, + * little white lie. */ +#define IS_SELECTABLE(s) (_PyIsSelectable_fd((s)-sock_fd) || s-sock_timeout = 0.0) #endif static PyObject* diff -r e572a97a1bd1 Lib/test/test_ossaudiodev.py --- a/Lib/test/test_ossaudiodev.py Fri Jun 10 19:05:16 2011 +0100 +++ b/Lib/test/test_ossaudiodev.py Fri Jun 10 23:44:08 2011 +0200 @@ -170,6 +170,14 @@ pass self.assertTrue(dsp.closed) +def test_on_closed(self): +dsp = ossaudiodev.open('w') +dsp.close() +self.assertRaises(ValueError, dsp.fileno) +self.assertRaises(ValueError, dsp.read, 1) +self.assertRaises(ValueError, dsp.write, b'x') +self.assertRaises(ValueError, dsp.writeall, b'x') + def test_main(): try: diff -r e572a97a1bd1 Modules/ossaudiodev.c --- a/Modules/ossaudiodev.c Fri Jun 10 19:05:16 2011 +0100 +++ b/Modules/ossaudiodev.c Fri Jun 10 23:44:08 2011 +0200 @@ -213,6 +213,21 @@ * Helper functions */ +/* Check if a given file descriptor is valid
[issue12287] ossaudiodev: stack corruption with FD = FD_SETSIZE
Changes by Charles-François Natali neolo...@free.fr: Removed file: http://bugs.python.org/file22284/oss_select.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12287 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12287] ossaudiodev: stack corruption with FD = FD_SETSIZE
Changes by Charles-François Natali neolo...@free.fr: Removed file: http://bugs.python.org/file22301/oss_check_closed.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12287 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11610] Improved support for abstract base classes with descriptors
Changes by Darren Dale dsdal...@gmail.com: -- components: +Library (Lib) -Interpreter Core ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11610 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12287] ossaudiodev: stack corruption with FD = FD_SETSIZE
Antoine Pitrou pit...@free.fr added the comment: Two patches attached: - a patch checking that the ossaudiodev object isn't closed - a patch adding _PyIsSelectable_fd() In oss_check_closed.diff, you might want to add tests for the other methods as well. Otherwise, looks good! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12287 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12287] ossaudiodev: stack corruption with FD = FD_SETSIZE
STINNER Victor victor.stin...@haypocalc.com added the comment: Comments on is_selectable.diff. +#define IS_SELECTABLE(s) (_PyIsSelectable_fd((s)-sock_fd) || s-sock_timeout = 0.0) You may add parenthesis around the second s (even if it's unrelated to this issue and not a regression of your patch). +#ifdef Py_SOCKET_FD_CAN_BE_GE_FD_SETSIZE ... #if defined(_MSC_VER) max = 0; /* not used for Win32 */ I still don't understand these checks: why not testing simply for #ifdef MS_WINDOWS? MinGW or Cygwin have another implementation of select() which is more limited? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12287 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12316] test_signal: test_sigwait_thread failure on FreeBSD 6.4 buildbot
New submission from Charles-François Natali neolo...@free.fr: http://www.python.org/dev/buildbot/all/builders/x86 FreeBSD 6.4 3.x/builds/1570/steps/test/logs/stdio [ 29/356] test_signal Fatal error 'mutex is on list' at line 540 in file /usr/src/lib/libpthread/thread/thr_mutex.c (errno = 22) test test_signal failed -- Traceback (most recent call last): File /usr/home/db3l/buildarea/3.x.bolen-freebsd/build/Lib/test/test_signal.py, line 669, in test_sigwait_thread self.check_sigwait(test, signal.SIGUSR1) File /usr/home/db3l/buildarea/3.x.bolen-freebsd/build/Lib/test/test_signal.py, line 632, in check_sigwait self.assertEqual(os.waitpid(pid, 0), (pid, 0)) AssertionError: Tuples differ: (50592, 134) != (50592, 0) First differing element 1: 134 0 - (50592, 134) ? ^^^ + (50592, 0) ? ^ Fatal error 'mutex is on list' at line 540 in file /usr/src/lib/libpthread/thread/thr_mutex.c (errno = 22) In a multi-threaded program, we're only allowed to call async-safe functions between fork() and exec() in the child process (well, taken literaly this means we shouldn't run Python at all after fork...). It looks like FreeBSD 6.4 doesn't like new threads after fork() : http://unix.derkeiler.com/Mailing-Lists/FreeBSD/hackers/2008-03/msg00108.html test_sigwait_thread should either be skipped on FreeBSD 6 (it seems to pass on FreeBSD 7), or removed altogether. -- components: Tests messages: 138138 nosy: haypo, neologix priority: normal severity: normal status: open title: test_signal: test_sigwait_thread failure on FreeBSD 6.4 buildbot type: behavior versions: Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12316 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12287] ossaudiodev: stack corruption with FD = FD_SETSIZE
Charles-François Natali neolo...@free.fr added the comment: In oss_check_closed.diff, you might want to add tests for the other methods as well. I've added checks for other methods (not all of them, there are quite a few). I've also added a check for the mixer object. You may add parenthesis around the second s Done. I still don't understand these checks Me neither. Since I don't know anything about Windows, I tried to keep the existing checks, but this doens't make much sense to me. Maybe Amaury can shed a light on this? -- Added file: http://bugs.python.org/file22326/is_selectable.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12287 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12287] ossaudiodev: stack corruption with FD = FD_SETSIZE
Changes by Charles-François Natali neolo...@free.fr: Added file: http://bugs.python.org/file22327/oss_check_closed.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12287 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12287] ossaudiodev: stack corruption with FD = FD_SETSIZE
Changes by Charles-François Natali neolo...@free.fr: Removed file: http://bugs.python.org/file22324/is_selectable.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12287 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com