[issue1629] Py_Size() should be named Py_SIZE()
Martin v. Löwis added the comment: I've fixed PEP 3123 to update the spelling. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1629 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1629] Py_Size() should be named Py_SIZE()
Martin v. Löwis added the comment: Why the compatibility? __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1629 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1629] Py_Size() should be named Py_SIZE()
Martin v. Löwis added the comment: FWIW, should PyUnicode_Check, PyTuple_Check etc. also change to PyUnicode_CHECK, PyTuple_CHECK etc because they are macros? __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1629 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1657] [patch] select.epoll wrapper for Linux 2.6 epoll()
Christian Heimes added the comment: UPDATE: * Better API with register(), unregister() and modify() instead of control() * Some documentation Added file: http://bugs.python.org/file8993/trunk_select_epoll2.patch __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1657 __Index: configure === --- configure (Revision 59566) +++ configure (Arbeitskopie) @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 59533 . +# From configure.in Revision: 59558 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for python 2.6. # @@ -5416,13 +5416,14 @@ + for ac_header in asm/types.h conio.h curses.h direct.h dlfcn.h errno.h \ fcntl.h grp.h \ io.h langinfo.h libintl.h ncurses.h poll.h process.h pthread.h \ shadow.h signal.h stdint.h stropts.h termios.h thread.h \ unistd.h utime.h \ -sys/audioio.h sys/bsdtty.h sys/file.h sys/loadavg.h sys/lock.h sys/mkdev.h \ -sys/modem.h \ +sys/audioio.h sys/bsdtty.h sys/epoll.h sys/file.h sys/loadavg.h sys/lock.h \ +sys/mkdev.h sys/modem.h \ sys/param.h sys/poll.h sys/select.h sys/socket.h sys/statvfs.h sys/stat.h \ sys/time.h \ sys/times.h sys/types.h sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \ @@ -15644,7 +15645,57 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo $as_me:$LINENO: checking for epoll 5 +echo $ECHO_N checking for epoll... $ECHO_C 6; } +cat conftest.$ac_ext _ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h conftest.$ac_ext +cat conftest.$ac_ext _ACEOF +/* end confdefs.h. */ +#include sys/epoll.h +int +main () +{ +void *x=epoll_create + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try=$ac_compile +case (($ac_try in + *\* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval echo \\$as_me:$LINENO: $ac_try_echo\) 5 + (eval $ac_compile) 2conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 conftest.err + rm -f conftest.er1 + cat conftest.err 5 + echo $as_me:$LINENO: \$? = $ac_status 5 + (exit $ac_status); } { + test -z $ac_c_werror_flag || + test ! -s conftest.err + } test -s conftest.$ac_objext; then +cat confdefs.h \_ACEOF +#define HAVE_EPOLL 1 +_ACEOF + + { echo $as_me:$LINENO: result: yes 5 +echo ${ECHO_T}yes 6; } +else + echo $as_me: failed program was: 5 +sed 's/^/| /' conftest.$ac_ext 5 + + { echo $as_me:$LINENO: result: no 5 +echo ${ECHO_T}no 6; } + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # On some systems (eg. FreeBSD 5), we would find a definition of the # functions ctermid_r, setgroups in the library, but no prototype # (e.g. because we use _XOPEN_SOURCE). See whether we can take their Index: configure.in === --- configure.in (Revision 59566) +++ configure.in (Arbeitskopie) @@ -1100,8 +1100,8 @@ io.h langinfo.h libintl.h ncurses.h poll.h process.h pthread.h \ shadow.h signal.h stdint.h stropts.h termios.h thread.h \ unistd.h utime.h \ -sys/audioio.h sys/bsdtty.h sys/file.h sys/loadavg.h sys/lock.h sys/mkdev.h \ -sys/modem.h \ +sys/audioio.h sys/bsdtty.h sys/epoll.h sys/file.h sys/loadavg.h sys/lock.h \ +sys/mkdev.h sys/modem.h \ sys/param.h sys/poll.h sys/select.h sys/socket.h sys/statvfs.h sys/stat.h \ sys/time.h \ sys/times.h sys/types.h sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \ @@ -2358,7 +2358,12 @@ AC_MSG_RESULT(yes), AC_MSG_RESULT(no) ) - +AC_MSG_CHECKING(for epoll) +AC_TRY_COMPILE([#include sys/epoll.h], void *x=epoll_create, + AC_DEFINE(HAVE_EPOLL, 1, Define if you have the 'epoll' functions.) + AC_MSG_RESULT(yes), + AC_MSG_RESULT(no) +) # On some systems (eg. FreeBSD 5), we would find a definition of the # functions ctermid_r, setgroups in the library, but no prototype # (e.g. because we use _XOPEN_SOURCE). See whether we can take their Index: Doc/library/select.rst === --- Doc/library/select.rst (Revision 59566) +++ Doc/library/select.rst (Arbeitskopie) @@ -7,10 +7,11 @@ This module provides access to the :cfunc:`select` and :cfunc:`poll` functions -available in most operating systems. Note that on Windows, it only works for -sockets; on other operating systems, it also works for other file types (in -particular, on Unix, it works on pipes). It cannot be used on regular files to -determine whether a file has grown since it was last read. +available in most operating systems and :cfunc:`epoll` available on Linux 2.5+. +Note that on Windows, it only works for sockets; on other operating systems, +it also works for other file types (in particular, on Unix, it works on pipes). +It cannot be used on regular files to determine whether a file has grown since +it was last read. The module defines the following: @@ -22,6 +23,16 @@ string, as would
[issue1657] [patch] select.epoll wrapper for Linux 2.6 epoll()
Thomas Herve added the comment: Cool, thanks for working on that. Just for the record, I don't really understand the workflow: why closing the other ticket as duplicate and not post the patch on the old one? But whatever. For this patch, I don't see the benefit of putting it in the select module, instead of a separate module. Is there a specific reason? Looking at the code, I don't have many remarks. pyepoll_new may leak if epoll_create fails. I think that allowing threading around epoll_ctl is useless, but I may be wrong. Thanks again for working on it. -- nosy: +therve __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1657 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1455] VS2008, quick hack for distutils.msvccompiler
zouguangxian added the comment: I succeed in building python26 with msvc 2005. I create a tool to convert pcbuild9 to pcbuild8. 1. delete pcbuild8 2. copy pcbuild9 to pcbuild8 3. run norm.py in pcbuild8, norm.py will change the format flag. Added file: http://bugs.python.org/file8994/norm.py __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1455 __# -*- coding: UTF-8 -*- # vim: noexpandtab:nolist:sw=4 ts=4 sts=4: # $Id$ import os import sys import re top = '.' for root, dirs, files in os.walk(top): for name in files: path, ext = os.path.splitext( name ) if not ( ext and ext.lower() in ['.vcproj', '.sln'] ): continue filename = os.path.normpath( os.path.join( root, name ) ) print filename fin = open( filename, 'r' ) lines = fin.read() lines = re.sub( r'Version=9,00', r'Version=8.00', lines) lines = re.sub( r'Format Version 10.00', r'Format Version 9.00', lines) lines = re.sub( r'Visual Studio 2008', r'Visual Studio 2005', lines) fin.close() fout = open( filename, 'w' ) fout.write(lines) fout.close() break ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1657] [patch] select.epoll wrapper for Linux 2.6 epoll()
Christian Heimes added the comment: For this patch, I don't see the benefit of putting it in the select module, instead of a separate module. Is there a specific reason? There is at least one, but probably several other modules named epoll or _epoll in the wild. These modules implement an epoll interface with Pyrex, ctypes or C. All of them have a slightly different API. I don't want to break 3rd party software. The select module already contains an interface to select and poll. IMO it's the best place. Looking at the code, I don't have many remarks. pyepoll_new may leak if epoll_create fails. I think that allowing threading around epoll_ctl is useless, but I may be wrong. Thanks, I've fixed the problem in pyepoll_new. The Linux kernel protects every call to epoll_ctl with a mutex. It *could* block and therefor I'm allowing threads around the epoll_ctl() call. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1657 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1660] Tests needing network flag?
New submission from Skip Montanaro: (third try at getting this bug report to submit by email.) While riding to work today I ran the test suite on trunk. The following tests failed due to lack of network connectivity: test_socket test_socket_ssl test_ssl test_urllib2 These tests should probably either require -u network or should themselves check to see if the network is available and skip those tests requiring network connectivity. In fact, regrtest.py's comments list test_socket_ssl as requiring the network resource. That seems to have regressed since 2.5 Simple patch attached. Skip -- files: network.diff messages: 58807 nosy: skip.montanaro severity: normal status: open title: Tests needing network flag? Added file: http://bugs.python.org/file8997/network.diff __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1660 __ network.diff Description: Binary data ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1659] Tests needing network flag?
New submission from Skip Montanaro: While riding to work today I ran the test suite on trunk. The following tests failed due to lack of network connectivity: test_socket test_socket_ssl test_ssl test_urllib2 These tests should probably either require -u network or should themselves check to see if the network is available and skip those tests requiring network connectivity. In fact, regrtest.py's comments list test_socket_ssl as requiring the network resource. That seems to have regressed since 2.5 Simple patch attached. Skip -- files: network.diff messages: 58806 nosy: skip.montanaro severity: normal status: open title: Tests needing network flag? Added file: http://bugs.python.org/file8996/network.diff __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1659 __ network.diff Description: Binary data ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1661] re.match ignores optional flags when receiving a compiled regex pattern
New submission from Brandon Corfman: Python's documentation for the re.match function is match(pattern, string, [flags]) where pattern can be either a regex string or a compiled regex object. If it's a compiled regex object, then supplying an optional flag to re.match (in my case, re.IGNORECASE) doesn't work and, more to the point, fails silently. I think this should throw an exception if it's not going to work. See http://mysite.verizon.net/bcorfman/2007/12/something-i-hate-about-pythons-re.html for a discussion. A possible change (proposed by effbot) is below: Index: re.py === --- re.py (revision 52330) +++ re.py (working copy) @@ -224,6 +224,7 @@ return p pattern, flags = key if isinstance(pattern, _pattern_type): +assert not flags return pattern if not sre_compile.isstring(pattern): raise TypeError, first argument must be string or compiled pattern -- components: Regular Expressions messages: 58808 nosy: bcorfman severity: normal status: open title: re.match ignores optional flags when receiving a compiled regex pattern type: behavior versions: Python 2.5 __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1661 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1660] Tests needing network flag?
Skip Montanaro added the comment: duplicate of 1659 -- resolution: - duplicate status: open - closed __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1660 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1623] Implement PEP-3141 for Decimal
Facundo Batista added the comment: I'm +1 to this change. As this does not negatively affect the behavior on Py2, for each part of the patch I propose: - decimal.py: incorporate them to the trunk - numbers.py: of course, in Py3 - test_decimal.py: incorporate this tests, activating them if in Py3 What do you think? __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1623 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1662] [patch] assert tp_traverse in PyType_GenericAlloc()
New submission from Bryan Silverthorn: Attached is a very short patch against r59568 which asserts tp_traverse on (the types of) objects allocated in PyType_GenericAlloc(). As far as I'm aware, tp_traverse should always be set at this point. Catching that error early, even if only in debug builds, would help to prevent bugs like http://bugzilla.gnome.org/show_bug.cgi?id=504337 . -- components: Interpreter Core files: bcs_typeobject_assert.patch messages: 58811 nosy: bsilverthorn severity: minor status: open title: [patch] assert tp_traverse in PyType_GenericAlloc() type: behavior versions: Python 2.6 Added file: http://bugs.python.org/file8998/bcs_typeobject_assert.patch __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1662 __Index: Objects/typeobject.c === --- Objects/typeobject.c (revision 59568) +++ Objects/typeobject.c (working copy) @@ -469,8 +469,10 @@ else (void) PyObject_INIT_VAR((PyVarObject *)obj, type, nitems); - if (PyType_IS_GC(type)) + if (PyType_IS_GC(type)) { + assert(type-tp_traverse); _PyObject_GC_TRACK(obj); + } return obj; } ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1623] Implement PEP-3141 for Decimal
Guido van Rossum added the comment: BTW abc.py and _abcoll.py have been backported to 2.6 already, I propose to backport numbers.py and test_abstract_numbers.py as well. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1623 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1657] [patch] select.epoll wrapper for Linux 2.6 epoll()
Changes by Christian Heimes: Removed file: http://bugs.python.org/file8992/trunk_select_epoll.patch __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1657 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1657] [patch] select.epoll wrapper for Linux 2.6 epoll()
Changes by Christian Heimes: __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1657 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1657] [patch] select.epoll wrapper for Linux 2.6 epoll()
Christian Heimes added the comment: I mistakenly removed the wrong message. Here is the original msg: The patch implements Linux's epoll interface (http://linux.die.net/man/4/epoll). My patch doesn't introduce a new module like http://bugs.python.org/issue1675118 and it wraps the epoll control fd in an object like Twisted's _epoll.pyd interface. My interface is almost identical to Twisted's API except for some names. I named my control function control instead of _control and the constants are all named select.EPOLL_SPAM instead of SPAM. Missing: Documentation __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1657 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1657] [patch] select.epoll wrapper for Linux 2.6 epoll()
Changes by Christian Heimes: Removed file: http://bugs.python.org/file8993/trunk_select_epoll2.patch __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1657 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1657] [patch] select.epoll wrapper for Linux 2.6 epoll()
Christian Heimes added the comment: Added license header to test_epoll. Some C code cleanups Added file: http://bugs.python.org/file8999/trunk_select_epoll3.patch __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1657 __Index: configure === --- configure (Revision 59566) +++ configure (Arbeitskopie) @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 59533 . +# From configure.in Revision: 59558 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for python 2.6. # @@ -5416,13 +5416,14 @@ + for ac_header in asm/types.h conio.h curses.h direct.h dlfcn.h errno.h \ fcntl.h grp.h \ io.h langinfo.h libintl.h ncurses.h poll.h process.h pthread.h \ shadow.h signal.h stdint.h stropts.h termios.h thread.h \ unistd.h utime.h \ -sys/audioio.h sys/bsdtty.h sys/file.h sys/loadavg.h sys/lock.h sys/mkdev.h \ -sys/modem.h \ +sys/audioio.h sys/bsdtty.h sys/epoll.h sys/file.h sys/loadavg.h sys/lock.h \ +sys/mkdev.h sys/modem.h \ sys/param.h sys/poll.h sys/select.h sys/socket.h sys/statvfs.h sys/stat.h \ sys/time.h \ sys/times.h sys/types.h sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \ @@ -15644,7 +15645,57 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo $as_me:$LINENO: checking for epoll 5 +echo $ECHO_N checking for epoll... $ECHO_C 6; } +cat conftest.$ac_ext _ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h conftest.$ac_ext +cat conftest.$ac_ext _ACEOF +/* end confdefs.h. */ +#include sys/epoll.h +int +main () +{ +void *x=epoll_create + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try=$ac_compile +case (($ac_try in + *\* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval echo \\$as_me:$LINENO: $ac_try_echo\) 5 + (eval $ac_compile) 2conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 conftest.err + rm -f conftest.er1 + cat conftest.err 5 + echo $as_me:$LINENO: \$? = $ac_status 5 + (exit $ac_status); } { + test -z $ac_c_werror_flag || + test ! -s conftest.err + } test -s conftest.$ac_objext; then +cat confdefs.h \_ACEOF +#define HAVE_EPOLL 1 +_ACEOF + + { echo $as_me:$LINENO: result: yes 5 +echo ${ECHO_T}yes 6; } +else + echo $as_me: failed program was: 5 +sed 's/^/| /' conftest.$ac_ext 5 + + { echo $as_me:$LINENO: result: no 5 +echo ${ECHO_T}no 6; } + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # On some systems (eg. FreeBSD 5), we would find a definition of the # functions ctermid_r, setgroups in the library, but no prototype # (e.g. because we use _XOPEN_SOURCE). See whether we can take their Index: configure.in === --- configure.in (Revision 59566) +++ configure.in (Arbeitskopie) @@ -1100,8 +1100,8 @@ io.h langinfo.h libintl.h ncurses.h poll.h process.h pthread.h \ shadow.h signal.h stdint.h stropts.h termios.h thread.h \ unistd.h utime.h \ -sys/audioio.h sys/bsdtty.h sys/file.h sys/loadavg.h sys/lock.h sys/mkdev.h \ -sys/modem.h \ +sys/audioio.h sys/bsdtty.h sys/epoll.h sys/file.h sys/loadavg.h sys/lock.h \ +sys/mkdev.h sys/modem.h \ sys/param.h sys/poll.h sys/select.h sys/socket.h sys/statvfs.h sys/stat.h \ sys/time.h \ sys/times.h sys/types.h sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \ @@ -2358,7 +2358,12 @@ AC_MSG_RESULT(yes), AC_MSG_RESULT(no) ) - +AC_MSG_CHECKING(for epoll) +AC_TRY_COMPILE([#include sys/epoll.h], void *x=epoll_create, + AC_DEFINE(HAVE_EPOLL, 1, Define if you have the 'epoll' functions.) + AC_MSG_RESULT(yes), + AC_MSG_RESULT(no) +) # On some systems (eg. FreeBSD 5), we would find a definition of the # functions ctermid_r, setgroups in the library, but no prototype # (e.g. because we use _XOPEN_SOURCE). See whether we can take their Index: Doc/library/select.rst === --- Doc/library/select.rst (Revision 59566) +++ Doc/library/select.rst (Arbeitskopie) @@ -7,10 +7,11 @@ This module provides access to the :cfunc:`select` and :cfunc:`poll` functions -available in most operating systems. Note that on Windows, it only works for -sockets; on other operating systems, it also works for other file types (in -particular, on Unix, it works on pipes). It cannot be used on regular files to -determine whether a file has grown since it was last read. +available in most operating systems and :cfunc:`epoll` available on Linux 2.5+. +Note that on Windows, it only works for sockets; on other operating systems, +it also works for other file types (in particular, on Unix, it works on pipes). +It cannot be used on regular files to determine whether a file has grown since +it was last read. The module defines the following: @@ -22,6 +23,16 @@ string, as would be printed by the C function :cfunc:`perror`.
[issue1662] [patch] assert tp_traverse in PyType_GenericAlloc()
Changes by Christian Heimes: -- keywords: +patch priority: - normal __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1662 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1658] RuntimeError: dictionary changed size during iteration in Tkinter
Christian Heimes added the comment: Yes, it sounds like a good idea. The patch should be applied to 2.6. -- keywords: +patch nosy: +tiran priority: - normal resolution: - accepted versions: +Python 2.6 __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1658 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1661] re.match ignores optional flags when receiving a compiled regex pattern
Changes by Raymond Hettinger: -- assignee: - rhettinger nosy: +rhettinger versions: +Python 2.6 -Python 2.5 __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1661 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1661] re.match ignores optional flags when receiving a compiled regex pattern
Raymond Hettinger added the comment: Fixed. See commit 59573. -- resolution: - fixed status: open - closed __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1661 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1549] Regression with __hash__ definition and rich comparison operators
Guido van Rossum added the comment: To be honest, I have no idea what pybots is, and how it's affected. Maybe you can get someone else interested in reviewing the code? I'm focusing mostly on Py3k. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1549 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1629] Py_Size() should be named Py_SIZE()
Guido van Rossum added the comment: FWIW, should PyUnicode_Check, PyTuple_Check etc. also change to PyUnicode_CHECK, PyTuple_CHECK etc because they are macros? While this would technically be the right thing to do, those macros have had a long and productive life before 2.6 so I'd rather be compatible. IOW no. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1629 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1583] Patch for signal.set_wakeup_fd
Guido van Rossum added the comment: Committed revision 59574. I added a simple C API as well, PySignal_SetWakeupFd(fd). Thanks all! -- resolution: - accepted status: open - closed __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1583 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1656] Make math.{floor,ceil}(float) return ints per PEP 3141
Changes by Guido van Rossum: -- assignee: - gvanrossum keywords: +patch nosy: +gvanrossum priority: - normal __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1656 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1179] [CVE-2007-4965] Integer overflow in imageop module
Guido van Rossum added the comment: Sigh. I'll try to make time to review apply this. -- assignee: - gvanrossum __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1179 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1663] Modification HTMLParser.py
New submission from diego: Hello my name is Diego, I needed to parse HTML to retrieve only text, but not grasped how to do it with class HTMLParser, so the change to do it. The code to use is: class ParsearHTML (HTMLParser.HTMLParser): def __init__(self,datos): HTMLParser.HTMLParser.__init__(self) self.feed(datos) self.close() def handle_data(self,data): return data parser = ParsearHTML(onTmp) data = parser.feed(onTmp) And changes in the class are attached. Thank you very much. Diego. -- components: None files: HTMLParser.py messages: 58821 nosy: diegorubenarias severity: normal status: open title: Modification HTMLParser.py type: resource usage versions: Python 2.4 Added file: http://bugs.python.org/file9000/HTMLParser.py __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1663 __A parser for HTML and XHTML. # This file is based on sgmllib.py, but the API is slightly different. # XXX There should be a way to distinguish between PCDATA (parsed # character data -- the normal case), RCDATA (replaceable character # data -- only char and entity references and end tags are special) # and CDATA (character data -- only end tags are special). import markupbase import re # Regular expressions used for parsing interesting_normal = re.compile('[]') interesting_cdata = re.compile(r'(/|\Z)') incomplete = re.compile('[a-zA-Z#]') entityref = re.compile('([a-zA-Z][-.a-zA-Z0-9]*)[^a-zA-Z0-9]') charref = re.compile('#(?:[0-9]+|[xX][0-9a-fA-F]+)[^0-9a-fA-F]') starttagopen = re.compile('[a-zA-Z]') piclose = re.compile('') commentclose = re.compile(r'--\s*') tagfind = re.compile('[a-zA-Z][-.a-zA-Z0-9:_]*') attrfind = re.compile( r'\s*([a-zA-Z_][-.:a-zA-Z_0-9]*)(\s*=\s*' r'(\'[^\']*\'|[^]*|[-a-zA-Z0-9./,:;+*%?!$\(\)[EMAIL PROTECTED]))?') locatestarttagend = re.compile(r [a-zA-Z][-.a-zA-Z0-9:_]* # tag name (?:\s+ # whitespace before attribute name (?:[a-zA-Z_][-.:a-zA-Z0-9_]* # attribute name (?:\s*=\s* # value indicator (?:'[^']*' # LITA-enclosed value |\[^\]*\# LIT-enclosed value |[^'\\s]+# bare value ) )? ) )* \s*# trailing whitespace , re.VERBOSE) endendtag = re.compile('') endtagfind = re.compile('/\s*([a-zA-Z][-.a-zA-Z0-9:_]*)\s*') class HTMLParseError(Exception): Exception raised for all parse errors. def __init__(self, msg, position=(None, None)): assert msg self.msg = msg self.lineno = position[0] self.offset = position[1] def __str__(self): result = self.msg if self.lineno is not None: result = result + , at line %d % self.lineno if self.offset is not None: result = result + , column %d % (self.offset + 1) return result class HTMLParser(markupbase.ParserBase): Find tags and other markup and call handler functions. Usage: p = HTMLParser() p.feed(data) ... p.close() Start tags are handled by calling self.handle_starttag() or self.handle_startendtag(); end tags by self.handle_endtag(). The data between tags is passed from the parser to the derived class by calling self.handle_data() with the data as argument (the data may be split up in arbitrary chunks). Entity references are passed by calling self.handle_entityref() with the entity reference as the argument. Numeric character references are passed to self.handle_charref() with the string containing the reference as the argument. CDATA_CONTENT_ELEMENTS = (script, style) def __init__(self): Initialize and reset this instance. self.reset() def reset(self): Reset this instance. Loses all unprocessed data. self.rawdata = '' self.lasttag = '???' self.interesting = interesting_normal markupbase.ParserBase.reset(self) Ultima Modificacion: Diego Arias 18/12/07 El metodo feed antiguamente no retornaba valor, ahora devuelve 'data' en donde se encuentra el texto sin tags html def feed(self, data): Feed data to the parser. Call this as often as you want, with as little or as much text as you want (may include '\n'). self.rawdata = self.rawdata + data data = self.goahead(0) return data def close(self): Handle any buffered data. self.goahead(1) def error(self, message): raise HTMLParseError(message, self.getpos()) __starttag_text = None def get_starttag_text(self): Return full source of start tag: '...'. return self.__starttag_text def set_cdata_mode(self): self.interesting = interesting_cdata def
[issue1664] nntplib is not IPv6-capable
New submission from Derek Morr: nntplib hardcodes AF_INET for the socket address family. This prevents it from using IPv6. Attached is a patch that converts NNTP.__init__() to use socket.create_connection(), which is IPv6-capable. -- components: Library (Lib) files: nntplib_ipv6.patch messages: 58822 nosy: dmorr severity: normal status: open title: nntplib is not IPv6-capable type: behavior versions: Python 2.6 Added file: http://bugs.python.org/file9001/nntplib_ipv6.patch __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1664 __ nntplib_ipv6.patch Description: Binary data ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1663] Modification HTMLParser.py
diego added the comment: -- Forwarded message -- From: diego [EMAIL PROTECTED] Date: 19-dic-2007 17:05 Subject: [issue1663] Modification HTMLParser.py To: [EMAIL PROTECTED] New submission from diego: Hello my name is Diego, I needed to parse HTML to retrieve only text, but not grasped how to do it with class HTMLParser, so the change to do it. The code to use is: class ParsearHTML (HTMLParser.HTMLParser): def __init__(self,datos): HTMLParser.HTMLParser.__init__(self) self.feed(datos) self.close() def handle_data(self,data): return data parser = ParsearHTML(onTmp) data = parser.feed(onTmp) And changes in the class are attached. Thank you very much. Diego. -- components: None files: HTMLParser.py messages: 58821 nosy: diegorubenarias severity: normal status: open title: Modification HTMLParser.py type: resource usage versions: Python 2.4 Added file: http://bugs.python.org/file9000/HTMLParser.py __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1663 __ Added file: http://bugs.python.org/file9002/unnamed Added file: http://bugs.python.org/file9003/HTMLParser.py __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1663 __brbr-- Forwarded message --brspan class=gmail_quoteFrom: b class=gmail_sendernamediego/b lt;a href=mailto:[EMAIL PROTECTED][EMAIL PROTECTED]/agt;brDate: 19-dic-2007 17:05 brSubject: [issue1663] Modification HTMLParser.pybrTo: a href=mailto:[EMAIL PROTECTED][EMAIL PROTECTED]/abrbr/spanbrNew submission from diego:brbrHello my name is Diego, I needed to parse HTML to retrieve only text, brbut not grasped how to do it with class HTMLParser, so the change to dobrit. The code to use is:brclass ParsearHTML (HTMLParser.HTMLParser):brbrnbsp;nbsp;nbsp;nbsp;def __init__(self,datos):brnbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;HTMLParser.HTMLParser.__init_ _(self)brnbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;self.feed(datos)brnbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;self.close()brbrnbsp;nbsp;nbsp;nbsp;def handle_data(self,data):brnbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;return databrbrparsernbsp;nbsp;= ParsearHTML(onTmp)brdata = parser.feed(onTmp)brAnd changes in the class are attached. Thank you very much. Diego. brbr--brcomponents: Nonebrfiles: HTMLParser.pybrmessages: 58821brnosy: diegorubenariasbrseverity: normalbrstatus: openbrtitle: Modification HTMLParser.pybrtype: resource usagebrversions: Python 2.4brAdded file: a href=http://bugs.python.org/file9000/HTMLParser.py;http://bugs.python.org/file9000/HTMLParser.py/abrbr__brTracker lt;a href=mailto:[EMAIL PROTECTED] [EMAIL PROTECTED]/agt;brlt;a href=http://bugs.python.org/issue1663;http://bugs.python.org/issue1663/agt;br__br A parser for HTML and XHTML. # This file is based on sgmllib.py, but the API is slightly different. # XXX There should be a way to distinguish between PCDATA (parsed # character data -- the normal case), RCDATA (replaceable character # data -- only char and entity references and end tags are special) # and CDATA (character data -- only end tags are special). import markupbase import re # Regular expressions used for parsing interesting_normal = re.compile('[]') interesting_cdata = re.compile(r'(/|\Z)') incomplete = re.compile('[a-zA-Z#]') entityref = re.compile('([a-zA-Z][-.a-zA-Z0-9]*)[^a-zA-Z0-9]') charref = re.compile('#(?:[0-9]+|[xX][0-9a-fA-F]+)[^0-9a-fA-F]') starttagopen = re.compile('[a-zA-Z]') piclose = re.compile('') commentclose = re.compile(r'--\s*') tagfind = re.compile('[a-zA-Z][-.a-zA-Z0-9:_]*') attrfind = re.compile( r'\s*([a-zA-Z_][-.:a-zA-Z_0-9]*)(\s*=\s*' r'(\'[^\']*\'|[^]*|[-a-zA-Z0-9./,:;+*%?!$\(\)[EMAIL PROTECTED]))?') locatestarttagend = re.compile(r [a-zA-Z][-.a-zA-Z0-9:_]* # tag name (?:\s+ # whitespace before attribute name (?:[a-zA-Z_][-.:a-zA-Z0-9_]* # attribute name (?:\s*=\s* # value indicator (?:'[^']*' # LITA-enclosed value |\[^\]*\# LIT-enclosed value |[^'\\s]+# bare value ) )? ) )* \s*# trailing whitespace , re.VERBOSE) endendtag = re.compile('') endtagfind = re.compile('/\s*([a-zA-Z][-.a-zA-Z0-9:_]*)\s*') class HTMLParseError(Exception): Exception raised for all parse errors. def __init__(self, msg, position=(None, None)): assert msg self.msg = msg self.lineno = position[0] self.offset = position[1] def __str__(self): result = self.msg if self.lineno is not None: result = result + , at line %d % self.lineno if self.offset is not None: result = result + , column %d %
[issue1609] test_re.py fails
Ismail Donmez added the comment: Python README says --with-wctype-functions is deprecated and will be removed in Python 2.6 , I don't think its worth to fix it now. Also test failures with --with-wctype-functions is seems to be known according to Google. What I wonder if removing --with-wctype-functions causes any regressions under Turkish locale. I will do some research on that. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1609 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1609] test_re.py fails
Ismail Donmez added the comment: Indeed there seems to be regressions: Python 2.4 : [~] python Python 2.4.4 (#1, Oct 23 2007, 11:25:50) [GCC 3.4.6] on linux2 Type help, copyright, credits or license for more information. import locale locale.setlocale(locale.LC_ALL,) 'tr_TR.UTF-8' print unicode() print unicode().upper() print unicode(i).upper() İ print unicode(İ).lower() i print unicode(III).lower() ııı Python 2.5 (incorrect) : import locale locale.setlocale(locale.LC_ALL,) 'tr_TR.UTF-8' print unicode(i).upper() I print unicode().upper() Traceback (most recent call last): File stdin, line 1, in module UnicodeDecodeError: 'ascii' codec can't decode byte 0xc4 in position 0: ordinal not in range(128) print unicode().upper() Looks like wctypes should not be dropped. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1609 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1609] test_re.py fails
Ismail Donmez added the comment: Situation is even more complicated, following functions behave _correctly_ when wctypes is enabled : print unicode(i).upper() İ print unicode().lower() Following doesn't work even if wctypes is enabled : print unicode().upper() Traceback (most recent call last): File stdin, line 1, in module UnicodeDecodeError: 'ascii' codec can't decode byte 0xc4 in position 0: ordinal not in range(128) print unicode(İ).lower() Traceback (most recent call last): File stdin, line 1, in module UnicodeDecodeError: 'ascii' codec can't decode byte 0xc4 in position 0: ordinal not in range(128) All of these four calls works fine in python 2.4 when wctypes is enabled. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1609 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1655] imaplib is not IPv6-capable
Derek Morr added the comment: I think it makes more sense to use socket.create_connection(), which performs the getaddrinfo call. It makes the patch against imaplib more compact. I've attached a new patch that uses create_connection() Added file: http://bugs.python.org/file9004/imaplib_ipv6.patch __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1655 __ imaplib_ipv6.patch Description: Binary data ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1179] [CVE-2007-4965] Integer overflow in imageop module
James Antill added the comment: I've applied the last patch I posted to recent RHEL and Fedora releases, and it doesn't seem to break anything ... and from what I could see it fixed the problem. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1179 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1179] [CVE-2007-4965] Integer overflow in imageop module
Ismail Donmez added the comment: Same here for Pardus Linux, applied the patch without a regression. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1179 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1659] Tests needing network flag?
Changes by Brett Cannon: -- assignee: - brett.cannon nosy: +brett.cannon __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1659 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1609] test_re.py fails
Guido van Rossum added the comment: Martin, can you have a look at this? Cartman, can you produce a unittest for the correct behavior that only uses ASCII input (using \u instead of just typing Turkish characters)? -- assignee: - loewis nosy: +loewis __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1609 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1609] test_re.py fails
Ismail Donmez added the comment: So in conclusion, - Enabling wctypes makes Turkish support work with \u syntax, breaks unicode() - Disabling wctypes breaks Turkish support with \u and/or unicode() Attached test.py tests Turkish corner cases of lower()/upper() . Correct output is which python 2.4 gives : Following should print I I Following should print i i Following should print İ İ Following should print ı ı Added file: http://bugs.python.org/file9006/test.py __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1609 __#!/usr/bin/python # -*- coding: utf-8 -*- import locale locale.setlocale(locale.LC_ALL,tr_TR.UTF-8) print Following should print I try: print u\u0131.upper() except UnicodeDecodeError: print Got a unicode decode error print Following should print i try: print u\u0130.lower() except UnicodeDecodeError: print Got a unicode decode error print uFollowing should print Ä° try: print ui.upper() except UnicodeDecodeError: print Got a unicode decode error print uFollowing should print ı try: print uI.lower() except UnicodeDecodeError: print Got a unicode decode error ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1609] test_re.py fails
Guido van Rossum added the comment: Hm. The test2.py file, when I download it, contains the two bytes \xc4\xb1 in the first unicode() call, and \xc4\xb0 in the second one. This is *always* supposed to produce a UnicodeDecodeError, since it would use the default encoding which is ASCII. So I don't understand how you get this to pass with 2.4 at all. When you replace the arguments with these hex escapes, does it still pass for you? Or does that break it? __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1609 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1609] test_re.py fails
Ismail Donmez added the comment: Replacing Turkish characters with hex versions in test2.py still results in UnicodeDecodeError and works with python 2.4. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1609 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1609] test_re.py fails
Guido van Rossum added the comment: Replacing Turkish characters with hex versions in test2.py still results in UnicodeDecodeError and works with python 2.4. I'm hoping Martin can confirm this, but I suspect that this is due to a tightening of the rules for converting from 8-bit strings to unicode strings. What happens if you change to unicode(, utf-8)? __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1609 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1549] Regression with __hash__ definition and rich comparison operators
Guido van Rossum added the comment: Committed revision 59576. I found some time. Happy pybotting! -- resolution: - accepted status: open - closed __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1549 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1665] re.match.func_code.co_filename returns re.py
Changes by thekorn: -- components: None nosy: thekorn severity: normal status: open title: re.match.func_code.co_filename returns re.py type: behavior versions: Python 2.5 __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1665 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1609] test_re.py fails
Ismail Donmez added the comment: Ok that was because we had modified default encoding in Lib/site.py to be utf-8. Sorry! The only problem left is last 2 conversions in test.py gives wrong results when wctypes is disabled, that is : print u\u0069.upper() should give \u0130 (LATIN CAPITAL LETTER I WITH DOT ABOVE) print u\u0049.lower() should give \u0131 (LATIN SMALL LETTER DOTLESS I) These transformations work fine with python2.5 when --with-wctype-functions is used. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1609 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1665] re.match.func_code.co_filename returns re.py
New submission from thekorn: re.match.func_code.co_filename returns re.py I expect something like /usr/lib/python2.5/re.py This causes issues in the inspect-module like: inspect.getabsfile(re.match) 'current-dir/re.py' Sorry, this is my first python-bugreport, please ping me if you need any further details. Markus __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1665 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1515] deepcopy doesn't copy instance methods
Guido van Rossum added the comment: I disagree that this would be harmless; this was excluded intentionally. A (bound) method contains an instance which definitely represents state and calling the method can easily mutate that state. This is different from classes (which could contain state) or modules (which almost certainly contain state) or functions (which could mutate global state) -- in all those cases, we're talking about singleton state, for which it makes sense not to create a clone. But for methods, we're talking about instances, of which there could be many, and I believe those should be properly copied or refused, rather than creating accidental state sharing between the original and its deep copy. I suppose you have a specific use case in mind. Can't you solve that by adding a __deepcopy__ method to some object? -- nosy: +gvanrossum __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1515 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1665] re.match.func_code.co_filename returns re.py
Guido van Rossum added the comment: I can't reproduce this. How did you install Python? Python 2.5.2a0 (release25-maint, Nov 27 2007, 14:00:00) [GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5)] on linux2 Type help, copyright, credits or license for more information. import re re.match.func_code.co_filename '/usr/local/lib/python2.5/re.py' -- nosy: +gvanrossum __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1665 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1665] re.match.func_code.co_filename returns re.py
thekorn added the comment: Thanks for your fast reply. I'm using the python package of ubuntu-feisty, $ python Python 2.5.1 (r251:54863, Oct 5 2007, 13:50:07) [GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2 Type help, copyright, credits or license for more information. import re re.match.func_code.co_filename 're.py' So maybe it's ubuntu-specific!? __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1665 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1637] urlparse.urlparse misparses URLs with query but no path
John Nagle added the comment: I tried downloading the latest rev of urlparse.py (59480) and it flunked its own unit test, urlparse.test() Two test cases fail. So I don't want to try to fix the module until the last people to change it fix their unit test problems. The fix I provided should fix the problem I reported, but I'm not sure if there's anything else wrong, since it flunks its unit test. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1637 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1609] test_re.py fails
Guido van Rossum added the comment: print u\u0069.upper() should give \u0130 (LATIN CAPITAL LETTER I WITH DOT ABOVE) print u\u0049.lower() should give \u0131 (LATIN SMALL LETTER DOTLESS I) These transformations work fine with python2.5 when --with-wctype-functions is used. I think that is rather a bug in the wctype functions. Those are ASCII letters 'i' and 'I' and their upper/lower versions are fixed by the Unicode standard to be the corresponding ASCII letters ('I' and 'i'). The Unicode case conversions are not affected by locale. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1609 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1609] test_re.py fails
Ismail Donmez added the comment: But it should be affected by locale, thats the point of locale.setlocale call. This is how libc's wc functions behave. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1609 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1665] re.match.func_code.co_filename returns re.py
Guido van Rossum added the comment: Then I suggest you talk to the Ubuntu developers or whoever packaged Python 2.5.1 for it. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1665 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1637] urlparse.urlparse misparses URLs with query but no path
Guido van Rossum added the comment: I tried downloading the latest rev of urlparse.py (59480) and it flunked its own unit test, urlparse.test() Two test cases fail. That's not the official test -- that code should probably be deleted. The real test is in Lib/test/test_urlparse.py. Please ignore that test. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1637 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1609] test_re.py fails
Guido van Rossum added the comment: But it should be affected by locale, thats the point of locale.setlocale call. This is how libc's wc functions behave. No, the locale should only affect 8-bit string operations, never unicode operations. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1609 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1609] test_re.py fails
Ismail Donmez added the comment: Ok then what is the suggested way to get back the Turkish way of doing upper/lower on i I ? __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1609 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1609] test_re.py fails
Guido van Rossum added the comment: Ok then what is the suggested way to get back the Turkish way of doing upper/lower on i I ? That's a question for Martin von Loewis. I suppose you could use 8-bit strings exclusively. Or you could use .translate() with a custom dict. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1609 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1664] nntplib is not IPv6-capable
Changes by Giampaolo Rodola': -- nosy: +giampaolo.rodola __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1664 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1455] VS2008, quick hack for distutils.msvccompiler
Amaury Forgeot d'Arc added the comment: I already do the same: pcbuild9 is easy to convert to vs2005, and the project is much better than the current pcbuild8. What do the others think? Should we update pcbuild8 with the content of pcbuild9, with the few changes proposed by weck? Or simply remove pcbuild8 and propose vs2005 users to run the attached script? -- nosy: +amaury.forgeotdarc __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1455 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1515] deepcopy doesn't copy instance methods
Michael Van Biesbrouck added the comment: I am implementing a library that makes extensive use of delayed executions represented by functions. Copying objects both with and without shared state referenced by the functions is important. There is one entry point where I would expect functions to go. On the other hand, I can't prevent users from taking an instance method and wrapping it inside of a callable object that lacks an appropriate __deepcopy__ method (this would be a sensible thing to do, in fact). I don't mind whether instance methods have shallow or deep copies as long as I can document the result. Neither invasive use of __deepcopy__ nor throwing an exception is suitable for my use. For reference, the exception is TypeError: instancemethod expected at least 2 arguments, got 0 Ideally, deepcopy() and pickle() would copy the internals of all function types and I could implement shared mutable state by using __deepcopy__ in a single class. I assume that this is unreasonable to implement. No matter the implementation, I think that there should be some way of running deepcopy() on all primitive types without throwing exceptions. I can see use cases where throwing exceptions for all types that can't be deeply copied would be useful and disabling __deepcopy__ might be important. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1515 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1666] integer subclass range behavior
New submission from Joseph Armbruster: I was wondering what would happen, so I tried this out for the heck of it with: Python 3.0a2 (py3k:59572M, Dec 19 2007, 15:54:07) [MSC v.1500 32 bit (Intel)] on win32 class a(int): def __new__(cls,number): return int.__new__(cls,number) for x in range(0,a(5)): print(x) This resulted in a: Traceback (most recent call last): File stdin, line 1, in module File a.py, line 5, in module for x in range(0,a(5)): SystemError: ..\Objects\longobject.c:400: bad argument to internal function [41030 refs] It looks like the rangeobject performs a FitsInLong test on each of the parameters to range, which uses the function _PyLong_FitsInLong(PyObject *vv) within longobject.c. In tern, this performs a typecheck: #define PyLong_CheckExact(op) (Py_TYPE(op) == PyLong_Type) that fails. -- components: Interpreter Core messages: 58852 nosy: JosephArmbruster severity: normal status: open title: integer subclass range behavior type: crash versions: Python 3.0 __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1666 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1666] integer subclass range behavior
Changes by Joseph Armbruster: -- type: crash - behavior __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1666 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1666] integer subclass range behavior
Guido van Rossum added the comment: Martin, I'm asking you because according to svn blame I copied this from the int/long integration branch last January. I looked at the code of _PyLong_FitsInLong(), and I don't understand why it wants an exact integer. The code if (!PyLong_CheckExact(vv)) { PyErr_BadInternalCall(); return 0; } can just be omitted IMO, to make this problem go away. There's no documentation for this function, and the only user (rangeobject.c()) never checks for an error... -- assignee: - loewis nosy: +gvanrossum, loewis __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1666 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1515] deepcopy doesn't copy instance methods
Guido van Rossum added the comment: I'll take this off line. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1515 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1665] re.match.func_code.co_filename returns re.py
Christian Heimes added the comment: I'm able to reproduce the problem on Ubuntu. It's probably caused by their compile step in python2.5.postinst: cd /usr/lib/python2.5 files=$(dpkg -L python2.5 | sed -n '/\.py$/s,^/usr/lib/python2.5/,,p') /usr/bin/python2.5 /usr/lib/python2.5/py_compile.py $files if grep -sq '^byte-compile[^#]*optimize' /etc/python/debian_config; then /usr/bin/python2.5 -O /usr/lib/python2.5/py_compile.py $files fi It's compiling the py files relative to /usr/lib/python2.5. Please note that the behavior of py_compile.py is intended. The relative path is useful for people who pack the compiled files into a zip file or egg file. -- nosy: +tiran resolution: - works for me status: open - pending __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1665 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1664] nntplib is not IPv6-capable
Changes by Christian Heimes: -- keywords: +patch priority: - normal __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1664 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1665] re.match.func_code.co_filename returns re.py
Guido van Rossum added the comment: Well, if they do that, they apparently break inspect.py. Should they be doing that? Why are they doing that? Can you contact the Ubuntu folks about this? __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1665 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1667] license() does not process keyboard input correctly
New submission from Joseph Armbruster: url: http://svn.python.org/projects/python/branches/py3k rev: 59577 The license() function does not appear to process keyboard input correctly. Symptoms: - Carriage returns do not move license pages downwards - q option did not quit Patch to site.py attached. -- components: Documentation files: licensepatch.patch messages: 58857 nosy: JosephArmbruster severity: normal status: open title: license() does not process keyboard input correctly type: behavior versions: Python 3.0 Added file: http://bugs.python.org/file9007/licensepatch.patch __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1667 __ licensepatch.patch Description: Binary data ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1623] Implement PEP-3141 for Decimal
Jeffrey Yasskin added the comment: Are you guys suggesting the backport before or after checking this in to the py3k branch? Either's fine with me. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1623 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1668] -E command line parameter intent
New submission from Joseph Armbruster: url: http://svn.python.org/projects/python/branches/py3k rev: 59577 The intent of the -E command line parameter is not entirely clear from it's description. If it implies that All environment variables will be ignored then this is not currently the case. If it implies that a few select environment variables will be ignored, then this is partially the case. See the attached patch for the potentially odd cases. -- components: Interpreter Core files: getenvpatch.patch messages: 58859 nosy: JosephArmbruster severity: normal status: open title: -E command line parameter intent type: behavior versions: Python 3.0 Added file: http://bugs.python.org/file9008/getenvpatch.patch __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1668 __ getenvpatch.patch Description: Binary data ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1665] re.match.func_code.co_filename returns re.py
Christian Heimes added the comment: Guido van Rossum wrote: Guido van Rossum added the comment: Well, if they do that, they apparently break inspect.py. Should they be doing that? Why are they doing that? Can you contact the Ubuntu folks about this? No, they shouldn't. It may be plain ignorance or they have a hidden agenda. I'm going to contact the Debian maintainers. I'm sure the Ubuntu guys have copied the behavior from Debian. Christian __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1665 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1609] test_re.py fails
Martin v. Löwis added the comment: I think too many issues get mixed in this report. I would like to ignore all but one issue, but I don't understand what the one issue is that this report should deal with. cartman, when you compare Python 2.4 and 2.5, could it be that the 2.4 Python was compiled --with-wctype-functions, and the 2.5 Python --without-wctype-functions? That would surely explain the difference. The Unicode lower/upper implementations are, by default, locale-inaware. That is correct behavior, and by design. If you want locale-dependent behavior, use 8-bit strings as Guido says. ISTM that the original report was resolved - the tests don't support --with-wctype-functions. This is because they assume that they know that LATIN CAPITAL LETTER A WITH DIAERESIS is a letter - which may not be the case if the isletter test is locale-specific. If this is too be fixed, the proper fix would be to just remove the test, which I advise against - instead, the best behavior that Python should implement is the current one, i.e. it is a good thing that the test fails --with-wctype-functions. Perhaps a comment should be attached explaining the potential breakage. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1609 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1665] re.match.func_code.co_filename returns re.py
Christian Heimes added the comment: I proposed to the maintainer that he should change one line to dpkg -L python2.5 | sed -n '/\.py$/p' In the mean time you can easily fix the issue with: sudo find /usr/lib/python2.5 -name '*.py[co]' -delete sudo python2.5 /usr/lib/python2.5/compileall.py /usr/lib/python2.5/ sudo python2.5 -O /usr/lib/python2.5/compileall.py /usr/lib/python2.5/ __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1665 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1646] Make socket support TIPC.
Alberto Bertogli added the comment: On Tue, Dec 18, 2007 at 07:10:39PM -, Guido van Rossum wrote: Guido van Rossum added the comment: I'm okay with adding this, it doesn't add much code and is properly safeguarded by #ifdefs and has a configure.in patch. Thanks! Is there anything else I need to do in order to get this ready for inclusion? Thanks again, Alberto __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1646 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com