[issue7700] -3 flag does not work anymore

2010-01-14 Thread Florent Xicluna
New submission from Florent Xicluna la...@yahoo.fr: The -3 flag no longer works with Python 2.7. ~ $ ./python -3 -c 'print 1 2, {}.has_key(3)' True False On python 2.6: ~ $ ./python -3 -c 'print 1 2, {}.has_key(3)' string:1: DeprecationWarning: not supported in 3.x; use != -c:1:

[issue7700] -3 flag does not work anymore

2010-01-14 Thread Florent Xicluna
Changes by Florent Xicluna la...@yahoo.fr: -- components: +Interpreter Core type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7700 ___

[issue7700] -3 flag does not work anymore

2010-01-14 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: Now that the DeprecationWarnings are silenced by default (see #7319) -3 should imply -Wd in order to work. ./python -3 -Wd -c 'print 1 2, {}.has_key(3)' string:1: DeprecationWarning: not supported in 3.x; use != -c:1: DeprecationWarning:

[issue1068268] subprocess is not EINTR-safe

2010-01-14 Thread David Oxley
David Oxley pyt...@psi.epsilon.org.uk added the comment: Another instance of a blocking function within subprocess not being protected against EINTR Python 2.6.4, subprocess.py, Popen function, line 1115: data = os.read(errpipe_read, 1048576) # Exceptions limited to 1 MB If a signal arrives

[issue7700] -3 flag does not work anymore

2010-01-14 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: Here's a patch. I'm not sure the approach is correct but it seems to fix at least the problem with ./python -3 -c 'print 1 2, {}.has_key(3)'. -- keywords: +patch nosy: +brett.cannon stage: needs patch - patch review Added file:

[issue7700] -3 flag does not work anymore

2010-01-14 Thread Florent Xicluna
Florent Xicluna la...@yahoo.fr added the comment: The undocumented -b flag behaves correctly. I would suggest to implement it the same way. ~ $ ./python -b -c bytearray('') == u'' -c:1: BytesWarning: Comparsion between bytearray and string (By the way, this feature is not documented in --help,

[issue7700] -3 flag does not work anymore

2010-01-14 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- priority: high - release blocker ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7700 ___ ___

[issue7701] fix output string length for binascii.b2a_uu()

2010-01-14 Thread STINNER Victor
New submission from STINNER Victor victor.stin...@haypocalc.com: binascii_b2a_uu() estimate the output string length using 2+bin_len*2. It's almost correct... except for bin_len=1. The result is a memory write into unallocated memory: $ ./python -c import binascii; binascii.b2a_uu('x')

[issue7701] fix output string length for binascii.b2a_uu()

2010-01-14 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: [len(binascii.b2a_uu(x*bin_len)) for bin_len in xrange(10)] [2, 6, 6, 6, 10, 10, 10, 14, 14, 14] [(2+(bin_len+2)*4//3) for bin_len in xrange(10)] [4, 6, 7, 8, 10, 11, 12, 14, 15, 16] How is this the correct estimation? The results

[issue7702] Wrong order of parameters of _get_socket in SMTP class in smtplib.py

2010-01-14 Thread alito
New submission from alito al...@organicrobot.com: Trivial change with (almost) no effect. The method signature for _get_socket in the SMTP class in stmplib.py is def _get_socket(self, port, host, timeout) It should be: def _get_socket(self, host, port, timeout) Evidence: 1) It calls

[issue7700] -3 flag does not work anymore

2010-01-14 Thread Florent Xicluna
Florent Xicluna la...@yahoo.fr added the comment: A variant, which mimics BytesWarning implementation. -- Added file: http://bugs.python.org/file15872/issue7700_variant.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7700

[issue7632] dtoa.c: oversize b in quorem

2010-01-14 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Bug 6 is indeed a bug: an example incorrectly-rounded string is:

[issue7701] fix output string length for binascii.b2a_uu()

2010-01-14 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: How is this the correct estimation? The results are different. The estimation have be bigger or equal, but not smaller. Try the following: [(2+(bin_len+2)//3*4) for bin_len in xrange(10)] [2, 6, 6, 6, 10, 10, 10, 14, 14, 14]

[issue7703] Replace buffer()--memoryview() in Lib/ctypes/test/

2010-01-14 Thread Florent Xicluna
New submission from Florent Xicluna la...@yahoo.fr: In order to upgrate the tests for ctypes, following changes are required: - binascii.hexlify should accept memoryview() objects - the ctypes character buffer should accept assignment of memoryview() objects using their raw property Then we

[issue7703] Replace buffer()--memoryview() in Lib/ctypes/test/

2010-01-14 Thread Florent Xicluna
Changes by Florent Xicluna la...@yahoo.fr: -- keywords: +patch Added file: http://bugs.python.org/file15874/issue7703_binascii_memoryview.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7703

[issue7703] Replace buffer()--memoryview() in Lib/ctypes/test/

2010-01-14 Thread Florent Xicluna
Changes by Florent Xicluna la...@yahoo.fr: Added file: http://bugs.python.org/file15875/issue7703_ctypes_memoryview.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7703 ___

[issue7703] Replace buffer()--memoryview() in Lib/ctypes/test/

2010-01-14 Thread Florent Xicluna
Florent Xicluna la...@yahoo.fr added the comment: Patches attached: - partial backport of Modules/binascii.c - partial backport of Modules/_ctypes/_ctypes.c (preserving 2.3 compat.) - update ctypes tests (buffer - memoryview) -- assignee: - theller components: +ctypes nosy: +theller

[issue7632] dtoa.c: oversize b in quorem

2010-01-14 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Bug 4 fixed in r77492. This just leaves bugs 5 and 7; I have a fix for these in the works. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7632

[issue7703] Replace buffer()--memoryview() in Lib/ctypes/test/

2010-01-14 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Does binascii still work with array.array objects? Also, there should be additional tests for compatibility of binascii with memoryview objects. -- nosy: +pitrou ___ Python tracker

[issue3299] Direct calls to PyObject_Del/PyObject_DEL are broken for --with-pydebug

2010-01-14 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +pitrou stage: - patch review versions: +Python 3.2 -Python 3.0 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3299 ___

[issue7703] Replace buffer()--memoryview() in Lib/ctypes/test/

2010-01-14 Thread Florent Xicluna
Florent Xicluna la...@yahoo.fr added the comment: Additional tests for binascii. -- Added file: http://bugs.python.org/file15877/issue7703_test_binascii.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7703

[issue7632] dtoa.c: oversize b in quorem

2010-01-14 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Tests committed in r77493. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7632 ___ ___

[issue7632] dtoa.c: oversize b in quorem

2010-01-14 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Fixes and tests so far merged to py3k in r77494, release31-maint in r77496. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7632 ___

[issue7703] Replace buffer()--memoryview() in Lib/ctypes/test/

2010-01-14 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Please be careful with the coding style. Stuff like: + if (_PyString_Resize(rv, 2*out_len) 0) \ + { Py_DECREF(rv); PyBuffer_Release(pin); return NULL; } \ should be spread out on several lines.

[issue7703] Replace buffer()--memoryview() in Lib/ctypes/test/

2010-01-14 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: I've now committed the binascii patch + tests to trunk, and merged the tests into py3k. Note: binascii_a2b_hqx() still uses the t# argument specifier in py3k as well as in trunk, this would deserve a separate patch. --

[issue7703] Replace buffer()--memoryview() in Lib/ctypes/test/

2010-01-14 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: Removed file: http://bugs.python.org/file15877/issue7703_test_binascii.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7703 ___

[issue7703] Replace buffer()--memoryview() in Lib/ctypes/test/

2010-01-14 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: Removed file: http://bugs.python.org/file15874/issue7703_binascii_memoryview.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7703 ___

[issue3299] Direct calls to PyObject_Del/PyObject_DEL are broken for --with-pydebug

2010-01-14 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Victor, your overflow test in the sre patch tests for TypeError, but OverflowError is actually raised: == ERROR: test_dealloc (test.test_re.ReTests)

[issue7701] fix output string length for binascii.b2a_uu()

2010-01-14 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: The patch doesn't apply cleanly against trunk (due to today's commits I fear, sorry). Also, it would be nice to add a test. -- ___ Python tracker rep...@bugs.python.org

[issue3299] Direct calls to PyObject_Del/PyObject_DEL are broken for --with-pydebug

2010-01-14 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Victor, your overflow test in the sre patch tests for TypeError, but OverflowError is actually raised: (...) Oops, fixed. -- Added file: http://bugs.python.org/file15878/sre_py_decref-2.patch

[issue3299] Direct calls to PyObject_Del/PyObject_DEL are broken for --with-pydebug

2010-01-14 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: Removed file: http://bugs.python.org/file10891/_sre-2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3299 ___

[issue3299] Direct calls to PyObject_Del/PyObject_DEL are broken for --with-pydebug

2010-01-14 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: Removed file: http://bugs.python.org/file15862/sre_py_decref.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3299 ___

[issue7701] fix output string length for binascii.b2a_uu()

2010-01-14 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: The patch doesn't apply cleanly against trunk Because of r77497 (issue #770). No problem, here is the new patch. I'm now using a git-svn repository to keep all my patches. It's much easier to update them to trunk ;-) Also, it

[issue7701] fix output string length for binascii.b2a_uu()

2010-01-14 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: Removed file: http://bugs.python.org/file15871/binascii_b2a_uu_length.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7701 ___

[issue7701] fix output string length for binascii.b2a_uu()

2010-01-14 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: Removed file: http://bugs.python.org/file15873/binascii_b2a_uu_length-2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7701 ___

[issue3299] Direct calls to PyObject_Del/PyObject_DEL are broken for --with-pydebug

2010-01-14 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: Added file: http://bugs.python.org/file15880/_curses_panel_py_decref.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3299 ___

[issue3299] Direct calls to PyObject_Del/PyObject_DEL are broken for --with-pydebug

2010-01-14 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Update _curses_panel patch. The crash occurs if malloc() fail in insert_lop(). I don't know how to write reliable test for this case. Maybe using http://www.nongnu.org/failmalloc/ library (a little bit overkill, isn't it?).

[issue3299] Direct calls to PyObject_Del/PyObject_DEL are broken for --with-pydebug

2010-01-14 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: The sre patch has been committed, thank you! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3299 ___

[issue3299] Direct calls to PyObject_Del/PyObject_DEL are broken for --with-pydebug

2010-01-14 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: Removed file: http://bugs.python.org/file15878/sre_py_decref-2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3299 ___

[issue3299] Direct calls to PyObject_Del/PyObject_DEL are broken for --with-pydebug

2010-01-14 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: I don't know how to write reliable test for this case. Maybe using http://www.nongnu.org/failmalloc/ library (a little bit overkill, isn't it?). Yes, it would IMO be overkill. -- ___ Python

[issue3299] Direct calls to PyObject_Del/PyObject_DEL are broken for --with-pydebug

2010-01-14 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: Removed file: http://bugs.python.org/file10892/_curses_panel.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3299 ___

[issue3299] Direct calls to PyObject_Del/PyObject_DEL are broken for --with-pydebug

2010-01-14 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Update pyexpat patch. As _curses_panel, the bug is raised on malloc() failure. The patch adds also a dummy test on ExternalEntityParserCreate(). -- Added file: http://bugs.python.org/file15881/pyexpat_py_decref.patch

[issue2375] PYTHON3PATH environment variable to supersede PYTHONPATH for multi-Python environments

2010-01-14 Thread Marc-Andre Lemburg
Marc-Andre Lemburg m...@egenix.com added the comment: Guido pronounced on this on python-dev, so closing the request again. -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2375

[issue7610] Cannot use both read and readline method in same ZipExtFile object

2010-01-14 Thread Nir Aides
Nir Aides n...@winpdb.org added the comment: I uploaded an update for Python 2.7. * you should probably write `n = sys.maxsize` instead of `n = 1 31 - 1` sys.maxsize is 64 bit number on my system but the maximum value accepted by zlib's decompress() seems to be INT_MAX defined in pyport.h

[issue7700] -3 flag does not work anymore

2010-01-14 Thread Brett Cannon
Brett Cannon br...@python.org added the comment: Fixed in r77505. I tweaked both patches slightly to minimize the special casing. Thanks for the help, guys! -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___

[issue7704] Math calculation problem (1.6-1.0)0.6, python said TRUE

2010-01-14 Thread pedro flores
New submission from pedro flores pflore...@gmail.com: this simple comparison (1.6-1.0)0.6 , python answer TRUE, and that isnt true. -- components: Windows files: bug.py messages: 97785 nosy: DhaReaL severity: normal status: open title: Math calculation problem (1.6-1.0)0.6, python said

[issue7704] Math calculation problem (1.6-1.0)0.6, python said TRUE

2010-01-14 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: This is not a bug: Python, like many other computer languages, stores floats in binary. The values 1.6 and 0.6 aren't exactly representable in the internal format used, so the stored versions of 1.6 and 0.6 are actually just very close

[issue1947] Exception exceptions.AttributeError '_shutdown' in module 'threading'

2010-01-14 Thread Christopher Nelson
Christopher Nelson nadiasver...@gmail.com added the comment: I also experience this problem. However, I experience it with a version of Python 2.4 that has had http://bugs.python.org/file10154/nondaemon_thread_shutdown.diff applied. We have a custom 2.4 build that builds using MS VS 2K5.

[issue2504] Add gettext.pgettext() and variants support

2010-01-14 Thread David D Lowe
David D Lowe daviddlowe.fl...@gmail.com added the comment: Same here. -- nosy: +Flimm ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2504 ___ ___

[issue7704] Math calculation problem (1.6-1.0)0.6, python said TRUE

2010-01-14 Thread pedro flores
pedro flores pflore...@gmail.com added the comment: kk, then i cannot use this comparison?, and this not happen with8.6-80.6 this is false, according to python. 2010/1/14 Mark Dickinson rep...@bugs.python.org Mark Dickinson dicki...@gmail.com added the comment: This is not a bug:

[issue1559298] test_popen fails on Windows if installed to Program Files

2010-01-14 Thread Brian Curtin
Brian Curtin cur...@acm.org added the comment: This has come up recently and Martin's approach seems to work. I updated his patch for trunk, and test_popen passes when I run it with and without a space in the path. Russ Gibson's suggestion was already applied to test_popen, so the only code

[issue1559298] test_popen fails on Windows if installed to Program Files

2010-01-14 Thread Brian Curtin
Brian Curtin cur...@acm.org added the comment: Here is a py3k version of the previous patch. os.popen is implemented using subprocess.Popen, so the quoting change was made there. -- Added file: http://bugs.python.org/file15886/issue1559298_py3k.diff

[issue3299] Direct calls to PyObject_Del/PyObject_DEL are broken for --with-pydebug

2010-01-14 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Patch for cElementTree: * Replace PyObject_Del() by Py_DECREF() * Catch element_new_extra() errors * parser dealloc: replace Py_DECREF() by Py_XDECREF() because the pointer may be NULL (error in the constructor) * set all parser

[issue7704] Math calculation problem (1.6-1.0)0.6, python said TRUE

2010-01-14 Thread Tim Peters
Tim Peters tim.pet...@gmail.com added the comment: You can use the comparison, provided you understand what it does, and that it does NOT do what you hoped it would do. Here: 1.6 - 1.0 0.60009 That shows quite clearly that subtracting 1 from the binary approximation to 1.6 does

[issue1754] WindowsError messages are not properly encoded

2010-01-14 Thread Naoki INADA
Naoki INADA songofaca...@gmail.com added the comment: I think WindowsError's message should be English like other errors. FormatMessageW() function can take dwLanguageId parameter. So I think Python should pass `MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US)` to the parameter. -- nosy:

[issue3299] Direct calls to PyObject_Del/PyObject_DEL are broken for --with-pydebug

2010-01-14 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: Removed file: http://bugs.python.org/file10893/pyobject_del.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3299 ___

[issue7544] Fatal error on thread creation in low memory condition

2010-01-14 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: Added file: http://bugs.python.org/file15888/thread_prealloc_pystate-3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7544 ___

[issue7544] Fatal error on thread creation in low memory condition

2010-01-14 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: Removed file: http://bugs.python.org/file15805/thread_prealloc_pystate.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7544 ___

[issue7544] Fatal error on thread creation in low memory condition

2010-01-14 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: Removed file: http://bugs.python.org/file15848/thread_prealloc_pystate-2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7544 ___

[issue7700] -3 flag does not work anymore

2010-01-14 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: The committed patch has a C++-style comment. You probably want to fix that. -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7700

[issue7701] fix output string length for binascii.b2a_uu()

2010-01-14 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Patch committed in r77506, r77507, r77508 and r77509. Thank you! -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7701

[issue7301] Add environment variable $PYTHONWARNINGS

2010-01-14 Thread Brian Curtin
Changes by Brian Curtin cur...@acm.org: Removed file: http://bugs.python.org/file15324/issue7301_v2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7301 ___

[issue7301] Add environment variable $PYTHONWARNINGS

2010-01-14 Thread Brian Curtin
Changes by Brian Curtin cur...@acm.org: Removed file: http://bugs.python.org/file15322/issue7301.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7301 ___

[issue7301] Add environment variable $PYTHONWARNINGS

2010-01-14 Thread Brian Curtin
Brian Curtin cur...@acm.org added the comment: fixed a tab/space issue -- Added file: http://bugs.python.org/file15889/issue7301.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7301 ___

[issue3426] os.path.abspath with unicode argument should call os.getcwdu

2010-01-14 Thread Brian Curtin
Brian Curtin cur...@acm.org added the comment: assertStr and assertUnicode don't exist in test_ntpath so the tests fail on Windows. I copied/pasted the functions over from test_posixpath just to see and test_ntpath passes. Other than that, it looks good to me. --

[issue7705] libpython2.6.so is not linked correctly on FreeBSD when threads are enabled

2010-01-14 Thread Alexis Ballier
New submission from Alexis Ballier aball...@gentoo.org: As reported in https://bugs.gentoo.org/show_bug.cgi?id=300961 : # gcc foo.c -lpython2.6 /usr/lib/gcc/i686-gentoo-freebsd7.2/4.4.2/../../../libpython2.6.so: undefined reference to `pthread_create' collect2: ld returned 1 exit status

[issue3426] os.path.abspath with unicode argument should call os.getcwdu

2010-01-14 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: I'll fix the patch. I added Ronald and Andrew to see if they have any opinion about macpath and os2emxpath. The main idea is that abspath should always return unicode if its arg is unicode or str otherwise. -- nosy: +aimacintyre,