[issue10271] warnings.showwarning should allow any callable object
lekma lekma...@gmail.com added the comment: how should we go about that? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10271 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12126] incorrect select documentation
Eli Bendersky eli...@gmail.com added the comment: Antoine, can you be more specific? I recall finding it quite useful when first learning Python. Perhaps it can be improved in a few specific places, but overall I don't think it's a bad document. -- nosy: +eli.bendersky ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12126 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12126] incorrect select documentation
Eli Bendersky eli...@gmail.com added the comment: This issue Jean-Paul raises seems to be a plain error. select() certainly can return that some given socket is both readable and writable (this is explicitly discussed in Steven's APitUE $14.5), and I see no evidence in the implementation of Python's selectmodule.c that it somehow violates the output of system's select() to behave otherwise. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12126 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11015] Bring test.support docs up to date
Eli Bendersky eli...@gmail.com added the comment: Can this issue be closed? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11015 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2091] file accepts 'rU+' as a mode
Changes by Eli Bendersky eli...@gmail.com: -- nosy: +eli.bendersky ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2091 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12090] 3.2: build --without-threads fails
Stefan Krah stefan-use...@bytereef.org added the comment: Georg, I think this might be a release blocker. I hope it is not too late for 3.2.1. Victor, was there any reason that 79fcd71d0356 wasn't backported? Otherwise I'll go ahead and push it to 3.2. -- priority: normal - release blocker ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12090 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2091] file accepts 'rU+' as a mode
Eli Bendersky eli...@gmail.com added the comment: In Python 3, the documentation no longer mentions that 'U' should not work with '+' (or 'w' or 'a', for that matter), and the code throws ValueError if 'U' is used with 'w' or 'a', but not '+'. On the other hand, the documentation *does* mention that 'U' is for backwards compatibility and shouldn't be used with new code. In light of this, how do you suggest to proceed with this issue? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2091 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12003] documentation: alternate version of xrange seems to fail.
Eli Bendersky eli...@gmail.com added the comment: I think that if this note should stay in the docs at all, it should be as concise as possible, so I like Terry's -1+2*(step0) option. I also tested it on a few more inputs and it works fine. If there are no objections, I can commit it to python 2.7 docs in a couple of days. -- nosy: +eli.bendersky ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12003 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1441530] socket read() can cause MemoryError in Windows
Charles-François Natali neolo...@free.fr added the comment: It's actually an obvious case of heap fragmentation due to long-lived chunks being realloc()ed to a smaller size. Some malloc implementations can choke on this (e.g. OS-X's malloc is known to not shrink blocks when realloc() is called with a smaller size). The solution is simply to use a StringIO to avoid holding references to those blocks for too long. Patch attached. -- Added file: http://bugs.python.org/file22044/imaplib_read.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1441530 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1441530] socket read() can cause MemoryError in Windows
Changes by Charles-François Natali neolo...@free.fr: Removed file: http://bugs.python.org/file16747/imaplib_read.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1441530 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12131] python built with --prefix fails in site.py with no section 'posix_prefix'
Changes by Nadeem Vawda nadeem.va...@gmail.com: -- nosy: +nadeem.vawda ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12131 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12132] test_packaging failures when run with -j
New submission from Nadeem Vawda nadeem.va...@gmail.com: test_packaging fails when regrtest is run with the -j option (run multiple tests concurrently). $ ./python -Wd -E -bb -j0 -v test_packaging [snip] == ERROR: test_build_ext (packaging.tests.test_command_build_ext.BuildExtTestCase) -- Traceback (most recent call last): File /home/nadeem/code/src/cpython/python/Lib/packaging/tests/test_command_build_ext.py, line 34, in setUp shutil.copy(_get_source_filename(), self.tmp_dir) File /home/nadeem/code/src/cpython/python/Lib/shutil.py, line 133, in copy copyfile(src, dst) File /home/nadeem/code/src/cpython/python/Lib/shutil.py, line 98, in copyfile with open(src, 'rb') as fsrc: IOError: [Errno 2] No such file or directory: '/home/nadeem/code/src/cpython/python/build/test_python_17565/Modules/xxmodule.c' == ERROR: test_compiler_option (packaging.tests.test_command_build_ext.BuildExtTestCase) -- Traceback (most recent call last): File /home/nadeem/code/src/cpython/python/Lib/packaging/tests/test_command_build_ext.py, line 34, in setUp shutil.copy(_get_source_filename(), self.tmp_dir) File /home/nadeem/code/src/cpython/python/Lib/shutil.py, line 133, in copy copyfile(src, dst) File /home/nadeem/code/src/cpython/python/Lib/shutil.py, line 98, in copyfile with open(src, 'rb') as fsrc: IOError: [Errno 2] No such file or directory: '/home/nadeem/code/src/cpython/python/build/test_python_17565/Modules/xxmodule.c' == ERROR: test_ext_fullpath (packaging.tests.test_command_build_ext.BuildExtTestCase) -- Traceback (most recent call last): File /home/nadeem/code/src/cpython/python/Lib/packaging/tests/test_command_build_ext.py, line 34, in setUp shutil.copy(_get_source_filename(), self.tmp_dir) File /home/nadeem/code/src/cpython/python/Lib/shutil.py, line 133, in copy copyfile(src, dst) File /home/nadeem/code/src/cpython/python/Lib/shutil.py, line 98, in copyfile with open(src, 'rb') as fsrc: IOError: [Errno 2] No such file or directory: '/home/nadeem/code/src/cpython/python/build/test_python_17565/Modules/xxmodule.c' == ERROR: test_finalize_options (packaging.tests.test_command_build_ext.BuildExtTestCase) -- Traceback (most recent call last): File /home/nadeem/code/src/cpython/python/Lib/packaging/tests/test_command_build_ext.py, line 34, in setUp shutil.copy(_get_source_filename(), self.tmp_dir) File /home/nadeem/code/src/cpython/python/Lib/shutil.py, line 133, in copy copyfile(src, dst) File /home/nadeem/code/src/cpython/python/Lib/shutil.py, line 98, in copyfile with open(src, 'rb') as fsrc: IOError: [Errno 2] No such file or directory: '/home/nadeem/code/src/cpython/python/build/test_python_17565/Modules/xxmodule.c' == ERROR: test_get_outputs (packaging.tests.test_command_build_ext.BuildExtTestCase) -- Traceback (most recent call last): File /home/nadeem/code/src/cpython/python/Lib/packaging/tests/test_command_build_ext.py, line 34, in setUp shutil.copy(_get_source_filename(), self.tmp_dir) File /home/nadeem/code/src/cpython/python/Lib/shutil.py, line 133, in copy copyfile(src, dst) File /home/nadeem/code/src/cpython/python/Lib/shutil.py, line 98, in copyfile with open(src, 'rb') as fsrc: IOError: [Errno 2] No such file or directory: '/home/nadeem/code/src/cpython/python/build/test_python_17565/Modules/xxmodule.c' == ERROR: test_get_source_files (packaging.tests.test_command_build_ext.BuildExtTestCase) -- Traceback (most recent call last): File /home/nadeem/code/src/cpython/python/Lib/packaging/tests/test_command_build_ext.py, line 34, in setUp shutil.copy(_get_source_filename(), self.tmp_dir) File /home/nadeem/code/src/cpython/python/Lib/shutil.py, line 133, in copy copyfile(src, dst) File /home/nadeem/code/src/cpython/python/Lib/shutil.py, line 98, in copyfile with open(src, 'rb') as fsrc:
[issue12126] incorrect select documentation
Antoine Pitrou pit...@free.fr added the comment: Well, my main issue with this document is that it doesn't seem to have a well-defined destination: - people who know sockets won't learn anything from it - but people who don't know sockets will probably find it clear as mud (for example, what's an INET or STREAM socket? what's select?) I have other issues, such as the style/tone it's written in. I'm sure the author had fun writing it but it doesn't fit well with the rest of the documentation. Also, the author gives a lot of advice without really giving an example (if somewhere in those input lists of sockets is one which has died a nasty death, the select will fail - is that really true? what is a nasty death and how is that supposed to happen? couldn't the author have put a 3-line example to demonstrate this supposed drawback and how it manifests?). And, finally, many statements seem arbitrary (There’s no question that the fastest sockets code uses non-blocking sockets and select to multiplex them) or plain wrong (threading support in Unixes varies both in API and quality. So the normal Unix solution is to fork a subprocess to deal with each connection). I don't think giving misleading advice to users is really a good idea. And suggesting beginners they use non-blocking sockets without even *showing* how (or pointing to asyncore or Twisted) is a very bad idea. select() is not enough, you still have to be prepared to get EAGAIN or EWOULDBLOCK when calling recv() or send() (i.e. select() can give false positives). Oh and I think it's obsolete too, because the class mysocket concatenates the output of recv() with a str rather than a bytes object. Not to mention that features of the class mysocket can be had using a buffered socket.makefile() instead of writing custom code. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12126 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5715] listen socket close in SocketServer.ForkingMixIn.process_request()
Charles-François Natali neolo...@free.fr added the comment: Thanks for reporting this, the current behaviour is clearly wrong. The child process doesn't need to - and shouldn't - inherit the server socket. The custom idiom when writting such code is to close the new socket (well, in TCP) in the parent process, and close the server socket in the child process. That's what the attached patch does. Since I really doubt anyone using socketserver ever used the server's socket from the handler, this shouldn't be a problem for existing code (and the server's socket was never documented to be usable from the request handler). -- keywords: +needs review, patch nosy: +charles-francois.natali, haypo stage: test needed - patch review Added file: http://bugs.python.org/file22045/ss_fork_close.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5715 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12132] test_packaging failures when run with -j
Changes by Antoine Pitrou pit...@free.fr: -- assignee: - tarek components: +Distutils2 nosy: +alexis, eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12132 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11877] Change os.fsync() to support physical backing store syncs
Steffen Daode Nurpmeso sdao...@googlemail.com added the comment: diff --git a/Doc/library/os.rst b/Doc/library/os.rst --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -810,6 +810,35 @@ Availability: Unix, and Windows. +.. function:: fullfsync(fd) + + The POSIX standart requires that :c:func:`fsync` must transfer the buffered + data to the storage device, not that the data is actually written by the + device itself. It explicitely leaves it up to operating system implementors + whether users are given stronger guarantees on data integrity or not. Some + systems also offer special functions which overtake the part of making such + stronger guarantees, i.e., Mac OS X and NetBSD. + + This non-standart function is *optionally* made available to access such + special functionality when feasible. It will force write of file buffers to + disk and the flush of disk caches of the file given by file descriptor *fd*. + To strive for best-possible data integrity, the following can be done:: + + # Force writeout of local buffer modifications + f.flush() + # Then synchronize the changes to physical backing store + if hasattr(os, 'fullfsync'): + os.fullfsync(f.fileno()) + elif hasattr(os, 'fsync'): + os.fsync(f.fileno()) + + ..note:: + Calling this function may take a long time, since it may block + until the disk reports that the transfer has been completed. + + Availability: Unix. + + .. function:: ftruncate(fd, length) Truncate the file corresponding to file descriptor *fd*, so that it is at most diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -835,12 +835,12 @@ class TestInvalidFD(unittest.TestCase): singles = [fchdir, dup, fdopen, fdatasync, fstat, - fstatvfs, fsync, tcgetpgrp, ttyname] + fstatvfs, fsync, fullfsync, tcgetpgrp, ttyname] #singles.append(close) -#We omit close because it doesn'r raise an exception on some platforms +# We omit close because it doesn't raise an exception on some platforms def get_single(f): def helper(self): -if hasattr(os, f): +if hasattr(os, f): self.check(getattr(os, f)) return helper for f in singles: diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -174,6 +174,11 @@ #endif /* ! __IBMC__ */ #ifndef _MSC_VER + /* os.fullfsync()? */ +# if (defined HAVE_FSYNC ((defined __APPLE__ defined F_FULLFSYNC) || \ + (defined __NetBSD__ defined FDISKSYNC))) +# define PROVIDE_FULLFSYNC +# endif #if defined(__sgi)_COMPILER_VERSION=700 /* declare ctermid_r if compiling with MIPSPro 7.x in ANSI C mode @@ -2129,6 +2134,41 @@ { return posix_fildes(fdobj, fsync); } + +# ifdef PROVIDE_FULLFSYNC +PyDoc_STRVAR(fullfsync__doc__, +fullfsync(fd)\n\n +force write of file buffers to disk, and the flush of disk caches\n +of the file given by file descriptor fd.); + +static PyObject * +fullfsync(PyObject *self, PyObject *fdobj) +{ +/* See issue 11877 discussion */ +int res, fd = PyObject_AsFileDescriptor(fdobj); +if (fd 0) +return NULL; +if (!_PyVerify_fd(fd)) +return posix_error(); + +Py_BEGIN_ALLOW_THREADS +# if defined __APPLE__ +/* F_FULLFSYNC is not supported for all types of FDs/FSYSs; + * be on the safe side and test for inappropriate ioctl errors */ +res = fcntl(fd, F_FULLFSYNC); +if (res 0 errno == ENOTTY) +res = fsync(fd); +# elif defined __NetBSD__ +res = fsync_range(fd, FFILESYNC | FDISKSYNC, 0, 0); +# endif +Py_END_ALLOW_THREADS + +if (res 0) +return posix_error(); +Py_INCREF(Py_None); +return Py_None; +} +# endif /* PROVIDE_FULLFSYNC */ #endif /* HAVE_FSYNC */ #ifdef HAVE_SYNC @@ -9473,6 +9513,9 @@ #endif #ifdef HAVE_FSYNC {fsync, posix_fsync, METH_O, posix_fsync__doc__}, +# ifdef PROVIDE_FULLFSYNC +{fullfsync, fullfsync, METH_O, fullfsync__doc__}, +# endif #endif #ifdef HAVE_SYNC {sync,posix_sync, METH_NOARGS, posix_sync__doc__}, -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11877 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11877] Change os.fsync() to support physical backing store syncs
Steffen Daode Nurpmeso sdao...@googlemail.com added the comment: (This was an attachment to an empty mail message.) -- Added file: http://bugs.python.org/file22046/11877-standalone.1.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11877 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12133] ResourceWarning in urllib.request
New submission from Ezio Melotti ezio.melo...@gmail.com: In case of error (e.g. timeout error), urllib.request leaves the socket open: import urllib.request as ur import socket s = socket.socket() s.bind(('localhost', 1)) s.listen(0) socket.setdefaulttimeout(5) ur.urlopen('http://localhost.localdomain:1') outputs: sys:1: ResourceWarning: unclosed socket.socket object, fd=4, family=2, type=1, proto=6 Traceback (most recent call last): File /home/wolf/dev/py/py3k/Lib/urllib/request.py, line 1146, in do_open r = h.getresponse() # an HTTPResponse instance File /home/wolf/dev/py/py3k/Lib/http/client.py, line 1046, in getresponse response.begin() File /home/wolf/dev/py/py3k/Lib/http/client.py, line 346, in begin version, status, reason = self._read_status() File /home/wolf/dev/py/py3k/Lib/http/client.py, line 308, in _read_status line = str(self.fp.readline(_MAXLINE + 1), iso-8859-1) File /home/wolf/dev/py/py3k/Lib/socket.py, line 279, in readinto return self._sock.recv_into(b) socket.timeout: timed out During handling of the above exception, another exception occurred: Traceback (most recent call last): File stdin, line 1, in module File /home/wolf/dev/py/py3k/Lib/urllib/request.py, line 138, in urlopen return opener.open(url, data, timeout) File /home/wolf/dev/py/py3k/Lib/urllib/request.py, line 369, in open response = self._open(req, data) File /home/wolf/dev/py/py3k/Lib/urllib/request.py, line 387, in _open '_open', req) File /home/wolf/dev/py/py3k/Lib/urllib/request.py, line 347, in _call_chain result = func(*args) File /home/wolf/dev/py/py3k/Lib/urllib/request.py, line 1163, in http_open return self.do_open(http.client.HTTPConnection, req) File /home/wolf/dev/py/py3k/Lib/urllib/request.py, line 1148, in do_open raise URLError(err) urllib.error.URLError: urlopen error timed out AFAIU, when urlopen returns or raises, the socket can be closed, so the attached patch adds a finally that calls close() on the HTTPConnection object. The test suite pass (except for a mock that was missing the close method), but I'm not 100% sure that it's always safe to call close(). This ResourceWarning has been exposed by test_packaging. -- components: Library (Lib) files: issue12133.diff keywords: needs review, patch messages: 136433 nosy: davide.rizzo, ezio.melotti, jhylton, pitrou priority: normal severity: normal stage: patch review status: open title: ResourceWarning in urllib.request type: resource usage versions: Python 3.3 Added file: http://bugs.python.org/file22047/issue12133.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12133 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12102] mmap requires file to be synced
Steffen Daode Nurpmeso sdao...@googlemail.com added the comment: Looked at it again and i think it's much better english with an additional ..to ensure that local... @Ross, aren't you a native english speaker? What do you say? -- Added file: http://bugs.python.org/file22048/12102.2.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12102 ___diff --git a/Doc/library/mmap.rst b/Doc/library/mmap.rst --- a/Doc/library/mmap.rst +++ b/Doc/library/mmap.rst @@ -21,6 +21,11 @@ :func:`os.open` function, which returns a file descriptor directly (the file still needs to be closed when done). +..note:: + If you want to create a memory-mapping for a writable, buffered file, you + should :func:`flush` the file first. This is necessary to ensure that local + modifications to the buffers are actually available to the mapping. + For both the Unix and Windows versions of the constructor, *access* may be specified as an optional keyword parameter. *access* accepts one of three values: :const:`ACCESS_READ`, :const:`ACCESS_WRITE`, or :const:`ACCESS_COPY` ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12133] ResourceWarning in urllib.request
Changes by Nadeem Vawda nadeem.va...@gmail.com: -- nosy: +nadeem.vawda ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12133 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11015] Bring test.support docs up to date
Ezio Melotti ezio.melo...@gmail.com added the comment: There are still functions that are not documented, so I think this should stay open until we documented them (unless they shouldn't be documented -- in that case it can be closed). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11015 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12133] ResourceWarning in urllib.request
Senthil Kumaran sent...@uthcode.com added the comment: Hi Ezio, the connection can be closed via the finally call as you do in the patch. There are times when request object is re-used, but before the connection is made. It may also help to understand how the code in the packaging was invoking it. If you run the whole suite and see the nothing breaks (to ensure that something is not waiting for the socket and trying to close later), go ahead with the patch. -- nosy: +orsenthil ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12133 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12133] ResourceWarning in urllib.request
Ezio Melotti ezio.melo...@gmail.com added the comment: The packaging test (test_pypi_simple.py:test_uses_mirrors) creates a server and a mirror, starts the mirror only, tries to connect to the server, and then falls back on the mirror when the server raises a timeout error. The code in the first message does more or less the same, causing a timeout error and the resource warning. I haven't checked in detail the urllib tests, but the fact that there are no ResourceWarnings while running test_urllib might mean that this case isn't currently tested. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12133 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4558] with_stdc89
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Yes, vs2008 requires that variables must be declared at the start of a block, and IIRC there is a AIX compiler that does not allow // comments. -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4558 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12134] json.dump much slower than dumps
New submission from poq p...@gmx.com: import json, timeit obj = [[1,2,3]*10]*10 class writable(object): def write(self, buf): pass w = writable() print('dumps: %.3f' % timeit.timeit(lambda: json.dumps(obj), number=1)) print('dump: %.3f' % timeit.timeit(lambda: json.dump(obj,w), number=1)) On my machine this outputs: dumps: 0.391 dump: 4.501 I believe this is mostly caused by dump using JSONEncoder.iterencode without _one_shot=True, resulting in c_make_encoder not being used. -- components: Extension Modules messages: 136439 nosy: poq priority: normal severity: normal status: open title: json.dump much slower than dumps type: performance versions: Python 2.7, Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12134 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12134] json.dump much slower than dumps
Changes by Ezio Melotti ezio.melo...@gmail.com: -- components: +Library (Lib) -Extension Modules nosy: +ezio.melotti versions: +Python 3.3 -Python 2.7, Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12134 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12134] json.dump much slower than dumps
Antoine Pitrou pit...@free.fr added the comment: This is indeed the case. And the solution is obvious: call dumps() and then write() the result yourself. If dump() used _one_shot=True, it would defeat the purpose of minimizing memory consumption by not buffering the whole result. -- assignee: - docs@python components: +Documentation nosy: +docs@python, pitrou, rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12134 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12135] test_packaging failure under Windows
New submission from Antoine Pitrou pit...@free.fr: Also, *please* provide stderr in the error message when an external command fails. Otherwise, it's impossible to properly debug failure of external commands. == ERROR: test_build_ext (packaging.tests.test_command_build_ext.BuildExtTestCase) -- Traceback (most recent call last): File D:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\packaging\compiler\msvc9compiler.py, line 622, in link self.spawn([self.linker] + ld_args) File D:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\packaging\compiler\ccompiler.py, line 847, in spawn spawn(cmd, dry_run=self.dry_run) File D:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\packaging\util.py, line 783, in spawn raise PackagingExecError(msg % (cmd, exit_status)) packaging.errors.PackagingExecError: command '['C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\BIN\\link.exe', '/DLL', '/nologo', '/INCREMENTAL:no', '/DEBUG', '/pdb:None', '/LIBPATH:D:\\cygwin\\home\\db3l\\buildarea\\3.x.bolen-windows\\build\\libs', '/LIBPATH:D:\\cygwin\\home\\db3l\\buildarea\\3.x.bolen-windows\\build\\PCbuild', '/EXPORT:initxx', 'c:\\docume~1\\db3l\\locals~1\\temp\\tmp3sylqy\\tmp4kk72e\\Debug\\docume~1\\db3l\\locals~1\\temp\\tmp3sylqy\\tmp4kk72e\\xxmodule.obj', '/OUT:c:\\docume~1\\db3l\\locals~1\\temp\\tmp3sylqy\\tmp4kk72e\\xx_d.pyd', '/IMPLIB:c:\\docume~1\\db3l\\locals~1\\temp\\tmp3sylqy\\tmp4kk72e\\Debug\\docume~1\\db3l\\locals~1\\temp\\tmp3sylqy\\tmp4kk72e\\xx_d.lib', '/MANIFESTFILE:c:\\docume~1\\db3l\\locals~1\\temp\\tmp3sylqy\\tmp4kk72e\\Debug\\docume~1\\db3l\\locals~1\\temp\\tmp3sylqy\\tmp4kk72e\\xx_d.pyd.manifest']' failed with exit status 1120 -- assignee: tarek components: Distutils2, Windows messages: 136441 nosy: alexis, eric.araujo, pitrou, tarek priority: critical severity: normal stage: needs patch status: open title: test_packaging failure under Windows type: behavior versions: Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12135 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12135] test_packaging failure under Windows
Antoine Pitrou pit...@free.fr added the comment: Many other failures in http://www.python.org/dev/buildbot/all/builders/x86%20XP-4%203.x/builds/4630/steps/test/logs/stdio , by the way -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12135 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8898] The email package should defer to the codecs module for all aliases
Michele Orrù maker...@gmail.com added the comment: The attached patch adds aliases for latin_N in encodings.aliases, and fixes email.charset behaviour according to codecs.lookup, as requested. Tested on (Arch) Linux. Am I supposed to add any unittest? I'm wavering about where they should be placed (in encodings or email?). -- keywords: +patch nosy: +ezio.melotti, maker Added file: http://bugs.python.org/file22049/issue8898.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8898 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12012] _ssl module doesn't compile with OpenSSL 1.0.0d: SSLv2_method is missing
Antoine Pitrou pit...@free.fr added the comment: Victor, you broke the Solaris gcc buildbot on 2.7. http://www.python.org/dev/buildbot/all/builders/sparc%20solaris10%20gcc%202.7/builds/837 -- assignee: - haypo stage: patch review - committed/rejected status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12012 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12107] TCP listening sockets created without FD_CLOEXEC flag
Christophe Devriese christophe.devri...@gmail.com added the comment: It would already be a nice piece of progress if you could request the SO_CLOEXEC (with fallback to FD_CLOEXEC), say, in the constructor, or even with a module variable. I hope at least this change can make it in, so that we have a decent in-python solution that can be used from within, say, django. Christophe On Sat, May 21, 2011 at 1:24 AM, Antoine Pitrou rep...@bugs.python.orgwrote: Changes by Antoine Pitrou pit...@free.fr: Removed file: http://bugs.python.org/file22038/unnamed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12107 ___ -- Added file: http://bugs.python.org/file22050/unnamed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12107 ___It would already be a nice piece of progress if you could request the SO_CLOEXEC (with fallback to FD_CLOEXEC), say, in the constructor, or even with a module variable. I hope at least this change can make it in, so that we have a decent in-python solution that can be used from within, say, django.div br/divdivChristophe/divdivbrdiv class=gmail_quoteOn Sat, May 21, 2011 at 1:24 AM, Antoine Pitrou span dir=ltrlt;a href=mailto:rep...@bugs.python.org;rep...@bugs.python.org/agt;/span wrote:br blockquote class=gmail_quote style=margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;div class=imbr Changes by Antoine Pitrou lt;a href=mailto:pit...@free.fr;pit...@free.fr/agt;:br br br /divRemoved file: a href=http://bugs.python.org/file22038/unnamed; target=_blankhttp://bugs.python.org/file22038/unnamed/abr divdiv/divdiv class=h5br ___br Python tracker lt;a href=mailto:rep...@bugs.python.org;rep...@bugs.python.org/agt;br lt;a href=http://bugs.python.org/issue12107; target=_blankhttp://bugs.python.org/issue12107/agt;br ___br /div/div/blockquote/divbr/div ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12107] TCP listening sockets created without FD_CLOEXEC flag
Antoine Pitrou pit...@free.fr added the comment: The request is reasonable, but the best bet is for someone interested to provide a patch. See http://docs.python.org/devguide/ if you aren't acquainted with the development process. -- components: +Library (Lib) nosy: +pitrou stage: - needs patch type: security - feature request versions: +Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12107 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12107] TCP listening sockets created without FD_CLOEXEC flag
Changes by Antoine Pitrou pit...@free.fr: Removed file: http://bugs.python.org/file22050/unnamed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12107 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12107] TCP listening sockets created without FD_CLOEXEC flag
Charles-François Natali neolo...@free.fr added the comment: $ cat test_sock.py import socket import fcntl with socket.socket(socket.AF_INET, socket.SOCK_STREAM|socket.SOCK_CLOEXEC) as s: print(bool(fcntl.fcntl(s, fcntl.F_GETFD) fcntl.FD_CLOEXEC)) $ ./python test_sock.py True -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12107 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12126] incorrect select documentation
Eli Bendersky eli...@gmail.com added the comment: It makes sense to bring this up for discussion on pydev, then. Perhaps it will be decided to remove this document from the official documentation, possibly relegating it to the Wiki. In the meantime, is there an objection to removing the incorrect statement Jean-Paul mentioned from the doc? It's obviously incorrect both in theory and practice. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12126 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12126] incorrect select documentation
Antoine Pitrou pit...@free.fr added the comment: It makes sense to bring this up for discussion on pydev, then. Ok, done. In the meantime, is there an objection to removing the incorrect statement Jean-Paul mentioned from the doc? Well, no. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12126 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12090] 3.2: build --without-threads fails
Georg Brandl ge...@python.org added the comment: No, it's not too late -- rc2 is shifted to next weekend. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12090 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1441530] socket read() can cause MemoryError in Windows
Antoine Pitrou pit...@free.fr added the comment: Patch looks ok. Is 3.x also affected? The I/O stack changed quite a bit in 3.x. -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1441530 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12102] mmap requires file to be synced
Ross Lagerwall rosslagerw...@gmail.com added the comment: Looked at it again and i think it's much better english with an additional ..to ensure that local... @Ross, aren't you a native english speaker? What do you say? Yes I am, but that doesn't make me any good ;-) I'd probably agree that it's better with that included. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12102 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12136] test_logging fails when no ssl available
New submission from Antoine Pitrou pit...@free.fr: == ERROR: test_output (test.test_logging.HTTPHandlerTest) -- Traceback (most recent call last): File /home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_logging.py, line 1529, in test_output import ssl File /home2/buildbot/slave/3.x.loewis-sun/build/Lib/importlib/_bootstrap.py, line 437, in load_module return self._load_module(fullname) File /home2/buildbot/slave/3.x.loewis-sun/build/Lib/importlib/_bootstrap.py, line 141, in decorated return fxn(self, module, *args, **kwargs) File /home2/buildbot/slave/3.x.loewis-sun/build/Lib/importlib/_bootstrap.py, line 342, in _load_module exec(code_object, module.__dict__) File /home2/buildbot/slave/3.x.loewis-sun/build/Lib/ssl.py, line 60, in module import _ssl # if we can't import it, let the error propagate ImportError: No module named '_ssl' -- assignee: vinay.sajip components: Library (Lib), Tests messages: 136453 nosy: pitrou, vinay.sajip priority: normal severity: normal stage: needs patch status: open title: test_logging fails when no ssl available type: behavior versions: Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12136 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12136] test_logging fails when no ssl available
Roundup Robot devnull@devnull added the comment: New changeset 2be3ffa82293 by Vinay Sajip in branch 'default': Issue #12136: Added change to handle non-availability of the ssl module. http://hg.python.org/cpython/rev/2be3ffa82293 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12136 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2091] file accepts 'rU+' as a mode
Changes by Tres Seaver tsea...@agendaless.com: -- nosy: -tseaver ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2091 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12137] EBADF in test_urllibnet
New submission from Antoine Pitrou pit...@free.fr: This is probably a transient failure due to the remote host being unavailable, but the bad file descriptor error is not ok: test test_urllibnet failed -- Traceback (most recent call last): File /Users/pythonbuildbot/buildarea/3.x.hansen-osx-x86/build/Lib/test/test_urllibnet.py, line 70, in test_readlines self.assertIsInstance(open_url.readlines(), list, File /Users/pythonbuildbot/buildarea/3.x.hansen-osx-x86/build/Lib/http/client.py, line 509, in read s = self.fp.read(amt) File /Users/pythonbuildbot/buildarea/3.x.hansen-osx-x86/build/Lib/socket.py, line 279, in readinto return self._sock.recv_into(b) socket.error: [Errno 9] Bad file descriptor -- components: Library (Lib) messages: 136455 nosy: orsenthil, pitrou priority: normal severity: normal status: open title: EBADF in test_urllibnet versions: Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12137 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12138] buggy use of transient_internet() in test_urllibnet
New submission from Antoine Pitrou pit...@free.fr: The code I added in b65f417dd266 is buggy, because it calls __exit__ with (None, None, None) rather than the exception to be tested. -- assignee: pitrou components: Tests messages: 136456 nosy: pitrou priority: normal severity: normal stage: needs patch status: open title: buggy use of transient_internet() in test_urllibnet type: behavior versions: Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12138 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1441530] socket read() can cause MemoryError in Windows
Charles-François Natali neolo...@free.fr added the comment: Patch looks ok. Is 3.x also affected? The I/O stack changed quite a bit in 3.x. I think it's not affected, but I can't reproduce this behaviour with glibc/eglibc, so don't just take my word for it. The reason is that in py3k, imaplib uses a buffered reader to read from the socket (obtained through sock.makefile()), and IIUC, reading from a buffered reader n bytes will always return n bytes (unless EOF is encountered or the underlying object is set to non-blocking), contrarily to reading directly from a socket. So the resizing is done from the buffered io module, which only grows the result buffer, freeing the buffers returned by socket's recv() one at a time. Note that if I'm right, another way to solve this would be to wrap the SSL socket with a call to makefile, like what's already done for the non-SSL case (and in py3k). This would also lead to cleaner and simpler code, because we wouldn't need to handle partial reads ourself. That's what the patch attached does. Note that if I'm correct, then the current py3k imaplib read() method could also be simplified: def read(self, size): Read 'size' bytes from remote. chunks = [] read = 0 while read size: data = self.file.read(min(size-read, 4096)) if not data: break read += len(data) chunks.append(data) return b''.join(chunks) It would also be a bit faster. But since I can't reproduce this issue, I'd rather make sure it's correct before making a such change. -- Added file: http://bugs.python.org/file22051/imaplib_ssl_makefile.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1441530 ___diff -r b3f410dbab25 Lib/imaplib.py --- a/Lib/imaplib.pyFri May 20 11:49:06 2011 -0500 +++ b/Lib/imaplib.pySat May 21 18:24:01 2011 +0200 @@ -1158,28 +1158,17 @@ self.port = port self.sock = socket.create_connection((host, port)) self.sslobj = ssl.wrap_socket(self.sock, self.keyfile, self.certfile) +self.file = self.sslobj.makefile('rb') def read(self, size): Read 'size' bytes from remote. -# sslobj.read() sometimes returns size bytes -chunks = [] -read = 0 -while read size: -data = self.sslobj.read(min(size-read, 16384)) -read += len(data) -chunks.append(data) - -return ''.join(chunks) +return self.file.read(n) def readline(self): Read line from remote. -line = [] -while 1: -char = self.sslobj.read(1) -line.append(char) -if char in (\n, ): return ''.join(line) +return self.file.readline() def send(self, data): ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1441530] socket read() can cause MemoryError in Windows
Charles-François Natali neolo...@free.fr added the comment: In the buffered reader case, the result buffer is actually pre-allocated with the total size, making fragmentation even less likely. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1441530 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12139] Add CCC command support to ftplib
New submission from Giampaolo Rodola' g.rod...@gmail.com: In FTPS, CCC command can be used to switch back to a clear-text control connection. This can be useful to take advantage of firewalls that know how to handle NAT with non-secure FTP without opening fixed ports. Patch in attachment includes lib, test and doc changes. -- assignee: giampaolo.rodola files: ftplib-ccc.patch keywords: patch messages: 136459 nosy: giampaolo.rodola priority: normal severity: normal stage: patch review status: open title: Add CCC command support to ftplib type: feature request versions: Python 3.3 Added file: http://bugs.python.org/file22052/ftplib-ccc.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12139 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12135] test_packaging failure under Windows
Tarek Ziadé ziade.ta...@gmail.com added the comment: As I said on python-dev, I am aware of the failures. I have fixed most of them today and yesterday. I have four left including this one. So no need to add more issues, I am on it :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12135 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12135] test_packaging failure under Windows
Antoine Pitrou pit...@free.fr added the comment: Specifically, the spawn function *must* be fixed to include stderr in the exception message. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12135 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12135] The spawn function should return stderr.
Tarek Ziadé ziade.ta...@gmail.com added the comment: That's a feature request then, so we will see this once the bbot are green -- priority: critical - normal title: test_packaging failure under Windows - The spawn function should return stderr. type: behavior - feature request ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12135 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12139] Add CCC command support to ftplib
Antoine Pitrou pit...@free.fr added the comment: This can be useful to take advantage of firewalls that know how to handle NAT with non-secure FTP without opening fixed ports. Can you explain this a little more? +resp = self.voidcmd('CCC') +self.sock = self.sock.unwrap() +return resp Should the response be checked before calling unwrap()? -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12139 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12135] The spawn function should return stderr.
Antoine Pitrou pit...@free.fr added the comment: Same request for distutils in issue11599, by the way. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12135 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12139] Add CCC command support to ftplib
Giampaolo Rodola' g.rod...@gmail.com added the comment: voidcmd() expects a response code starting with 2 and automatically raises an exception otherwise. A server succesfully accepting the CCC command is supposed to first reply with 220 and then shutdown() the SSL layer. Client is supposed to do the same: first receive the 2xx response and then make the shutdown(). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12139 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11949] Make float('nan') unorderable
Mark Dickinson dicki...@gmail.com added the comment: Table 5.2 referenced above lists 10 operations, four of which (, , =, and =) are given spellings that are identical to the spellings of Python comparison operators. Yep, those are included amongst the various ad-hoc and traditional names and symbols. So what? It's still the case that IEEE 754 gives no requirement (or even recommendation) for how either of 'compareQuietLess' or 'compareSignalingLess' should be spelt in any particular language. IOW, it's fine to argue that *you* personally would like Python's '' to be bound to IEEE 754's 'compareSignalingLess' instead of the current effective binding to 'compareQuietLess', but it would be a bit disingenuous to claim that IEEE 754 recommends or requires that. It doesn't. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11949 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11986] Min/max not symmetric in presence of NaN
Mark Dickinson dicki...@gmail.com added the comment: Prof. Kahan states that nan x must signal. Would that be the sentence that starts In the syntax of C ... ? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11986 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11986] Min/max not symmetric in presence of NaN
Mark Dickinson dicki...@gmail.com added the comment: keep naive implementation of builtin max() Agreed. provide symmetric float.max such that nan.max(x) = x.max(nan) = x (nan result would be a valid but less useful alternative.) That might be viable (a math module function might also make sense here), though it feels a bit YAGNI to me. If we were going to add such a method, it should follow IEEE 754: nan.max(x) == x.max(n) == x, but also nan.min(x) == x.min(nan) == x, for finite x. (See section 5.3.1.) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11986 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11949] Make float('nan') unorderable
Alexander Belopolsky belopol...@users.sourceforge.net added the comment: On Sat, May 21, 2011 at 3:18 PM, Mark Dickinson rep...@bugs.python.org wrote: Mark Dickinson dicki...@gmail.com added the comment: Table 5.2 referenced above lists 10 operations, four of which (, , =, and =) are given spellings that are identical to the spellings of Python comparison operators. Yep, those are included amongst the various ad-hoc and traditional names and symbols. So what? It's still the case that IEEE 754 gives no requirement (or even recommendation) for how either of 'compareQuietLess' or 'compareSignalingLess' should be spelt in any particular language. IEEE 754 is not a standard that is directly applicable to the design of programming languages. For example, it is completely silent on the issue of which operations should be implemented as infix operators and which as functions. Still, to the extent it is appropriate for IEEE 754 to say so, I think it says that '' is 'compareSignalingLess'. IEEE 754 can only be a guide for language design and not a specification. However, the decimal module, which was explicitly designed for IEEE 754 compliance, makes order comparison operators signaling. What is the reason to make them quiet for floats other than backward compatibility? Note that backward compatibility is likely not to be an issue if we make nan comparisons generate a warning (possibly even off by default) rather than error. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11949 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11986] Min/max not symmetric in presence of NaN
Alexander Belopolsky belopol...@users.sourceforge.net added the comment: On Sat, May 21, 2011 at 3:22 PM, Mark Dickinson rep...@bugs.python.org wrote: Mark Dickinson dicki...@gmail.com added the comment: Prof. Kahan states that nan x must signal. Would that be the sentence that starts In the syntax of C ... ? This is just sophistry. If Python was more popular than C at the time Prof. Kahan wrote this, he would write in the syntax of Python. (Not directly on-topic, but Python 3 seems to be moving towards C spelling of operators. I, for one, miss the removal of easy to type '' in favor of finger-twisting '!='.) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11986 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11949] Make float('nan') unorderable
Mark Dickinson dicki...@gmail.com added the comment: What is the reason to make them quiet for floats other than backward compatibility? For me, none. I'll happily agree that, all other things being equal, it's more natural (and more consistent with other languages) to have correspond to the signaling operation, and in a new language that's probably what I'd go for. But as a *change* to existing behaviour in a language that's been widely adopted for numerical work, the risk of breakage seems to me to outweigh any benefits. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11949 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8898] The email package should defer to the codecs module for all aliases
Changes by Michele Orrù maker...@gmail.com: -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8898 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11949] Make float('nan') unorderable
Mark Dickinson dicki...@gmail.com added the comment: On the idea of a warning, I don't really see the point; I find it hard to imagine it's really going to catch many real errors. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11949 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11986] Min/max not symmetric in presence of NaN
Mark Dickinson dicki...@gmail.com added the comment: This is just sophistry. If Python was more popular than C at the time Prof. Kahan wrote this, he would write in the syntax of Python. I doubt it. C has a standard that explicitly states that must signal on comparison with NaNs. Python doesn't. Alexander, I've read both these documents (Kahan's lecture notes and IEEE 754-2008) many many times. I've looked hard in the past for language that would give this exact connection, about signalling. It just isn't there in either document, and it's dishonest to claim it is. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11986 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11949] Make float('nan') unorderable
Alexander Belopolsky belopol...@users.sourceforge.net added the comment: On Sat, May 21, 2011 at 3:50 PM, Mark Dickinson rep...@bugs.python.org wrote: .. On the idea of a warning, I don't really see the point; I find it hard to imagine it's really going to catch many real errors. My experience is different. In my work, NaNs often creep into calculations that are not designed to deal with them. (More often from data files than from invalid operations.) Sorting a large list with a handful of NaNs, often leads to rather mysterious errors if not to silently wrong results. I believe there was even an issue on the tracker about this particular case. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11949 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11949] Make float('nan') unorderable
Mark Dickinson dicki...@gmail.com added the comment: Hmm, okay. Call me +0 on the warning. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11949 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11986] Min/max not symmetric in presence of NaN
Mark Dickinson dicki...@gmail.com added the comment: and it's dishonest to claim it is. This language was going too far, and I apologise for it. I think I need one of those 'wait 5 minutes before allowing you to post' controls. -- keywords: +gsoc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11986 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12127] Inconsistent leading zero treatment
Mark Dickinson dicki...@gmail.com added the comment: It does look as though all the arguments were pretty thoroughly hashed out on the python-3000 list when this was first proposed. See e.g., the thread starting at: http://mail.python.org/pipermail/python-3000/2007-March/006262.html and various follow-on threads. I retract my suggestion that this should be discussed again on python-dev; it probably wouldn't achieve anything. On the subject of other languages, I was rather hoping that more recent and enlightened languages would have done away with the leading zero implies octal business. It looks as though C# has, at least, but I was a bit disappointed to see that Go still has leading-zero octal literals. For the old-school languages, I'd still expect that for most users this feature is more often a surprising gotcha than expected and useful. http://stackoverflow.com/questions/565634/integer-with-leading-zeroes Anyway, +0 for closing as 'rejected'. (Or perhaps 'wont fix'.) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12127 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11986] Min/max not symmetric in presence of NaN
Alexander Belopolsky belopol...@users.sourceforge.net added the comment: On Sat, May 21, 2011 at 3:32 PM, Mark Dickinson rep...@bugs.python.org wrote: .. That might be viable (a math module function might also make sense here), though it feels a bit YAGNI to me. I have to admit that it would be YAGNI for most of my code because it uses numpy for numeric calculations. Still, for consistency with decimal, it may be a good addition. Going a bit off-topic, I would like to mention the feature that may actually be quite useful: float.sorting_key() that will return an integer for each float in such a way that keys are ordered in IEEE 754 total ordering. Note that decimal has compare_total() that can be used for sorting, but a cmp-style method is less useful than a key since in py3k sort does not take cmp function anymore. Nice thing about IEEE 754 is that float.sorting_key() can be implemented very efficiently because one can simply use float's binary representation interpreted as an integer for the key. If we were going to add such a method, it should follow IEEE 754: nan.max(x) == x.max(n) == x, but also nan.min(x) == x.min(nan) == x, for finite x. (See section 5.3.1.) Agree. Unfortunately, numpy does not do it that way: nan maximum(1.0, nan) nan I am not sure whether this is an argument for or against float.max/min: if numpy had properly defined maximum, I would just recommend to use that. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11986 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12075] python3.2 memory leak when reloading class with attributes
Terry J. Reedy tjre...@udel.edu added the comment: my class also inherits from subprocess.Popen, which has a __del__ method, which might interfere w/ collection The doc says __del__ *will* prevent collection. (although gc.garbage says otherwise ;). Do you mean that gc.garbage is empty, when it should not be? Have you tried replacing __del__ with an explicit close or cleanup method? -- nosy: +terry.reedy title: python3.2 memory leak when setting integer key in dictionary - python3.2 memory leak when reloading class with attributes ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12075 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12131] python built with --prefix fails in site.py with no section 'posix_prefix'
Tarek Ziadé ziade.ta...@gmail.com added the comment: This seems to be the proper fix, I forgot to change the Makefile. Would you mind applying it ? thanks about editing this file: as mentioned on python dev, there will be several levels of customization (global, per project, per user) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12131 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8898] The email package should defer to the codecs module for all aliases
Changes by Michele Orrù maker...@gmail.com: Removed file: http://bugs.python.org/file22049/issue8898.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8898 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8898] The email package should defer to the codecs module for all aliases
Changes by Michele Orrù maker...@gmail.com: Added file: http://bugs.python.org/file22053/issue8898.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8898 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12140] Crash upon start up
New submission from Philip Drew pwtd...@gmail.com: Upon execution of python.exe a command line box appears for a fraction of a second, closes and is followed by nothing. On executing IDLE from the start menu, nothing happens. I have installed python to C:\Python27 using the python windows installer. I am running win7 64 bit on a toshiba satellite 17X -- components: IDLE, Installation messages: 136481 nosy: Philip.Drew priority: normal severity: normal status: open title: Crash upon start up type: crash versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12140 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12140] Crash upon start up
Ezio Melotti ezio.melo...@gmail.com added the comment: Can you try to open a Windows terminal (start-run-cmd or win+r on the keyboard), cd to Python27, execute python.exe and see if it gives any error message there? -- nosy: +ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12140 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12141] --multiprocessing fails with packaging.tests.test_command_build_ext
New submission from Tarek Ziadé ziade.ta...@gmail.com: this test module looks for sysconfig.get_config_var('srcdir') which in turns uses the sys,executable path. multiprocess seems to change it in every process, leading to the errors. To reproduce: ./python Lib/test/regrtest.py -j2 -v test_packaging A workaround is to skip the test in case the file is not found, but we need to fix it because it boils down to sysconfig being broken in multiprocess -- assignee: pitrou messages: 136483 nosy: pitrou, tarek priority: normal severity: normal status: open title: --multiprocessing fails with packaging.tests.test_command_build_ext ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12141 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12141] --multiprocessing fails with packaging.tests.test_command_build_ext
Antoine Pitrou pit...@free.fr added the comment: What's the difference with issue12132? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12141 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12132] test_packaging failures when run with -j
Changes by Tarek Ziadé ziade.ta...@gmail.com: -- superseder: - test_packaging failures when run with -j ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12132 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12132] test_packaging failures when run with -j
Changes by Tarek Ziadé ziade.ta...@gmail.com: -- superseder: test_packaging failures when run with -j - --multiprocessing fails with packaging.tests.test_command_build_ext ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12132 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12142] Circular reference when importing ctypes
New submission from poq p...@gmx.com: When importing ctypes after gc.set_debug(gc.DEBUG_LEAK), the garbage collector finds a 'c_int_Array_3' class and some related objects. The class is created in ctypes/_endian.py: _array_type = type(c_int * 3) It seems that this could be avoided with: _array_type = type(Array) Of course, I realize this is not a bug because normally it will just get collected. It is just an extremely minor annoyance because this is currently the only thing still found by DEBUG_LEAK for my program ;) -- components: ctypes messages: 136485 nosy: poq priority: normal severity: normal status: open title: Circular reference when importing ctypes type: resource usage versions: Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12142 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12141] --multiprocessing fails with packaging.tests.test_command_build_ext
Tarek Ziadé ziade.ta...@gmail.com added the comment: Oops. It's a duplicate. Keeping this one since the problem was narrowed to multiprocessing/sys,executable and sysconfig -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12141 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12142] eference cycle when importing ctypes
Changes by poq p...@gmx.com: -- title: Circular reference when importing ctypes - eference cycle when importing ctypes ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12142 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12142] Reference cycle when importing ctypes
Changes by poq p...@gmx.com: -- title: eference cycle when importing ctypes - Reference cycle when importing ctypes ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12142 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12132] test_packaging failures when run with -j
Changes by Tarek Ziadé ziade.ta...@gmail.com: -- resolution: - duplicate status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12132 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12141] --multiprocessing fails with packaging.tests.test_command_build_ext
Changes by Nadeem Vawda nadeem.va...@gmail.com: -- nosy: +nadeem.vawda ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12141 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12141] --multiprocessing fails with packaging.tests.test_command_build_ext
Antoine Pitrou pit...@free.fr added the comment: Oops. It's a duplicate. Keeping this one since the problem was narrowed to multiprocessing/sys,executable and sysconfig I don't think it has anything to do with sys.executable. As the other issue says, it seems the test (or packaging/sysconfig itself) is simply unable to locate the root of the current checkout (which should be trivial using __file__). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12141 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8898] The email package should defer to the codecs module for all aliases
Ezio Melotti ezio.melo...@gmail.com added the comment: The patch looks ok to me. AFAIU the lookup will take care to normalize the name and return latin_N. This also implies that other names (like 'latin-N', 'LaTiN~~N' and so on) will be normalized to latin_N and then accepted. Regarding the tests, I don't see tests for the aliases anywhere, so something like: for alias, codec_name in encodings.aliases.items(): self.assertEqual(codecs.lookup(alias).name, codec_name) could be added somewhere to check that all the aliases in the dict map to the correct codec. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8898 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12141] --multiprocessing fails with packaging.tests.test_command_build_ext
Tarek Ziadé ziade.ta...@gmail.com added the comment: sysconfig is looking for the source dir when sysconfig.get_config_var('srcdir') is called. And this is done like this: if sys.executable: _PROJECT_BASE = os.path.dirname(_safe_realpath(sys.executable)) else: # sys.executable can be empty if argv[0] has been changed and Python is # unable to retrieve the real program name _PROJECT_BASE = _safe_realpath(os.getcwd()) Because sys.executable (argv[0] in fact) is not filled when you call multiprocess vvia the -j option. So yeah, this has to do with sys.executable -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12141 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12131] python built with --prefix fails in site.py with no section 'posix_prefix'
Roundup Robot devnull@devnull added the comment: New changeset f37a4e1182d6 by Ned Deily in branch 'default': Issue #12131: Ensure that the sysconfig.cfg file, introduced by packaging, http://hg.python.org/cpython/rev/f37a4e1182d6 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12131 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12131] python built with --prefix fails in site.py with no section 'posix_prefix'
Ned Deily n...@acm.org added the comment: Applied as requested. -- assignee: tarek - ned.deily resolution: - fixed stage: needs patch - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12131 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12143] packaging extension gcc linking fails on Ubuntu Shared
New submission from Tarek Ziadé ziade.ta...@gmail.com: I can't reproduce this yet, or compare it to distutils. I == ERROR: test_build_ext (packaging.tests.test_command_build_ext.BuildExtTestCase) -- Traceback (most recent call last): File /srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/packaging/compiler/unixccompiler.py, line 255, in link self.spawn(linker + ld_args) File /srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/packaging/compiler/ccompiler.py, line 847, in spawn spawn(cmd, dry_run=self.dry_run) File /srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/packaging/util.py, line 783, in spawn raise PackagingExecError(msg % (cmd, exit_status)) packaging.errors.PackagingExecError: command '['gcc', '-pthread', '-shared', '/tmp/tmpwe7ci9/tmp3v8m7p/tmp/tmpwe7ci9/tmp3v8m7p/xxmodule.o', '-L.', '-lpython3.3', '-o', '/tmp/tmpwe7ci9/tmp3v8m7p/xx.cpython-33dm.so']' failed with exit status 1 During handling of the above exception, another exception occurred: Traceback (most recent call last): File /srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/packaging/tests/test_command_build_ext.py, line 59, in test_build_ext cmd.run() File /srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/packaging/command/build_ext.py, line 345, in run self.build_extensions() File /srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/packaging/command/build_ext.py, line 368, in build_extensions self.build_extension(ext) File /srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/packaging/command/build_ext.py, line 454, in build_extension target_lang=language) File /srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/packaging/compiler/ccompiler.py, line 675, in link_shared_object extra_preargs, extra_postargs, build_temp, target_lang) File /srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/packaging/compiler/unixccompiler.py, line 257, in link raise LinkError(msg) packaging.errors.LinkError: command '['gcc', '-pthread', '-shared', '/tmp/tmpwe7ci9/tmp3v8m7p/tmp/tmpwe7ci9/tmp3v8m7p/xxmodule.o', '-L.', '-lpython3.3', '-o', '/tmp/tmpwe7ci9/tmp3v8m7p/xx.cpython-33dm.so']' failed with exit status 1 == ERROR: test_get_outputs (packaging.tests.test_command_build_ext.BuildExtTestCase) -- Traceback (most recent call last): File /srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/packaging/compiler/unixccompiler.py, line 255, in link self.spawn(linker + ld_args) File /srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/packaging/compiler/ccompiler.py, line 847, in spawn spawn(cmd, dry_run=self.dry_run) File /srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/packaging/util.py, line 783, in spawn raise PackagingExecError(msg % (cmd, exit_status)) packaging.errors.PackagingExecError: command '['gcc', '-pthread', '-shared', '/tmp/tmpdfxahd/tmp0m_s9d/tempt/tmp/tmpdfxahd/tmp_cb75f/foo.o', '-L.', '-lpython3.3', '-o', '/tmp/tmpdfxahd/tmpcoi8oo/foo.cpython-33dm.so']' failed with exit status 1 During handling of the above exception, another exception occurred: Traceback (most recent call last): File /srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/packaging/tests/test_command_build_ext.py, line 263, in test_get_outputs cmd.run() File /srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/packaging/command/build_ext.py, line 345, in run self.build_extensions() File /srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/packaging/command/build_ext.py, line 368, in build_extensions self.build_extension(ext) File /srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/packaging/command/build_ext.py, line 454, in build_extension target_lang=language) File /srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/packaging/compiler/ccompiler.py, line 675, in link_shared_object extra_preargs, extra_postargs, build_temp, target_lang) File /srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/packaging/compiler/unixccompiler.py, line 257, in link raise LinkError(msg) packaging.errors.LinkError: command '['gcc', '-pthread', '-shared', '/tmp/tmpdfxahd/tmp0m_s9d/tempt/tmp/tmpdfxahd/tmp_cb75f/foo.o', '-L.', '-lpython3.3', '-o', '/tmp/tmpdfxahd/tmpcoi8oo/foo.cpython-33dm.so']' failed with exit status 1 -- assignee: tarek components: Distutils2 messages: 136492 nosy: alexis, eric.araujo, tarek priority: normal severity: normal status: open title: packaging extension gcc linking fails on Ubuntu Shared ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12143 ___ ___ Python-bugs-list mailing list Unsubscribe:
[issue12141] --multiprocessing fails with packaging.tests.test_command_build_ext
Antoine Pitrou pit...@free.fr added the comment: Because sys.executable (argv[0] in fact) is not filled when you call multiprocess vvia the -j option. sys.executable is set perfectly well when running regrtest in multiprocess mode, otherwise many other tests would fail. Try: $ grep sys.executable Lib/test/* Lib/test/regrtest.py:585:base_cmd = [sys.executable] + opt_args + ['-m', 'test.regrtest'] Lib/test/script_helper.py:20:cmd_line = [sys.executable] Lib/test/script_helper.py:60:cmd_line = [sys.executable, '-E'] Lib/test/test_base64.py:231:args = (sys.executable, '-m', 'base64') + args Lib/test/test_capi.py:42:p = subprocess.Popen([sys.executable, -c, [etc.] Again, it seems sysconfig simply has a bug which you can reproduce on the command line: $ pwd /home/antoine/cpython/default/build $ ../python -c import sys, sysconfig; print(sys.executable, sysconfig.get_config_var('srcdir')) /home/antoine/cpython/default/build/../python /home/antoine/cpython/default/build -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12141 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12141] --multiprocessing fails with packaging.tests.test_command_build_ext
Ned Deily n...@acm.org added the comment: The test should be changed anyway to avoid the dependency on srcdir, whose value has no meaning when the tests are not run from a simple in-source-directory build. The test could create its own temp copy of xxmodule.c. -- nosy: +ned.deily ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12141 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12143] packaging extension gcc linking fails on Ubuntu Shared
David Bolen db3l@gmail.com added the comment: I just ran a manual build/test on the buildbot, and these underlying failures appear to be due to the -l python3.3 option, which can't be found. I also don't see that library in the build tree. Instead, the library is built as python3.3dm (the buildbot process uses --with-pydebug and --with-pymalloc is now default in 3.2+). Haven't dug much deeper than that, so not sure how the packaging tests are figuring out the shared library to link with. I did verify that the sysconfig module variables that are related do all have the dm suffix information so it should be available to the tests. -- David -- nosy: +db3l ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12143 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6560] socket sendmsg(), recvmsg() methods
Brian May br...@microcomaustralia.com.au added the comment: What needs to happen to get recvmsg() supported in Python? recvmsg() is required to get get transparent UDP proxies working under Linux using tproxy, the code needs to run recvmsg() to be able to find out what the original destination address was for the the packet. Thanks Brian May -- nosy: +brian ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6560 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11949] Make float('nan') unorderable
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- assignee: - rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11949 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12144] cookielib.CookieJar.make_cookies fails for cookies with 'expires' set
New submission from Scott Wimer scott.wi...@gmail.com: When cookielib.CookieJar().make_cookies is used to extract cookies from a urllib2 response, it crashes when it encounters a 'Set-Cookie' header entry that has an 'expires' attribute. This crash occurs because the expires time is evaluated against the '_now' attribute of the CookieJar instance -- an attribute which is not set unless CookieJar().extract_cookies() was called previously. Attached is a script that triggers this bug. -- components: Library (Lib) files: cookielib-crash.py messages: 136497 nosy: Scott.Wimer priority: normal severity: normal status: open title: cookielib.CookieJar.make_cookies fails for cookies with 'expires' set type: crash versions: Python 2.6 Added file: http://bugs.python.org/file22054/cookielib-crash.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12144 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12144] cookielib.CookieJar.make_cookies fails for cookies with 'expires' set
Scott Wimer scott.wi...@gmail.com added the comment: The actual error is triggered by line 1507 in '_cookie_from_cookie_tuple()'. An easy fix is to move the setting of '_now' on line 1636 into the 'make_cookies()' method. That addresses this problem and doesn't look like it would introduce any negative side effects. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12144 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12144] cookielib.CookieJar.make_cookies fails for cookies with 'expires' set
Scott Wimer scott.wi...@gmail.com added the comment: Forgot to include the patch. Oops. -- keywords: +patch Added file: http://bugs.python.org/file22055/cookielib-crash.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12144 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12145] distutils2 should support README.rst
New submission from Daniel Lindsley dan...@toastdriven.com: Given that reST is the format all of Python's docs are in, it'd be nice if distutils(2) would support looking for README.rst (in addition to the existing README README.txt). -- assignee: tarek components: Distutils2 messages: 136500 nosy: alexis, daniellindsley, eric.araujo, tarek priority: normal severity: normal status: open title: distutils2 should support README.rst type: feature request ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12145 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12146] Possible bug in 're' documentation example
New submission from Eli Bendersky eli...@gmail.com: From the docs maillist, by Herman L. Jackson: --- Hi, When running the tokenize example at the bottom of http://docs.python.org/py3k/library/re.html#match-objects I received the following error: Traceback (most recent call last): File stdin, line 1, in module File stdin, line 23, in tokenize NameError: global name 'val' is not defined The problem is that val is never assigned to before this line: if typ == 'ID' and val in keywords: Here is a suggested rewrite of the that section: elif typ != 'SKIP': val = mo.group(typ) if typ == 'ID' and val in keywords: typ = val yield Token(typ, val, line, mo.start()-line_start) Attached is a complete working example. -- assignee: eli.bendersky components: Documentation files: tokenize.py keywords: easy messages: 136501 nosy: eli.bendersky priority: normal severity: normal stage: needs patch status: open title: Possible bug in 're' documentation example type: behavior versions: Python 3.1, Python 3.2, Python 3.3, Python 3.4 Added file: http://bugs.python.org/file22056/tokenize.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12146 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com