[issue15209] Re-raising exceptions from an expression

2012-06-27 Thread Ethan Furman
Ethan Furman et...@stoneleaf.us added the comment: I agree that raise from None would be a nice enhancement. I don't see it going into 3.3 since we've hit feature freeze. Nick, do we need another PEP, or just consensus on pydev? (If consensus, I can bring it up there after 3.3.0final is

[issue4489] shutil.rmtree is vulnerable to a symlink attack

2012-06-27 Thread Arfrever Frehtes Taifersar Arahesis
Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com added the comment: The fix (c910af2e3c98 + 53fc7f59c7bb) for this issue broke deletion of directories, which contain symlinks to directories. (Directories with symlinks to regular files or symlinks to nonexistent files are unaffected.)

[issue15030] PyPycLoader can't read cached .pyc files

2012-06-27 Thread Marc Abramowitz
Marc Abramowitz msabr...@gmail.com added the comment: Here's a patch that unconditionally switches over to the 12 byte format. I'm assuming the size in data[8:12] is the length of the bytecode? -- Added file: http://bugs.python.org/file26186/cpython-issue-15030.patch

[issue15030] PyPycLoader can't read cached .pyc files

2012-06-27 Thread Marc Abramowitz
Marc Abramowitz msabr...@gmail.com added the comment: Oops, last attachment included the source timestamp twice instead of timestamp + bytecode size. -- Added file: http://bugs.python.org/file26188/cpython-issue-15030.patch ___ Python tracker

[issue15030] PyPycLoader can't read cached .pyc files

2012-06-27 Thread Marc Abramowitz
Marc Abramowitz msabr...@gmail.com added the comment: Oops. Refactor. :-) -- Added file: http://bugs.python.org/file26189/cpython-issue-15030.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15030

[issue15206] uuid module falls back to unsuitable RNG

2012-06-27 Thread Christian Heimes
Christian Heimes li...@cheimes.de added the comment: IMHO it's all about managing expectations. As libuuid is using a crypto RNG before it falls back to a less suitable RNG. We should follow this example. I couldn't find any information about the implementation details of Window's

[issue15209] Re-raising exceptions from an expression

2012-06-27 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15209 ___

[issue15210] importlib.__init__ checks for the wrong exception when looking for _frozen_importlib

2012-06-27 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15210 ___

[issue15209] Re-raising exceptions from an expression

2012-06-27 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: The from clause is intended for replacing previous exceptions with *new* exceptions, not editing the attributes of existing ones which may already have a different __cause__ set. So - 1 from me, even for 3.4. A patch to the docs explaining that

[issue15209] Re-raising exceptions from an expression

2012-06-27 Thread Ethan Furman
Ethan Furman et...@stoneleaf.us added the comment: Okay, I see your point. It's also not difficult to work around if you really want to toss the extra info: except NameError: try: fallback_module.getch() except Exception as exc:

[issue15206] uuid module falls back to unsuitable RNG

2012-06-27 Thread Raymond Hettinger
Raymond Hettinger raymond.hettin...@gmail.com added the comment: Are uuid's promised to be cryptographically secure? -- assignee: - rhettinger nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15206

[issue15209] Re-raising exceptions from an expression

2012-06-27 Thread Ethan Furman
Ethan Furman et...@stoneleaf.us added the comment: Patch attached. It basically says: 8 Note: Because using :keyword:`from` can throw away valuable debugging information, its use with a bare :keyword:`raise` is not

[issue15209] Re-raising exceptions from an expression

2012-06-27 Thread Ethan Furman
Ethan Furman et...@stoneleaf.us added the comment: Nick Coghlan wrote: The from clause is intended for replacing previous exceptions with *new* exceptions, not editing the attributes of existing ones which may already have a different __cause__ set. Huh. While I agree with the doc patch

[issue14814] Implement PEP 3144 (the ipaddress module)

2012-06-27 Thread pmoody
pmoody pyt...@hda3.com added the comment: Hynek, I don't see that error when I run the tests on a freshly built python. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14814 ___

[issue15206] uuid module falls back to unsuitable RNG

2012-06-27 Thread Christian Heimes
Christian Heimes li...@cheimes.de added the comment: Not, not by definition. However an uuid generator shall geenerate uuid in a way that make collisions highly improbable. IMHO this verdict implies that an uuid generator should use the cryptographic RNG if available. The behavior after

[issue15206] uuid module falls back to unsuitable RNG

2012-06-27 Thread STINNER Victor
STINNER Victor victor.stin...@gmail.com added the comment: However a MT isn't suitable for cryptographic purposes. The module should first try to use os.urandom() and then perhaps use its own instance of random.Random, similar to uuid_generate_* [1] os.urandom() is not suitable for

[issue15206] uuid module falls back to unsuitable RNG

2012-06-27 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: From the /dev/urandom Linux man page: If you are unsure about whether you should use /dev/random or /dev/urandom, then probably you want to use the latter. As a general rule, /dev/urandom should be used for

[issue15206] uuid module falls back to unsuitable RNG

2012-06-27 Thread Christian Heimes
Christian Heimes li...@cheimes.de added the comment: Antoine beat me to it and he is totally right. Please don't derail this bug report. I agree with your analysis that the RNG core of random.Random subclass can't be replaced easily and that more implementations for different purposes would

[issue15209] Re-raising exceptions from an expression

2012-06-27 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: The purpose of the from clause in general is to change the exception *type* (for example, from KeyError - AttributeError or vice-versa), or to add additional information without losing access to any previous information (like the original

[issue15212] Rename SC_GLOBAL_EXPLICT to SC_GLOBAL_EXPLICIT in compiler module

2012-06-27 Thread Arfrever Frehtes Taifersar Arahesis
New submission from Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: Revision 4809afa85a9b introduced a typo in compiler module: SC_GLOBAL_EXPLICT instead of SC_GLOBAL_EXPLICIT The attached patch fixes this typo. -- components: Library (Lib) files:

[issue15212] Rename SC_GLOBAL_EXPLICT to SC_GLOBAL_EXPLICIT in compiler module

2012-06-27 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +nascheme ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15212 ___

[issue6422] timeit called from within Python should allow autoranging

2012-06-27 Thread STINNER Victor
STINNER Victor victor.stin...@gmail.com added the comment: Hi, I wrote recently a similar function because timeit is not reliable by default. Results look random and require to run the same benchmark 3 times or more on the command line.

[issue6422] timeit called from within Python should allow autoranging

2012-06-27 Thread STINNER Victor
STINNER Victor victor.stin...@gmail.com added the comment: The calibration function uses also the precision of the timer. Oh, I forgot to mention that it computes the precision in Python, it doesn't read the precision announced by the OS or the precision of the C structure.

[issue15213] _PyOS_URandom documentation

2012-06-27 Thread Christian Heimes
New submission from Christian Heimes li...@cheimes.de: The comment for Python/random.c:_PyOS_URandom() states Fill buffer with size pseudo-random bytes, not suitable for cryptographic use, from the operating random number generator (RNG). which is not correct as all paths use a RNG that is

[issue15214] list.startswith() and list.remove() fails to catch consecutive items in a list.

2012-06-27 Thread Isaac
New submission from Isaac isaacloves2...@yahoo.com: The simple repro below, shows that if a list of strings has two consecutive items that begin with the same letter, an iteration over the list to find and remove all strings that start with that letter fails. The second string that starts

[issue15214] list.startswith() and list.remove() fails to catch consecutive items in a list.

2012-06-27 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: This happens because you modify the list while iterating over it, which makes the loop not work as you expect. Essentially, when you remove the item that's currently being pointed to, the loop skips over the next item. An idiomatic way to

[issue15206] uuid module falls back to unsuitable RNG

2012-06-27 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: a) my patch handles the fork() issue correctly If the system has urandom, yes. b) if it's a good idea to try SystemRandom first Certainly. c) a backport to 2.6, 2.7, 3.1 and 3.2 is required and perhaps Cannot backport to 2.6 and 3.1;

[issue15206] uuid module falls back to unsuitable RNG

2012-06-27 Thread Martin v . Löwis
Changes by Martin v. Löwis mar...@v.loewis.de: -- versions: -Python 2.6, Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15206 ___ ___

<    1   2