[issue1508475] transparent gzip compression in liburl2
Jakob Truelsen antial...@users.sourceforge.net added the comment: No, I have long since moved on to other things. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1508475 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1508475] transparent gzip compression in liburl2
Senthil Kumaran orsent...@gmail.com added the comment: Its okay, Jacab, we will take it forward. -- assignee: - orsenthil ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1508475 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1027206] unicode DNS names in socket, urllib, urlopen
Florent Xicluna florent.xicl...@gmail.com added the comment: Two builders are sad: * x86 gentoo * sparc solaris10 gcc == ERROR: test_idna (test.test_socket.GeneralModuleTests) -- Traceback (most recent call last): File /home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_socket.py, line 644, in test_idna socket.getaddrinfo('\u0438\u0441\u043f\u044b\u0442\u0430\u043d\u0438\u0435.python.org',0) socket.gaierror: [Errno 9] service name not available for the specified socket type http://www.python.org/dev/buildbot/builders/x86%20gentoo%203.x/builds/2898 http://www.python.org/dev/buildbot/builders/sparc%20solaris10%20gcc%203.x/builds/1472 -- keywords: +buildbot nosy: +flox status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1027206 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9664] Make gzip module not require that underlying file object support seek
New submission from Matthias Klose d...@debian.org: [ forwarded from http://bugs.debian.org/571317 ] I'm writing a program that uses the popularity contest results. Since downloading the compressed results takes about a quarter of the time it takes to download the uncompressed results, I'd like to use the following construct to iterate over the results: for line in gzip.GzipFile(fileobj=urllib.request.urlopen('http://popcon.debian.org/by_vote.gz')): Unfortunately, this fails with the following exception: Traceback (most recent call last): File /home/kraai/bin/rc-bugs, line 76, in module main() File /home/kraai/bin/rc-bugs, line 56, in main for line in gzip.GzipFile(fileobj=urllib.request.urlopen('http://popcon.debian.org/by_vote.gz')): File /usr/lib/python3.1/gzip.py, line 469, in __next__ line = self.readline() File /usr/lib/python3.1/gzip.py, line 424, in readline c = self.read(readsize) File /usr/lib/python3.1/gzip.py, line 249, in read self._read(readsize) File /usr/lib/python3.1/gzip.py, line 277, in _read pos = self.fileobj.tell() # Save current position io.UnsupportedOperation: seek I wish that the gzip module didn't require the underlying file object to support seek so that this construct would work. -- messages: 114728 nosy: doko priority: normal severity: normal status: open title: Make gzip module not require that underlying file object support seek versions: Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9664 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9441] increase logging handlers test coverage
Vinay Sajip vinay_sa...@yahoo.co.uk added the comment: Tom, thanks for the patch. If I apply it I get an error at shutdown when run with the command python3.2 regrtest.py test_logging test_logging i.e. when I run test_logging twice. If I use python3.2 regrtest.py test_logging there are no errors. I haven't had time to look into it - please can you check that everything is cleaned up so that there are no shutdown errors? Thanks. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9441 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3548] subprocess.pipe function
Anh Hai Trinh anh.hai.tr...@gmail.com added the comment: I've written a package which can do this with arbitrary redirection in all subcommands (and some more). You can, for example, do this: Pipe(Sh('echo -n foo 2', {2: 1}), Sh('cat; echo ERROR 2', {2: os.devnull})).capture(1).read() 'foo' The package is at: http://github.com/aht/pc.py -- nosy: +aht ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3548 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7742] please avoid 'which' in Modules/ld_so_aix
Michael Haubenwallner michael.haubenwall...@salomon.at added the comment: @Stefan: Nope, setting some PATH in ~/.cshrc is the wrong thing to do, and it actually is the reason for this issue at all: 'which' is intended to tell the location of some command that would be used when started on current commandline or within current running shell-script using _current_ PATH. When ~/.cshrc modifies PATH, the found command-path would be wrong (or not found at all). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7742 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7742] please avoid 'which' in Modules/ld_so_aix
Stefan Krah stefan-use...@bytereef.org added the comment: Michael Haubenwallner rep...@bugs.python.org wrote: @Stefan: Nope, setting some PATH in ~/.cshrc is the wrong thing to do, and it actually is the reason for this issue at all: 'which' is intended to tell the location of some command that would be used when started on current commandline or within current running shell-script using _current_ PATH. When ~/.cshrc modifies PATH, the found command-path would be wrong (or not found at all). Yes, that's why I wrote in the worst case. Of course AIX 'which' is broken, but this could be easily fixed by IBM. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7742 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2830] Copy cgi.escape() to html
Georg Brandl ge...@python.org added the comment: Looks good already. Two points: * if we do the move, we should finally make sure all problematic characters are escaped. For now, I think the single quote is the most important one in attribute mode. * the new docs for cgi.escape() are missing a newline between signature and body. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2830 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1481032] patch smtplib:when SMTPDataError, rset crashes with sslerror
kxroberto kxrobe...@users.sourceforge.net added the comment: still I think all 3 self.rset()'s in SMTP.sendmail, which are followed by a raise someerror statement have to be bracketed with an except clause or so - nowadays better like try: self.res() except (EnvironmentError, SMTPException): pass , as all socket.error, sslerror seem meanwhile correctly inherited (via IOError). Because the original error must pop up, not a side effect of state cleaning! -- versions: +Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1481032 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1481032] patch smtplib:when SMTPDataError, rset crashes with sslerror
Changes by kxroberto kxrobe...@users.sourceforge.net: Added file: http://bugs.python.org/file18613/smtplib_nosideeffecterror.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1481032 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1481032] patch smtplib:when SMTPDataError, rset crashes with sslerror
Changes by kxroberto kxrobe...@users.sourceforge.net: Removed file: http://bugs.python.org/file7227/smtplib-authplain-tryrset.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1481032 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9512] logging.handlers.RotatingFileHandler - mode argument not respected
Friðrik Már Jónsson frid...@pyth.net added the comment: That's a fair conclusion, but in this case I'd appreciate Terry's suggested doc patch being implemented: DOC PATCH In 15.6.12.5. RotatingFileHandler, replace If mode is not specified, 'a' is used. with If mode is not specified or if maxBytes 0, the mode is 'a'. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9512 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9654] merge PC/getpathp.c into Modules/getpath.c
Tim Golden m...@timgolden.me.uk added the comment: +1 in principle -- nosy: +tim.golden ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9654 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9653] New default argparse output to be added
Tom Browder tom.brow...@gmail.com added the comment: On Sun, Aug 22, 2010 at 17:06, Steven Bethard rep...@bugs.python.org wrote: ... import argparse import sys parser = argparse.ArgumentParser() parser.add_argument('--foo') if len(sys.argv) == 1: parser.print_help() else: print(parser.parse_args()) Of course that works, but I want to be able to customize the parser so it shows something like: Usage: program name [options] Use option '-h' for help. Two problems for me with current behavior: 1. usage and optional = not capitalized 2. usage: temp.py [-h] [--foo FOO] = gets very lengthy and mind numbing for programs with lots of options Regards, -Tom -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9653 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9665] Buid issues on Cygwin - _curses, _curses_panel, and _io
New submission from Brian Curtin cur...@acm.org: Using Cygwin 1.7, there are build failures for both _curses, _curses_panel, and _io. The curses failures are because symlinking /usr/include/{n}curses.h from /usr/include/{n}curses.h was removed in recent versions [0], so I added -I/usr/include/ncurses to the BASECFLAGS for cygwin. Not knowing the ins and outs of gcc/configure/make, I doubt the patch (ncurses_fix.diff) is correct or complete. It works on my machine so at least it's a starting point (maybe?). _io gets the following warning and then later failure on gcc 4.3.4: /cygdrive/c/Users/bcurtin/cygwin-python/release27-maint/Modules/_io/_iomodule.c:172: warning: ‘PyExc_BlockingIOError’ redeclared without dllimport attribute: previous dllimport ignored ... build/temp.cygwin-1.7.5-i686-2.7/cygdrive/c/Users/bcurtin/cygwin-python/release27-maint/Modules/_io/bufferedio.o: In function `_buffered_check_blocking_error': /cygdrive/c/Users/bcurtin/cygwin-python/release27-maint/Modules/_io/bufferedio.c:558: undefined reference to `__imp__PyExc_BlockingIOError' /cygdrive/c/Users/bcurtin/cygwin-python/release27-maint/Modules/_io/bufferedio.c:558: undefined reference to `__imp__PyExc_BlockingIOError' My Linux compile (gcc 4.5.0) gets the same warning, but no error. Windows is totally fine with _iomodule.c:172. This was found by Ben Walker. [0] http://cygwin.com/ml/cygwin-announce/2010-01/msg2.html -- assignee: brian.curtin components: Build, Extension Modules, Windows files: ncurses_fix.diff keywords: patch, patch messages: 114738 nosy: brian.curtin, stutzbach, tim.golden priority: normal severity: normal stage: needs patch status: open title: Buid issues on Cygwin - _curses, _curses_panel, and _io type: compile error versions: Python 2.7, Python 3.1, Python 3.2 Added file: http://bugs.python.org/file18614/ncurses_fix.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9665 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9501] Logging shutdown regressions with weakrefs
Vinay Sajip vinay_sa...@yahoo.co.uk added the comment: Fix checked into py3k and release27-maint (r84282). -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9501 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2889] curses for windows (alternative patch)
Roumen Petrov bugtr...@roumenpetrov.info added the comment: -1 for PDCurses -- nosy: +rpetrov ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2889 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9665] Buid issues on Cygwin - _curses, _curses_panel, and _io
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: The _io module appears both in setup.py and Modules/Setup.dist. Is it normal? IMO if the _io module is built-in, it should not be built as an extension module. -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9665 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9665] Buid issues on Cygwin - _curses, _curses_panel, and _io
Daniel Stutzbach dan...@stutzbachenterprises.com added the comment: Should release27-maint/Modules/_io/_iomodule.c:172 be: PyAPI_DATA(PyObject *) PyExc_BlockingIOError = (PyObject *)_PyExc_BlockingIOError; ? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9665 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue658749] asyncore connect() and winsock errors
Giampaolo Rodola' g.rod...@gmail.com added the comment: Fixed in r84284. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue658749 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9665] Buid issues on Cygwin - _curses, _curses_panel, and _io
Benjamin Peterson benja...@python.org added the comment: Why should it be? -- nosy: +benjamin.peterson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9665 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9665] Buid issues on Cygwin - _curses, _curses_panel, and _io
Roumen Petrov bugtr...@roumenpetrov.info added the comment: patch of patch attached to issue 3871 --- ./Modules/_io/_iomodule.h.MINGW 2009-12-23 12:52:04.0 +0200 +++ ./Modules/_io/_iomodule.h 2009-12-14 22:01:16.0 +0200 @@ -72,7 +72,7 @@ PyObject *filename; /* Not used, but part of the IOError object */ Py_ssize_t written; } PyBlockingIOErrorObject; -PyAPI_DATA(PyObject *) PyExc_BlockingIOError; +extern PyObject* PyExc_BlockingIOError; /* * Offset type for positioning. -- nosy: +rpetrov ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9665 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9601] ftplib should accept 250 on MKD
Giampaolo Rodola' g.rod...@gmail.com added the comment: This is now fixed in r84288. -- assignee: - giampaolo.rodola resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9601 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9660] PEP 383: socket module doesn't handle undecodable protocol or service names
David Watson bai...@users.sourceforge.net 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 decode with MBCS? Or does it use a different encoding? I don't have a system to experiment with. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9660 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1057417] New BaseSMTPServer module
Giampaolo Rodola' g.rod...@gmail.com added the comment: I agree with opinions expressed by Jean-Paul in msg47196. I see no real gain in providing a smptd.py clone which provides no other new difference other than using threads instead of a non-blocking approach. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1057417 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9665] Buid issues on Cygwin - _curses, _curses_panel, and _io
Daniel Stutzbach dan...@stutzbachenterprises.com added the comment: Why should it be? The error indicates that the definition in the .c file doesn't match the declaration in the .h file, with respect to the funky Windows-specific stuff ('dllimport') that PyAPI_DATA adds. Roumen's patch suggests I had it backwards, and it's the .h file that should be changed. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9665 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9665] Buid issues on Cygwin - _curses, _curses_panel, and _io
Benjamin Peterson benja...@python.org added the comment: 2010/8/23 Daniel Stutzbach rep...@bugs.python.org: Daniel Stutzbach dan...@stutzbachenterprises.com added the comment: Why should it be? The error indicates that the definition in the .c file doesn't match the declaration in the .h file, with respect to the funky Windows-specific stuff ('dllimport') that PyAPI_DATA adds. Roumen's patch suggests I had it backwards, and it's the .h file that should be changed. Why would this not be required for the standard exceptions then? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9665 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9665] Buid issues on Cygwin - _curses, _curses_panel, and _io
Ben Walker jaeda...@gmail.com added the comment: I have been using the following patch to fix the issue locally for a few weeks now (in addition to something equivalent to what Brian submitted for the _curses issue). These two patches combined give me a working python 2.7 on cygwin 1.7. I originally used something identical to Roumen's patch, but later started using the patch below after reading up on __declspec. Note that line 740 is also a candidate to be changed to dllexport, but I don't have the setup to test that. Index: Include/pyport.h === --- Include/pyport.h(revision 84288) +++ Include/pyport.h(working copy) @@ -739,7 +739,7 @@ # if !defined(__CYGWIN__) # define PyAPI_FUNC(RTYPE) __declspec(dllimport) RTYPE # endif /* !__CYGWIN__ */ -# define PyAPI_DATA(RTYPE) extern __declspec(dllimport) RTYPE +# define PyAPI_DATA(RTYPE) extern __declspec(dllexport) RTYPE /* module init functions outside the core must be exported */ # if defined(__cplusplus) # define PyMODINIT_FUNC extern C __declspec(dllexport) void -- nosy: +bwalker ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9665 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1597850] Cross compiling patches for MINGW
Roumen Petrov bugtr...@roumenpetrov.info added the comment: -1 for the patch (after review of cross-3.0-0.7.diff) : 1) AC_CHECK_TOOLS(CC,gcc cc) and AC_CHECK_TOOLS(CXX,g++ c++) is bogus 2) $CC -dumpmachine when is added AC_CANONICAL_HOST is bogus 3) if (strcmp(buffe,me) 123)) is buggy Good point is setup.py is to exclude default searches for header/libraries in /usr/XXX directories . Note that this is requested in other issues not related to cross compilation. About pgen build i'm not sure that is wort to cross-build as there is no reason to recreate files , right ? To me this is only dependency issue. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1597850 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1027206] unicode DNS names in socket, urllib, urlopen
David Watson bai...@users.sourceforge.net 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 either, but if it's not supposed to accept hostnames, it should use AI_NUMERICHOST in the call it makes to getaddrinfo(). As it is, it does both forward and reverse lookups when called with a hostname. Attaching a patch to use AI_NUMERICHOST. Also, this issue # isn't really resolved yet as Python does not support IRIs (AFAIK). -- Added file: http://bugs.python.org/file18615/getnameinfo-numerichost.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1027206 ___diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -3969,6 +3969,7 @@ socket_getnameinfo(PyObject *self, PyObj memset(hints, 0, sizeof(hints)); hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_DGRAM; /* make numeric port happy */ +hints.ai_flags = AI_NUMERICHOST;/* don't do any name resolution */ Py_BEGIN_ALLOW_THREADS ACQUIRE_GETADDRINFO_LOCK error = getaddrinfo(hostp, pbuf, hints, res); ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9377] socket, PEP 383: Mishandling of non-ASCII bytes in host/domain names
David Watson bai...@users.sourceforge.net 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 may be configured with non-ASCII bytes in hostnames (either in the local DNS *or* a different lookup mechanism - I mentioned /etc/hosts as a simple example), or someone might deliberately connect from a garbage hostname as a denial of service attack against a server which tries to look it up with gethostbyaddr() or whatever (this may require a non-strict resolver library, as noted above). If theoretical, I recommend to close it as won't fix. I find it perfectly reasonable if Python's socket module gives an error if the hostname can't be clearly decoded. Applications that run into it as a result of gethostbyaddr should treat that as no reverse name available. There are two points here. One is that the decoding can fail; I do think that programmers will find this surprising, and the fact that Python refuses to return what was actually received is a regression compared to 2.x. The other is that the encoding and decoding are not symmetric - hostnames are being decoded with UTF-8 but encoded with IDNA. That means that when a decoded hostname contains a non-ASCII character which is not prohibited by IDNA/Nameprep, that string will, when used in a subsequent call, not refer to the hostname that was actually received, because it will be re-encoded using a different codec. Attaching a refreshed version of try-surrogateescape-first.diff. I've separated out the change to getnameinfo() as it may be superfluous (issue #1027206). -- Added file: http://bugs.python.org/file18616/try-surrogateescape-first-4.diff Added file: http://bugs.python.org/file18617/try-surrogateescape-first-getnameinfo-4.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9377 ___Accept ASCII/surrogateescape strings as hostname arguments. diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst --- a/Doc/library/socket.rst +++ b/Doc/library/socket.rst @@ -49,6 +49,28 @@ supported. The address format required b automatically selected based on the address family specified when the socket object was created. +When a hostname is returned by a system interface, it is decoded into +a string using the ``'ascii'`` codec and the ``'surrogateescape'`` +error handler; this leaves ASCII bytes as ASCII, including IDNA +ASCII-compatible encodings (see :mod:`encodings.idna`), but converts +any non-ASCII bytes to the Unicode lone surrogate codes +U+DC80...U+DCFF. + +Hostname arguments can be passed as strings or :class:`bytes` objects. +The latter are passed to the system unchanged, while strings are +encoded as follows: if a string contains only ASCII characters and/or +the Unicode lone surrogate codes U+DC80...U+DCFF, it is encoded using +the ``'ascii'`` codec and the ``'surrogateescape'`` error handler; +otherwise it is converted to IDNA ASCII-compatible form using the +``'idna'`` codec, and if this is not possible, :exc:`UnicodeError` is +raised. + +.. versionchanged:: XXX + Previously, hostnames were decoded as UTF-8 and encoded using IDNA + or UTF-8; ``surrogateescape`` was not used; some interfaces + formerly accepted :class:`bytearray` objects, or did not accept + :class:`bytes` objects. + For IPv4 addresses, two special forms are accepted instead of a host address: the empty string represents :const:`INADDR_ANY`, and the string ``'broadcast'`` represents :const:`INADDR_BROADCAST`. The behavior is not diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -322,6 +322,51 @@ class GeneralModuleTests(unittest.TestCa except socket.error: pass +def tryHostnameArgs(self, function, notfounderror): +# Call the given one-argument function with various valid and +# invalid representations of nonexistent hostnames. Check +# that it raises notfounderror for valid representations, and +# UnicodeError for invalid ones. + +# An RFC 1123-compliant host name (.invalid TLD is reserved +# under RFC 2606). +self.assertRaises(notfounderror, function, host.domain.invalid) +# Previous name as a bytes object. +self.assertRaises(notfounderror, function, bhost.domain.invalid) +# A domain name with a non-ASCII octet, as bytes. +self.assertRaises(notfounderror, function, b\xff.domain.invalid) +# Previous domain name as ASCII/surrogateescape string representation. +self.assertRaises(notfounderror, function, \udcff.domain.invalid) +# A legal IDN. +self.assertRaises(notfounderror, function, â¬.domain.invalid) +# A combination of the
[issue9129] DoS smtpd module vulnerability
Giampaolo Rodola' g.rod...@gmail.com added the comment: Fixed in r84289. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9129 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9377] socket, PEP 383: Mishandling of non-ASCII bytes in host/domain names
Martin v. Löwis mar...@v.loewis.de 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 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: what was the specific environment, and what was the specific host name? There are two points here. One is that the decoding can fail; I do think that programmers will find this surprising, and the fact that Python refuses to return what was actually received is a regression compared to 2.x. True. However, I think this is an acceptable regression, assuming the problem is merely theoretical. It is ok if an operation fails that you will never run into in real life. That means that when a decoded hostname contains a non-ASCII character which is not prohibited by IDNA/Nameprep, that string will, when used in a subsequent call, not refer to the hostname that was actually received, because it will be re-encoded using a different codec. Again, I fail to see the problem in this. It won't happen in real life. However, if you worried that this could be abused, I think it should decode host names as ASCII, not as UTF-8. Then it will be symmetric again (IIUC). -- title: socket, PEP 383: Mishandling of non-ASCII bytes in host/domain names - socket, PEP 383: Mishandling of non-ASCII bytes in host/domain names ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9377 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7546] msvc9compiler.py: add .asm extension
Roumen Petrov bugtr...@roumenpetrov.info added the comment: To me distutils does not support assembler files and for other compilers this is required to build ctypes - see also issue 2942. -- nosy: +rpetrov ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7546 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7546] msvc9compiler.py: add .asm extension
Éric Araujo mer...@netwok.org added the comment: To me distutils does not support assembler files Do you think it should? and for other compilers this is required to build ctypes Sorry, I don’t understand. Can you rephrase? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7546 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1057417] New BaseSMTPServer module
Changes by Benjamin Peterson benja...@python.org: -- resolution: - rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1057417 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9665] Buid issues on Cygwin - _curses, _curses_panel, and _io
Roumen Petrov bugtr...@roumenpetrov.info added the comment: Ben, import of variables cannot be changed to export as this will produce crash in application (core dump/bus error etc.) that try to use them. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9665 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9665] Buid issues on Cygwin - _curses, _curses_panel, and _io
Daniel Stutzbach dan...@stutzbachenterprises.com added the comment: Why would this not be required for the standard exceptions then? It looks like PyAPI_DATA can be defined differently depending on whether we're building code as a built-in or as a loadable module. If _iomodule.c is really being built as a module, that would explain why there's a difference. The standard exceptions are always built-in. In Python 2.7, _io is not the default I/O system for Python, so I could understand why it might be a loadable module there. Of course, if Amaury is right that it's being built both ways then I assume that could be the underlying problem. Also, the definition of PyAPI_DATA has a bunch of conditions specifically for Cygwin, which (partially) explains why the behavior is different from a regular Windows build. I am not an export on the dllimport and dllexport keywords, although I have needed to use them on occasion. I am speculating. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9665 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9665] Buid issues on Cygwin - _curses, _curses_panel, and _io
Brian Curtin cur...@acm.org added the comment: This patch lets everything build ok, but a run of regrtest segfaults usually after a few tests (using -r) and there are nearly constant stack traces printed to stderr about not being able to remap the Cygwin bz2 DLL's address space. I used extern as Roumen suggested, plus my curses hack, and added a #ifndef in Modules/main.c that was causing a problem without it. -- Added file: http://bugs.python.org/file18618/issue9665.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9665 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7546] msvc9compiler.py: add .asm extension
Roumen Petrov bugtr...@roumenpetrov.info added the comment: Please see my comments to issue 2942 - so I think compilers should support assembler suffixes. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7546 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2830] Copy cgi.escape() to html
Pablo Mouzo pablomo...@gmail.com added the comment: Thanks Georg for the review, I'm attaching a new patch with those problems fixed. The new patch escapes ' when the quote parameter is true, and / always. -- Added file: http://bugs.python.org/file18619/issue2830.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2830 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2830] Copy cgi.escape() to html
Changes by Pablo Mouzo pablomo...@gmail.com: Removed file: http://bugs.python.org/file18612/issue2830.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2830 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2889] curses for windows (alternative patch)
Changes by Trundle andy-pyt...@hammerhartes.de: -- nosy: +Trundle ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2889 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9061] cgi.escape Can Lead To XSS Vulnerabilities
Changes by Benjamin Peterson benja...@python.org: -- resolution: - duplicate status: open - closed superseder: - Copy cgi.escape() to html ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9061 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1162477] Parsing failures in parsedate_tz
R. David Murray rdmur...@bitdance.com added the comment: Here's a patch (essentially the one provided by Thomas) with unit test. -- keywords: +patch stage: unit test needed - patch review Added file: http://bugs.python.org/file18620/parsedate.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1162477 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1194222] parsedate and Y2K
R. David Murray rdmur...@bitdance.com added the comment: Thanks for working on this. I would prefer to have two patches: one that fixes the bug (and adds the unit tests) and a separate one for the cleanups (in a new issue). I agree that the fact that it isn't complying with the RFC makes it a bug. It seems unlikely that fixing this would break anyone's code, since if they are already working around the bug the return of a four digit year should cause their workaround code to be skipped. -- type: feature request - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1194222 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2636] Regexp 2.7 (modifications to current re 2.2.2)
Matthew Barnett pyt...@mrabarnett.plus.com added the comment: issue2636-20100824.zip is a new version of the regex module. More speedups. Getting towards Perl speed now, depending on the regex. :-) -- Added file: http://bugs.python.org/file18621/issue2636-20100824.zip ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2636 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9666] 'hasattr' fix to suppress only AttributeError
New submission from Yury Selivanov yseliva...@gmail.com: As discussed on python-dev mailing list (http://mail.python.org/pipermail/python-dev/2010-August/103178.html), 'hasattr' default behaviour should be changed to suppress only AttributeError exceptions. Other should pass through. The fix, however, shouldn't change behaviour of existing C API, functions PyObject_HasAttr and PyObject_HasAttrString in particular. I'm targeting this issue on Python 3.2 version, but probably it may be introduced in the next Python 3.1 maintenance release. -- assignee: d...@python components: Documentation, Library (Lib) files: hasattr.patch keywords: patch messages: 114767 nosy: Yury.Selivanov, d...@python priority: normal severity: normal status: open title: 'hasattr' fix to suppress only AttributeError type: behavior versions: Python 3.2 Added file: http://bugs.python.org/file18622/hasattr.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9666 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9666] 'hasattr' fix to suppress only AttributeError
Changes by Benjamin Peterson benja...@python.org: -- assignee: d...@python - benjamin.peterson nosy: +benjamin.peterson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9666 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1327971] HTTPResponse instance has no attribute 'fileno'
Changes by Senthil Kumaran orsent...@gmail.com: -- assignee: - orsenthil ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1327971 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1490929] urllib.retrieve's reporthook called with non-helpful value
Changes by Senthil Kumaran orsent...@gmail.com: -- assignee: - orsenthil ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1490929 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9666] 'hasattr' fix to suppress only AttributeError
Benjamin Peterson benja...@python.org added the comment: Fixed in r84294. I will not backport to 3.1. Thanks for the contribution! -- keywords: +gsoc -patch resolution: - accepted status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9666 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7579] Patch to add docstrings to msvcrt
Brian Curtin cur...@acm.org added the comment: Committed to py3k in r84295. -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7579 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com