[issue16438] Numeric operator predecence confusing

2012-11-08 Thread Jesús Cea Avión
Jesús Cea Avión added the comment: Precedence ordered per row. Same row, same precedence. I don't see any problem. It is natural math precedence. Closed as invalid. -- nosy: +jcea resolution: -> invalid ___ Python tracker

[issue16438] Numeric operator predecence confusing

2012-11-08 Thread Mark Dickinson
Changes by Mark Dickinson : -- status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://ma

[issue5950] Make zipimport work with zipfile containing comments

2012-11-08 Thread Brett Cannon
Brett Cannon added the comment: This is a feature request so it won't change in Python 2.7. As for progress, the answer is no as the hope is to eventually replace zipimport with something in pure Python thanks to importlib. -- versions: +Python 3.4 -Python 2.7, Python 3.3

[issue16392] import crashes on circular imports in ext modules

2012-11-08 Thread Brett Cannon
Brett Cannon added the comment: The fully qualified name requirement is definitely a design flaw where init functions should just be given the module object with everything already set, just like what @importlib.util.module_for_loader does. Hopefully we can come up with a solution through your

[issue16439] Code not collapsed correctly

2012-11-08 Thread Yongzhi Pan
New submission from Yongzhi Pan: http://docs.python.org/3/library/stdtypes.html#str.title The second snippets is not collapsed correctly. -- assignee: docs@python components: Documentation messages: 175171 nosy: docs@python, fossilet priority: normal severity: normal status: open title:

[issue16439] Code not collapsed correctly

2012-11-08 Thread Jesús Cea Avión
Changes by Jesús Cea Avión : -- nosy: +jcea ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue16438] Numeric operator predecence confusing

2012-11-08 Thread Yongzhi Pan
Yongzhi Pan added the comment: I mean the text at the first link need fix. '+' and '-' are not on the same row. And the doc says: "sorted by ascending priority", that means they have ascending priority. The table in the reference is just right. --

[issue16439] Code not collapsed correctly

2012-11-08 Thread Jesús Cea Avión
Jesús Cea Avión added the comment: Looks like a sphinx bug :-??. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue16440] Exception type

2012-11-08 Thread Yongzhi Pan
New submission from Yongzhi Pan: http://docs.python.org/3/library/stdtypes.html#methods "Attempting to set a method attribute results in a TypeError being raised." But in the example, if we do c.method.whoami = 'c', we get AttributeError instead of TypeError. -- assignee: docs@python

[issue16439] Code not collapsed correctly

2012-11-08 Thread Andrew Svetlov
Andrew Svetlov added the comment: No, it isn't sphinx bug, it's markup problem. Will commit a fix in few minutes. -- nosy: +asvetlov ___ Python tracker ___ __

[issue16441] range usage in gzip module leads to excessive memory usage.

2012-11-08 Thread Chris Withers
New submission from Chris Withers: gzip.py uses range instead of xrange in two places. This results in excessive memory usage when opening large .gz files. I actually bumped into this using tarfile. Am I right in thinking that range basically *is* xrange in 3.x? If so, this bug applies only to

[issue16439] Code not collapsed correctly

2012-11-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset aeb5c53a1d69 by Andrew Svetlov in branch '3.2': Issue #16439: Fix markup in example for stdtypes. http://hg.python.org/cpython/rev/aeb5c53a1d69 New changeset 65499860c6f8 by Andrew Svetlov in branch '3.3': Merge issue #16439: Fix markup in example f

[issue16438] Numeric operator predecence confusing

2012-11-08 Thread Jesús Cea Avión
Jesús Cea Avión added the comment: You are right, Yongzhi Pan. Reopening. Not sure how to solve it. Delegating to docs@python. -- resolution: invalid -> status: closed -> open ___ Python tracker _

[issue16439] Code not collapsed correctly

2012-11-08 Thread Andrew Svetlov
Andrew Svetlov added the comment: Fixed. Thanks. -- resolution: -> fixed stage: -> committed/rejected status: open -> closed ___ Python tracker ___

[issue2005] posixmodule expects sizeof(pid_t/gid_t/uid_t) <= sizeof(long)

2012-11-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch that introduces four private function for convert an integer to uid_t/gid_t and back, and consistently apply these functions in all cases of uid_t/gid_t conversions. This should fix this issue and issues 4591, 7365, 15301, and a part of 1598

[issue16441] range usage in gzip module leads to excessive memory usage.

2012-11-08 Thread Jesús Cea Avión
Jesús Cea Avión added the comment: Yes, "range()" in python 3 is equivalent to python 2 "xrange()". 2.6 is in "security only" fix mode. So, you only need to fix 2.7. -- nosy: +jcea ___ Python tracker _

[issue16441] range usage in gzip module leads to excessive memory usage.

2012-11-08 Thread Jesús Cea Avión
Changes by Jesús Cea Avión : -- versions: -Python 2.6 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://m

[issue16439] Code not collapsed correctly

2012-11-08 Thread Jesús Cea Avión
Jesús Cea Avión added the comment: Good catch. I was not aware of this feature :-). -- ___ Python tracker ___ ___ Python-bugs-list mai

[issue16442] PATH_MAX vs MAXPATHLEN vs pathconf(..., _PC_PATH_MAX).

2012-11-08 Thread Trent Nelson
New submission from Trent Nelson: Two immediate issues identified whilst trying to build on HP-UX and IRIX: 1. Our source is wildly inconsistent with regards to using PATH_MAX versus MAXPATHLEN. 2. The current logic in osdefs.h is insufficient for ensuring one or the other always has a valu

[issue16441] range usage in gzip module leads to excessive memory usage.

2012-11-08 Thread Chris Withers
Chris Withers added the comment: Okay, here's the patch. I can't imagine any unit tests are needed or will be impacted by this. I do have commit rights, am I good to commit this? -- keywords: +patch stage: needs patch -> patch review Added file: http://bugs.python.org/file27927/gzip.py.

[issue16218] Python launcher does not support unicode characters

2012-11-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think here should be used something like CommonTest.test_nonascii_abspath() in Lib/test/test_genericpath.py. -- ___ Python tracker ___

[issue16441] range usage in gzip module leads to excessive memory usage.

2012-11-08 Thread Nadeem Vawda
Nadeem Vawda added the comment: Looks good to me. Go ahead. You needn't add or change any tests for this, but you should run the existing tests before committing, just to be safe. -- nosy: +nadeem.vawda ___ Python tracker

[issue13429] provide __file__ to extension init function

2012-11-08 Thread Stefan Behnel
Stefan Behnel added the comment: Triggered discussion on python-dev: http://thread.gmane.org/gmane.comp.python.devel/135764 -- ___ Python tracker ___ ___

[issue16443] Add docstrings to regular expression match objects

2012-11-08 Thread Raymond Hettinger
New submission from Raymond Hettinger: The match objects currently do not have useful docstrings. An easy task is to add docstrings modeled after the text in the regular docs. import re mo = re.search('abc', 'abc') help(mo) -- assignee: docs@python components: Documentation keyw

[issue16438] Numeric operator predecence confusing

2012-11-08 Thread Meador Inge
Changes by Meador Inge : -- nosy: +meador.inge ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

[issue16436] Missing anchor in doc

2012-11-08 Thread Chris Jerdonek
Chris Jerdonek added the comment: Currently, the built-in types are not treated consistently as to whether their constructors are documented in the "Built-in Functions" or "Built-in Types" page. There are some open issues related to this topic (see, for example, issue 16209). For the purpose

[issue16436] Missing anchor in doc

2012-11-08 Thread Chris Jerdonek
Changes by Chris Jerdonek : -- nosy: +ezio.melotti ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.

[issue9584] Allow curly brace expansion

2012-11-08 Thread R. David Murray
R. David Murray added the comment: Given the backward compatibility concerns, and the fact that brace expansion and wildcard expansion are conceptually separate operations, perhaps what we should have a is a glob.expand_braces (or some such name) function? (Note: I haven't looked at whether o

[issue16436] Link directly to set and frozenset in built-in function docs

2012-11-08 Thread Chris Jerdonek
Changes by Chris Jerdonek : -- title: Missing anchor in doc -> Link directly to set and frozenset in built-in function docs type: -> enhancement versions: +Python 2.7, Python 3.2 ___ Python tracker __

[issue16436] Link directly to set and frozenset in built-in function docs

2012-11-08 Thread Chris Jerdonek
Chris Jerdonek added the comment: I recommend copying for set and frozenset the documentation pattern for dict (and in particular by stating explicitly in its own sentence that the object is a class): http://docs.python.org/3/library/functions.html#func-dict -- __

[issue16443] Add docstrings to regular expression match objects

2012-11-08 Thread Ezio Melotti
Changes by Ezio Melotti : -- components: +Regular Expressions nosy: +ezio.melotti, mrabarnett stage: -> needs patch versions: -Python 3.1 ___ Python tracker ___ ___

[issue14621] Hash function is not randomized properly

2012-11-08 Thread Sasha B
Sasha B added the comment: Ruby uses the Murmur hash for some types (string & integer at least): http://murmurhash.googlepages.com/ src: http://stackoverflow.com/a/3270836/1332819 The Perl hash implementation: http://cpansearch.perl.org/src/NWCLARK/perl-5.8.8/hv.c PHP5 hash implementation: ht

[issue16438] Numeric operator predecence confusing

2012-11-08 Thread Ezio Melotti
Changes by Ezio Melotti : -- keywords: +easy nosy: +ezio.melotti stage: -> needs patch type: -> enhancement ___ Python tracker ___ _

[issue15861] ttk.Treeview "unmatched open brace in list"

2012-11-08 Thread Zachary Ware
Changes by Zachary Ware : -- versions: +Python 3.2, Python 3.3, Python 3.4 ___ Python tracker ___ ___ Python-bugs-list mailing list Un

[issue9584] Allow curly brace expansion

2012-11-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > Given the backward compatibility concerns, and the fact that brace expansion > and wildcard expansion are conceptually separate operations, perhaps what we > should have a is a glob.expand_braces (or some such name) function? In this case it may be appropr

[issue15861] ttk.Treeview "unmatched open brace in list"

2012-11-08 Thread Zachary Ware
Zachary Ware added the comment: Just tested on 3.3 and this still happens with that version of Tkinter, which should mean the same happens in 3.2 and 3.4. -- nosy: +zach.ware ___ Python tracker ___

[issue16441] range usage in gzip module leads to excessive memory usage.

2012-11-08 Thread Ezio Melotti
Ezio Melotti added the comment: Also remember to add a Misc/NEWS entry (and/or run `make patchcheck`) before committing. If this only affects 2.7 there's no need to merge anything with 3.x, so you can just commit on 2.7 and push. -- nosy: +ezio.melotti ___

[issue15861] ttk.Treeview "unmatched open brace in list"

2012-11-08 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +serhiy.storchaka stage: -> needs patch ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue14621] Hash function is not randomized properly

2012-11-08 Thread Christian Heimes
Christian Heimes added the comment: I considered MurMur a year ago, too. Nowadays I don't think it's an option anymore. JPA and DJB have released a C++ program that is able to generate lots of collisions: https://www.131002.net/siphash/ C++ program to find universal (key-independent) multicoll

[issue15133] tkinter.BooleanVar.get() behavior and docstring disagree

2012-11-08 Thread Zachary Ware
Zachary Ware added the comment: I don't think 2.7 and 3.3 were meant to be removed from this one and we're now in 3.4 time. -- nosy: +zach.ware versions: +Python 2.7, Python 3.3, Python 3.4 ___ Python tracker

[issue14621] Hash function is not randomized properly

2012-11-08 Thread Christian Heimes
Christian Heimes added the comment: >From the header of murmurcollisions.cc: * multicollisions for MurmurHash3 * * MurmurHash3 C++ implementation is available at * http://code.google.com/p/smhasher/wiki/MurmurHash3 * * the function Murmur3Multicollisions finds many different inputs * has

[issue16435] Python 3 doc link to Python 2 FAQ

2012-11-08 Thread Chris Jerdonek
Chris Jerdonek added the comment: Isn't it better to do this type of within-doc linking with a :ref: (which would prevent issues like this)? -- nosy: +chris.jerdonek ___ Python tracker

[issue16440] Exception type

2012-11-08 Thread Ezio Melotti
Changes by Ezio Melotti : -- assignee: docs@python -> ezio.melotti nosy: +ezio.melotti ___ Python tracker ___ ___ Python-bugs-list mai

[issue16409] urlretrieve regression: first call returns block size as 0

2012-11-08 Thread Gregory P. Smith
Changes by Gregory P. Smith : -- assignee: -> gregory.p.smith nosy: +gregory.p.smith ___ Python tracker ___ ___ Python-bugs-list mail

[issue16444] Use support.TESTFN_UNDECODABLE on UNIX

2012-11-08 Thread STINNER Victor
New submission from STINNER Victor: Attached patch changes how support.TESTFN_UNDECODABLE is computed on UNIX: use the filesystem encoding in *strict* mode, not using the surrogateescape error handler. So we can use support.TESTFN_UNDECODABLE to check if a function uses correctly the surrogat

[issue16444] Use support.TESTFN_UNDECODABLE on UNIX

2012-11-08 Thread STINNER Victor
STINNER Victor added the comment: The patch contains two print to help debugging the patch itself, these print statements must be removed later. +print("TESTFN_UNDECODABLE = %a" % TESTFN_UNDECODABLE) +print("TESTFN_NONASCII = %a" % TESTFN_NONASCII) --

[issue16444] Use support.TESTFN_UNDECODABLE on UNIX

2012-11-08 Thread STINNER Victor
STINNER Victor added the comment: > We may also use support.TESTFN_UNDECODABLE > in test_cmd_line_script.test_non_ascii() on Windows Oh, subprocess doesn't support passing bytes arguments to a program anymore (since Python 3.0). http://bugs.python.org/issue4036#msg100376 So it's better to use

[issue16445] SEGFAULT when deleting Exception.message

2012-11-08 Thread Amaury Forgeot d'Arc
New submission from Amaury Forgeot d'Arc: The script below segfaults cpython2.7. The cause is in BaseException_set_message(), which calls Py_XDECREF(self->message) and thus can call back into Python code with a dangling PyObject* pointer. Py_CLEAR should be used instead. class Nasty(str):

[issue16440] Exception type

2012-11-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset 8b181c75792f by Ezio Melotti in branch '2.7': #16440: fix exception type and clarify example. http://hg.python.org/cpython/rev/8b181c75792f New changeset bb39ca6bcd7a by Ezio Melotti in branch '3.2': #16440: fix exception type and clarify example. h

[issue16446] pdb raises BdbQuit on 'quit' when started with set_trace

2012-11-08 Thread Xavier de Gaye
New submission from Xavier de Gaye: Also, the two oldest frames of the stack are identical (sic), according to the printed traceback. $ python3 foo.py > /tmp/foo.py(3)() -> x = 1 (Pdb) import sys; print(sys.version) 3.2.2 (default, Dec 27 2011, 17:35:55) [GCC 4.3.2] (Pdb) list 1 import pd

[issue16440] Exception type

2012-11-08 Thread Ezio Melotti
Ezio Melotti added the comment: Fixed, thanks for the report! -- resolution: -> fixed stage: -> committed/rejected status: open -> closed type: -> enhancement ___ Python tracker _

[issue15861] ttk.Treeview "unmatched open brace in list"

2012-11-08 Thread Stefan Stuhr
Stefan Stuhr added the comment: I think this is a case of faulty over-engineering in the ttk module. The following works just fine (imports converted to Python3): import tkinter as tk import tkinter.ttk as ttk root = tk.Tk() tree = ttk.Treeview(root, columns="1 2 3") tree.tk.call(tree, "insert

[issue15680] PEP 3121 refactoring applied to audioop module

2012-11-08 Thread Ezio Melotti
Changes by Ezio Melotti : -- keywords: +patch stage: -> patch review ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubsc

[issue16445] SEGFAULT when deleting Exception.message

2012-11-08 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue16437] issubclass doc improvement

2012-11-08 Thread Ezio Melotti
Ezio Melotti added the comment: While this is documented for isinstance, I'm not sure it should be advertised too much, as it seems to me an implementation detail and doesn't seem too useful in practice. This is a side-effect of the fact that isinstance(x, (A, B, ...)) is equivalent to isi

[issue16444] Use support.TESTFN_UNDECODABLE on UNIX

2012-11-08 Thread STINNER Victor
STINNER Victor added the comment: > Please test the patch on UNIX, Windows and Mac OS X. The full test suite pass on: * Linux with UTF-8 locale encoding * Linux with ASCII locale encoding * Windows with cp932 ANSI code page * Mac OS 10.8 with ASCII locale encoding (and utf-8/surrogateescape

[issue16447] SEGFAULT when setting type.__name__

2012-11-08 Thread Amaury Forgeot d'Arc
New submission from Amaury Forgeot d'Arc: Following script crashes all versions of Python. Cause is the "Py_DECREF(et->ht_name)" in type_set_name(). class Nasty(str): def __del__(self): C.__name__ = "other" class C(object): pass C.__name__ = Nasty("abc") C.__name__ = "normal"

[issue16445] SEGFAULT when deleting Exception.message

2012-11-08 Thread STINNER Victor
STINNER Victor added the comment: According to Amaury an IRC, replacing "Py_XDECREF(obj->attr); obj->attr = NULL;" pattern with "Py_CLEAR(obj->attr);" should fix the issue. Instead of opening one issue per occurence of this pattern, it is possible to write a semantic patch to do the replace on

[issue16445] SEGFAULT when deleting Exception.message

2012-11-08 Thread STINNER Victor
Changes by STINNER Victor : -- keywords: +patch Added file: http://bugs.python.org/file27930/python27_pyclear.patch ___ Python tracker ___ ___

[issue16445] SEGFAULT when deleting Exception.message

2012-11-08 Thread STINNER Victor
STINNER Victor added the comment: The "spatch" doesn't match the following macro: Modules/_testcapimodule.c:#define UNBIND(X) Py_DECREF(X); (X) = NULL -- Python/Python-ast.c is autogenerated from Parser/asdl_c.py, the .py file should be fixed instead. -- __

[issue16445] SEGFAULT when deleting Exception.message

2012-11-08 Thread STINNER Victor
STINNER Victor added the comment: python27_pyclear.patch does fix the use case described in msg175203, but it doesn't fix #16447. -- ___ Python tracker ___ _

[issue16447] SEGFAULT when setting type.__name__

2012-11-08 Thread STINNER Victor
STINNER Victor added the comment: It looks like the bug is the pattern "Py_DECREF(obj->attr); obj->attr = new_value;". Replacing it with "{ PyObject *tmp = obj->attr; obj->attr = new_value; Py_DECREF(tmp); }" does fix this specific issue. We can use the coccinelle tool to replace all such patt

[issue16447] SEGFAULT when setting type.__name__

2012-11-08 Thread STINNER Victor
Changes by STINNER Victor : -- keywords: +patch Added file: http://bugs.python.org/file27932/python27_decref_replace.patch ___ Python tracker ___

[issue16447] SEGFAULT when setting type.__name__

2012-11-08 Thread STINNER Victor
STINNER Victor added the comment: We should maybe use a macro (ex: Py_DECREC_REPLACE) instead of copying the pattern "{ PyObject *tmp = obj->attr; obj->attr = new_value; Py_DECREF(tmp); }". -- ___ Python tracker _

[issue16445] SEGFAULT when deleting Exception.message

2012-11-08 Thread STINNER Victor
STINNER Victor added the comment: py_clear.spatch replaces: Py_DECREF(obj->attr); obj->attr = NULL; but also: Py_DECREF(obj); obj = NULL; If the second pattern is not dangerous, py_clear.spatch can be modified to only match the first pattern: see py_decref_replace.spatch of issue #16447 for

<    1   2