[issue7700] "-3" flag does not work anymore

2010-01-14 Thread Florent Xicluna
New submission from Florent Xicluna : 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)' :1: DeprecationWarning: <> not supported in 3.x; use != -c:1: DeprecationWarning: dict

[issue7700] "-3" flag does not work anymore

2010-01-14 Thread Florent Xicluna
Changes by Florent Xicluna : -- components: +Interpreter Core type: -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue7700] "-3" flag does not work anymore

2010-01-14 Thread Ezio Melotti
Ezio Melotti 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)' :1: DeprecationWarning: <> not supported in 3.x; use != -c:1: DeprecationWarning: dict.has_key() not suppo

[issue1068268] subprocess is not EINTR-safe

2010-01-14 Thread David Oxley
David Oxley 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 while blocked in this read

[issue7700] "-3" flag does not work anymore

2010-01-14 Thread Ezio Melotti
Ezio Melotti 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: http://bugs.python.o

[issue7700] "-3" flag does not work anymore

2010-01-14 Thread Florent Xicluna
Florent Xicluna 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", and ther

[issue7700] "-3" flag does not work anymore

2010-01-14 Thread R. David Murray
Changes by R. David Murray : -- priority: high -> release blocker ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2010-01-14 Thread STINNER Victor
New submission from STINNER Victor : 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')" Debug memory block at address

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

2010-01-14 Thread Antoine Pitrou
Antoine Pitrou 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 are diff

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

2010-01-14 Thread alito
New submission from alito : 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 socket.create_connection((por

[issue7700] "-3" flag does not work anymore

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

[issue7632] dtoa.c: oversize b in quorem

2010-01-14 Thread Mark Dickinson
Mark Dickinson added the comment: Bug 6 is indeed a bug: an example incorrectly-rounded string is: '104308485241983990666713401708072175773165034278685682646111762292409330928739751702404658197872319129036519947435319418387839758990478549475866730759458448959810120243879921356170645

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

2010-01-14 Thread STINNER Victor
STINNER Victor 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] Cool, it's not an esti

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

2010-01-14 Thread Florent Xicluna
New submission from Florent Xicluna : 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 can backport

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

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

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

2010-01-14 Thread Florent Xicluna
Changes by Florent Xicluna : Added file: http://bugs.python.org/file15875/issue7703_ctypes_memoryview.diff ___ Python tracker ___ ___ Python-bu

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

2010-01-14 Thread Florent Xicluna
Florent Xicluna 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 stage: needs

[issue7632] dtoa.c: oversize b in quorem

2010-01-14 Thread Mark Dickinson
Mark Dickinson 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 ___

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

2010-01-14 Thread Antoine Pitrou
Antoine Pitrou 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 : -- nosy: +pitrou stage: -> patch review versions: +Python 3.2 -Python 3.0 ___ Python tracker ___ ___ Pytho

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

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

[issue7632] dtoa.c: oversize b in quorem

2010-01-14 Thread Mark Dickinson
Mark Dickinson added the comment: Tests committed in r77493. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue7632] dtoa.c: oversize b in quorem

2010-01-14 Thread Mark Dickinson
Mark Dickinson added the comment: Fixes and tests so far merged to py3k in r77494, release31-maint in r77496. -- ___ Python tracker ___ __

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

2010-01-14 Thread Antoine Pitrou
Antoine Pitrou 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. Otherwise,

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

2010-01-14 Thread Antoine Pitrou
Antoine Pitrou 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 : Removed file: http://bugs.python.org/file15877/issue7703_test_binascii.diff ___ Python tracker ___ ___ Python-bugs-

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

2010-01-14 Thread Antoine Pitrou
Changes by Antoine Pitrou : Removed file: http://bugs.python.org/file15874/issue7703_binascii_memoryview.diff ___ Python tracker ___ ___ Pytho

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

2010-01-14 Thread Antoine Pitrou
Antoine Pitrou 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 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 _

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

2010-01-14 Thread STINNER Victor
STINNER Victor 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 ___ Python tracker

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

2010-01-14 Thread STINNER Victor
Changes by STINNER Victor : Removed file: http://bugs.python.org/file10891/_sre-2.patch ___ Python tracker ___ ___ Python-bugs-list mailing lis

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

2010-01-14 Thread STINNER Victor
Changes by STINNER Victor : Removed file: http://bugs.python.org/file15862/sre_py_decref.patch ___ Python tracker ___ ___ Python-bugs-list mail

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

2010-01-14 Thread STINNER Victor
STINNER Victor 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 would be nice to add a test.

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

2010-01-14 Thread STINNER Victor
Changes by STINNER Victor : Removed file: http://bugs.python.org/file15871/binascii_b2a_uu_length.patch ___ Python tracker ___ ___ Python-bugs-

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

2010-01-14 Thread STINNER Victor
Changes by STINNER Victor : Removed file: http://bugs.python.org/file15873/binascii_b2a_uu_length-2.patch ___ Python tracker ___ ___ Python-bug

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

2010-01-14 Thread STINNER Victor
Changes by STINNER Victor : Added file: http://bugs.python.org/file15880/_curses_panel_py_decref.patch ___ Python tracker ___ ___ Python-bugs-l

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

2010-01-14 Thread STINNER Victor
STINNER Victor 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 added the comment: The sre patch has been committed, thank you! -- ___ Python tracker ___ ___ Python-bugs-list mailing

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

2010-01-14 Thread Antoine Pitrou
Changes by Antoine Pitrou : Removed file: http://bugs.python.org/file15878/sre_py_decref-2.patch ___ Python tracker ___ ___ Python-bugs-list ma

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

2010-01-14 Thread Antoine Pitrou
Antoine Pitrou 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 tracker

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

2010-01-14 Thread STINNER Victor
Changes by STINNER Victor : Removed file: http://bugs.python.org/file10892/_curses_panel.patch ___ Python tracker ___ ___ Python-bugs-list mail

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

2010-01-14 Thread STINNER Victor
STINNER Victor 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 added the comment: Guido pronounced on this on python-dev, so closing the request again. -- status: open -> closed ___ Python tracker ___ _

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

2010-01-14 Thread Nir Aides
Nir Aides 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 which equals t

[issue7700] "-3" flag does not work anymore

2010-01-14 Thread Brett Cannon
Brett Cannon 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 ___ Python tracker

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

2010-01-14 Thread pedro flores
New submission from pedro flores : 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 TRUE type: behavio

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

2010-01-14 Thread Mark Dickinson
Mark Dickinson 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 approximations to tho

[issue1947] Exception exceptions.AttributeError '_shutdown' in

2010-01-14 Thread Christopher Nelson
Christopher Nelson 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. We support an applicat

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

2010-01-14 Thread David D Lowe
David D Lowe added the comment: Same here. -- nosy: +Flimm ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http

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

2010-01-14 Thread pedro flores
pedro flores added the comment: kk, then i cannot use this comparison?, and this not happen with8.6-8>0.6 this is false, according to python. 2010/1/14 Mark Dickinson > > Mark Dickinson added the comment: > > This is not a bug: Python, like many other computer languages, stores > floats

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

2010-01-14 Thread Brian Curtin
Brian Curtin 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 change is to p

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

2010-01-14 Thread Brian Curtin
Brian Curtin 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 ___ Python tra

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

2010-01-14 Thread STINNER Victor
STINNER Victor 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 attributes to NULL at the be

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

2010-01-14 Thread Tim Peters
Tim Peters 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 not leave exactly

[issue1754] WindowsError messages are not properly encoded

2010-01-14 Thread Naoki INADA
Naoki INADA 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: +naoki

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

2010-01-14 Thread STINNER Victor
Changes by STINNER Victor : Removed file: http://bugs.python.org/file10893/pyobject_del.patch ___ Python tracker ___ ___ Python-bugs-list maili

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

2010-01-14 Thread STINNER Victor
Changes by STINNER Victor : Added file: http://bugs.python.org/file15888/thread_prealloc_pystate-3.patch ___ Python tracker ___ ___ Python-bugs

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

2010-01-14 Thread STINNER Victor
Changes by STINNER Victor : Removed file: http://bugs.python.org/file15805/thread_prealloc_pystate.patch ___ Python tracker ___ ___ Python-bugs

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

2010-01-14 Thread STINNER Victor
Changes by STINNER Victor : Removed file: http://bugs.python.org/file15848/thread_prealloc_pystate-2.patch ___ Python tracker ___ ___ Python-bu

[issue7700] "-3" flag does not work anymore

2010-01-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: The committed patch has a C++-style comment. You probably want to fix that. -- nosy: +pitrou ___ Python tracker ___

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

2010-01-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: Patch committed in r77506, r77507, r77508 and r77509. Thank you! -- resolution: -> fixed status: open -> closed ___ Python tracker ___

[issue7301] Add environment variable $PYTHONWARNINGS

2010-01-14 Thread Brian Curtin
Changes by Brian Curtin : Removed file: http://bugs.python.org/file15324/issue7301_v2.patch ___ Python tracker ___ ___ Python-bugs-list mailing

[issue7301] Add environment variable $PYTHONWARNINGS

2010-01-14 Thread Brian Curtin
Changes by Brian Curtin : Removed file: http://bugs.python.org/file15322/issue7301.patch ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue7301] Add environment variable $PYTHONWARNINGS

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

[issue7700] "-3" flag does not work anymore

2010-01-14 Thread Brett Cannon
Brett Cannon added the comment: Fixed in r77510. Look forward to when we use C99 over C89. On Thu, Jan 14, 2010 at 16:29, Antoine Pitrou wrote: > > Antoine Pitrou added the comment: > > The committed patch has a C++-style comment. You probably want to fix that. > > -- > nosy: +pitrou

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

2010-01-14 Thread Brian Curtin
Brian Curtin 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 : 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 libpython2.6.so doesn't

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

2010-01-14 Thread Ezio Melotti
Ezio Melotti 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, ronaldoussoren ___