[issue12211] Better document math.copysign behavior.

2011-06-04 Thread Terry J. Reedy
Terry J. Reedy added the comment: Third party refers to things other than Pythonx.y code For instance, distutils2/distribute was for some years developed separately from the main codebase and was recently merged into the 3.3 repository. While separate, its issues were '3rd party'. That has no

[issue12266] str.capitalize contradicts

2011-06-04 Thread py.user
New submission from py.user : specification str.capitalize()¶ Return a copy of the string with its first character capitalized and the rest lowercased. >>> '\u1ffc', '\u1ff3' ('ῼ', 'ῳ') >>> '\u1ffc'.isupper() False >>> '\u1ff3'.islower() True >>> s = '\u1ff3\u1ff3\u1ffc\u1ffc' >>> s 'ῳῳῼ

[issue12265] revamp argument errors

2011-06-04 Thread Nick Coghlan
Nick Coghlan added the comment: Looks good in a desk review. Assuming the full test suite passes, +1 from me. -- nosy: +ncoghlan ___ Python tracker ___ _

[issue4949] Constness in PyErr_NewException

2011-06-04 Thread Benjamin Peterson
Benjamin Peterson added the comment: This patch is not applicable anymore to 3.x. -- nosy: +benjamin.peterson resolution: -> out of date status: open -> closed ___ Python tracker __

[issue12211] math.copysign must keep object type.

2011-06-04 Thread umedoblock
umedoblock added the comment: I attached DOC patch. I misunderstand ? Sorry... I think that "go ahead and make one" means I shuold make the source patch. I use just Python3.2. I didn't use Python 2.x, 3.0 and 3.1 in my programming life. Therefore I reported version 3.2. I should the versions

[issue4949] Constness in PyErr_NewException

2011-06-04 Thread Andreas Kloeckner
Andreas Kloeckner added the comment: ping? -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pytho

[issue12264] parser.expr(): reference count error if more than one argument is passed

2011-06-04 Thread Roundup Robot
Roundup Robot added the comment: New changeset 3ffd8dea77bf by Benjamin Peterson in branch 'default': only clear the parser error if it's set (closes #12264) http://hg.python.org/cpython/rev/3ffd8dea77bf -- nosy: +python-dev resolution: -> fixed stage: -> committed/rejected status: op

[issue12265] revamp argument errors

2011-06-04 Thread Benjamin Peterson
Changes by Benjamin Peterson : Added file: http://bugs.python.org/file22253/argerror.patch ___ Python tracker ___ ___ Python-bugs-list mailing

[issue12265] revamp argument errors

2011-06-04 Thread Benjamin Peterson
Changes by Benjamin Peterson : Removed file: http://bugs.python.org/file22252/argerror.patch ___ Python tracker ___ ___ Python-bugs-list maili

[issue12265] revamp argument errors

2011-06-04 Thread Benjamin Peterson
New submission from Benjamin Peterson : This patch completely rewrites errors given for positional error mismatches. The goal is to give more informative and correct errors. Some examples: >>> def f(): pass ... >>> f(1) Traceback (most recent call last): File "", line 1, in TypeError: f()

[issue12211] math.copysign must keep object type.

2011-06-04 Thread umedoblock
umedoblock added the comment: sorry. I fix my bug. but this patch contain new fail... math.copysign(-1., 0.) returns 1. -- Added file: http://bugs.python.org/file22251/math_copysign.patch ___ Python tracker

[issue12211] math.copysign must keep object type.

2011-06-04 Thread Terry J. Reedy
Terry J. Reedy added the comment: umedoblock: David, Mark, and I agree that this should be a doc issue, and so I suggested a DOC patch. So I do not know why you are screwing around with the code, or what you are trying to do with it, or why you are messing around with the version headers or w

[issue12211] math.copysign must keep object type.

2011-06-04 Thread umedoblock
Changes by umedoblock : Removed file: http://bugs.python.org/file22250/math_copysign.patch ___ Python tracker ___ ___ Python-bugs-list mailing

[issue12211] math.copysign must keep object type.

2011-06-04 Thread umedoblock
Changes by umedoblock : Added file: http://bugs.python.org/file22250/math_copysign.patch ___ Python tracker ___ ___ Python-bugs-list mailing l

[issue12211] math.copysign must keep object type.

2011-06-04 Thread umedoblock
Changes by umedoblock : Removed file: http://bugs.python.org/file22249/math_copysign.patch ___ Python tracker ___ ___ Python-bugs-list mailing

[issue12211] math.copysign must keep object type.

2011-06-04 Thread umedoblock
umedoblock added the comment: I made the patch. But it cannot pass testCopysign(). math.copysign(1, -0.) returns 1. I hope to return -1. But I don't know how to realize -0. as negative value. Please help me. -- components: +Library (Lib) -Documentation keywords: +patch versions: -Py

[issue12232] embedded python import cmath

2011-06-04 Thread Terry J. Reedy
Terry J. Reedy added the comment: {It you reply by mail, please snip off the message you are replying to.} >From what I have read, Windows is not a very pleasant environment for >extending and embedding. 1. It works best if both Python and the extender or embedder are compiled with the same

[issue12246] create installation path if it's non-existent

2011-06-04 Thread Tshepang Lekhonkhobe
Tshepang Lekhonkhobe added the comment: s/use/user -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://m

[issue12246] create installation path if it's non-existent

2011-06-04 Thread Tshepang Lekhonkhobe
Tshepang Lekhonkhobe added the comment: But this part of the code runs only when you want to install a 3rd party module isn't it? What you are proposing simply adds a delay, for the use will have to then add that directory manually. Or is there something I'm missing here? --

[issue12211] math.copysign must keep object type.

2011-06-04 Thread Terry J. Reedy
Terry J. Reedy added the comment: > "Return a float with the magnitude of x but the sign of y." This appears to describe both current behavior and what I believe was the intention. I would go with a doc patch based on this. umedoblock, go ahead and make one. It occurred to me, also, that as cu

[issue12264] parser.expr(): reference count error if more than one argument is passed

2011-06-04 Thread STINNER Victor
New submission from STINNER Victor : import parser; parser.expr("a", "b") raises a TypeError('expr() takes at most 1 argument (2 given)') but corrupt also the reference count of an object (I don't know which one): "python: Modules/gcmodule.c:327: visit_decref: Assertion `gc->gc.gc_refs != 0' f

[issue12263] punycode codec ignores the error handler argument

2011-06-04 Thread STINNER Victor
STINNER Victor added the comment: base64_codec.py uses an assertion to check the error handler: it should use an if+raise (assertions are ignored in optimized mode, python -O). -- ___ Python tracker _

[issue12263] punycode codec ignores the error handler argument

2011-06-04 Thread STINNER Victor
New submission from STINNER Victor : b'abc\xff'.decode('punycode', 'ignore') raises the same error than b'abc\xff'.decode('punycode', 'replace') or b'abc\xff'.decode('punycode'): it uses the strict error handler, and simply ignores the error handler. punycodec, as idna, should raise an excepti

[issue12248] __dir__ semantics changed in Python 2.7.2

2011-06-04 Thread Soren Hansen
Soren Hansen added the comment: 2011/6/5 Benjamin Peterson : > 2011/6/4 Soren Hansen : >> ...I end up with a "RuntimeError: maximum recursion depth exceeded". I >> can't say I'm surprised :) > Ah, sorry I should have thought before writing that. :) > self.__class__.__dir__.__get__(self, self.__c

[issue12248] __dir__ semantics changed in Python 2.7.2

2011-06-04 Thread Benjamin Peterson
Benjamin Peterson added the comment: 2011/6/4 Soren Hansen : > > Soren Hansen added the comment: > > 2011/6/4 Benjamin Peterson : >> 2011/6/4 Soren Hansen : >>> So my question is: If this change stays (which seems clear given that the >>> only changes proposed here are ways of relaxing the typ

[issue12248] __dir__ semantics changed in Python 2.7.2

2011-06-04 Thread Soren Hansen
Soren Hansen added the comment: 2011/6/4 Benjamin Peterson : > 2011/6/4 Soren Hansen : >> So my question is: If this change stays (which seems clear given that the >> only changes proposed here are ways of relaxing the type requirement of the >> __dir__ method's return value, not reverting the

[issue10935] wsgiref.handlers.BaseHandler and subclasses of str

2011-06-04 Thread Phillip J. Eby
Phillip J. Eby added the comment: That change to the spec is fine, though you might also want to add something like, "Like all other WSGI specification types", since *all* types specified in WSGI are 'type()' not 'isinstance()'. -- ___ Python track

[issue12262] Not Inheriting File Descriptors on Windows?

2011-06-04 Thread sbt
sbt added the comment: Although Windows fds are not inheritable, the handles associated with fds can be made inheritable. A workaround for the fact fds are not inheritable is the following pattern: 1) The parent process converts the fd to a handle using _get_osfhandle(fd). 2) The parent proc

[issue12248] __dir__ semantics changed in Python 2.7.2

2011-06-04 Thread Benjamin Peterson
Benjamin Peterson added the comment: 2011/6/4 Soren Hansen : > > Soren Hansen added the comment: > > When I first investigated this problem (I reported the original bug on > Launchpad), my first attempt to address this issue in pymox had me quite > stumped. The class in question has a __getat

[issue12248] __dir__ semantics changed in Python 2.7.2

2011-06-04 Thread Soren Hansen
Soren Hansen added the comment: When I first investigated this problem (I reported the original bug on Launchpad), my first attempt to address this issue in pymox had me quite stumped. The class in question has a __getattr__ method. Up until now, this hasn't affected the use of dir(), but it

[issue12164] str.translate docstring doesn't mention that 'table' can be None

2011-06-04 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- resolution: -> accepted ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http

[issue12248] __dir__ semantics changed in Python 2.7.2

2011-06-04 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- keywords: +patch Added file: http://bugs.python.org/file22246/dir.patch ___ Python tracker ___ ___ P

[issue12164] str.translate docstring doesn't mention that 'table' can be None

2011-06-04 Thread Petri Lehtinen
Petri Lehtinen added the comment: > What do you think? Sounds very good to my native Finnish ears :) -- ___ Python tracker ___ ___ P

[issue12014] str.format parses replacement field incorrectly

2011-06-04 Thread Petri Lehtinen
Petri Lehtinen added the comment: > PEP 3101 defines format strings as intermingled character data and markup. > Markup defines replacement fields and is delimited by braces. Only after > markup is extracted does the PEP talk about interpreting the contents of the > markup. > > So, given "{0

[issue12080] decimal.py: performance in _power_exact

2011-06-04 Thread Stefan Krah
Stefan Krah added the comment: Mark Dickinson wrote: > Here's a patch. Stefan, could you please review? Mark, sorry for not replying earlier. The patch looks great. I've also tested the patch in practice: I ran 700,000,000 random tests with an exponent range of [-9, 9]. This t

[issue12080] decimal.py: performance in _power_exact

2011-06-04 Thread Mark Dickinson
Mark Dickinson added the comment: Fixed for 3.3 and 2.7. -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ P

[issue12080] decimal.py: performance in _power_exact

2011-06-04 Thread Roundup Robot
Roundup Robot added the comment: New changeset 78d79499e7de by Mark Dickinson in branch '2.7': Issue #12080: Fix a performance issue in Decimal._power_exact that caused some corner-case Decimal.__pow__ calls to take an unreasonably long time. http://hg.python.org/cpython/rev/78d79499e7de -

[issue12080] decimal.py: performance in _power_exact

2011-06-04 Thread Roundup Robot
Roundup Robot added the comment: New changeset c3fe54781244 by Mark Dickinson in branch 'default': Issue #12080: Fix a performance issue in Decimal._power_exact that causes some corner-case Decimal.__pow__ calls to take an unreasonably long time. http://hg.python.org/cpython/rev/c3fe54781244 -

[issue12245] Document the meaning of FLT_ROUNDS constants for sys.float_info

2011-06-04 Thread Mark Dickinson
Changes by Mark Dickinson : -- assignee: docs@python -> mark.dickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubs

[issue12245] Document the meaning of FLT_ROUNDS constants for sys.float_info

2011-06-04 Thread Mark Dickinson
Changes by Mark Dickinson : -- nosy: +christian.heimes ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://m

[issue12232] embedded python import cmath

2011-06-04 Thread Mark Dickinson
Changes by Mark Dickinson : -- nosy: +mark.dickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue11934] build with --prefix=/dev/null and zlib enabled in Modules/Setup failed

2011-06-04 Thread Éric Araujo
Éric Araujo added the comment: Isn’t zlib built by setup.py anyway? -- nosy: +eric.araujo resolution: invalid -> status: pending -> open ___ Python tracker ___

[issue8286] distutils: path '[...]' cannot end with '/' -- need better error message

2011-06-04 Thread Éric Araujo
Éric Araujo added the comment: a one-line* I’ll have a patch up for review shortly. -- ___ Python tracker ___ ___ Python-bugs-list ma

[issue8286] distutils: path '[...]' cannot end with '/' -- need better error message

2011-06-04 Thread Éric Araujo
Éric Araujo added the comment: There is a simple way to fix this: change one line in sdist to catch ValueErrors in addition to DistutilsTemplateError. Users will get a on-line warning message with the ill-formed manifest line number instead of a wall of traceback. This is clearly a bug fix

[issue12248] __dir__ semantics changed in Python 2.7.2

2011-06-04 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: Using sorted() makes sense to me. Note that I've at least accomplished one goal, which is to have a tracker issue that discusses the merits of the change. That way, no matter what the RM decides, I can at least point to an issue for justification when I r

[issue12245] Document the meaning of FLT_ROUNDS constants for sys.float_info

2011-06-04 Thread Mark Dickinson
Mark Dickinson added the comment: float_info.rounds is a bit of an odd fish, and I think it was probably a mistake to include it in sys.float_info in the first place. All the other float_info fields relate to parameters of the floating-point format, which is fixed, useful information. In con

[issue12127] Inconsistent leading zero treatment

2011-06-04 Thread Mark Dickinson
Mark Dickinson added the comment: Closing, based on feedback in the comments. Maybe one day... -- resolution: -> later status: open -> closed ___ Python tracker ___ __

[issue12164] str.translate docstring doesn't mention that 'table' can be None

2011-06-04 Thread Mark Dickinson
Mark Dickinson added the comment: Thanks for the patches! Here's a slight expansion of the wording on your second patch: Return a copy of the string S, where all characters occurring in the optional argument deletechars are removed, and the remaining characters have been mapped through the

[issue11557] Increase coverage in logging module

2011-06-04 Thread Éric Araujo
Changes by Éric Araujo : -- assignee: trentm -> vinay.sajip nosy: -trentm ___ Python tracker ___ ___ Python-bugs-list mailing list Un

[issue11557] Increase coverage in logging module

2011-06-04 Thread Éric Araujo
Éric Araujo added the comment: I saw this commit pass by and noticed a few instances of non-idiomatic unittest code, like unnecessary lambdas or overuse of assertEqual where other methods would give more useful messages in case of failure. Here’s a patch to better it. -- assignee: v

[issue10935] wsgiref.handlers.BaseHandler and subclasses of str

2011-06-04 Thread Éric Araujo
Éric Araujo added the comment: Here’s my try at making the spec more explicit about str subclasses. -- keywords: +patch Added file: http://bugs.python.org/file22244/pep--no-subclasses.diff ___ Python tracker _

[issue12185] Decimal documentation lists "first" and "second" arguments, should be "self" and "other"

2011-06-04 Thread Mark Dickinson
Changes by Mark Dickinson : -- nosy: +mark.dickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue12257] Rework/replace use of DISTUTILS_USE_SDK in packaging

2011-06-04 Thread Éric Araujo
Éric Araujo added the comment: Agreed. Thanks for the insight. -- title: Use PYPACKAGING_USE_SDK envvar instead of DISTUTILS_USE_SDK -> Rework/replace use of DISTUTILS_USE_SDK in packaging ___ Python tracker ___

[issue12211] math.copysign must keep object type.

2011-06-04 Thread Mark Dickinson
Mark Dickinson added the comment: How about something like: "Return a float with the magnitude of x but the sign of y."? The behaviour of math.copysign with respect to non-float inputs matches that of almost all the other math module functions: integer arguments are first converted to float

[issue12231] regrtest: add -k and -K options to filter tests by function/file names

2011-06-04 Thread Éric Araujo
Éric Araujo added the comment: File name, class name, method name unless I misremember. -- ___ Python tracker ___ ___ Python-bugs-lis

[issue12246] create installation path if it's non-existent

2011-06-04 Thread Éric Araujo
Éric Araujo added the comment: We do not want to create a directory under $prefix before installation. This would be a sort of dirty half-installation. When you have an uninstalled, unconfigured Python, you cannot install modules without giving a prefix option: this sounds good to me.

[issue12226] use secured channel for uploading packages to pypi

2011-06-04 Thread Éric Araujo
Éric Araujo added the comment: > I think there should be a warning that the connection is > unauthenticated (i.e. not secure). Users tend to be upset if they see > 'https' and later find out that no certificates were verified. Thanks Stephan, that was on my mind but I forgot it. I’m -1 on usin

[issue12224] problem with siginterrupt

2011-06-04 Thread Zhiping Deng
Zhiping Deng added the comment: I think the problem is that after a user calles signal.siginterrupt(False), he would expect that the socket.recv should handles EINTR properly for him because it's the behaviour in c level. He doesn't know socket.recv() calles select(2) internally and he needn'

[issue12257] Use PYPACKAGING_USE_SDK envvar instead of DISTUTILS_USE_SDK

2011-06-04 Thread Martin v . Löwis
Martin v. Löwis added the comment: I don't think the name should be changed. If anything should be done, we should reconsider whether this flag is actually needed, or whether some other approach to selecting a compiler can be taken. -- ___ Python t

[issue12185] Decimal documentation lists "first" and "second" arguments, should be "self" and "other"

2011-06-04 Thread Francisco Martín Brugué
Francisco Martín Brugué added the comment: Hi Adam, I couldn’t see that from the threat context, I'm new to this and just wanted to learn the work flow and tools so I've just picked up an easy issue to start with. Anyway your patch seems more complete. -- __

[issue12224] problem with siginterrupt

2011-06-04 Thread STINNER Victor
STINNER Victor added the comment: > Victor, I understand your response as saying that there is no bug, > which would suggest closing this. Correct? If not, what is > the requested action? siginterrupt(False) has no effect on select(). I listed some solutions to not interrupt select() on a sign

[issue11104] distutils sdist ignores MANIFEST

2011-06-04 Thread Stephen Thorne
Stephen Thorne added the comment: This patch is tested against the 3.1 and default branches, the previous patch attached was against the 2.7 branch. -- Added file: http://bugs.python.org/file22243/manifest-respect-3.patch ___ Python tracker

[issue11104] distutils sdist ignores MANIFEST

2011-06-04 Thread Stephen Thorne
Stephen Thorne added the comment: I've taken the sdist.patch and wrote some tests for it. The resulting patch is attached as 'manifest-respect.patch'. -- nosy: +jerub Added file: http://bugs.python.org/file22242/manifest-respect.patch ___ Python tra

[issue12224] problem with siginterrupt

2011-06-04 Thread Charles-François Natali
Charles-François Natali added the comment: Actually, it's part of a more general problem with EINTR being returned by many posix/socket module functions, see for example issue #7978. On the one hand, having to retry manually on EINTR is cumbersome, on the other hand, some code might rely on th

[issue12234] unittest2 could enable regex debugging for more information

2011-06-04 Thread Domen Kožar
Domen Kožar added the comment: I see, currently re module does not support debugging for matching a string. Even the upcoming new regex implementation does not support it. -- ___ Python tracker __

[issue11583] os.path.isdir() is slow on windows

2011-06-04 Thread Tim Golden
Tim Golden added the comment: Code looks good and tests pass. Only one thing: the code in the patched lib\ntpath.py still refers to FindFirstFile -- ___ Python tracker ___