[issue13405] Add DTrace probes

2012-01-20 Thread anatoly techtonik
anatoly techtonik added the comment: I am an almost complete 0 in C system programming and in DTrace matters, but I feel like DTrace has a potential to help me understand internal CPython processes better. If maintenance of the code with DTrace is hard, there are several ways to make it easier:

[issue13703] Hash collision security issue

2012-01-20 Thread Charles-François Natali
Charles-François Natali added the comment: > A dict can contain non-orderable keys, I don't know how an AVL tree > can fit into that. They may be non-orderable, but since they are required to be hashable, I guess one can build an comparison function with the following: def cmp(x, y): if x

[issue13703] Hash collision security issue

2012-01-20 Thread Frank Sievertsen
Frank Sievertsen added the comment: > They may be non-orderable, but since they are required to be hashable, > I guess one can build an comparison function with the following: Since we are are trying to fix a problem where hash(X) == hash(Y), you can't make them orderable by using the hash-valu

[issue13736] urllib.request.urlopen leaks exceptions from socket and httplib.client

2012-01-20 Thread Senthil Kumaran
Changes by Senthil Kumaran : -- assignee: -> orsenthil ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://

[issue13703] Hash collision security issue

2012-01-20 Thread Charles-François Natali
Charles-François Natali added the comment: > Since we are are trying to fix a problem where hash(X) == hash(Y), you > can't make them orderable by using the hash-values and build a binary > out of the (equal) hash-values. That's not what I suggested. Keys would be considered equal if they are i

[issue13703] Hash collision security issue

2012-01-20 Thread Frank Sievertsen
Frank Sievertsen added the comment: > The hash value is just used to know if the key belongs to the left > or the right child tree. Yes, that's what I don't understand: How can you do this, when ALL hash-values are equal. -- ___ Python tracker

[issue13817] deadlock in subprocess while running several threads using Popen

2012-01-20 Thread Martijn van Oosterhout
Martijn van Oosterhout added the comment: What a concidence, we had this problem as well and just today tracked it down, and turns out someone filed this bug yesterday. I note the referenced bug (#13156) says that it's been fixed in the release branch but not yet released. I don't suppose the

[issue13703] Hash collision security issue

2012-01-20 Thread Charles-François Natali
Charles-François Natali added the comment: > Yes, that's what I don't understand: How can you do this, when ALL > hash-values are equal. You're right, that's stupid. Short night... -- ___ Python tracker _

[issue13703] Hash collision security issue

2012-01-20 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Charles-François Natali wrote: > > Anyway, I still think that the hash randomization is the right way to > go, simply because it does solve the problem, whereas the collision > counting doesn't: Martin made a very good point on python-dev with his > databas

[issue13807] logging.Handler.handlerError() may raise AttributeError in traceback.print_exception()

2012-01-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset b60c789c4ccd by Vinay Sajip in branch '2.7': Closes #13807: Now checks for sys.stderr being there before writing to it. http://hg.python.org/cpython/rev/b60c789c4ccd New changeset 73dad4940b88 by Vinay Sajip in branch '3.1': Closes #13807: Now chec

[issue13516] Gzip old log files in rotating handlers

2012-01-20 Thread Vinay Sajip
Vinay Sajip added the comment: Refactoring in 57295c4d81ac supports this use case. -- resolution: -> fixed stage: -> committed/rejected status: open -> closed ___ Python tracker _

[issue8108] test_ftplib fails with OpenSSL 0.9.8m

2012-01-20 Thread Maxim Yegorushkin
Maxim Yegorushkin added the comment: I am still having this issue with Python-2.7.2 (which includes the patch) and openssl-devel-1.0.0e-1.fc14.x86_64: File "./download.py", line 195, in download_file ftp.retrbinary("retr " + filename, lambda data: file.write(data)) File "/usr/local/ots

[issue13703] Hash collision security issue

2012-01-20 Thread STINNER Victor
STINNER Victor added the comment: > Note that the collision counting demo patch is trivial - I just > wanted to demonstrate how it works. As already mentioned, there's > room for improvement: > > If Python objects were to provide an additional > method for calculating a universal hash value (bas

[issue13736] urllib.request.urlopen leaks exceptions from socket and httplib.client

2012-01-20 Thread Antoine Pitrou
Antoine Pitrou added the comment: I think the general pattern of wrapping exceptions in other exceptions is rather unfortunate. It makes it harder to examine the original problem (for example the ``errno`` attribute) for no actual gain. -- nosy: +pitrou __

[issue13703] Hash collision security issue

2012-01-20 Thread Charles-François Natali
Charles-François Natali added the comment: > So you get the best of both worlds and randomization would only > kick in when it's really needed to keep the application running. Of course, but then the collision counting approach loses its main advantage over randomized hashing: smaller patch, ea

[issue13760] ConfigParser exceptions are not pickleable

2012-01-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset e63e2471f46f by Łukasz Langa in branch 'default': #13760: picklability tests for configparser exceptions http://hg.python.org/cpython/rev/e63e2471f46f New changeset 76077971ee1f by Łukasz Langa in branch '3.2': #13760: picklability tests for config

[issue13822] is(upper/lower/title) are not exactly correct

2012-01-20 Thread Ezio Melotti
Changes by Ezio Melotti : -- stage: -> needs patch type: -> enhancement ___ Python tracker ___ ___ Python-bugs-list mailing list Uns

[issue13814] Generators as context managers.

2012-01-20 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +ncoghlan versions: +Python 3.3 -Python 2.7, Python 3.4 ___ Python tracker ___ ___ Python-bugs-li

[issue13832] tokenization assuming ASCII whitespace; missing multiline case

2012-01-20 Thread Jim Jewett
Jim Jewett added the comment: Ignoring non-ascii whitespace is defensible, and I agree that it should match the rest of the parser. Ignoring 2nd lines is still a problem, and supposedly part of what got fixed. Test case: s="""x=5 # comment x=6 """ compile(s, "", 'single') --

[issue13832] tokenization assuming ASCII whitespace; missing multiline case

2012-01-20 Thread Benjamin Peterson
Benjamin Peterson added the comment: $ ./python Python 3.3.0a0 (default:50a4af2ca654+, Jan 20 2012, 10:59:48) [GCC 4.5.3] on linux Type "help", "copyright", "credits" or "license" for more information. >>> s="""x=5 # comment ... x=6 ... """ >>> compile(s, "", "single") Traceback (most recent

[issue13760] ConfigParser exceptions are not pickleable

2012-01-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset 5ecf650ede7c by Łukasz Langa in branch '2.7': Fixes #13760: picklability of ConfigParser exceptions http://hg.python.org/cpython/rev/5ecf650ede7c -- ___ Python tracker

[issue13760] ConfigParser exceptions are not pickleable

2012-01-20 Thread Łukasz Langa
Łukasz Langa added the comment: 3.2 and 3.3 already worked as expected. For 2.7 I did the __reduce__ workaround that's also used by SQLAlchemy. -- resolution: -> fixed stage: test needed -> committed/rejected status: open -> closed type: -> behavior _

[issue13736] urllib.request.urlopen leaks exceptions from socket and httplib.client

2012-01-20 Thread Jyotirmoy Bhattacharya
Jyotirmoy Bhattacharya added the comment: Antoine, could "raise ... from" be used here? Perhaps also using new subclasses of URLError to allow the exceptions to be caught with finer granularity. That way no information would be lost while at the same time not surprising clients who only catch

[issue13822] is(upper/lower/title) are not exactly correct

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

[issue13736] urllib.request.urlopen leaks exceptions from socket and httplib.client

2012-01-20 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Antoine, could "raise ... from" be used here? That's a possible compromise indeed. It's up to Senthil to decide anyway. > Perhaps also using new subclasses of URLError to allow the exceptions > to be caught with finer granularity. That way no information wo

[issue13703] Hash collision security issue

2012-01-20 Thread Jim Jewett
Jim Jewett added the comment: Marc-Andre Lemburg: >> So you get the best of both worlds and randomization would only >> kick in when it's really needed to keep the application running. Charles-François Natali > The only argument in favor the collision counting is that it will not > break applic

[issue13703] Hash collision security issue

2012-01-20 Thread Guido van Rossum
Guido van Rossum added the comment: On Thu, Jan 19, 2012 at 8:58 PM, Frank Sievertsen wrote: > > Frank Sievertsen added the comment: > > >> That's true. But without the suffix, I can pretty easy and efficient > >> guess the prefix by just seeing the result of a few well-chosen and > >> short r

[issue13703] Hash collision security issue

2012-01-20 Thread Jim Jewett
Jim Jewett added the comment: On Fri, Jan 20, 2012 at 7:58 AM, STINNER Victor > If the hash output depends on an argument, the result cannot be > cached. They can still be cached in a separate dict based on id, rather than string contents. It may also be possible to cache them in the dict itse

[issue13806] Audioop decompression frames size check fix

2012-01-20 Thread Antoine Pitrou
Antoine Pitrou added the comment: Do you think it would be possible to add a test for valid compressed data that used to trigger the check? -- ___ Python tracker ___ __

[issue13703] Hash collision security issue

2012-01-20 Thread STINNER Victor
STINNER Victor added the comment: I ran the test suite of Twisted 11.1 using a limit of 20 collisions: there is no test failing because of hash collisions. -- ___ Python tracker ___

[issue13760] ConfigParser exceptions are not pickleable

2012-01-20 Thread Faheem Mitha
Faheem Mitha added the comment: Thanks for the quick attention to this, Lukasz. I'm just curious. Why do 3.2 and 3.3 already work? My understanding was that the basic exception issue in http://bugs.python.org/issue1692335 was still open. -- ___ Pyt

[issue11076] Iterable argparse Namespace

2012-01-20 Thread Jean-Lou Dupont
Changes by Jean-Lou Dupont : -- nosy: +Jean-Lou.Dupont ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://m

[issue13829] exception error

2012-01-20 Thread Brett Cannon
Brett Cannon added the comment: Can you isolate the cause? There is way too much in that core dump to try to debug the problem. Without knowing what code in this Moviegrabber app caused the bug we can't do anything to debug the issue. -- nosy: +brett.cannon status: open -> pending __

[issue13405] Add DTrace probes

2012-01-20 Thread Jesús Cea Avión
Changes by Jesús Cea Avión : -- stage: -> patch review ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://

[issue13829] exception error

2012-01-20 Thread Dan kamp
Dan kamp added the comment: On Jan 20, 2012, at 4:20 PM, Brett Cannon wrote: > Can you isolate the cause? There is way too much in that core dump to try to > debug the problem. Without knowing what code in this Moviegrabber app caused > the bug we can't do anything to debug the issue. All I

[issue13703] Hash collision security issue

2012-01-20 Thread Dave Malcolm
Dave Malcolm added the comment: On Fri, 2012-01-06 at 12:52 +, Marc-Andre Lemburg wrote: > Marc-Andre Lemburg added the comment: > > Demo patch implementing the collision limit idea for Python 2.7. > > -- > Added file: http://bugs.python.org/file24151/hash-attack.patch > Marc: i

[issue13782] xml.etree.ElementTree: Element.append doesn't type-check its argument

2012-01-20 Thread Terry J. Reedy
Terry J. Reedy added the comment: Confirmed with on 3.2.2 Win7 for all three methods. Docs say .append should raise AssertionError (see below). However, that is unusual and TypeError is normal practice. I am not sure what to do. Our docs say: ''' append(subelement) Adds the element subelement

[issue13790] In str.format an incorrect error message for list, tuple, dict, set

2012-01-20 Thread Terry J. Reedy
Terry J. Reedy added the comment: Doc patch attached to make sure correct. Should {} be quoted? Eric, do you want to close off the idea of changing :d errors, or switch back after the doc fix? -- keywords: +patch nosy: +terry.reedy stage: -> test needed Added file: http://bugs.python

[issue13405] Add DTrace probes

2012-01-20 Thread Jesús Cea Avión
Jesús Cea Avión added the comment: My point about DTrace probes is not performance per-se but observability. An OS with DTrace support can be completely inspected and shows you ALL the inner working. You can see a particular pattern in the operating system and locate the syscalls and the proc

[issue13790] In str.format an incorrect error message for list, tuple, dict, set

2012-01-20 Thread Eric V. Smith
Eric V. Smith added the comment: I don't think "{}" is the correct way to document this. These all have an empty format specifier: "{}".format(foo) "{:}".format(foo) "{0}".format(foo) "{0:}".format(foo) "{name}".format(name=foo) format(foo, "") format(foo) That is, they all call foo.__format_

[issue13796] use 'text=...' to define the text attribute of and xml.etree.ElementTree.Element

2012-01-20 Thread Terry J. Reedy
Terry J. Reedy added the comment: Pedro and Patrick: if you are going to respond by email rather than by typing in the browser box, PLEASE delete the quoted text. Or on occasion, quote a line or two if really necessary, as when responding to a previous message other than the last one. Each me

[issue13798] Pasting and then running code doesn't work in the IDLE Shell

2012-01-20 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- resolution: -> duplicate status: open -> closed superseder: -> Pasted \n not same as typed \n ___ Python tracker ___

[issue13799] Base 16 should be hexadecimal in Unicode HOWTO

2012-01-20 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- nosy: +terry.reedy ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.p

[issue13804] Python library structure creates hard to read code when using higher order functions

2012-01-20 Thread Terry J. Reedy
Terry J. Reedy added the comment: I am closing this because map has even less chance of being made a collection method than join. Unlike join, map takes any positive number of iterables as args, not just one. 'Iterables' includes iterators, which intentionally need have no methods other than

[issue13812] multiprocessing package doesn't flush stderr on child exception

2012-01-20 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- nosy: +jnoller stage: -> test needed versions: -Python 3.4 ___ Python tracker ___ ___ Python-bugs-lis

[issue13703] Hash collision security issue

2012-01-20 Thread Dave Malcolm
Dave Malcolm added the comment: On Fri, 2012-01-20 at 22:55 +, Dave Malcolm wrote: > Dave Malcolm added the comment: > > On Fri, 2012-01-06 at 12:52 +, Marc-Andre Lemburg wrote: > > Marc-Andre Lemburg added the comment: > > > > Demo patch implementing the collision limit idea for Pyt

[issue6631] Disallow relative files paths in urllib*.open()

2012-01-20 Thread Senthil Kumaran
Changes by Senthil Kumaran : -- title: urlparse.urlunsplit() can't handle relative files (for urllib*.open() -> Disallow relative files paths in urllib*.open() ___ Python tracker ___

[issue6631] Disallow relative files paths in urllib*.open()

2012-01-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset f6008e936fbc by Senthil Kumaran in branch '2.7': Fix Issue6631 - Disallow relative files paths in urllib*.open() http://hg.python.org/cpython/rev/f6008e936fbc -- nosy: +python-dev ___ Python tracker

[issue6631] Disallow relative files paths in urllib*.open()

2012-01-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset 4366c0df2c73 by Senthil Kumaran in branch '2.7': NEWS entry for Issue6631 http://hg.python.org/cpython/rev/4366c0df2c73 New changeset 514994d7a9f2 by Senthil Kumaran in branch '3.2': Fix Issue6631 - Disallow relative file paths in urllib urlopen h

[issue6631] Disallow relative files paths in urllib*.open()

2012-01-20 Thread Senthil Kumaran
Changes by Senthil Kumaran : -- resolution: -> fixed stage: -> committed/rejected status: open -> closed type: performance -> behavior versions: +Python 2.7, Python 3.2, Python 3.3 ___ Python tracker _

[issue13814] Generators as context managers.

2012-01-20 Thread Terry J. Reedy
Terry J. Reedy added the comment: Calling g.close() is pointless for a generator used in normal pull mode and run to completion, as in the example. The generator is already 'closed', so g.close() does not do anything useful. See http://docs.python.org/py3k/reference/expressions.html#yield-expr

[issue13834] In help(bytes.strip) there is no info about leading ASCII whitespace

2012-01-20 Thread py.user
New submission from py.user : help(bytes.strip): strip(...) B.strip([bytes]) -> bytes Strip leading and trailing bytes contained in the argument. If the argument is omitted, strip trailing ASCII whitespace. -- assignee: docs@python components: Documentation messages: 15

[issue13815] tarfile.ExFileObject can't be wrapped using io.TextIOWrapper

2012-01-20 Thread Terry J. Reedy
Terry J. Reedy added the comment: Based on other examples in the doc, I think the note "... and also supports iteration over its lines." should be extended with " It also has a dummy `flush` method, so that it can be wrapped using :class:`io.TextIOWrapper`." Then just add ".. versionchanged::

[issue13790] In str.format an incorrect error message for list, tuple, dict, set

2012-01-20 Thread R. David Murray
R. David Murray added the comment: Oh, I see. Yes, that is a problem. object.__format__ knows the type of the object it was called on, right? Couldn't it catch the error and re-raise it with the correct type? (If the type isn't str, of course, we don't want to get into an infinite recursio

[issue13816] Two typos in the docs

2012-01-20 Thread Terry J. Reedy
Terry J. Reedy added the comment: The Chicago Manual of Style. which is perhaps the mostly widely used general style manual in the US, uses 'th' as a suffix without ' or -. ie, 28th, etc except for 22d ('preferred' to 22nd) and 23d ('preferred' to 23rd). https://en.wiktionary.org/wiki/nth giv

[issue13790] In str.format an incorrect error message for list, tuple, dict, set

2012-01-20 Thread R. David Murray
R. David Murray added the comment: Oh, never mind that comment about recursion, I wasn't thinking it through. -- ___ Python tracker ___ _

[issue13818] argparse: -h listening required options under optional arguments

2012-01-20 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- nosy: +bethard stage: -> test needed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscr

[issue13820] 2.6 is no longer in the future

2012-01-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset c84b39c18963 by Terry Jan Reedy in branch '2.7': Issue13820 as and with really became keywords in 2.6. http://hg.python.org/cpython/rev/c84b39c18963 -- nosy: +python-dev ___ Python tracker

[issue13820] 2.6 is no longer in the future

2012-01-20 Thread Terry J. Reedy
Terry J. Reedy added the comment: I verified that 'as' and 'with' are in the 2.6 keyword.kwlist. http://svn.python.org/projects/python/branches/release26-maint/Lib/keyword.py. I verified that they work as keywords in 2.7. http://svn.python.org/projects/python/branches/release26-maint/Doc/refere

[issue13790] In str.format an incorrect error message for list, tuple, dict, set

2012-01-20 Thread Terry J. Reedy
Terry J. Reedy added the comment: OK, the example of an empty format spec should be dropped. Let people figure it out ;-). >>> format([], 'd') Traceback (most recent call last): File "", line 1, in ValueError: Unknown format code 'd' for object of type 'str' One possibility is to give (str

[issue1602] windows console doesn't print or input Unicode

2012-01-20 Thread akira
Changes by akira <4kir4...@gmail.com>: -- nosy: +akira ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://ma