[issue13170] distutils2 test failures

2011-10-17 Thread David Barnett
David Barnett added the comment: The ConfigTestCase.test_parse_extensions_in_config failure is a manifestation of http://bugs.python.org/issue6988. -- ___ Python tracker <http://bugs.python.org/issue13

[issue13205] NameErrors in generated setup.py (codecs, split_multiline)

2011-10-18 Thread David Barnett
David Barnett added the comment: Sure, I can give it a go. I'll probably have a chance sometime today. -- ___ Python tracker <http://bugs.python.org/is

[issue13205] NameErrors in generated setup.py (codecs, split_multiline)

2011-10-18 Thread David Barnett
David Barnett added the comment: Regression tests. Not positive that subprocess is the best approach for running these, but it seems to work. In the process of writing tests, I discovered another missing import for PackagingFileError when there's no setup.cfg. -- Added file:

[issue13170] distutils2 test failures

2011-10-27 Thread David Barnett
David Barnett added the comment: The remaining test (test_command_install_data.InstallDataTestCase.test_simple_run) was broken in r1152. What's happening is that the type of exception being raised was changed and it's getting through the try/except block in install_data.run().

[issue13170] distutils2 test failures

2011-10-28 Thread David Barnett
David Barnett added the comment: >> The remaining test >> (test_command_install_data.InstallDataTestCase.test_simple_run) was >> broken in r1152. >This looks like a local revision number, which has no meaning outside of one >specific repository. What is the changeset

[issue11638] python setup.py sdist crashes if version is unicode

2011-10-29 Thread David Barnett
David Barnett added the comment: Here's a test for the bug. -- keywords: +patch Added file: http://bugs.python.org/file23548/test_unicode_sdist.patch ___ Python tracker <http://bugs.python.org/is

[issue11638] python setup.py sdist crashes if version is unicode

2011-10-29 Thread David Barnett
David Barnett added the comment: One way to fix the symptom (maybe not the correct way) would be to edit tarfile._Stream._init_write_gz and change the line that reads self.__write(self.name + NUL) to something like self.__write(self.name.encode('utf-8') + NUL) tarfile is buil

[issue12760] Add create mode to open()

2011-10-31 Thread David Townshend
David Townshend added the comment: I see this has been marked as a duplicate of http://bugs.python.org/issue12797. Please explain how this is, since that proposal does not appear to provide the functionality discussed here. -- ___ Python tracker

[issue13323] urllib2 does not correctly handle multiple www-authenticate headers in an HTTP response

2011-11-02 Thread David Fischer
New submission from David Fischer : I ran into an application that responded with two www-authenticate challenges to an HTTP request. First, it sends a standard Basic authentication challenge and then it also returns a www-authenticate header referencing another scheme. This looks legal to

[issue13323] urllib2 does not correctly handle multiple www-authenticate headers in an HTTP response

2011-11-02 Thread David Fischer
David Fischer added the comment: Perhaps I should have chosen my words more carefully. There are two www-authenticate headers the single HTTP response. -- ___ Python tracker <http://bugs.python.org/issue13

[issue13323] urllib2 does not correctly handle multiple www-authenticate headers in an HTTP response

2011-11-02 Thread David Fischer
David Fischer added the comment: I think the key words in the RFC are "strongest auth-scheme it understands". I think in an ideal world, the urllib2 opener (given its handlers) would see that it doesn't understand the second auth-scheme and then see if it understands the fir

[issue13323] urllib2 does not correctly handle multiple www-authenticate headers in an HTTP response

2011-11-06 Thread David Fischer
David Fischer added the comment: With this patch, the AbstractBasicAuthHandler (and its subclasses) performs a regex search on the amalgamated "www-authenticate" header for basic authentication. This fixes the case where you have an HTTP response of the form: HTTP/1.1 401 Aut

[issue12760] Add create mode to open()

2011-11-06 Thread David Townshend
David Townshend added the comment: It is already possible to write a wrapper function that does it: def create(file): fd = os.open(file, os.O_EXCL | os.O_CREAT | os.O_WRONLY) return os.fdopen(fd) The point it not that it can't be done, but that it is not straight forward. The

[issue13420] newer() function in dep_util.py discard changes in the same second

2011-11-17 Thread David Amian
New submission from David Amian : Hi, I had a problem making deb packages with distutils and cdbs. Looking for any solution, I found Issue 11933 and saw that the newer() method has been changed, using [ST_MTIME] instead of st_mtime. This commit is to solve Issue 10148 that describes a bug

[issue13420] newer() function in dep_util.py discard changes in the same second

2011-11-18 Thread David Amian
David Amian added the comment: sorry, I didn't explain well. I've a project, in the setup.py file, I've a function called update_prefix, that updates the 'path_project' variable with prefix arguments from setup.py If you runs setup.py with --prefix=/usr, then

[issue13420] newer() function in dep_util.py discard changes in the same second

2011-11-21 Thread David Amian
David Amian added the comment: 2011/11/18 Éric Araujo > > Éric Araujo added the comment: > > > I've a project, in the setup.py file, I've a function called > update_prefix, that updates the > > 'path_project' variable with prefix arguments from set

[issue13616] Never ending loop in in update_refs Modules/gcmodule.c

2011-12-16 Thread David Butler
New submission from David Butler : CPU will sit a 100% indefinitely, this is also pretty tough (takes several hours) to reproduce if you step through the program it is stuck between 290 and 292 Modules/gcmodule.c: /* Set all gc_refs = ob_refcnt. After this, gc_refs is > 0 for all obje

[issue13616] Never ending loop in in update_refs Modules/gcmodule.c

2011-12-19 Thread David Butler
David Butler added the comment: sorry for the delay, I had to wait until the problem occurred again... I gdb'ed into the process again, the backtrace is a little different this time... (gdb) bt #0 0xb76adfc6 in update_refs (containers=) at Modules/gcmodule.c:292 #1 collect (generat

[issue13616] Never ending loop in in update_refs Modules/gcmodule.c

2011-12-19 Thread David Butler
David Butler added the comment: 2011/12/19 Jesús Cea Avión I am willing to work toward a simplified test case, but its going to be difficult, I am hoping that I can narrow down the source of the problem... Forgive me, I'm gdb is actually a new thing to me... how could I check the object

[issue13616] Never ending loop in in update_refs Modules/gcmodule.c

2011-12-20 Thread David Butler
David Butler added the comment: I have 10 identical test machines running this this code ( operating systems are cloned ). I am not usning valgrind in these tests, it was causing various issues... (gdb) info sharedlibrary >FromTo Syms Read Shared Object Library 0xb75a0

[issue13616] Never ending loop in in update_refs Modules/gcmodule.c

2011-12-20 Thread David Butler
David Butler added the comment: This also looks familiar: http://bytes.com/topic/python/answers/36901-fatal-error-gc-object-already-tracked "semi-randomly locks somewhere outside my C-code (after returning to python), and semi-randomly issues a "Fatal error: GC object alrea

[issue13616] Never ending loop in in update_refs Modules/gcmodule.c

2011-12-20 Thread David Butler
David Butler added the comment: I think I have found the problem! I took a closer look at the Fatal error core: #0 0xb76fe424 in __kernel_vsyscall () #1 0xb740ccb1 in *__GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64 #2 0xb740e3f2 in *__GI_abort () at abort.c:92 #3

[issue13616] Never ending loop in in update_refs Modules/gcmodule.c

2011-12-20 Thread David Butler
David Butler added the comment: resolved as wont fix, because its not python's fault :) -- resolution: -> wont fix status: open -> closed ___ Python tracker <http://bugs.python.

[issue12760] Add create mode to open()

2012-01-11 Thread David Townshend
David Townshend added the comment: I've done a bit or rewording in the io docs, but I honestly don't know if this is any better that what you already had! -- Added file: http://bugs.python.org/file24210/x_diff2.patch ___ Python trac

[issue6560] socket sendmsg(), recvmsg() methods

2011-05-23 Thread David Watson
David Watson added the comment: On Mon 23 May 2011, Gergely Kálmán wrote: > It's been a while I had a look at that code. As far as I remember though > the code is fairly decent not > taking the missing unit tests into account. There are a few todos, and > also a pretty bad bu

[issue12197] non-blocking SSL write in Windows sends large data but raises exception

2011-05-27 Thread David Siroky
New submission from David Siroky : Trying to send large bulk of data in MS Windows via non-blocking SSLSocket raises an exception but part of the data is delivered. E.g. ssl_socket.write(b"a" * 20) raises ssl.SSLError: [Errno 3] _ssl.c:1126: The operation did not complete (wri

[issue11240] Running unit tests in a command line tool leads to infinite loop with multiprocessing on Windows

2011-05-29 Thread David Barnett
Changes by David Barnett : -- nosy: +mu_mind ___ Python tracker <http://bugs.python.org/issue11240> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12197] non-blocking SSL write in Windows sends large data but raises exception

2011-06-08 Thread David Siroky
David Siroky added the comment: Sorry, I attached wrong example version. It uses repeated sslsock.write() of the same buffer after catching SSL_ERROR_WANT_WRITE. It delivers the full block but this is a blocking operation. I'm troubled with non-blocking writes. But as I dig deeper int

[issue12197] non-blocking SSL write in Windows sends large data but raises exception

2011-06-09 Thread David Siroky
David Siroky added the comment: I didn't meant blocking as setblocking(True). I use select/poll but I can't use returned value from send() immediately since in Windows there are often needed more send rounds to actually know how much data was sent. E.g. in Linux I know it after

[issue8372] socket: Buffer overrun while reading unterminated AF_UNIX addresses

2011-06-16 Thread David Watson
David Watson added the comment: On Sun 12 Jun 2011, Charles-François Natali wrote: > The patches look good to me, except that instead of passing > (addrlen > buflen) ? buflen : addrlen > as addrlen argument every time makesockaddr is called, I'd > prefer if this

[issue12578] Erratic socket.gaierror: [Errno 11004] when using smtplib

2011-07-17 Thread David Ward
New submission from David Ward : When migrating from python 2.7.1 to 2.7.2 (or 3.2) I get unpredictable /erratic exceptions thrown on constucting smtplib.SMTP: socket.gaierror: [Errno 11004] getaddrinfo failed Here is the call stack: File "**\mail.py", line 41, in Mail

[issue12741] Implementation of shutil.move

2011-08-12 Thread David Townshend
New submission from David Townshend : The shutil.move function uses os.rename to move files on the same file system. On unix, this function will overwrite an existing destination, so the obvious approach is if not os.path.exists(dst): shutil.move(src, dst) But this could result in race

[issue12741] Add function similar to shutil.move that does not overwrite

2011-08-13 Thread David Townshend
David Townshend added the comment: A bit of research has shown that the proposed implementation will not work either, so my next suggestion is something along the lines of def move2(src, dst): try: os.link(src, dst) except OSError as err: # handle error appropriately

[issue12760] Add create mode to open()

2011-08-16 Thread David Townshend
New submission from David Townshend : Currently, opening a file with open(file, 'w') overwrites existing files. It would be useful for open() to raise an error when the file exists. This proposal is to add a 'c' mode to open, which has the effect to creating a file

[issue12760] Add create mode to open()

2011-08-16 Thread David Townshend
David Townshend added the comment: It was discussed on python-ideas, but the subject of the thread was actually on shutils.move so it was not really discussed much. I will repost this idea separately. -- ___ Python tracker <http://bugs.python.

[issue12760] Add create mode to open()

2011-08-18 Thread David Townshend
David Townshend added the comment: My aim isn't to add all the commonly used flags, that would be pointless since its already possible using os.open. The aim is to add a missing feature to the builtin open(), i.e. file creation. At the moment open() implements read, write, and append

[issue12760] Add create mode to open()

2011-08-18 Thread David Townshend
David Townshend added the comment: Changing form 'c' to 'x' is easy enough, and if there is already a convention it makes sense to stick to it. I thought I had done a mercurial diff! I'll try again and resubmit. --

[issue12760] Add create mode to open()

2011-08-18 Thread David Townshend
David Townshend added the comment: I hope this patch suits you better :-) I've updated the documentation typo (thanks for pointing that out). I've also changed 'c' to 'x', since I think that if there is a convention we should stick to it. I don't think th

[issue12835] Missing SSLSocket.sendmsg() wrapper allows programs to send unencrypted data by mistake

2011-08-24 Thread David Watson
New submission from David Watson : Changeset fd10d042b41d removed the wrappers on ssl.SSLSocket for the new socket.send/recvmsg() methods (since I forgot to check for the existence of the underlying methods - see issue #6560), but this leaves SSLSocket with send/recvmsg() methods inherited

[issue6560] socket sendmsg(), recvmsg() methods

2011-08-24 Thread David Watson
David Watson added the comment: On Tue 23 Aug 2011, Nick Coghlan wrote: > As you can see, I just pushed a change that removed the new > methods from SSLSocket objects. If anyone wants to step up with > a valid use case (not already covered by wrap_socket), > preferably with a patch

[issue12837] Patch for issue #12810 removed a valid check on socket ancillary data

2011-08-24 Thread David Watson
New submission from David Watson : Changeset 4736e172fa61 for issue #12810 removed the test "msg->msg_controllen < 0" from socketmodule.c, where msg_controllen happened to be unsigned on the reporter's system. I included this test deliberately, because msg_controllen m

[issue12837] Patch for issue #12810 removed a valid check on socket ancillary data

2011-08-25 Thread David Watson
David Watson added the comment: On Wed 24 Aug 2011, Charles-François Natali wrote: > > I included this test deliberately, because msg_controllen may be > > of signed type [...] POSIX allows socklen_t to be signed > > http://pubs.opengroup.org/onlinepubs/007908799/xn

[issue12835] Missing SSLSocket.sendmsg() wrapper allows programs to send unencrypted data by mistake

2011-08-25 Thread David Watson
David Watson added the comment: On Thu 25 Aug 2011, Antoine Pitrou wrote: > Adding an explanation message to the NotImplementedError would be more > helpful. Otherwise, good catch. OK, I've copied the messages from the ValueErrors the other methods raise. -- Added

[issue12844] Support more than 255 arguments

2011-09-02 Thread David Benjamin
David Benjamin added the comment: I don't think that patch works. Consider a dict subclass which has overridden update. Or perhaps a list subclass which has overridden addition. It would be quite poor if Python's behavior here w.r.t. which overrides are followed switched as you

[issue9569] Add tests for posix.mknod() and posix.mkfifo()

2010-08-11 Thread David Watson
New submission from David Watson : Attaching simple tests for these functions, which aren't currently tested. -- components: Extension Modules files: test-mknod-mkfifo-3.x.diff keywords: patch messages: 113609 nosy: baikie priority: normal severity: normal status: open title: Add

[issue9569] Add tests for posix.mknod() and posix.mkfifo()

2010-08-11 Thread David Watson
Changes by David Watson : Added file: http://bugs.python.org/file18479/test-mknod-mkfifo-2.x.diff ___ Python tracker <http://bugs.python.org/issue9569> ___ ___ Python-bug

[issue9570] PEP 383: os.mknod() and os.mkfifo() do not accept surrogateescape arguments

2010-08-11 Thread David Watson
New submission from David Watson : These functions still use the "s" format for their arguments; the attached patch fixes them to use PyUnicode_FSConverter() in 3.2. Some simple tests for these functions (not for PEP 383 behaviour) are at issue #9569. -- components: Extensi

[issue9579] In 3.x, os.confstr() returns garbage if value is longer than 255 bytes

2010-08-12 Thread David Watson
New submission from David Watson : It may be hard to find a configuration string this long, but you can see the problem if you apply the attached confstr-reduce-bufsize.diff to reduce the size of the local array buffer that posix_confstr() uses. With it applied: >>> import os >&g

[issue9579] In 3.x, os.confstr() returns garbage if value is longer than 255 bytes

2010-08-12 Thread David Watson
Changes by David Watson : Added file: http://bugs.python.org/file18487/confstr-long-result.diff ___ Python tracker <http://bugs.python.org/issue9579> ___ ___ Python-bug

[issue9580] os.confstr() doesn't decode result according to PEP 383

2010-08-12 Thread David Watson
New submission from David Watson : The attached patch applies on top of the patch from issue #9579 to make it use PyUnicode_DecodeFSDefaultAndSize(). (You could use it in the existing code, but until that issue is fixed, there is sometimes nothing to decode!) -- components: Extension

[issue9579] In 3.x, os.confstr() returns garbage if value is longer than 255 bytes

2010-08-12 Thread David Watson
David Watson added the comment: The returned string should also be decoded with the file system encoding and surrogateescape error handler, as per PEP 383 - there's a patch at issue #9580 to do this. -- ___ Python tracker <http://bugs.py

[issue9569] Add tests for posix.mknod() and posix.mkfifo()

2010-08-12 Thread David Watson
David Watson added the comment: I'm not quite sure what you mean, but the man page for FreeBSD 5.3 specifies EPERM for an unprivileged user and EINVAL for an attempt to create something other than a device node. POSIX requires creating a FIFO to work for any user, and just says that E

[issue9569] Add tests for posix.mknod() and posix.mkfifo()

2010-08-12 Thread David Watson
David Watson added the comment: OK, these patches work on FreeBSD 5.3 (root and non-root) if you want to check the errno. I don't know what other systems might return though. I did also find that the 2.x tests were failing on cleanup because the test class used os.unlink rather

[issue9569] Add tests for posix.mknod() and posix.mkfifo()

2010-08-12 Thread David Watson
Changes by David Watson : Added file: http://bugs.python.org/file18490/add-errno-check-2.x.diff ___ Python tracker <http://bugs.python.org/issue9569> ___ ___ Python-bug

[issue9569] Add tests for posix.mknod() and posix.mkfifo()

2010-08-12 Thread David Watson
Changes by David Watson : Added file: http://bugs.python.org/file18491/add-errno-check-3.x.diff ___ Python tracker <http://bugs.python.org/issue9569> ___ ___ Python-bug

[issue9585] Largefile detection in configure fails

2010-08-13 Thread David Austin
New submission from David Austin : On a Linux Xeon server (x86_64) largefile support is (incorrectly) not included. configure determines: checking size of int... 4 checking size of long... 8 checking size of void *... 8 checking size of short... 2 checking size of float... 4 checking size of

[issue9580] os.confstr() doesn't decode result according to PEP 383

2010-08-13 Thread David Watson
David Watson added the comment: The CS_PATH variable is a colon-separated list of directories ("the value for the PATH environment variable that finds all standard utilities"), so the file system encoding is certainly correct there. I don't see any reference to an encoding in

[issue9579] In 3.x, os.confstr() returns garbage if value is longer than 255 bytes

2010-08-13 Thread David Watson
David Watson added the comment: I don't see why confstr() values shouldn't change. sysconf() values can change between calls, IIRC. Implementations can also define their own confstr variables - they don't have to stick to the POSIX stuff. And using a loop means the conf

[issue9603] os.ttyname() and os.ctermid() don't decode result according to PEP 383

2010-08-14 Thread David Watson
New submission from David Watson : These functions each return the path to a terminal, so they should use PyUnicode_DecodeFSDefault(). Patch attached. -- components: Extension Modules files: ttyname-ctermid-pep383.diff keywords: patch messages: 113920 nosy: baikie priority: normal

[issue9604] os.initgroups() doesn't accept PEP 383 usernames returned by pwd module

2010-08-14 Thread David Watson
New submission from David Watson : The pwd module decodes usernames using PyUnicode_DecodeFSDefault(), so initgroups() should use PyUnicode_FSConverter() for the username. Patch attached. -- components: Extension Modules files: initgroups-pep383.diff keywords: patch messages: 113921

[issue9605] os.getlogin() should use PEP 383 decoding to match the pwd module

2010-08-14 Thread David Watson
New submission from David Watson : The pwd module decodes usernames with PyUnicode_DecodeFSDefault(), and the LOGNAME environment variable (suggested as an alternative to getlogin()) is decoded the same way. Attaching a patch to use PyUnicode_DecodeFSDefault() in getlogin

[issue9580] os.confstr() doesn't decode result according to PEP 383

2010-08-14 Thread David Watson
David Watson added the comment: > CS_PATH is hardcoded to "/bin:/usr/bin" in the GNU libc for UNIX. Do you know > another key for which the value can be controled by the user (or the system > administrator)? No, not a specific example, but CS_PATH could conceivably

[issue9579] In 3.x, os.confstr() returns garbage if value is longer than 255 bytes

2010-08-14 Thread David Watson
David Watson added the comment: > I just fear that the loop is "endless". Imagine the worst case: confstr() > returns a counter (n, n+1, n+2, ...). In 64 bits, it can be long. The returned length is supposed to be determined by the length of the variable, not the length of t

[issue1210680] Split email headers near a space

2010-08-17 Thread David Stanek
Changes by David Stanek : -- nosy: +dstanek ___ Python tracker <http://bugs.python.org/issue1210680> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue7275] CoverageResult fails to merge input file with non-empty callers in trace.py (patch)

2010-08-17 Thread David Stanek
Changes by David Stanek : -- nosy: +dstanek ___ Python tracker <http://bugs.python.org/issue7275> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue8722] Documentation for __getattr__

2010-08-17 Thread David Stanek
Changes by David Stanek : -- nosy: +dstanek ___ Python tracker <http://bugs.python.org/issue8722> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue5843] Possible normalization error in urlparse.urlunparse

2010-08-17 Thread David Stanek
Changes by David Stanek : -- nosy: +dstanek ___ Python tracker <http://bugs.python.org/issue5843> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue7159] Urllib2 authentication memory.

2010-08-17 Thread David Stanek
Changes by David Stanek : -- nosy: +dstanek ___ Python tracker <http://bugs.python.org/issue7159> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue9417] Declaring a class creates circular references

2010-08-17 Thread David Stanek
Changes by David Stanek : -- nosy: +dstanek ___ Python tracker <http://bugs.python.org/issue9417> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue9644] PEP 383: os.statvfs() does not accept surrogateescape arguments

2010-08-19 Thread David Watson
New submission from David Watson : The statvfs() function still converts its argument with the "s" format; the attached patch (for 3.2) fixes it to use PyUnicode_FSConverter(). -- components: Extension Modules files: statvfs-pep383-3.2.diff keywords: patch messages: 114392 no

[issue9645] PEP 383: os.pathconf() does not accept surrogateescape arguments

2010-08-19 Thread David Watson
New submission from David Watson : The pathconf() function still converts its argument with the "s" format; the attached pathconf-pep383-3.2.diff fixes it to use PyUnicode_FSConverter() (in 3.2). Also attaching pathconf-cleanup.diff to clean up the indentation, which otherwise make

[issue9645] PEP 383: os.pathconf() does not accept surrogateescape arguments

2010-08-19 Thread David Watson
Changes by David Watson : Added file: http://bugs.python.org/file18580/pathconf-cleanup.diff ___ Python tracker <http://bugs.python.org/issue9645> ___ ___ Python-bug

[issue9647] os.confstr() does not handle value changing length between calls

2010-08-19 Thread David Watson
New submission from David Watson : This came up in relation to issue #9579; there is some discussion of it there. Basically, if os.confstr() has to call confstr() twice because the buffer wasn't big enough the first time, the existing code assumes the string is the same length that t

[issue9579] In 3.x, os.confstr() returns garbage if value is longer than 255 bytes

2010-08-19 Thread David Watson
David Watson added the comment: I've opened a separate issue for the changing-length problem (issue #9647; it affects 2.x as well). Here is a patch that fixes the 255-byte issue only, and has similar results to the 2.x code if the value changes length between calls (except that it could

[issue9580] os.confstr() doesn't decode result according to PEP 383

2010-08-19 Thread David Watson
David Watson added the comment: I wrote this patch to make confstr() return bytes (with code similar to 2.x), and document the change in "Porting to Python 3.2" and elsewhere, but it then occurred to me that you might have been talking about making a separate bytes API like os.enviro

[issue9660] PEP 383: socket module doesn't handle undecodable protocol or service names

2010-08-22 Thread David Watson
New submission from David Watson : The protocol and service/port number databases are typically implemented as text files on Unix and can contain non-ASCII names in any encoding (presumably for local services), but the socket module tries to decode them as strict UTF-8. In particular

[issue9377] socket, PEP 383: Mishandling of non-ASCII bytes in host/domain names

2010-08-22 Thread David Watson
David Watson added the comment: I noticed that try-surrogateescape-first.diff missed out one of the string references that needed to be changed to point to the bytes object, and also used PyBytes_AS_STRING() in an unlocked section. This version fixes these things by taking the generally safer

[issue1027206] unicode DNS names in socket, urllib, urlopen

2010-08-22 Thread David Watson
David Watson added the comment: Updated the socket module patch to include gethostbyaddr() - it happens to accept hostnames and is used this way in the standard library. -- Added file: http://bugs.python.org/file18610/socket-idna.diff ___ Python

[issue9660] PEP 383: socket module doesn't handle undecodable protocol or service names

2010-08-23 Thread David Watson
David Watson added the comment: Come to think of it, I'm not sure if the patch is correct for Windows, as PyUnicode_DecodeFSDefault() appears to do strict MBCS decoding by default (similarly with PyUnicode_FSConverter() for encoding). Can Windows return service names that won't d

[issue1027206] unicode DNS names in socket, urllib, urlopen

2010-08-23 Thread David Watson
David Watson added the comment: > Thanks for the patch. Committed as r84261. > > I'm not sure what the point is of supporting IDNA in getnameinfo, so I have > removed that from the patch. If you think it's needed, please elaborate. I don't see the point of it eithe

[issue9377] socket, PEP 383: Mishandling of non-ASCII bytes in host/domain names

2010-08-23 Thread David Watson
David Watson added the comment: > Is this patch in response to an actual problem, or a theoretical problem? > If "actual problem": what was the specific application, and what was the > specific host name? It's about environments, not applications - the local network ma

[issue9377] socket, PEP 383: Mishandling of non-ASCII bytes in host/domain names

2010-08-24 Thread David Watson
David Watson added the comment: > > It's about environments, not applications > > Still, my question remains. Is it a theoretical problem (i.e. one > of your imagination), or a real one (i.e. one you observed in real > life, without explicitly triggering it)? If real:

[issue1512163] mailbox (2.5b1): locking doesn't work (esp. on FreeBSD)

2010-08-26 Thread David Watson
David Watson added the comment: > Is this still an issue on later versions of Python and/or FreeBSD? Yes, there is still an issue. There is no longer a deadlock on FreeBSD because the module been changed to use only lockf() and dot-locking (on all platforms), but the issue is now about

[issue9377] socket, PEP 383: Mishandling of non-ASCII bytes in host/domain names

2010-08-26 Thread David Watson
David Watson added the comment: > The surrogateescape mechanism is a very hackish approach, and > violates the principle that errors should never pass silently. I don't see how a name resolution API returning non-ASCII bytes would indicate an error. If the host table contains a non

[issue9696] xdrlib's pack_int generates DeprecationWarnings for negative in-range values

2010-08-26 Thread David Powell
New submission from David Powell : The problem is easy to reproduce: >>> import xdrlib >>> p = xdrlib.Packer() >>> p.pack_int(-1) __main__:1: DeprecationWarning: struct integer overflow masking is deprecated The cause is xdrlib.Packer uses the same pack operation f

[issue9377] socket, PEP 383: Mishandling of non-ASCII bytes in host/domain names

2010-08-27 Thread David Watson
David Watson added the comment: > > I don't see how a name resolution API returning non-ASCII bytes > > would indicate an error. > > It's in violation of RFC 952 (slightly relaxed by RFC 1123). That's bad if it's on the public Internet, but it's not

[issue9377] socket, PEP 383: Mishandling of non-ASCII bytes in host/domain names

2010-08-29 Thread David Watson
David Watson added the comment: OK, I still think this issue should be addressed, but here is a patch for the part we agree on: that decoding should not return any Unicode characters except ASCII. -- Added file: http://bugs.python.org/file18674/decode-strict-ascii.diff

[issue9377] socket, PEP 383: Mishandling of non-ASCII bytes in host/domain names

2010-08-29 Thread David Watson
David Watson added the comment: The rest of the issue could also be straightforwardly addressed by adding bytes versions of the name lookup APIs. Attaching a patch which does that (applies on top of decode-strict-ascii.diff). -- Added file: http://bugs.python.org/file18675/hostname

[issue9377] socket, PEP 383: Mishandling of non-ASCII bytes in host/domain names

2010-08-29 Thread David Watson
Changes by David Watson : Removed file: http://bugs.python.org/file18675/hostname-bytes-apis.diff ___ Python tracker <http://bugs.python.org/issue9377> ___ ___ Python-bug

[issue9377] socket, PEP 383: Mishandling of non-ASCII bytes in host/domain names

2010-08-29 Thread David Watson
David Watson added the comment: Oops, forgot to refresh the last change into that patch. This should fix it. -- Added file: http://bugs.python.org/file18676/hostname-bytes-apis.diff ___ Python tracker <http://bugs.python.org/issue9

[issue9777] test_socket.GeneralModuleTests.test_idna should require the "network" resource

2010-09-04 Thread David Watson
New submission from David Watson : This test requires network access as it tries to resolve a domain name at python.org. Patch attached. -- components: Tests files: idna-test-resource.diff keywords: patch messages: 115593 nosy: baikie priority: normal severity: normal status: open

[issue8372] socket: Buffer overrun while reading unterminated AF_UNIX addresses

2010-09-05 Thread David Watson
David Watson added the comment: > > baikie: why did the test pass for you? > > The test passes (I assume) if linux-pass-unterminated.diff is applied. The > latter patch is only meant to exhibit the issue, though, not to be checked in. No, I meant for linux-pass-untermin

[issue8372] socket: Buffer overrun while reading unterminated AF_UNIX addresses

2010-09-06 Thread David Watson
David Watson added the comment: > baikie, coming back to your original message: what precisely makes you > believe that sun_path does not need to be null-terminated on Linux? That's the way I demonstrated the bug - the only way to bind to a 108-byte path is to pass it without null

[issue8373] socket: AF_UNIX socket paths not handled according to PEP 383

2010-09-11 Thread David Watson
David Watson added the comment: Updated the patches for Python 3.2 - these are now simpler as they do not support bytearray arguments, as these are no longer used for filenames (the existing code does not support bytearrays either). I've put the docs and tests in one patch, and made sep

[issue8373] socket: AF_UNIX socket paths not handled according to PEP 383

2010-09-11 Thread David Watson
Changes by David Watson : Added file: http://bugs.python.org/file18851/af_unix-pep383-3.2-with-linux-unterminated.diff ___ Python tracker <http://bugs.python.org/issue8

[issue8373] socket: AF_UNIX socket paths not handled according to PEP 383

2010-09-11 Thread David Watson
Changes by David Watson : Added file: http://bugs.python.org/file18852/af_unix-pep383-3.2-without-linux-unterminated.diff ___ Python tracker <http://bugs.python.org/issue8

[issue8372] socket: Buffer overrun while reading unterminated AF_UNIX addresses

2010-09-11 Thread David Watson
David Watson added the comment: I've updated the PEP 383 patches at issue #8373 with separate versions for if the linux-pass-unterminated patch is applied or not. If it's not essential to have unit tests for the overrun issue, I'd suggest applying just the return-untermina

[issue8373] socket: AF_UNIX socket paths not handled according to PEP 383

2010-09-11 Thread David Watson
David Watson added the comment: One of the tests got broken by the removal of sys.setfilesystemencoding(). Replaced it. -- Added file: http://bugs.python.org/file18853/af_unix-pep383-docs-tests-3.2-2.diff ___ Python tracker <h

[issue8372] socket: Buffer overrun while reading unterminated AF_UNIX addresses

2010-09-12 Thread David Watson
David Watson added the comment: > With all the effort that went into the patch, I recommend to get it right: if > there is space for the \0, include it. If the string size is exactly 108, and > it's linux, write it unterminated. Else fail. > > As for testing: we should th

[issue8372] socket: Buffer overrun while reading unterminated AF_UNIX addresses

2010-09-12 Thread David Watson
David Watson added the comment: I meant to say that FreeBSD provides the SUN_LEN macro, but it turns out that Linux does as well, and its version behaves the same as FreeBSD's. The FreeBSD man pages state that the terminating null is not part of the address: http://www.freebsd.org/cgi/ma

<    1   2   3   4   5   6   7   8   9   10   >