[issue7117] Backport py3k float repr to trunk

2009-10-24 Thread Raymond Hettinger
Raymond Hettinger added the comment: +1 on backporting the 'f' and 'g' work also. We will be well served by getting the two code bases ins-sync with one another. Eliminating obscure differences makes it easier to port code from 2.x to 3.x -- ___ Pyt

[issue1625] bz2.BZ2File doesn't support multiple streams

2009-10-24 Thread David Bonner
David Bonner added the comment: That was mostly just out of paranoia, since the comments mentioned multiple calls to close being legal. Looking at it again, that particular case isn't an issue, since we don't hit that call when the mode is MODE_CLOSED. The testsuite runs happily with those

[issue1602] windows console doesn't print utf8 (Py30a2)

2009-10-24 Thread Glenn Linderman
Glenn Linderman added the comment: With Python 3.1.1, the following batch file seems to be necessary to use UTF-8 successfully from an XP console: set PYTHONIOENCODING=UTF-8 cmd /u /k chcp 65001 set PYTHONIOENCODING= exit the cmd line seems to be necessary because of Windows having compatibili

[issue7201] double Endian problem and more on arm

2009-10-24 Thread Mancausoft
New submission from Mancausoft : I compile python for arm (on debian etch) but it don't pass ctype test: == FAIL: test_struct_return_2H (ctypes.test.test_as_parameter.AsParamPropertyWrapperTestCase)

[issue2746] ElementTree ProcessingInstruction uses character entities in content

2009-10-24 Thread Antoine Pitrou
Antoine Pitrou added the comment: Oops, sorry, I hadn't read your message about the patch also correcting cElementTree. -- ___ Python tracker ___

[issue2746] ElementTree ProcessingInstruction uses character entities in content

2009-10-24 Thread Antoine Pitrou
Antoine Pitrou added the comment: Can you include the cElementTree fix and test case in your patch as well? -- nosy: +pitrou priority: -> normal stage: -> patch review versions: +Python 3.2 -Python 2.5, Python 3.0 ___ Python tracker

[issue7198] csv.writer

2009-10-24 Thread Bob Cannon
Changes by Bob Cannon : -- status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue7198] csv.writer

2009-10-24 Thread Bob Cannon
Bob Cannon added the comment: Probably so. I'm sorry to report this as a bug if it's not. I asked abut this on a Python group on IRC and got no suggestions. Thanks for taking a look. -- ___ Python tracker __

[issue7200] multiprocessing deadlock on Mac OS X when queue collected before process terminates

2009-10-24 Thread Brian Quinlan
New submission from Brian Quinlan : This code: import multiprocessing import queue def _process_worker(q): while True: try: something = q.get(block=True, timeout=0.1) except queue.Empty: return else: pass # print('Grabb

[issue7199] Doc: Logging level order seems inconsistent

2009-10-24 Thread Terry J. Reedy
New submission from Terry J. Reedy : LibRef 15.6, Logging module: Intro start with "The default levels provided are DEBUG, INFO, WARNING, ERROR and CRITICAL." which seems like the proper ordering. Then 15.6.1.1. Simple examples "Another useful feature of the logging API is the ability to produ

[issue7198] csv.writer

2009-10-24 Thread Skip Montanaro
Skip Montanaro added the comment: Your output file should be opened in binary mode. Sounds like you opened it in text mode. -- nosy: +skip.montanaro ___ Python tracker ___ _

[issue7198] csv.writer

2009-10-24 Thread Bob Cannon
New submission from Bob Cannon : I used csv.writer to open a file for writing with comma as separator and dialect='excel'. I used writerow to write each row into the file. When I execute under linux, each line is terminated by '\r\n'. When I execute under windows, each line is terminated by '\

[issue7198] csv.writer

2009-10-24 Thread Bob Cannon
Changes by Bob Cannon : -- nosy: zacktu severity: normal status: open title: csv.writer type: behavior versions: Python 2.6 ___ Python tracker ___

[issue7117] Backport py3k float repr to trunk

2009-10-24 Thread Eric Smith
Eric Smith added the comment: Another thing to consider is that in py3k we removed all conversions of converting 'f' to 'g', such as this, from Objects/unicodeobject.c: if (type == 'f' && fabs(x) >= 1e50) type = 'g'; Should we also do that as part of this exercise? Or should it be

[issue7111] abort when stderr is moved

2009-10-24 Thread Benjamin Peterson
Changes by Benjamin Peterson : -- title: core dump when stderr is moved -> abort when stderr is moved ___ Python tracker ___ ___ Python

[issue2746] ElementTree ProcessingInstruction uses character entities in content

2009-10-24 Thread Tom Lynn
Changes by Tom Lynn : -- nosy: +tlynn ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mai

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

2009-10-24 Thread Andrew Ziem
Changes by Andrew Ziem : -- nosy: +AndrewZiem ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python

[issue1087418] long int bitwise ops speedup (patch included)

2009-10-24 Thread Mark Dickinson
Mark Dickinson added the comment: > Most operations are add and subtract, and in each such operation you > need to look at both signs, and decide if you want to really add or > subtract, and if you are subtracting, you then have to do a magnitude > test to see which way - all of that before you

[issue1625] bz2.BZ2File doesn't support multiple streams

2009-10-24 Thread Antoine Pitrou
Antoine Pitrou added the comment: I'm not comfortable with the following change (which appears twice in the patch): - BZ2_bzReadClose(&bzerror, self->fp); + if (self->fp) + BZ2_bzReadClose(&bzerror, self->fp);

[issue7117] Backport py3k float repr to trunk

2009-10-24 Thread Eric Smith
Eric Smith added the comment: Adding tim_one as nosy. He'll no doubt have an opinion on rounding. And hopefully he'll share it! -- nosy: +tim_one ___ Python tracker ___ _

[issue3488] Provide compress/uncompress functions on the gzip module

2009-10-24 Thread Gregory P. Smith
Gregory P. Smith added the comment: Seems simple enough, I don't see why not. -- nosy: +gregory.p.smith ___ Python tracker ___ ___ Pyt

[issue7117] Backport py3k float repr to trunk

2009-10-24 Thread Mark Dickinson
Mark Dickinson added the comment: One issue occurs to me: should the backport change the behaviour of the round function? In py3k, round consistently uses round-half-to-even for halfway cases. In trunk, round semi-consistently uses round-half-away-from-zero (and this is documented). E.g., ro

[issue7117] Backport py3k float repr to trunk

2009-10-24 Thread Eric Smith
Eric Smith added the comment: I think the next step on my side is to remove _PyOS_double_to_string, and make all of the internal code call PyOS_double_to_string. The distinction is that _PyOS_double_to_string gets passed a buffer and length, but PyOS_double_to_string returns allocated memory th

[issue6986] _json crash on scanner/encoder initialization error

2009-10-24 Thread Antoine Pitrou
Antoine Pitrou added the comment: The tests could go in Lib/json/tests/test_speedups.py. -- ___ Python tracker ___ ___ Python-bugs-lis

[issue1596] Broken pipes should be handled better in 2.x

2009-10-24 Thread Matteo Bertini
Changes by Matteo Bertini : -- nosy: +naufraghi ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

[issue1488934] file.write + closed pipe = no error

2009-10-24 Thread Matteo Bertini
Changes by Matteo Bertini : -- nosy: +naufraghi type: -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscr

[issue7117] Backport py3k float repr to trunk

2009-10-24 Thread Mark Dickinson
Mark Dickinson added the comment: r75672: temporarily disable the short float repr while we're putting the pieces in place. When testing, the disablement can be disabled (hah) by defining the PY_SHORT_FLOAT_REPR preprocessor symbol, e.g. (on Unix) with CC='gcc -DPY_SHORT_FLOAT_REPR'

[issue1678380] 0.0 and -0.0 identified, with surprising results

2009-10-24 Thread Mark Dickinson
Mark Dickinson added the comment: Thanks for testing! I'll apply the fix once the 2.6 branch is unfrozen. -- ___ Python tracker ___ __

[issue1678380] 0.0 and -0.0 identified, with surprising results

2009-10-24 Thread Mancausoft
Mancausoft added the comment: Mark Dickinson scrisse: > > Mark Dickinson added the comment: > > Here's a patch for floats. Mancausoft, could you give this a try and > let me know whether it fixes the issue? it works. test_math Ran 39 tests in 23.561s

[issue7111] core dump when stderr is moved

2009-10-24 Thread Matteo Bertini
Matteo Bertini added the comment: sorry, title restored! -- title: stdout closed -> core dump when stderr is moved ___ Python tracker ___

[issue1678380] 0.0 and -0.0 identified, with surprising results

2009-10-24 Thread Mark Dickinson
Mark Dickinson added the comment: Here's a patch for floats. Mancausoft, could you give this a try and let me know whether it fixes the issue? The same fix would also need to be applied for complex numbers. -- Added file: http://bugs.python.org/file15193/issue1678380.patch _

[issue7111] stdout closed

2009-10-24 Thread Matteo Bertini
Changes by Matteo Bertini : -- title: core dump when stderr is moved -> stdout closed ___ Python tracker ___ ___ Python-bugs-list maili

[issue7111] core dump when stderr is moved

2009-10-24 Thread Matteo Bertini
Changes by Matteo Bertini : -- nosy: +naufraghi ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

[issue1678380] 0.0 and -0.0 identified, with surprising results

2009-10-24 Thread Mark Dickinson
Mark Dickinson added the comment: > I try: *p==0 && p[sizeof(double)-1]==0 && p[(sizeof(double)-1)/2]==0; Sure, that should work. It would seem cleaner and safer to use copysign, though: that way, things will still work when some other byte layout comes along, or when some version of Python

[issue1678380] 0.0 and -0.0 identified, with surprising results

2009-10-24 Thread Mancausoft
Mancausoft added the comment: Mark Dickinson scrisse: > Mancausoft: is this little-endian, OABI? Mixed endian > If so, then I think I know what the problem is: the disambiguation > code in compile.c looks at the first and last bytes of the double to > distinguish 0.0 and -0.0; for mixed

[issue7071] distutils and IronPython compatibility

2009-10-24 Thread Tarek Ziadé
Tarek Ziadé added the comment: Notice that install_lib has a --no-compile option that can be used to avoid compiling .pyc/.pyo files. What I am adding now is just a gentle warning in case a compilation is tried and sys.dont_write_bytecode is True, so the installation may proceed nevertheless an

[issue1087418] long int bitwise ops speedup (patch included)

2009-10-24 Thread Martin v . Löwis
Martin v. Löwis added the comment: > I would be happy to do a design doc for this and write some of the inner > loops, but if (a) it's already being done or (b) there's no chance of it > being deployed then it would be a waste of time... > if there was definite interest in it (and reasonable sch

[issue1678380] 0.0 and -0.0 identified, with surprising results

2009-10-24 Thread Mark Dickinson
Mark Dickinson added the comment: Mancausoft: is this little-endian, OABI? If so, then I think I know what the problem is: the disambiguation code in compile.c looks at the first and last bytes of the double to distinguish 0.0 and -0.0; for mixed-endian (aka little-endian, swapped words)

[issue1678380] 0.0 and -0.0 identified, with surprising results

2009-10-24 Thread Mancausoft
Mancausoft added the comment: This bug is still present on arm. Python 2.6.3 cs-e9302# cat ../prova.py import math print math.atan2(0., -0.) print (math.copysign(4., -0.), -4.0) print math.atan2(0., -0.) print (math.copysign(4., -0.), -4.0) print math.atan2(0., -0.) cs-e9302# cat ../prova1

[issue7117] Backport py3k float repr to trunk

2009-10-24 Thread Mark Dickinson
Mark Dickinson added the comment: r75666: Add sys.float_repr_style attribute. -- ___ Python tracker ___ ___ Python-bugs-list mailing l

[issue1087418] long int bitwise ops speedup (patch included)

2009-10-24 Thread Gregory Smith
Gregory Smith added the comment: Antoine, "most uses of it are for small ints (< 2**32 or 2**64), ", that's my point exactly, the current long type is quite slow for those cases because of sign-magnitude implementation. I don't see a problem with sign-magnitude for old long ints, or for GMP, si

[issue7066] archive_util.make_archive doesn't restore the cwd if an error is raised

2009-10-24 Thread Tarek Ziadé
Tarek Ziadé added the comment: Done in r75659, r75662 and r75663 (merge in 2.6 maint. waiting for 2.6.4 final tag to be done) Thanks ! -- status: open -> closed versions: +Python 2.6, Python 3.1 ___ Python tracker

[issue7117] Backport py3k float repr to trunk

2009-10-24 Thread Mark Dickinson
Mark Dickinson added the comment: Some key revision numbers from the py3k short float repr, for reference: r71663: include Gay's code, build and configure fixes r71723: backout SSE2 detection code added in r71663 r71665: rewrite of float formatting code to use Gay's code Backported most of

[issue7060] test_multiprocessing dictionary changed size errors and hang

2009-10-24 Thread Antoine Pitrou
Antoine Pitrou added the comment: Kristján: > So, can one just clear the __traceback__ member? Yes, or use `exc_value.with_traceback(None)`. -- ___ Python tracker ___ __

[issue7175] unify pydistutils.cfg and distutils.cfg and use .local

2009-10-24 Thread Tarek Ziadé
Tarek Ziadé added the comment: The subversion system looks pretty nice ! So here's a modified proposal that covers the python version as well. = per user configuration files = ~/.pythonMAJOR.MINOR Examples: ~/.python2.7 ~/.python3.1 On Windows, ~ will be replaced by APPDATA if founded in

[issue3578] 'dictionary changed size' error in test_multiprocessing

2009-10-24 Thread Antoine Pitrou
Antoine Pitrou added the comment: Actually, it's probably a duplicate of #7105. -- resolution: -> duplicate status: open -> closed superseder: -> weak dict iterators are fragile because of unpredictable GC runs ___ Python tracker

[issue6242] Fix reference leak in io.StringIO

2009-10-24 Thread Antoine Pitrou
Antoine Pitrou added the comment: I just noticed that this hadn't been committed to trunk. I did the backport myself, but in the future please first commit IO changes to trunk and then merge to py3k. -- ___ Python tracker

[issue7191] Odd behaviour with zlib.decompressobj optional parameter "wbits"

2009-10-24 Thread Georg Brandl
Georg Brandl added the comment: The decompressor can't have a window size smaller than the size used to compress the stream. Therefore in your case, it can't be smaller than 15. Still, the docs must be improved, e.g. compressobj() has more parameters than documented. -- assignee: ->

[issue7197] test_multiprocessing crashes under Windows when run in verbose mode

2009-10-24 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here is a patch. -- keywords: +patch stage: -> patch review Added file: http://bugs.python.org/file15192/testrunner.patch ___ Python tracker __

[issue7197] test_multiprocessing crashes under Windows when run in verbose mode

2009-10-24 Thread Antoine Pitrou
Antoine Pitrou added the comment: Amusingly, there is a Test_TextTestRunner but it's not run by test_unittest -- ___ Python tracker ___ __

[issue7197] test_multiprocessing crashes under Windows when run in verbose mode

2009-10-24 Thread Antoine Pitrou
New submission from Antoine Pitrou : When run under Windows in verbose mode ("python -m test.regrtest -v test_multiprocessing"), most tests in test_multiprocessing fail with a recursion limit error. The explanation is that most tests are written in the following manner: class _TestArray(BaseTes

[issue1087418] long int bitwise ops speedup (patch included)

2009-10-24 Thread Mark Dickinson
Mark Dickinson added the comment: Here's the inline assembly version, for comparison: #define SUM2_BIN64(sumhigh, sumlow, ahigh, alow, bhigh, blow)\ __asm__ ("addq\t%5, %1\n\t"\ "adcq\t%3, %0"\

[issue1087418] long int bitwise ops speedup (patch included)

2009-10-24 Thread Mark Dickinson
Mark Dickinson added the comment: [Greg] > It would seem to me that a more suitable implementation would be to > store numbers as 32*k-bit 2's complement integers; I've used this in > C++ libraries. Compared to the rad-15 sign/magnitude approach, it may > seem trickier to do carries but in prac

[issue7185] csv reader utf-8 BOM error

2009-10-24 Thread Istvan Szirtes
Istvan Szirtes added the comment: Hi Everyone, I have tried the "utf-8-sig" and it does not work in this case or rather I think not the csv module is wrong. The seek() does not work correctly in the csv file or object. With "utf-8-sig" the file is opend correctly and the first row does not