[issue6108] unicode(exception) and str(exception) should return the same message on Py2.6

2009-12-12 Thread Ezio Melotti
Ezio Melotti added the comment: Here is a new patch (issue6108-3.patch) that checks if __str__ has been overridden and calls PyObject_Unicode(PyObject_Str(self)). All the tests (including the one with KeyError) in issue6108_testcase.diff now pass. If the patch is OK I'll make sure that the tes

[issue6108] unicode(exception) and str(exception) should return the same message on Py2.6

2009-12-12 Thread Ezio Melotti
Ezio Melotti added the comment: > An alternative approach that should work even for the KeyError case is > for BaseException_unicode to check explicitly for the situation where > the __str__ slot has been overridden but __unicode__ is still the > BaseException version and invoke "PyObject_Unicod

[issue6108] unicode(exception) and str(exception) should return the same message on Py2.6

2009-12-12 Thread Ezio Melotti
Ezio Melotti added the comment: Assume the case of e = MyException() (note: 0 args) with a __str__ that returns a default message. Now, if the message is ascii, str(e) works and the user see the default message but unicode(e) returns a not-so-useful empty string. On the other hand, if __str__ re

[issue6108] unicode(exception) and str(exception) should return the same message on Py2.6

2009-12-12 Thread Nick Coghlan
Nick Coghlan added the comment: I agree the 2.6 implementation creates backwards compatibility problems with subclasses that only override __str__ that we didn't recognise at the time. An alternative approach that should work even for the KeyError case is for BaseException_unicode to check expl

[issue6108] unicode(exception) and str(exception) should return the same message on Py2.6

2009-12-12 Thread Robert Collins
Robert Collins added the comment: "2) 0 args, e = MyException(), with overridden __str__: py2.5 : str(e) -> 'ascii' or error; unicode(e) -> u'ascii' or error; py2.6 : str(e) -> 'ascii' or error; unicode(e) -> u'' desired: str(e) -> 'ascii' or error; unicode(e) -> u'ascii' or error; No

[issue3932] HTMLParser cannot handle '&' and non-ascii characters in attribute names

2009-12-12 Thread Sérgio
Sérgio added the comment: the patch fix parsing in simple tag a with title with ?! and accents like this: -- nosy: +sergiomb2 ___ Python tracker ___ _

[issue6108] unicode(exception) and str(exception) should return the same message on Py2.6

2009-12-12 Thread Ezio Melotti
Ezio Melotti added the comment: What you said is only a special case, and I agree that the solution introduced with r64791 is correct for that. However, that fix has the side effect of breaking the code in other situations. To summarize the possible cases and the behaviours I prepared the foll

[issue6108] unicode(exception) and str(exception) should return the same message on Py2.6

2009-12-12 Thread Nick Coghlan
Nick Coghlan added the comment: As Antoine said, there's a reason BaseException now implements both __str__ and __unicode__ and doesn't implement the latter in terms of the former - it's the only way to consistently support Unicode arguments that can't be encoded to an 8-bit ASCII string: >>> s

[issue7489] OS X binary installer for 3.1.1 missing from http://www.python.org/download/

2009-12-12 Thread Mitchell Model
New submission from Mitchell Model : Is there some reason the OS X installer is missing from http://www.python.org/download/ but present on http://www.python.org/download/releases/3.1.1/? Seems it should be in both places. -- components: None messages: 96317 nosy: MLModel severity: norma

[issue7488] Mac/README continues to refer to 2.6, not 3

2009-12-12 Thread Mitchell Model
New submission from Mitchell Model : The file Mac/README in the Subversion source continues to refer to 2.6, not the appropriate version of 3. -- components: Build messages: 96316 nosy: MLModel severity: normal status: open title: Mac/README continues to refer to 2.6, not 3 versions: Pyt

[issue6108] unicode(exception) and str(exception) should return the same message on Py2.6

2009-12-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: Well the obvious problem with this approach is that it won't work if __str__() returns a non-ascii string. The only working solution would be to replicate the functioning of __str__() in each __unicode__() implementation. -- ___

[issue6108] unicode(exception) and str(exception) should return the same message on Py2.6

2009-12-12 Thread Ezio Melotti
Ezio Melotti added the comment: > IMO __unicode__ should have the same behaviour as __str__. There's no > reason to implement two different formatting algorithms. If BaseException has both the methods they have to be both overridden by derived exceptions in order to have the same behaviour. The

[issue7402] reduce() is an anti-example in "Idioms and Anti-Idioms"

2009-12-12 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: -> rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http:

[issue6108] unicode(exception) and str(exception) should return the same message on Py2.6

2009-12-12 Thread Nick Coghlan
Nick Coghlan added the comment: Following this down the rabbit hole a little further: Issue #2517 (the origin of my checkin) was just a restoration of the __unicode__ slot implementation that had been ripped out in r51837 due to Issue #1551432. At the time of the r64791 checkin, BaseException_s

[issue7306] Patch - skip winsound tests if no default sound is configured

2009-12-12 Thread Benjamin Peterson
Benjamin Peterson added the comment: You can use unittest.skipUnless instead of skipIf since you have a not condition in all of them. -- nosy: +benjamin.peterson ___ Python tracker _

[issue6654] Add "path" to the xmrlpc dispatcher method

2009-12-12 Thread Benjamin Peterson
Benjamin Peterson added the comment: Hi, Kristjan. Could you port your commit to py3? -- nosy: +benjamin.peterson ___ Python tracker ___ _

[issue7486] doc: Built-in Functions, exec statement is obsolete

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

[issue7479] os.lchmod is not present

2009-12-12 Thread steve
steve added the comment: Thank you for you explanation of os.lchmod() Adding a note to the documentation would be very useful. I did search the internet for an answer before posting the bug, and I was only able to find forum posts of other people having the same issue. Thank you again, peace;

[issue7402] reduce() is an anti-example in "Idioms and Anti-Idioms"

2009-12-12 Thread Christoph Zwerschke
Christoph Zwerschke added the comment: My point was that the passage starts with "there are also many useful built-in functions people seem not to be aware of for some reasons" and then it looks like the author himself was not aware of sum() for some reason because he gives calculating a sum wit

[issue7247] test_fcntl_64_bit from test_fcntl.py fails in Python 2.6.4

2009-12-12 Thread Dror Levin
Changes by Dror Levin : -- nosy: +spatz ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/m

[issue7487] doc: Code is not always colored

2009-12-12 Thread flox
flox added the comment: The bug seems related to Sphynx on Python3. These examples are NOT colored:: class Z: def __init__(self): pass :: class F: def __foo__(self): pass :: class C: def method(self): pass c = C() c.method.__func__.whoami = 'm

[issue7487] doc: Code is not always colored

2009-12-12 Thread flox
New submission from flox : Some code samples are not syntax colored in the doc for Python 3. In the documentation for Python 2, it is OK. Example: http://docs.python.org/dev/py3k/library/stdtypes.html#methods http://docs.python.org/dev/library/stdtypes.html#methods -- assignee: geor

[issue7481] Failing to start a thread leaves "zombie" thread in "initial" state

2009-12-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: I can reproduce it under Linux using "ulimit -Su 2600". (deselecting 2.5 as it doesn't receive bug fixes anymore) -- nosy: +gps, jyasskin, pitrou priority: -> normal stage: -> needs patch versions: +Python 2.7, Python 3.1, Python 3.2 -Python 2.5

[issue7316] Add a timeout functionality to common locking operations

2009-12-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: Updated patch against py3k. -- keywords: +needs review Added file: http://bugs.python.org/file15533/timedlock3.patch ___ Python tracker ___

[issue7306] Patch - skip winsound tests if no default sound is configured

2009-12-12 Thread Brian Curtin
Brian Curtin added the comment: Removing versions that this wouldn't apply to if it were accepted. -- versions: +Python 3.2 -Python 2.6, Python 3.0, Python 3.1 ___ Python tracker ___

[issue7466] Segmentation fault with tuple + gc.collect()

2009-12-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: Committed, thanks! -- resolution: -> fixed stage: needs patch -> committed/rejected status: open -> closed ___ Python tracker ___ _

[issue7475] codecs missing: base64 bz2 hex zlib ...

2009-12-12 Thread Martin v . Löwis
Martin v. Löwis added the comment: > So, after reading the above comments, I think we may end up with > following changes: > * restore the "bytes-to-bytes" codecs in the "encodings" package > * then create new helpers on bytes objects (either >".transform()/.untransform()" or ".encodebytes

[issue5949] IMAP4_SSL spin because of SSLSocket.suppress_ragged_eofs

2009-12-12 Thread R. David Murray
R. David Murray added the comment: Patch modified to skip ssl tests if ssl not available in r76727 in trunk; that changeset included in all merges. p3k merge in r76730 as stated. 2.6 merge in r76761, using the 2.6 patch provided by Scott. 3.1 merge in r76762. -- resolution: -> fixed

[issue7479] os.lchmod is not present

2009-12-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: Perhaps the top-level module description should just be clearer. Right now it is not obvious that functions marked "availability: Unix" may only be available on certain Unix flavours. -- ___ Python tracker

[issue7484] smtplib: verify breaks with Postfix servers

2009-12-12 Thread R. David Murray
R. David Murray added the comment: I agree. My reading of the rfc is that the form without the brackets *must* be supported by the MTA, while any other form is optional. So smtplib should use the required form for its VRFY query. Any MTA that doesn't recognize that form would be broken. 2.5

[issue6108] unicode(exception) and str(exception) should return the same message on Py2.6

2009-12-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: > In r64791, BaseException gained a new __unicode__ method that does the > equivalent of the following things: It remains to be seen why that behaviour was chosen. Apparently Nick implemented it. IMO __unicode__ should have the same behaviour as __str__. There'

[issue7475] codecs missing: base64 bz2 hex zlib ...

2009-12-12 Thread flox
flox added the comment: > And this statement was not converted s/this statement/this method call/ -- ___ Python tracker ___ ___ Pytho

[issue7475] codecs missing: base64 bz2 hex zlib ...

2009-12-12 Thread flox
flox added the comment: Martin, actually, I was trying to convert some piece of code from python2 to python3. And this statement was not converted by 2to3: "x.decode('base64').decode('zlib')" So, I read the official documentation, and found no hint about the removal of these codecs. For my s

[issue7396] regrtest single: iterator not subscriptable

2009-12-12 Thread R. David Murray
R. David Murray added the comment: Yes, rebinding a variable to a different type is something that is considered an acceptable pattern in Python programs, at least in certain circumstances. Python programs generally use 'duck typing', and a list and an iterable have equivalent semantics for the

[issue7486] doc: Built-in Functions, exec statement is obsolete

2009-12-12 Thread flox
Changes by flox : -- keywords: +patch Added file: http://bugs.python.org/file15531/issue7486_doc_py3k.diff ___ Python tracker ___ ___ P

[issue7486] doc: Built-in Functions, exec statement is obsolete

2009-12-12 Thread flox
New submission from flox : In the documentation of "compile(...)", there's a mention of the "exec statement". -- assignee: georg.brandl components: Documentation messages: 96293 nosy: flox, georg.brandl severity: normal status: open title: doc: Built-in Functions, exec statement is obsol

[issue7469] Design and History FAQ entry on Floating Point does not mention short repr.

2009-12-12 Thread R. David Murray
R. David Murray added the comment: No, you are right, there's nothing actually inaccurate. It might be good for it to say, about repr, that it prints the "minimum number of digits necessary", which is what is different from the old behavior. But I agree that it doesn't *have* to change. -

[issue7485] Error in FAQ entry '4.25 Why doesn't Python have a "with" statement for attribute assignments?'

2009-12-12 Thread Eric Smith
New submission from Eric Smith : The documentation says: "If the referenced object does not have a, b and c attributes, of course, the end result is still a run-time exception." For the given example, this is likely not true. Since the attributes are being assigned to, they will be created. The

[issue7469] Design and History FAQ entry on Floating Point does not mention short repr.

2009-12-12 Thread Mark Dickinson
Mark Dickinson added the comment: Is there anything actually *wrong* with that FAQ section? I'm not sure how mentioning short float repr would address any particular FAQ. Unless that FAQ is "why do 2.6 and 2.7 give different results?". I agree that the tutorial section for trunk needs updat

[issue7479] os.lchmod is not present

2009-12-12 Thread Martin v . Löwis
Martin v. Löwis added the comment: If we do that, we would probably need to acknowledge that most functions in the POSIX module are available only on some Unixes - namely all that are listed in posix_methods with conditional compilation. That, in turn, would be silly for things like getcwd where

[issue7479] os.lchmod is not present

2009-12-12 Thread Georg Brandl
Georg Brandl added the comment: I don't see why we can't start it. I'd prefer "Some Unices" though, since you never know when e.g. Linux is going to start supporting e.g. lchmod(). -- status: closed -> open ___ Python tracker

[issue7402] reduce() is an anti-example in "Idioms and Anti-Idioms"

2009-12-12 Thread Raymond Hettinger
Raymond Hettinger added the comment: FWIW, I think the example is fine as-is. It could be changed to a product example: reduce(operator.mul, range(1, n+1)) or somesuch. Also, the text could be modified to mention sum(). But it is also fine if the example is unchanged, it does show how reduce

[issue7396] regrtest single: iterator not subscriptable

2009-12-12 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +michael.foord, ncoghlan, pitrou, r.david.murray priority: -> normal versions: -Python 3.0 ___ Python tracker ___

[issue7402] reduce() is an anti-example in "Idioms and Anti-Idioms"

2009-12-12 Thread Ezio Melotti
Ezio Melotti added the comment: The example alone can't be fixed, because half of the section talks about how useful reduce() is. The whole document should IMHO be rewritten, possibly using some of the examples in http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html I already as

[issue7483] str.format behaviour changed from Python 2.6

2009-12-12 Thread Eric Smith
Eric Smith added the comment: This is a duplicate of issue 6902. I have a patch for that in the works. -- resolution: -> duplicate status: open -> closed ___ Python tracker ___