[issue2256] Install failure of 2.6a1 on Windows XP without VS8 installed

2008-04-09 Thread Martin v. Löwis
Martin v. Löwis <[EMAIL PROTECTED]> added the comment: > Ping. Does the problem still exist in 2.6a2? It shouldn't. __ Tracker <[EMAIL PROTECTED]> __ __

[issue2604] doctest.DocTestCase fails when run repeatedly

2008-04-09 Thread Piet Delport
Piet Delport <[EMAIL PROTECTED]> added the comment: Addendum: This appears to be a regression in r36809 (Python 2.4+). __ Tracker <[EMAIL PROTECTED]> __ ___

[issue2604] doctest.DocTestCase fails when run repeatedly

2008-04-09 Thread Piet Delport
New submission from Piet Delport <[EMAIL PROTECTED]>: DocTestCase.tearDown destructively clears its DocTest instance's globs, preventing the test from being run repeatedly (such as with trial --until-failure). There's a fix for this in zope.testing's version of doctest, which resets the globs in

[issue2530] Document IO module

2008-04-09 Thread Benjamin Peterson
Benjamin Peterson <[EMAIL PROTECTED]> added the comment: When you remove the class from the method declaration, it shows up in the html as io.write? Is this correct? __ Tracker <[EMAIL PROTECTED]>

[issue2603] Make range __eq__ work

2008-04-09 Thread Benjamin Peterson
Benjamin Peterson <[EMAIL PROTECTED]> added the comment: Thanks for the help. Added file: http://bugs.python.org/file9995/range_eq2.patch __ Tracker <[EMAIL PROTECTED]> __

[issue2587] PyString_FromStringAndSize() to be considered unsafe

2008-04-09 Thread Guido van Rossum
Guido van Rossum <[EMAIL PROTECTED]> added the comment: > [*sigh* i wish we didn't use a signed size type all over the place] What would you use for error returns then? __ Tracker <[EMAIL PROTECTED]> ___

[issue2587] PyString_FromStringAndSize() to be considered unsafe

2008-04-09 Thread Gregory P. Smith
Gregory P. Smith <[EMAIL PROTECTED]> added the comment: release25-maint r62262 I'm closing this one. Please open additional issues with patches and/or pointers to bad callers of *_FromStringAndSize that let negative values through. [*sigh* i wish we didn't use a signed size type all over the p

[issue1049] socket.socket.getsockname() has inconsistent UNIX/Windows behavior

2008-04-09 Thread Bill Janssen
Bill Janssen <[EMAIL PROTECTED]> added the comment: Here's what the OS X man page says: The getsockname() function returns the value 0 if successful; otherwise the value -1 is returned and the global variable errno is set to indicate the error. __ Tracker <[EMAIL

[issue2587] PyString_FromStringAndSize() to be considered unsafe

2008-04-09 Thread Gregory P. Smith
Gregory P. Smith <[EMAIL PROTECTED]> added the comment: python trunk r62261 adds the checks and SystemError. patches to cleanup modules that inadvertently allow negative values to be passed into *_FromStringAndSize would still be appreciated. __ Tracker <[EMAIL P

[issue2587] PyString_FromStringAndSize() to be considered unsafe

2008-04-09 Thread Gregory P. Smith
Changes by Gregory P. Smith <[EMAIL PROTECTED]>: Removed file: http://bugs.python.org/file9994/unnamed __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs

[issue2587] PyString_FromStringAndSize() to be considered unsafe

2008-04-09 Thread Gregory P. Smith
Changes by Gregory P. Smith <[EMAIL PROTECTED]>: -- assignee: -> gregory.p.smith __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing

[issue2603] Make range __eq__ work

2008-04-09 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: On Wed, Apr 9, 2008 at 6:08 PM, Georg Brandl <[EMAIL PROTECTED]> wrote: > Ah yes, and variable declarations must be at the start of a block You can avoid the need for extra local variables by declaring range_richcompare arguments as r

[issue2256] Install failure of 2.6a1 on Windows XP without VS8 installed

2008-04-09 Thread Jim Kleckner
Jim Kleckner <[EMAIL PROTECTED]> added the comment: It appears that issue2563 may be a dependency. __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list

[issue2587] PyString_FromStringAndSize() to be considered unsafe

2008-04-09 Thread Guido van Rossum
Guido van Rossum <[EMAIL PROTECTED]> added the comment: Cool. Let's make this a SystemError (in both debug builds and non-debug build). Greg, go ahead and fix it. -- nosy: +gvanrossum __ Tracker <[EMAIL PROTECTED]> _

[issue2256] Install failure of 2.6a1 on Windows XP without VS8 installed

2008-04-09 Thread Jim Kleckner
Jim Kleckner <[EMAIL PROTECTED]> added the comment: Ping. __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.

[issue2587] PyString_FromStringAndSize() to be considered unsafe

2008-04-09 Thread Gregory P. Smith
Gregory P. Smith <[EMAIL PROTECTED]> added the comment: I think I like the SystemError approach for the same reasons. It still exposes the caller's bug but no longer does bad things. Added file: http://bugs.python.org/file9994/unnamed __ Tracker <[EMAIL PROTECTE

[issue2603] Make range __eq__ work

2008-04-09 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: Actually, the patch contains an exploitable bug: $ cat x.py class X(int): def __eq__(self, other): raise ValueError x = range(X(1),X(10),X(1)) x == x $ ./python x.py Segmentation fault (core dumped) __

[issue2568] Seconds range in time unit

2008-04-09 Thread Georg Brandl
Changes by Georg Brandl <[EMAIL PROTECTED]>: -- assignee: georg.brandl -> __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing list

[issue2568] Seconds range in time unit

2008-04-09 Thread Georg Brandl
Georg Brandl <[EMAIL PROTECTED]> added the comment: Okay, sorry that I made uninformed guesses :) __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list

[issue2530] Document IO module

2008-04-09 Thread Georg Brandl
Georg Brandl <[EMAIL PROTECTED]> added the comment: Other than the "class.method" change you already noticed, I changed some "method"s to "attribute"s (since they are @propertied in the source), removed parens in :meth:`` roles, moved the constructor description into the .. class block and did so

[issue2603] Make range __eq__ work

2008-04-09 Thread Georg Brandl
Georg Brandl <[EMAIL PROTECTED]> added the comment: Ah yes, and variable declarations must be at the start of a block, else MSVC (and possible other compilers) will complain. __ Tracker <[EMAIL PROTECTED]> ___

[issue2603] Make range __eq__ work

2008-04-09 Thread Georg Brandl
Georg Brandl <[EMAIL PROTECTED]> added the comment: I have no opinion whether the patch should go in, but in any case: * You should use PyObject_RichCompareBool. * You should error-check the returns of those. -- nosy: +georg.brandl __ Tracker <[EMAIL PRO

[issue2603] Make range __eq__ work

2008-04-09 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: Your patch does not check the return values of PyObject_RichCompare calls for NULL. This is probably ok given the current restrictions on the type of start/step/stop, but adding the null checks will make the code more robust. -

[issue2530] Document IO module

2008-04-09 Thread Benjamin Peterson
Benjamin Peterson <[EMAIL PROTECTED]> added the comment: Georg, I have a few questions: Just out of curiosity, what did you change? Are their markup things I missed or other things you're looking for that I just didn't get? Are we going to want to push some of this stuff back into the docstrings

[issue2603] Make range __eq__ work

2008-04-09 Thread Benjamin Peterson
New submission from Benjamin Peterson <[EMAIL PROTECTED]>: This patch makes this work: >>> range(4) == range(4) True This is in similar fashion to dict.keys >>> {1:2}.keys() == {1:2}.keys() True Tests included. -- components: Interpreter Core files: range_eq.patch keywords: patch messa

[issue2598] "{ +(}".format(**{' +(': 44}) should produce ValueError: invalid identifier, ' +(' in format

2008-04-09 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: This is a feature explained in PEP 3101: """ Implementation note: The implementation of this proposal is not required to enforce the rule about a simple or dotted name being a valid Python identifier. Instead, it will rely

[issue2599] allow field_name in format strings to default to next positional argument (e.g., "{}")

2008-04-09 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: Omitting the ordinals from {} format units will present a problem with internationalization because the arguments may need to be rendered in different order in different languages. This is a frequent problem with the % formats and it is

[issue2587] PyString_FromStringAndSize() to be considered unsafe

2008-04-09 Thread Justin Ferguson
Justin Ferguson <[EMAIL PROTECTED]> added the comment: > 1. If you change PyString_FromStringAndSize, you should change > PyBytes_FromStringAndSize and PyUnicode_FromStringAndSize for > consistency. Okay, if we don't patch the API call itself, I will look at the users of those two API calls as w

[issue2568] Seconds range in time unit

2008-04-09 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: On Wed, Apr 9, 2008 at 2:49 PM, Georg Brandl <[EMAIL PROTECTED]> wrote: > Isn't the bug here rather that strptime doesn't allow leap seconds? This is not specific to strptime. The datetime module does not allow leap seconds: Traceba

[issue2587] PyString_FromStringAndSize() to be considered unsafe

2008-04-09 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: On Wed, Apr 9, 2008 at 3:08 PM, Justin Ferguson <[EMAIL PROTECTED]> wrote: > Okay, so I'm not sure whose point of view takes precedence here? I don't have a strong view on this, but just a few points to consider: 1. If you change PyS

[issue2601] [regression] reading from a urllib2 file descriptor happens byte-at-a-time

2008-04-09 Thread Georg Brandl
Changes by Georg Brandl <[EMAIL PROTECTED]>: -- priority: high -> critical __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing list

[issue2587] PyString_FromStringAndSize() to be considered unsafe

2008-04-09 Thread Justin Ferguson
Justin Ferguson <[EMAIL PROTECTED]> added the comment: Okay, so I'm not sure whose point of view takes precedence here? Also, to answer the question asked, I'm doing this manually. __ Tracker <[EMAIL PROTECTED]>

[issue1297] pyconfig.h not compatible with MS VC++ Express Edition

2008-04-09 Thread Martin v. Löwis
Martin v. Löwis <[EMAIL PROTECTED]> added the comment: > Amaury: The file python.hpp, thus basetsd.h, is used by boost-python. I don't think that was the question. Instead, the question was: why is basetsd.h needed in the first place, when compiling Python? Apparently, basetsd was added in r159

[issue2221] Py30a3: eval in threaded code raises SystemError

2008-04-09 Thread Kurt B. Kaiser
Kurt B. Kaiser <[EMAIL PROTECTED]> added the comment: PyObject_CallMethod is actually returning a non-NULL result for sys.std{out,err}, and PyErr_Clear() isn't being run in flush_io. The problem is deeper. PyErr is being used during unexceptional processing in typeobject.c:slot_tp_getattr_hook

[issue2513] 64bit cross compilation on windows

2008-04-09 Thread Martin v. Löwis
Martin v. Löwis <[EMAIL PROTECTED]> added the comment: > Martin - my patch creates a new executable in Lib\distutils\command, and > IMO it should be included in binary builds for all windows platforms. > Is there something I should change in the MSI process? Yes, I fixed that in r62255: it now

[issue2568] Seconds range in time unit

2008-04-09 Thread Georg Brandl
Georg Brandl <[EMAIL PROTECTED]> added the comment: Isn't the bug here rather that strptime doesn't allow leap seconds? __ Tracker <[EMAIL PROTECTED]> __ ___

[issue2587] PyString_FromStringAndSize() to be considered unsafe

2008-04-09 Thread Gregory P. Smith
Changes by Gregory P. Smith <[EMAIL PROTECTED]>: -- priority: -> high versions: +Python 2.6 __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-l

[issue2587] PyString_FromStringAndSize() to be considered unsafe

2008-04-09 Thread Gregory P. Smith
Gregory P. Smith <[EMAIL PROTECTED]> added the comment: agreed, the assert in PyString_FromStringAndSize() should be changed to a non-debug test. -- nosy: +gregory.p.smith __ Tracker <[EMAIL PROTECTED]> _

[issue2588] PyOS_vsnprintf() underflow leads to memory corruption

2008-04-09 Thread Justin Ferguson
Justin Ferguson <[EMAIL PROTECTED]> added the comment: Yep, that works for me. __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing list Unsub

[issue2575] Reference manual: production for integer literals is missing "bininteger"

2008-04-09 Thread Georg Brandl
Georg Brandl <[EMAIL PROTECTED]> added the comment: Thanks, fixed in r62254. -- resolution: -> fixed status: open -> closed __ Tracker <[EMAIL PROTECTED]> __ _

[issue2580] Revise builtin class int library manual entry

2008-04-09 Thread Georg Brandl
Georg Brandl <[EMAIL PROTECTED]> added the comment: Committed as r62253. Thanks! -- resolution: -> accepted status: open -> closed __ Tracker <[EMAIL PROTECTED]> __ __

[issue2530] Document IO module

2008-04-09 Thread Georg Brandl
Georg Brandl <[EMAIL PROTECTED]> added the comment: Reviewed, changed a few things and committed as r62252. Thanks! -- resolution: -> accepted status: open -> closed __ Tracker <[EMAIL PROTECTED]> __

[issue2587] PyString_FromStringAndSize() to be considered unsafe

2008-04-09 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: On Wed, Apr 9, 2008 at 1:20 PM, Justin Ferguson <[EMAIL PROTECTED]> wrote: .. > Do I need to create proof of concepts for each of these bugs, or can I > reference this ticket? > It would be best if you could provide a patch complete w

[issue1745] Backport of PEP 3102 "keyword-only arguments" to 2.6

2008-04-09 Thread Eric Smith
Eric Smith <[EMAIL PROTECTED]> added the comment: The patch doesn't apply cleanly for me. I can fix the non-clean patch, but another error is that obj2ast_arguments doesn't call arguments() with the correct parameters. If I pass in NULL's for the new params, all tests pass, but that just tells

[issue2585] urllib2.HTTPError broken due to urllib.addinfourl changes

2008-04-09 Thread Georg Brandl
Georg Brandl <[EMAIL PROTECTED]> added the comment: Thanks Guilherme, that is indeed a detail that I forgot. Fixed in r62246. -- resolution: -> fixed status: open -> closed __ Tracker <[EMAIL PROTECTED]> ___

[issue1184112] Missing trailing newline with comment raises SyntaxError

2008-04-09 Thread Georg Brandl
Georg Brandl <[EMAIL PROTECTED]> added the comment: The exec example still presents me a syntax error in 2.5.2. _ Tracker <[EMAIL PROTECTED]> _ __

[issue2588] PyOS_vsnprintf() underflow leads to memory corruption

2008-04-09 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: On Wed, Apr 9, 2008 at 1:16 PM, Justin Ferguson <[EMAIL PROTECTED]> wrote: .. > That said, theres plenty of other implementations that manage this > without the potential of underflowing a buffer > Do you have in mind something like t

[issue2579] Misleading 'toctree references unknown document' error

2008-04-09 Thread Georg Brandl
Georg Brandl <[EMAIL PROTECTED]> added the comment: Thanks, fixed in r62245. -- resolution: -> fixed status: open -> closed __ Tracker <[EMAIL PROTECTED]> __ _

[issue2578] Figure out what to do with unittest's redundant APIs

2008-04-09 Thread Steve Purcell
Steve Purcell <[EMAIL PROTECTED]> added the comment: Hey, I came to Python from Perl, Java *and* C++! I'm pretty sure the xUnits in all those other languages hold to the same basic API. Adding more TestLoaders/TestRunners sounds like an excellent move. I'd expect that once those common conve

[issue2587] PyString_FromStringAndSize() to be considered unsafe

2008-04-09 Thread Justin Ferguson
Justin Ferguson <[EMAIL PROTECTED]> added the comment: Do I need to create proof of concepts for each of these bugs, or can I reference this ticket? __ Tracker <[EMAIL PROTECTED]> __ __

[issue2588] PyOS_vsnprintf() underflow leads to memory corruption

2008-04-09 Thread Justin Ferguson
Justin Ferguson <[EMAIL PROTECTED]> added the comment: Actually, I'm not sure things are any better today- even the same operating system but different versions have inconsistencies, for instance on some versions of RHEL the vsnprintf() can fail during unicode conversion. MSVCRT still returns -1

[issue2587] PyString_FromStringAndSize() to be considered unsafe

2008-04-09 Thread Justin Ferguson
Justin Ferguson <[EMAIL PROTECTED]> added the comment: While I think its a mistake that will cause security concerns in Python for quite some time to come, thats fair enough. I will refile all the places that this messes up individually __ Tracker <[EMAIL PROTECT

[issue2578] Figure out what to do with unittest's redundant APIs

2008-04-09 Thread Guido van Rossum
Guido van Rossum <[EMAIL PROTECTED]> added the comment: > Steve Purcell <[EMAIL PROTECTED]> added the comment: > Hey, I'm open to anything. If I started writing unittest from scratch > knowing what I know now, I'd probably have kept the API a little > slimmer. Oh, and I'd have named everthi

[issue2585] urllib2.HTTPError broken due to urllib.addinfourl changes

2008-04-09 Thread Guilherme Polo
Guilherme Polo <[EMAIL PROTECTED]> added the comment: It seems the fix is just passing code to addinfourl __init__, not sure if someone forgot this or this is just totally wrong. Patch added. -- keywords: +patch nosy: +gpolo Added file: http://bugs.python.org/file9992/urllib2_2585.diff

[issue2602] importing gtk hangs (freebsd 7.0)

2008-04-09 Thread Benjamin Peterson
Benjamin Peterson <[EMAIL PROTECTED]> added the comment: I'm going to close this, since it is probably a gtk or FreeBSD problem. Please report if this it not so. -- nosy: +benjamin.peterson resolution: -> invalid status: open -> closed __ Tracker <[EMAIL

[issue2587] PyString_FromStringAndSize() to be considered unsafe

2008-04-09 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: I agree that PySSL_SSLread should check that its argument is >= 0. I don't think this check belongs to PyString_FromStringAndSize. It should be the responsibility of the caller to verify that the precondition size >= 0 is satisfied

[issue1751] Fast BytesIO implementation + misc changes

2008-04-09 Thread Antoine Pitrou
Changes by Antoine Pitrou <[EMAIL PROTECTED]>: -- type: -> performance __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing list Uns

[issue2523] binary buffered reading is quadratic

2008-04-09 Thread Antoine Pitrou
Antoine Pitrou <[EMAIL PROTECTED]> added the comment: By the way, a simple way to fix it would be to use a native BytesIO object (as provided by Alexandre's patch in #1751) rather than a str object for the underlying buffer. __ Tracker <[EMAIL PROTECTED]>

[issue2602] importing gtk hangs (freebsd 7.0)

2008-04-09 Thread Antoine Pitrou
Antoine Pitrou <[EMAIL PROTECTED]> added the comment: You should report this to the FreeBSD team, because I think importing gtk works on most platforms. Also, gtk is not part of the Python standard library, and since it's a very large package I doubt people here are wanting to debug it. Of cours

[issue2541] Unicode escape sequences not parsed in raw strings.

2008-04-09 Thread Marc-Andre Lemburg
Marc-Andre Lemburg <[EMAIL PROTECTED]> added the comment: While that's true for cPickle, it is not for pickle. The pickle protocol itself is defined in terms of the "raw-unicode-escape" codec (see pickle.py). Besides, you cannot assume that the Python interpreter itself is the only use-case for

[issue2602] importing gtk hangs (freebsd 7.0)

2008-04-09 Thread Taavi Repän
New submission from Taavi Repän <[EMAIL PROTECTED]>: Python 2.5.3a0 (release25-maint:62241, Apr 9 2008, 11:26:27) [GCC 4.2.1 20070719 [FreeBSD]] on freebsd7 Type "help", "copyright", "credits" or "license" for more information. >>> import pygtk >>> import gtk [hangs here] -- files: ba