Re: [Python-Dev] [Python-checkins] cpython (2.7): Fix closes issue10761: tarfile.extractall failure when symlinked files are

2011-04-29 Thread Eli Bendersky
On Thu, Apr 28, 2011 at 04:20:06PM +0200, Éric Araujo wrote:          if hasattr(os, symlink) and hasattr(os, link):              # For systems that support symbolic and hard links.              if tarinfo.issym(): +                if os.path.exists(targetpath): +                  

Re: [Python-Dev] Not-a-Number

2011-04-29 Thread Ben Finney
Steven D'Aprano st...@pearwood.info writes: Robert Kern wrote: On 4/28/11 8:44 PM, Steven D'Aprano wrote: The real question should be, why does Python treat all NANs as signalling NANs instead of quiet NANs? I don't believe this helps anyone. Actually, Python treats all NaNs as quiet

Re: [Python-Dev] Not-a-Number

2011-04-29 Thread Nick Coghlan
On Fri, Apr 29, 2011 at 3:28 PM, Steven D'Aprano st...@pearwood.info wrote: Robert Kern wrote: Actually, Python treats all NaNs as quiet NaNs and never signalling NaNs. Sorry, did I get that backwards? I thought it was signalling NANs that cause a signal (in Python terms, an exception)? If

Re: [Python-Dev] Proposal for a common benchmark suite

2011-04-29 Thread Maciej Fijalkowski
On Thu, Apr 28, 2011 at 11:10 PM, Stefan Behnel stefan...@behnel.de wrote: M.-A. Lemburg, 28.04.2011 22:23: Stefan Behnel wrote: DasIch, 28.04.2011 20:55: the CPython benchmarks have an extensive set of microbenchmarks in the pybench package Try not to care too much about pybench. There

Re: [Python-Dev] Not-a-Number

2011-04-29 Thread Steven D'Aprano
Ben Finney wrote: Steven D'Aprano st...@pearwood.info writes: Robert Kern wrote: On 4/28/11 8:44 PM, Steven D'Aprano wrote: The real question should be, why does Python treat all NANs as signalling NANs instead of quiet NANs? I don't believe this helps anyone. Actually, Python treats all

Re: [Python-Dev] [Python-checkins] cpython (2.7): Fix closes issue10761: tarfile.extractall failure when symlinked files are

2011-04-29 Thread Nick Coghlan
On Fri, Apr 29, 2011 at 4:26 PM, Eli Bendersky eli...@gmail.com wrote: On Thu, Apr 28, 2011 at 04:20:06PM +0200, Éric Araujo wrote: The kind of race condition which can happen here is if an attacker creates targetpath between os.path.exists and os.unlink. Whether it is an exploitable flaw

Re: [Python-Dev] Not-a-Number (was PyObject_RichCompareBool identity shortcut)

2011-04-29 Thread Stephen J. Turnbull
Terry Reedy writes: Python treats it as if it were a number: As I said, so did the committee, and that was its mistake that we are more or less stuck with. The committee didn't really have a choice. You could ask that they call NaNs something else, but some bit pattern is going to

Re: [Python-Dev] the role of assert in the standard library ?

2011-04-29 Thread Holger Krekel
On Fri, Apr 29, 2011 at 12:31 AM, Raymond Hettinger raymond.hettin...@gmail.com wrote: On Apr 28, 2011, at 3:07 PM, Guido van Rossum wrote: On Thu, Apr 28, 2011 at 2:53 PM, Raymond Hettinger raymond.hettin...@gmail.com wrote: On Apr 28, 2011, at 1:27 PM, Holger Krekel wrote: On Thu, Apr

Re: [Python-Dev] [Python-checkins] cpython (2.7): Fix closes issue10761: tarfile.extractall failure when symlinked files are

2011-04-29 Thread Eli Bendersky
On Fri, Apr 29, 2011 at 09:52, Nick Coghlan ncogh...@gmail.com wrote: On Fri, Apr 29, 2011 at 4:26 PM, Eli Bendersky eli...@gmail.com wrote: On Thu, Apr 28, 2011 at 04:20:06PM +0200, Éric Araujo wrote: The kind of race condition which can happen here is if an attacker creates targetpath

Re: [Python-Dev] the role of assert in the standard library ?

2011-04-29 Thread Maciej Fijalkowski
On Fri, Apr 29, 2011 at 9:55 AM, Holger Krekel holger.kre...@gmail.com wrote: On Fri, Apr 29, 2011 at 12:31 AM, Raymond Hettinger raymond.hettin...@gmail.com wrote: On Apr 28, 2011, at 3:07 PM, Guido van Rossum wrote: On Thu, Apr 28, 2011 at 2:53 PM, Raymond Hettinger

Re: [Python-Dev] Proposal for a common benchmark suite

2011-04-29 Thread Mark Shannon
Maciej Fijalkowski wrote: On Thu, Apr 28, 2011 at 11:10 PM, Stefan Behnel stefan...@behnel.de wrote: M.-A. Lemburg, 28.04.2011 22:23: Stefan Behnel wrote: DasIch, 28.04.2011 20:55: the CPython benchmarks have an extensive set of microbenchmarks in the pybench package Try not to care too

Re: [Python-Dev] [Python-checkins] cpython (2.7): Fix closes issue10761: tarfile.extractall failure when symlinked files are

2011-04-29 Thread Nadeem Vawda
On Fri, Apr 29, 2011 at 10:02 AM, Eli Bendersky eli...@gmail.com wrote: I completely understand this other code/thread deletes the path between exists() and unlink() case - it indeed is a race condition waiting to happen. What I didn't understand was Antoine's example of attacker creates

Re: [Python-Dev] Proposal for a common benchmark suite

2011-04-29 Thread M.-A. Lemburg
Mark Shannon wrote: Maciej Fijalkowski wrote: On Thu, Apr 28, 2011 at 11:10 PM, Stefan Behnel stefan...@behnel.de wrote: M.-A. Lemburg, 28.04.2011 22:23: Stefan Behnel wrote: DasIch, 28.04.2011 20:55: the CPython benchmarks have an extensive set of microbenchmarks in the pybench package

Re: [Python-Dev] Proposal for a common benchmark suite

2011-04-29 Thread Michael Foord
On 29/04/2011 11:04, M.-A. Lemburg wrote: Mark Shannon wrote: Maciej Fijalkowski wrote: On Thu, Apr 28, 2011 at 11:10 PM, Stefan Behnelstefan...@behnel.de wrote: M.-A. Lemburg, 28.04.2011 22:23: Stefan Behnel wrote: DasIch, 28.04.2011 20:55: the CPython benchmarks have an extensive set of

Re: [Python-Dev] the role of assert in the standard library ?

2011-04-29 Thread Floris Bruynooghe
On 28 April 2011 23:07, Guido van Rossum gu...@python.org wrote: On Thu, Apr 28, 2011 at 2:53 PM, Raymond Hettinger raymond.hettin...@gmail.com wrote: On Apr 28, 2011, at 1:27 PM, Holger Krekel wrote: On Thu, Apr 28, 2011 at 6:59 PM, Guido van Rossum gu...@python.org wrote: On Thu, Apr 28,

Re: [Python-Dev] Socket servers in the test suite

2011-04-29 Thread Georg Brandl
On 27.04.2011 23:23, Vinay Sajip wrote: I've been recently trying to improve the test coverage for the logging package, and have got to a not unreasonable point: logging/__init__.py 99% (96%) logging/config.py 89% (85%) logging/handlers.py 60% (54%) where the figures in parentheses

Re: [Python-Dev] Socket servers in the test suite

2011-04-29 Thread Nick Coghlan
On Fri, Apr 29, 2011 at 9:44 PM, Georg Brandl g.bra...@gmx.net wrote: On 27.04.2011 23:23, Vinay Sajip wrote: I've been recently trying to improve the test coverage for the logging package, and have got to a not unreasonable point: logging/__init__.py 99% (96%) logging/config.py 89% (85%)

Re: [Python-Dev] Proposal for a common benchmark suite

2011-04-29 Thread DasIch
Given those facts I think including pybench is a mistake. It does not allow for a fair or meaningful comparison between implementations which is one of the things the suite is supposed to be used for in the future. This easily leads to misinterpretation of the results from this particular

Re: [Python-Dev] Proposal for a common benchmark suite

2011-04-29 Thread M.-A. Lemburg
DasIch wrote: Given those facts I think including pybench is a mistake. It does not allow for a fair or meaningful comparison between implementations which is one of the things the suite is supposed to be used for in the future. This easily leads to misinterpretation of the results from

Re: [Python-Dev] Proposal for a common benchmark suite

2011-04-29 Thread Antoine Pitrou
On Fri, 29 Apr 2011 14:29:46 +0200 DasIch dasdas...@googlemail.com wrote: Given those facts I think including pybench is a mistake. It does not allow for a fair or meaningful comparison between implementations which is one of the things the suite is supposed to be used for in the future.

Re: [Python-Dev] Not-a-Number

2011-04-29 Thread Ben Finney
Steven D'Aprano st...@pearwood.info writes: I'm sorry for my lack of clarity. I'm referring to functions which potentially produce NANs, not the exceptions themselves. A calculation which might have produced a (quiet) NAN as the result instead raises an exception (which I'm treating as

[Python-Dev] What if replacing items in a dictionary returns the new dictionary?

2011-04-29 Thread Roy Hyunjin Han
It would be convenient if replacing items in a dictionary returns the new dictionary, in a manner analogous to str.replace(). What do you think? :: # Current behavior x = {'key1': 1} x.update(key1=3) == None x == {'key1': 3} # Original variable has changed # Possible

Re: [Python-Dev] What if replacing items in a dictionary returns the new dictionary?

2011-04-29 Thread Mark Shannon
Roy Hyunjin Han wrote: It would be convenient if replacing items in a dictionary returns the new dictionary, in a manner analogous to str.replace(). What do you think? :: # Current behavior x = {'key1': 1} x.update(key1=3) == None x == {'key1': 3} # Original variable has

Re: [Python-Dev] What if replacing items in a dictionary returns the new dictionary?

2011-04-29 Thread R. David Murray
On Fri, 29 Apr 2011 10:27:46 -0400, Roy Hyunjin Han starsareblueandfara...@gmail.com wrote: It would be convenient if replacing items in a dictionary returns the new dictionary, in a manner analogous to str.replace(). What do you think? This belongs on python-ideas, but the short answer is

Re: [Python-Dev] What if replacing items in a dictionary returns the new dictionary?

2011-04-29 Thread Oleg Broytman
Hi! Seems like a question for python-ideas mailing list, not for python-dev. On Fri, Apr 29, 2011 at 10:27:46AM -0400, Roy Hyunjin Han wrote: It would be convenient if replacing items in a dictionary returns the new dictionary, in a manner analogous to str.replace(). What do you think? ::

Re: [Python-Dev] What if replacing items in a dictionary returns the new dictionary?

2011-04-29 Thread Roy Hyunjin Han
2011/4/29 R. David Murray rdmur...@bitdance.com: 2011/4/29 Roy Hyunjin Han starsareblueandfara...@gmail.com: It would be convenient if replacing items in a dictionary returns the new dictionary, in a manner analogous to str.replace() This belongs on python-ideas, but the short answer is no.  

Re: [Python-Dev] What if replacing items in a dictionary returns the new dictionary?

2011-04-29 Thread Roy Hyunjin Han
  You can implement this in your own subclass of dict, no? Yes, I just thought it would be convenient to have in the language itself, but the responses to my post seem to indicate that [not returning the updated object] is an intended language feature for mutable types like dict or list. class

Re: [Python-Dev] Not-a-Number

2011-04-29 Thread Robert Kern
On 4/29/11 1:35 AM, Nick Coghlan wrote: On Fri, Apr 29, 2011 at 3:28 PM, Steven D'Apranost...@pearwood.info wrote: Robert Kern wrote: Actually, Python treats all NaNs as quiet NaNs and never signalling NaNs. Sorry, did I get that backwards? I thought it was signalling NANs that cause a

[Python-Dev] Summary of Python tracker Issues

2011-04-29 Thread Python tracker
ACTIVITY SUMMARY (2011-04-22 - 2011-04-29) Python tracker at http://bugs.python.org/ To view or respond to any of the issues listed below, click on the issue. Do NOT respond to this message. Issues counts and deltas: open2760 ( +8) closed 20976 (+39) total 23736 (+47) Open issues

Re: [Python-Dev] Socket servers in the test suite

2011-04-29 Thread Vinay Sajip
[Georg] BTW, didn't we agree not to put pragma comments into the stdlib code? I'd be grateful for a link to the prior discussion - it must have passed me by originally, and I searched python-dev on gmane but couldn't find any threads about this. [Nick] I think some folks objected, but since

Re: [Python-Dev] Not-a-Number

2011-04-29 Thread Alexander Belopolsky
On Fri, Apr 29, 2011 at 11:31 AM, Robert Kern robert.k...@gmail.com wrote: .. And in fact, 0.0/0.0 is covered by the more general rule that x/0.0 raises ZeroDivisionError, not a rule that converts IEEE-754 INVALID exceptions into Python exceptions. It is unfortunate that official text of

Re: [Python-Dev] Not-a-Number (was PyObject_RichCompareBool identity shortcut)

2011-04-29 Thread Guido van Rossum
On Fri, Apr 29, 2011 at 12:10 AM, Stephen J. Turnbull step...@xemacs.org wrote: Other aspects of NaN behavior may be a mistake.  But it's not clear to me, even after all the discussion in this thread. ISTM that the current behavior of NaN (never mind the identity issue) helps numeric experts

Re: [Python-Dev] Not-a-Number (was PyObject_RichCompareBool identity shortcut)

2011-04-29 Thread Alexander Belopolsky
On Fri, Apr 29, 2011 at 1:11 PM, Guido van Rossum gu...@python.org wrote: … Would it make sense to add a float context that also lets one specify what should happen? That could include returning Inf for 1.0/0.0 (for experts), or raising exceptions when NaNs are produced (for the numerically

Re: [Python-Dev] Socket servers in the test suite

2011-04-29 Thread Terry Reedy
On 4/29/2011 3:11 PM, Terry Reedy wrote: On 4/29/2011 12:09 PM, Vinay Sajip wrote: BTW, is there a public place somewhere showing stdlib coverage statistics? I looked on the buildbot pages as the likeliest home for them, but perhaps I missed them.

[Python-Dev] Fwd: viewVC shows traceback on non utf-8 module markup

2011-04-29 Thread Michael Foord
I know that the svn repo is now for legacy purposes only, but I doubt it is intended that the online source browser should raise exceptions. (See report below.) All the best, Michael Original Message Subject:viewVC shows traceback on non utf-8 module markup Date:

Re: [Python-Dev] Socket servers in the test suite

2011-04-29 Thread Vinay Sajip
Terry Reedy tjreedy at udel.edu writes: http://coverage.livinglogic.de/ which, however, currently has nothing for *.py. Perhaps a glitch/bug, as there used to be such. Anyone who knows the page owner might ask about this. Thanks for the pointer, nevertheless, Terry. Regards, Vinay

Re: [Python-Dev] python and super

2011-04-29 Thread Ethan Furman
Ricardo Kirkner wrote: I'll give you the example I came upon: I have a TestCase class, which inherits from both Django's TestCase and from some custom TestCases that act as mixin classes. So I have something like class MyTestCase(TestCase, Mixin1, Mixin2): ... now django's TestCase class

Re: [Python-Dev] Not-a-Number

2011-04-29 Thread Robert Kern
On Fri, Apr 29, 2011 at 11:35, Alexander Belopolsky alexander.belopol...@gmail.com wrote: On Fri, Apr 29, 2011 at 11:31 AM, Robert Kern robert.k...@gmail.com wrote: .. And in fact, 0.0/0.0 is covered by the more general rule that x/0.0 raises ZeroDivisionError, not a rule that converts

Re: [Python-Dev] Not-a-Number

2011-04-29 Thread Greg Ewing
Steven D'Aprano wrote: If I do x = 0.0/0 I get an exception instead of a NAN. But the exception you get is ZeroDivisionError, so I think Python is catching this before you get to the stage of producing a NaN. -- Greg ___ Python-Dev mailing list