[issue5117] os.path.relpath problem with root drive directory on windows

2009-01-31 Thread Hirokazu Yamamoto
Changes by Hirokazu Yamamoto : -- versions: +Python 2.7, Python 3.0, Python 3.1 ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue4428] make io.BufferedWriter observe max_buffer_size limits

2009-01-31 Thread Gregory P. Smith
Gregory P. Smith added the comment: fwiw, I decided Guido and Antoine were right and took out the support for input that did not support len() to keep things a bit simpler. ___ Python tracker ___

[issue4428] make io.BufferedWriter observe max_buffer_size limits

2009-01-31 Thread Gregory P. Smith
Gregory P. Smith added the comment: I've uploaded a new patch set with more extensive unit tests. It also handles the case of writing array.array objects (or anything with a memoryview itemsize > 1). The previous code would buffer by item rather than by byte. it has been updated in codereview

[issue4428] make io.BufferedWriter observe max_buffer_size limits

2009-01-31 Thread Gregory P. Smith
Changes by Gregory P. Smith : Added file: http://bugs.python.org/file12914/issue4428-io-bufwrite-gps05.diff ___ Python tracker ___ ___ Python-b

[issue5122] test_tcl and test_ttk_guionly don't like each other

2009-01-31 Thread Guilherme Polo
New submission from Guilherme Polo : Recently I've added this test named test_ttk_guionly, and I noticed some buildslaves went red, like amd64 gentoo trunk and x86 FreeBSD trunk (I though there were others for the reason I'm going to say next, but didn't found on a quick look). amd 64 gentoo tru

[issue5121] PyRun_InteractiveLoop disagrees with documentation?

2009-01-31 Thread Ben Kuhn
Changes by Ben Kuhn : -- versions: +Python 3.0 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pytho

[issue5121] PyRun_InteractiveLoop disagrees with documentation?

2009-01-31 Thread Ben Kuhn
New submission from Ben Kuhn : The description of PyRun_InteractiveLoop(FILE * file, const char * filename) states that if filename is NULL, "???" will be used instead. In actuality, if the method is called with a NULL filename, it will segfault after the first command is entered. Example: //

[issue4706] try to build a C module, but don't worry if it doesn't work

2009-01-31 Thread Zooko O'Whielacronx
Zooko O'Whielacronx added the comment: Here's Twisted failing to build because Python.h isn't found: Added file: http://bugs.python.org/file12913/Twisted-build-no-Python.h.txt ___ Python tracker ___

[issue4706] try to build a C module, but don't worry if it doesn't work

2009-01-31 Thread Zooko O'Whielacronx
Zooko O'Whielacronx added the comment: Here's Twisted failing to build when gcc is not installed: Added file: http://bugs.python.org/file12912/Twisted-build-with-no-gcc.txt ___ Python tracker __

[issue4706] try to build a C module, but don't worry if it doesn't work

2009-01-31 Thread Zooko O'Whielacronx
Changes by Zooko O'Whielacronx : Added file: http://bugs.python.org/file12911/build-with-no-gcc.txt ___ Python tracker ___ ___ Python-bugs-list

[issue4706] try to build a C module, but don't worry if it doesn't work

2009-01-31 Thread Zooko O'Whielacronx
Zooko O'Whielacronx added the comment: Oh! And simplejson is able to cleanly fall back to pure Python when gcc is not found, as well. Perhaps Twisted http://twistedmatrix.com/trac/ticket/3586 could use simplejson's approach. ___ Python tracker

[issue4706] try to build a C module, but don't worry if it doesn't work

2009-01-31 Thread Zooko O'Whielacronx
Zooko O'Whielacronx added the comment: Hey check it out -- simplejson can try to build its extension module, and when it fails to compile (in this case because there is no Python.h), then it prints out a warning message and finishes a successful build: Added file: http://bugs.python.org/file129

[issue4448] should socket readline() use default_bufsize instead of _rbufsize?

2009-01-31 Thread Gregory P. Smith
Gregory P. Smith added the comment: unassigning, i don't have time to look at this one right now. -- assignee: gregory.p.smith -> ___ Python tracker ___

[issue4903] binascii.crc32() - document signed vs unsigned results

2009-01-31 Thread Gregory P. Smith
Gregory P. Smith added the comment: and r69161, r69160, r69162, r69163, r69164. -- resolution: -> fixed status: open -> closed versions: +Python 2.7, Python 3.1 ___ Python tracker _

[issue4903] binascii.crc32() - document signed vs unsigned results

2009-01-31 Thread Gregory P. Smith
Gregory P. Smith added the comment: wording updated in r69159, thanks. ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: h

[issue5119] wide character parameter handling in ctypes

2009-01-31 Thread Jason R. Coombs
Jason R. Coombs added the comment: I've confirmed that my original assumption was quite false, and that even if the parameters are the correct width, WNetAddConnection2W behaves differently in 64-bit windows versus 32-bit windows, so it made a bad test case. So I've changed the title of this is

[issue4704] Update pybench for python 3.0

2009-01-31 Thread Antoine Pitrou
Antoine Pitrou added the comment: The patch changes results a lot compared to the previous version (BuiltinFunctionCalls is 3x slower). I propose the following patch, which gives roughly the same runtimes as before (I use divmod() and max() rather than complex() and pow()). Added file: http://b

[issue4804] Python on Windows disables all C runtime library assertions

2009-01-31 Thread Mark Hammond
Mark Hammond added the comment: I believe your new patch suffers the same problem. Consider the blocks like: + /* turn off crt asserts on windows since we have no control over fd */ + Py_BEGIN_CRT_ERROR_HANDLING Py_BEGIN_ALLOW_THREADS size = write(fd, pbuf.buf, (siz

[issue4718] wsgiref package totally broken

2009-01-31 Thread Benjamin Peterson
Benjamin Peterson added the comment: I assume the buildbots were placated? -- nosy: +benjamin.peterson resolution: accepted -> fixed status: pending -> closed ___ Python tracker

[issue5104] getsockaddrarg() casts port number from int to short without any warning

2009-01-31 Thread Gregory P. Smith
Gregory P. Smith added the comment: Fixed in trunk (2.7) r69156. All places in socketmodule that called htons and silently truncated values that were too large have been changed to raise OverflowError. Unit tests included. I'm leaving this open until it is merged into the py3k branch for 3.1.

[issue5120] Disabling test_ttk_guionly on mac

2009-01-31 Thread Guilherme Polo
Guilherme Polo added the comment: > For some reason the recently added test_ttk_guionly is causing Tcl to > abort on Mac. I would prefer to disable the test for now, except if some > mac owner has the time to fix it. Just saw it didn't cause an abort with the buildslave heller-x86-osx5, btw. _

[issue5119] inconsistent wide character parameter handling in 64-bit python

2009-01-31 Thread Jason R. Coombs
Jason R. Coombs added the comment: Or alternately, is it possible (and reasonable) for ctypes to inspect the function signature and create wide character buffers when appropriate? ___ Python tracker

[issue5119] inconsistent wide character parameter handling in 64-bit python

2009-01-31 Thread Jason R. Coombs
Jason R. Coombs added the comment: After putting together a more simple example without externalities, I'm unable to continue to assert the discrepancy between 32 and 64-bit Windows, although I do still see where narrow character strings are treated as wide character buffers. See the attached s

[issue5120] Disabling test_ttk_guionly on mac

2009-01-31 Thread Guilherme Polo
New submission from Guilherme Polo : For some reason the recently added test_ttk_guionly is causing Tcl to abort on Mac. I would prefer to disable the test for now, except if some mac owner has the time to fix it. I would like to know the tcl version being used on the noller-osx86 buildslave too

[issue5119] inconsistent wide character parameter handling in 64-bit python

2009-01-31 Thread Jason R. Coombs
New submission from Jason R. Coombs : Using Python 2.5.4 and Python 2.6.1 on 32-bit python, when passing a regular string to a function expecting pointer to a wide string (wintypes.LPCWSTR), the function executes without problems. When calling the same using Python 2.6.1 on 64-bit windows, the c

[issue5115] Extend subprocess.kill to be able to kill process groups

2009-01-31 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' : -- nosy: +giampaolo.rodola ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http:/

[issue5097] asyncore.dispatcher_with_send undocumented

2009-01-31 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' : -- nosy: +giampaolo.rodola ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http:/

[issue4753] Faster opcode dispatch on gcc

2009-01-31 Thread Mark Dickinson
Mark Dickinson added the comment: > The test failure also happens on trunk, it may be related to the recent > tk changes. Yes; sorry---I didn't mean to suggest that the test failures were in any way related to the opcode dispatch stuff. Apart from the ttk teething difficulties, there's a wei

[issue4753] Faster opcode dispatch on gcc

2009-01-31 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Square brackets added in r69133. The gentoo x86 3.x buildbot seems to be > passing the compile stage now. (Though not the test stage, of course: > one can't have everything!) The test failure also happens on trunk, it may be related to the recent tk chan

[issue5117] os.path.relpath problem with root drive directory on windows

2009-01-31 Thread Hirokazu Yamamoto
Changes by Hirokazu Yamamoto : ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/pyt

[issue5117] os.path.relpath problem with root drive directory on windows

2009-01-31 Thread Hirokazu Yamamoto
Changes by Hirokazu Yamamoto : Removed file: http://bugs.python.org/file12906/fix_relpath_v2.patch ___ Python tracker ___ ___ Python-bugs-list

[issue5117] os.path.relpath problem with root drive directory on windows

2009-01-31 Thread Hirokazu Yamamoto
Changes by Hirokazu Yamamoto : Removed file: http://bugs.python.org/file12904/fix_relpath.patch ___ Python tracker ___ ___ Python-bugs-list mai

[issue5117] os.path.relpath problem with root drive directory on windows

2009-01-31 Thread Hirokazu Yamamoto
Hirokazu Yamamoto added the comment: I hope this works. Added file: http://bugs.python.org/file12907/fix_relpath_v3.patch ___ Python tracker ___ _

[issue5112] Incorrect documentation for PyErr_BadInternalCall

2009-01-31 Thread Benjamin Peterson
Benjamin Peterson added the comment: Fixed in r69140. -- nosy: +benjamin.peterson resolution: -> fixed status: open -> closed ___ Python tracker ___

[issue789290] Minor FP bug in object.c

2009-01-31 Thread Mark Dickinson
Mark Dickinson added the comment: I'll take this. I think there *is* a problem here: on a system with 64-bit long, _Py_HashDouble can end up trying to cast the float value 2.**63 to a C long. Since 2.**63 doesn't fit in a long, we get undefined behaviour, according to the C standards. In m

[issue5117] os.path.relpath problem with root drive directory on windows

2009-01-31 Thread Hirokazu Yamamoto
Hirokazu Yamamoto added the comment: It seems that there is still problem. >>> ntpath.relpath("//whiterab-c2znlh/foo/", "//whiterab-c2znlh/bar/") '..\\foo' This should raise ValueError because "//whiterab-c2znlh/foo" is UNC root prefix (like "e:" for normal path) not "//whiterab-c2znlh" AFAIK.

[issue5118] '%.2f' % 2.545 doesn't round correctly

2009-01-31 Thread Mark Dickinson
Mark Dickinson added the comment: > result is 2.55 and not 2.54. If python doesn't deliver "2.55" as the > result of it's rounding algorithm then it's doing it wrong. And if Sorry, but that's just not true. I suggest that you (a) read the section on floating-point[1] in the Python tutorial, a

[issue5118] '%.2f' % 2.545 doesn't round correctly

2009-01-31 Thread Ultrasick
Ultrasick added the comment: Well that's not what I have learned how rounding works. I think that's the more common way: 0.4 -> 0 0.5 -> 1 0.6 -> 1 I hope you don't try to spread the misbehavoir of pythons way of rounding print '%.2f' % 2.545 // returns 2.54 to the built in round() function.

[issue5118] '%.2f' % 2.545 doesn't round correctly

2009-01-31 Thread Mark Dickinson
Mark Dickinson added the comment: > So you might want to reopen the bug. But either way I don't consider > this bug as really serious either. I don't understand. As far as I can see '%.2f' % 2.545 is returning the correct result: there is no bug here, so no need to reopen. '%.2f' should *not*

[issue5118] '%.2f' % 2.545 doesn't round correctly

2009-01-31 Thread Ultrasick
Ultrasick added the comment: I am sorry but I am not a C programmer. I cannot provide any patches. As far as I understood this issue and issue #1869 have a common problem but this issue wouldn't be solved if issue #1869 is solved. "print '%.2f' % 2.545" doesn't seam to use the built in round()

[issue1869] Builtin round function is sometimes inaccurate for floats

2009-01-31 Thread Mark Dickinson
Mark Dickinson added the comment: See also issue 5118. ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pytho

[issue5118] '%.2f' % 2.545 doesn't round correctly

2009-01-31 Thread Mark Dickinson
Mark Dickinson added the comment: > print round(2.545, 2) // returns 2.55 Aha! Yes, that one *is* a bug (see issue #1869), though it's not one that I regard as terribly serious, and not one that can be easily solved in all cases. Here's why I don't see it as particularly serious: you're rou

[issue5118] '%.2f' % 2.545 doesn't round correctly

2009-01-31 Thread Ultrasick
Ultrasick added the comment: print round(2.545, 2) // returns 2.55 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http:

[issue5118] '%.2f' % 2.545 doesn't round correctly

2009-01-31 Thread Mark Dickinson
Changes by Mark Dickinson : -- status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue5118] '%.2f' % 2.545 doesn't round correctly

2009-01-31 Thread Mark Dickinson
Mark Dickinson added the comment: This is not a bug; it's a consequence of the finite accuracy of floating- point arithmetic. If you look at the actual value that's stored for '2.545', you'll see that it's actually slightly less than 2.545, so rounding it down is the correct thing to do. >>

[issue5118] '%.2f' % 2.545 doesn't round correctly

2009-01-31 Thread Ultrasick
New submission from Ultrasick : print '%.2f' % 2.544 // returns 2.54 print '%.2f' % 2.545 // returns 2.54 but should return 2.55 print '%.2f' % 2.546 // returns 2.55 -- messages: 80868 nosy: Ultrasick severity: normal status: open title: '%.2f' % 2.545 doesn't round correctly type: behav

[issue4753] Faster opcode dispatch on gcc

2009-01-31 Thread Mark Dickinson
Mark Dickinson added the comment: Square brackets added in r69133. The gentoo x86 3.x buildbot seems to be passing the compile stage now. (Though not the test stage, of course: one can't have everything!) ___ Python tracker

[issue5094] datetime lacks concrete tzinfo impl. for UTC

2009-01-31 Thread Antoine Pitrou
Antoine Pitrou added the comment: Please do. The current situation where the doc tells you not to use "naive" datetime objects but Python gives you no way to do so is awful. -- nosy: +pitrou ___ Python tracker

[issue4804] Python on Windows disables all C runtime library assertions

2009-01-31 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: I think we ought to make sure that python doesn't crash, even if one passes a bogus fd to os.closerange(). My current patch catches all invalid arguments in software, except for the file descriptors sometimes allowed. To that end, I suggest my current

[issue5117] os.path.relpath problem with root drive directory on windows

2009-01-31 Thread Hirokazu Yamamoto
Changes by Hirokazu Yamamoto : Added file: http://bugs.python.org/file12906/fix_relpath_v2.patch ___ Python tracker ___ ___ Python-bugs-list ma

[issue5117] os.path.relpath problem with root drive directory on windows

2009-01-31 Thread Hirokazu Yamamoto
Changes by Hirokazu Yamamoto : Removed file: http://bugs.python.org/file12905/fix_relpath_v2.patch ___ Python tracker ___ ___ Python-bugs-list

[issue5117] os.path.relpath problem with root drive directory on windows

2009-01-31 Thread Hirokazu Yamamoto
Hirokazu Yamamoto added the comment: If it is better _abspath_split("/") to return [""] instead of [] for consistency, "fix_relpath_v2.patch" might be better. (There is no difference for relpath behavior though) Added file: http://bugs.python.org/file12905/fix_relpath_v2.patch

[issue5117] os.path.relpath problem with root drive directory on windows

2009-01-31 Thread Hirokazu Yamamoto
Hirokazu Yamamoto added the comment: I hope attached patch will fix this bug. -- keywords: +patch Added file: http://bugs.python.org/file12904/fix_relpath.patch ___ Python tracker __

[issue5117] os.path.relpath problem with root drive directory on windows

2009-01-31 Thread eliben
eliben added the comment: The problem is with these lines: start_list = abspath(start).split(sep) path_list = abspath(path).split(sep) In case of 'd:\', the split returns two elements, the second empty. ___ Python tracker

[issue5117] os.path.relpath problem with root drive directory on windows

2009-01-31 Thread Hirokazu Yamamoto
Hirokazu Yamamoto added the comment: About this, >But this isn't: >relpath(r'd:\jho', r'd:\\') >=> '..\jho' Same happens on posixpath. from posixpath import relpath print relpath(r'/abc', r'/') #=> ../abc I'll look at the code. -- nosy: +ocean-city _