[issue7528] Provide PyLong_AsLongAndOverflow compatibility to Python 2.x

2009-12-17 Thread Case Van Horsen
New submission from Case Van Horsen : When I ported gmpy to Python 3.x, I began to use PyLong_AsLongAndOverflow frequently. I found the code to slightly faster and cleaner than using PyLong_AsLong and checking for overflow. I had several code fragments that looked like: #if PY_MAJOR_VERSION == 2

[issue7528] Provide PyLong_AsLongAndOverflow compatibility to Python 2.x

2009-12-17 Thread Case Van Horsen
Case Van Horsen added the comment: Attached py3intcompat.c -- Added file: http://bugs.python.org/file15579/py3intcompat.c ___ Python tracker ___ _

[issue7518] Some functions in pymath.c should be moved elsewhere.

2009-12-17 Thread Mark Dickinson
Mark Dickinson added the comment: So the configure test for tanh(-0.0) is purely informational: it doesn't affect the behaviour of the built Python in any way. I agree that the test is imperfect, in that if atan2 is also non-conformant on the given platform then the sign issue with tanh may

[issue7529] StreamHandler does not live in logging.Handlers

2009-12-17 Thread Chris Withers
New submission from Chris Withers : http://docs.python.org/library/logging.html#module-logging.handlers ...explains that StreamHandler lives in logging but then the class docs say logging.handlers. Georg, if this isn't trivial for you to fix, re-assign it to me and I'll make the changes when I

[issue7497] configure test for posix_semaphore capability leaves semaphore behind, causing test to fail for other users

2009-12-17 Thread Mark Dickinson
Mark Dickinson added the comment: The configure test for enabled POSIX semaphores is now failing for me on OS X 10.6: the test produces sem_open: Permission denied -- assignee: -> mark.dickinson status: closed -> open ___ Python tracker

[issue3588] sysconfig variable LINKFORSHARED has wrong value for MacOS X framework build

2009-12-17 Thread Tarek Ziadé
Tarek Ziadé added the comment: I agree with Ronald: making sure all variables in Makefile provide values that can work in any environment just because distutils offers an API to read them would be a major pain. What is planned is to remove sysconfig from distutils, and have it in the stdlib, wi

[issue7381] subprocess.check_output: "docstring has inconsistent leading whitespace"

2009-12-17 Thread flox
flox added the comment: Patch updated to backport r51536 in trunk. It makes "python -3" happier (do not compare None >= 0). -- Added file: http://bugs.python.org/file15580/issue7381_v2.diff ___ Python tracker _

[issue7381] subprocess.check_output: "docstring has inconsistent leading whitespace"

2009-12-17 Thread flox
Changes by flox : Added file: http://bugs.python.org/file15581/issue7381_py3k_v2.diff ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue7381] subprocess.check_output: "docstring has inconsistent leading whitespace"

2009-12-17 Thread flox
Changes by flox : Removed file: http://bugs.python.org/file15447/issue7381_py3k.diff ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue7381] subprocess.check_output: "docstring has inconsistent leading whitespace"

2009-12-17 Thread flox
Changes by flox : Removed file: http://bugs.python.org/file15446/issue7381.diff ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubs

[issue7530] doc of multiprocessing.managers is wrong (server_forever)

2009-12-17 Thread Stefan Schwarzburg
New submission from Stefan Schwarzburg : The documentation of multiprocessing.managers.BaseManager (http://docs.python.org/library/multiprocessing.html#module-multiprocessing.managers) refers to a method "serve_forever". This method is only available at the server object inside BaseManager (e.g.

[issue7529] StreamHandler does not live in logging.Handlers

2009-12-17 Thread Benjamin Peterson
Changes by Benjamin Peterson : -- assignee: georg.brandl -> vinay.sajip nosy: +vinay.sajip ___ Python tracker ___ ___ Python-bugs-list

[issue7530] doc of multiprocessing.managers is wrong (server_forever)

2009-12-17 Thread R. David Murray
Changes by R. David Murray : -- nosy: +jnoller ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pytho

[issue7523] add SOCK_NONBLOCK and SOCK_CLOEXEC to socket module

2009-12-17 Thread Antoine Pitrou
Antoine Pitrou added the comment: A couple of things: - the test shouldn't be marked as Linux-specific since perhaps these constants will be supported by other systems some day - when importing fcntl, bear in mind that some systems don't have this module (e.g. Windows), so you should catch and s

[issue7531] datetime.timedelta doc has incorrect output

2009-12-17 Thread John Gardner
New submission from John Gardner : The output example for timedelta in datetime package has the wrong output for the supplied commands. For example: >>> ten_years, ten_years.days // 365 (datetime.timedelta(3650), 10) should be: >>> ten_years, ten_years.days (datetime.timedelta(3650), 3650) (or

[issue7531] datetime.timedelta doc has incorrect output

2009-12-17 Thread Mark Dickinson
Mark Dickinson added the comment: Perhaps you're misreading the '//'? It's a division operator, not the start of a comment. The example works fine for me: dicki...@alberti:~> python2.6 Python 2.6.2 (r262:71600, Aug 26 2009, 09:40:44) [GCC 4.2.1 (SUSE Linux)] on linux2 Type "help", "copyright"

[issue7511] msvc9compiler.py: ValueError: [u'path']

2009-12-17 Thread Stefan Krah
Stefan Krah added the comment: I needed a new Windows VM image anyway, so I can now confirm that the paths of a fresh VS Express + SDK 64-bit tools install are broken as described above. -- ___ Python tracker _

[issue7529] StreamHandler does not live in logging.Handlers

2009-12-17 Thread Vinay Sajip
Vinay Sajip added the comment: Fixed in trunk (r76869). I had to add a .. currentmodule::logging to the file, even though this is the first currentmodule directive in the file. Is this a Sphinx glitch? Shouldn't the current module be set by the module directive until changed via a currentmodule

[issue7528] Provide PyLong_AsLongAndOverflow compatibility to Python 2.x

2009-12-17 Thread Mark Dickinson
Mark Dickinson added the comment: > I'm specifically not in favor of adding it to the Python 2.7 API. Out of curiosity, why not? It seems like a reasonable addition to me. I'd continue to call it simply PyLong_AsLongAndOverflow, though. I note that in 2.x, PyLong_AsLong accepts both ints and

[issue7528] Provide PyLong_AsLongAndOverflow compatibility to Python 2.x

2009-12-17 Thread Case Van Horsen
Case Van Horsen added the comment: I don't want it to be a 2.7-only feature. I'm trying to maintain compatibility with 2.4 and later for gmpy. I would be in favor with adding it to 2.7 as long as we could still provide a standalone version for earlier releases of Python. I hadn't realized th

[issue7532] Extended slicing with classic class behaves strangely

2009-12-17 Thread flox
New submission from flox : See attached example. The Classic class should behave like the New-style class. -- components: Interpreter Core files: case_slice.py messages: 96520 nosy: flox severity: normal status: open title: Extended slicing with classic class behaves strangely type: beh

[issue7533] unable to install pycurl in 2.6.4

2009-12-17 Thread iamraprap
New submission from iamraprap : first i tried using easy_install pycurl, also set a path to CURL_DIR and i had error: File "setup.py", line 69, in assert os.path.isdir(CURL_DIR), "please check CURL_DIR in setup.py" AssertionError: please check CURL_DIR in setup.py second attempt, downloa

[issue7533] unable to install pycurl in 2.6.4

2009-12-17 Thread Brett Cannon
Brett Cannon added the comment: This is not a Python error. It simply looks like you didn't set the CURL_DIR variable in the setup.py file that came w/ pycurl. If you can't figure out how to set the variable then I would ask the pycurl developers how to fix this. -- nosy: +brett.cann

[issue7534] float('nan')**2 != nan. float('nan')**2 error 33 on windows

2009-12-17 Thread Marcos Donolo
New submission from Marcos Donolo : I am not getting the expected result for the ** operator on windows, python 2.6 I do... a=float('nan') b=a*a then b is nan which is right but if I do b = a**2 I get. Traceback (most recent call last): File "", line 1, in ValueError: (33, 'Domain error') If

[issue7534] float('nan')**2 != nan. float('nan')**2 error 33 on windows

2009-12-17 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +mark.dickinson priority: -> normal ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubs

[issue7535] logging: Filters on Loggers can't actually filter messages on lower levels of the logging hierarchy

2009-12-17 Thread Leonardo Rochael Almeida
New submission from Leonardo Rochael Almeida : A filter added to, say, logging.getLogger('a').addFilter() never gets the chance to filter messages logged into logging.getLogger('a.b'). On logging.Logger.handle() the current logger filters are called to check if the message should be processed or

[issue7535] logging: Filters on Loggers can't actually filter messages on lower levels of the logging hierarchy

2009-12-17 Thread Vinay Sajip
Vinay Sajip added the comment: This behaviour is by design. Messages logged to logger 'a.b' are not passed to logger 'a' - they are passed to *the handlers* of logger 'a' (and so on up until a false value is seen for the logger's 'propagate' attribute). In this respect, filtering works in the sa

[issue7534] float('nan')**2 != nan. float('nan')**2 error 33 on windows

2009-12-17 Thread Mark Dickinson
Mark Dickinson added the comment: Yep. There's not much consistency in inf/nan handling across platforms, though the situation is slowly getting better. math.pow makes an effort to handle these special cases correctly (for some value of correctly), and it would probably make some sense to h

[issue7536] float('inf')**2 != inf

2009-12-17 Thread Marcos Donolo
New submission from Marcos Donolo : The ** operator produces an error when it gets inf as an argument. if I try. >>>a=float('inf') >>>a*a inf -but if I try >>>a**2 Traceback (most recent call last): File "", line 1, in OverflowError: (34, 'Result too large') I should get inf too. -

[issue7536] float('inf')**2 != inf

2009-12-17 Thread Mark Dickinson
Mark Dickinson added the comment: This is essentially the same issue as issue7534, but for infinities instead of nans. I'm closing this and folding the issue into that one. -- nosy: +mark.dickinson resolution: -> duplicate status: open -> closed superseder: -> float('nan')**2 != nan

[issue7534] float('nan')**2 != nan. float('inf')**2 != inf. float('nan')**2 error 33 on windows

2009-12-17 Thread Mark Dickinson
Mark Dickinson added the comment: Closed 7536 as a duplicate of this issue. -- title: float('nan')**2 != nan. float('nan')**2 error 33 on windows -> float('nan')**2 != nan. float('inf')**2 != inf. float('nan')**2 error 33 on windows ___ Python t

[issue7534] float('nan')**2 != nan. float('nan')**2 error 33 on windows

2009-12-17 Thread Marcos Donolo
Marcos Donolo added the comment: I will give it a shot. On Thu, Dec 17, 2009 at 11:22 AM, Mark Dickinson wrote: > > Mark Dickinson added the comment: > > Yep. There's not much consistency in inf/nan handling across platforms, > though the situation is slowly getting better. math.pow makes a

[issue7534] float('nan')**2 != nan. float('nan')**2 error 33 on windows

2009-12-17 Thread Mark Dickinson
Mark Dickinson added the comment: Great! For math.pow, see the function math_pow in Modules/mathmodule.c; some sort of (careful!) cut-and-paste job from there to float_pow in Objects/floatobject.c might do the trick. -- ___ Python tracker

[issue7534] float('nan')**2 != nan. float('nan')**2 error 33 on windows

2009-12-17 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti versions: +Python 3.1 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubsc

[issue7532] Extended slicing with classic class behaves strangely

2009-12-17 Thread Mark Dickinson
Mark Dickinson added the comment: Hmm. This doesn't look like something that's easy to fix without affecting existing correct code; given that the behaviour has been around for a while (I'm not sure exactly how long), and that the issue is gone in 3.x, I suspect it may not be worth trying.

[issue7532] Extended slicing with classic class behaves strangely

2009-12-17 Thread Mark Dickinson
Mark Dickinson added the comment: Issue #974635 looks like the same thing. That issue was closed as a duplicate of issue #723806, though to my eyes #723806 doesn't look quite the same. -- ___ Python tracker

[issue7442] decimal.py: format failure with locale specifier

2009-12-17 Thread Mark Dickinson
Mark Dickinson added the comment: I'm failing to reproduce this (with py3k) on OS X: Python 3.2a0 (py3k:76866:76867, Dec 17 2009, 09:19:26) [GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import locale >>> from de

[issue7442] decimal.py: format failure with locale specifier

2009-12-17 Thread Mark Dickinson
Mark Dickinson added the comment: What are the multibyte strings that mbstowcs is failing to convert? On my machine, the separators come out as plain ASCII '.' (for thousands) and ',' (for the decimal point). -- ___ Python tracker

[issue7532] Extended slicing with classic class behaves strangely

2009-12-17 Thread flox
flox added the comment: Mark, Thank you for your analysis. I looked at similar implementation of tp_as_sequence->sq_slice slots in "stringobject.c" (and tuple, list). I've added extra controls before the _PySlice_FromIndices call to let it behave like new-style classes. I have updated the tes

[issue7471] GZipFile.readline too slow

2009-12-17 Thread Antoine Pitrou
Antoine Pitrou added the comment: Thanks for the new patch. The problem with inheriting from BufferedRandom, though, is that if you call e.g. write() on a read-only gzipfile, it will appear to succeed because the bytes are buffered internally. I think the solution would be to use delegation rat

[issue7471] GZipFile.readline too slow

2009-12-17 Thread Nir Aides
Nir Aides added the comment: How about using the first patch with the slicing optimization and additionally enhancing GzipFile with the methods required to make it play nice as a raw stream to an io.BufferedReader object (readable(), writable(), readinto(), etc...). This way we still get the

[issue7471] GZipFile.readline too slow

2009-12-17 Thread Antoine Pitrou
Antoine Pitrou added the comment: > How about using the first patch with the slicing optimization and > additionally enhancing GzipFile with the methods required to make it > play nice as a raw stream to an io.BufferedReader object (readable(), > writable(), readinto(), etc...). That's fine

[issue7522] random.choice should accept a set as input

2009-12-17 Thread Leo
Leo added the comment: Thanks for the suggestions "random.sample(s, 1)[0]" and "x=next(iter(s))". A counterpoint: isn't this a classic example of where polymorphism enables a more elegant, simple, and clear (dare I say Pythonic) approach? The complexity of allowing sets as inputs, even with

[issue7535] logging: Filters on Loggers can't actually filter messages on lower levels of the logging hierarchy

2009-12-17 Thread Leonardo Rochael Almeida
Leonardo Rochael Almeida added the comment: At the very least this is a documentation bug. By reading the std docs on the logging module [1] one gets the impression that if a log record gets to a certain logger, even if percolated from more specific loggers, then the filters to that logger shoul

[issue7532] Extended slicing with classic class behaves strangely

2009-12-17 Thread flox
flox added the comment: Patch augmented with extensive tests: * Classic class or New-style class * with or without __getslice__ -- Added file: http://bugs.python.org/file15586/issue7532_classic_getitem_v2.diff ___ Python tracker

[issue7532] Extended slicing with classic class behaves strangely

2009-12-17 Thread flox
Changes by flox : Removed file: http://bugs.python.org/file15585/issue7532_classic_getitem.diff ___ Python tracker ___ ___ Python-bugs-list mai

[issue5819] Add PYTHONPREFIXES environment variable

2009-12-17 Thread Christopher Dunn
Christopher Dunn added the comment: I am not sure that this guy's idea is good, but I think that he deserves more attention. In comments elsewhere on the web, I noticed that people thought the PYTHONUSERBASE site-packages directory could contain .pth files which would serve the same purpose as

[issue7442] decimal.py: format failure with locale specifier

2009-12-17 Thread Eric Smith
Eric Smith added the comment: I can reproduce it on a Fedora (fc6) Linux box. It's not a decimal problem, but a plain locale problem: >>> import locale >>> locale.setlocale(locale.LC_NUMERIC, 'fi_FI') 'fi_FI' >>> locale.localeconv() Traceback (most recent call last): File "", line 1, in Fi

[issue1578269] Add os.link() and os.symlink() and os.path.islink() support for Windows

2009-12-17 Thread Eric Smith
Eric Smith added the comment: I apologize (again) Jason, for taking forever to move forward on this. With patch 16 on XP, I get this error on test_platform: == ERROR: test_architecture_via_symlink (__main__.PlatformTest) -

[issue5093] 2to3 with a pipe on non-ASCII script

2009-12-17 Thread Benjamin Peterson
Benjamin Peterson added the comment: Fixed in r76871. -- nosy: +benjamin.peterson, collinwinter resolution: -> fixed status: open -> closed ___ Python tracker ___ __

[issue7537] test_format

2009-12-17 Thread James G. sack (jim)
New submission from James G. sack (jim) : With -r 76870, on Fedora 11, amd x80_64, regrtest of test_format fails when the -j option is combined with the -v option. It happens whether testing everything or just the one test. ./python -Ebb Lib/test/regrtest -j3 -vv or ./python -Ebb Lib/tes

[issue7528] Provide PyLong_AsLongAndOverflow compatibility to Python 2.x

2009-12-17 Thread Case Van Horsen
Case Van Horsen added the comment: I uploaded a patch to add PyLong_AsLongAndOverflow. It was made against the 2.7a1 source. "make test", gmpy's test suite, and mpmath's test suite all pass. Let me know if there is anything else I can do. -- keywords: +patch Added file: http://bugs.pyt

[issue7528] Provide PyLong_AsLongAndOverflow compatibility to Python 2.x

2009-12-17 Thread Case Van Horsen
Case Van Horsen added the comment: Uploaded a new version of py3intcompat.c. It should be save to include with any version of Python, included 2.7 with PyLong_AsLongAndOverflow added. The file includes basic documentation on use. -- Added file: http://bugs.python.org/file15588/py3intco

[issue7537] test_format fails with -j combined with -v

2009-12-17 Thread Eric Smith
Eric Smith added the comment: I can duplicate this on Fedora Core 6, x86, r76872. I simplified the command line down to: ./python Lib/test/regrtest.py -j1 -v test_format (and any value for j >= 1 causes the error). -- nosy: +eric.smith title: test_format -> test_format fails with -j c

[issue7523] add SOCK_NONBLOCK and SOCK_CLOEXEC to socket module

2009-12-17 Thread lekma
lekma added the comment: > - when importing fcntl, bear in mind that some systems don't have this > module (e.g. Windows), so you should catch and silence the ImportError would something like the following be ok?: try: import fcntl except ImportError: fcntl = False and then: if hasat