[issue17636] Modify IMPORT_FROM to fallback on sys.modules

2014-10-09 Thread Nick Coghlan
Nick Coghlan added the comment: The language reference - at least the section on the import statement, and potentially the section on the overall operation of the import system. I don't *think* it would affect anywhere in the tutorial or the importlib docs, but they may be worth skimming to

[issue19494] urllib2.HTTPBasicAuthHandler (or urllib.request.HTTPBasicAuthHandler) doesn't work with GitHub API v3 and similar

2014-10-09 Thread Armin Rigo
Armin Rigo added the comment: In my own case I use os.popen(wget ...) instead of urllib2 just because some version long ago failed on some web site. I can trust that this external tool works all the time. It would be great if urllib2 worked as well nowadays. So my opinion on this issue, as

[issue21049] Warning at interpreter exit triggers flood of “ImportWarning: sys.meta_path is empty”

2014-10-09 Thread Quentin Pradet
Quentin Pradet added the comment: Martin, yes, I'd be glad to see a fix if it's not too complicated. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21049 ___

[issue22584] Get rid of SRE character tables

2014-10-09 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Currently the SRE regular expression engine uses internal tables to implement ASCII-only character predicates and converting. Proposed patch get rid of these tables and reuse standard Python macros Py_ISSPACE, Py_TOLOWER, etc. -- components:

[issue17381] IGNORECASE breaks unicode literal range matching

2014-10-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Updated patch for 3.5 addresses Antoine's comments. Note that 3.4 and 3.5 use different solutions of this issue. -- dependencies: +Get rid of SRE character tables Added file: http://bugs.python.org/file36842/re_ignore_case_range-3.5_3.patch

[issue19380] Optimize parsing of regular expressions

2014-10-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Updated patch implements Antoine's suggestions. -- Added file: http://bugs.python.org/file36843/re_parse_5.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19380

[issue22389] Generalize contextlib.redirect_stdout

2014-10-09 Thread Berker Peksag
Berker Peksag added the comment: Here's an updated patch. -- Added file: http://bugs.python.org/file36844/issue22389_v2.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22389 ___

[issue22389] Add contextlib.redirect_stderr()

2014-10-09 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- title: Generalize contextlib.redirect_stdout - Add contextlib.redirect_stderr() ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22389 ___

[issue22389] Add contextlib.redirect_stderr()

2014-10-09 Thread STINNER Victor
STINNER Victor added the comment: issue22389_v2.diff: .. function:: redirect_stdout(new_target) + redirect_stderr(new_target) I would prefer to have two distinct entries in the documentation. The redirect_stderr() doc can be after redirect_stdout() and just say Similar to

[issue22493] Deprecate the use of flags not at the start of regular expression

2014-10-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is alternative, much simpler, patch. It deprecates only flags in nested subpatterns. No changes needed in tests and other stdlib modules. It is very unlikely that it is used in third party code. -- Added file:

[issue16254] Make PyUnicode_AsWideCharString() increase temporary

2014-10-09 Thread STINNER Victor
STINNER Victor added the comment: I proposed to change PyUnicode_AsWideCharString() to not cache the result: see my issue #22323 Rewrite PyUnicode_AsWideChar() and PyUnicode_AsWideCharString(): don't cache the result. See also my issues #22271 Deprecate PyUnicode_AsUnicode(): emit a

[issue22323] Rewrite PyUnicode_AsWideChar() and PyUnicode_AsWideCharString(): don't cache the result

2014-10-09 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- title: Rewrite PyUnicode_AsWideChar() and PyUnicode_AsWideCharString() - Rewrite PyUnicode_AsWideChar() and PyUnicode_AsWideCharString(): don't cache the result ___ Python tracker

[issue22580] PyUnicode_Tailmatch documentation does not match signature

2014-10-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset 4aba14bb6b1e by Victor Stinner in branch '3.4': Closes #22580: Fix documentation of PyUnicode_Tailmatch() https://hg.python.org/cpython/rev/4aba14bb6b1e New changeset 335d16d864e1 by Victor Stinner in branch 'default': (Merge 3.4) Closes #22580:

[issue22580] PyUnicode_Tailmatch documentation does not match signature

2014-10-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset de4ffe20 by Victor Stinner in branch '2.7': Closes #22580: Fix documentation of PyUnicode_Tailmatch() https://hg.python.org/cpython/rev/de4ffe20 -- ___ Python tracker rep...@bugs.python.org

[issue22580] PyUnicode_Tailmatch documentation does not match signature

2014-10-09 Thread STINNER Victor
STINNER Victor added the comment: The documentation for PyUnicode_Tailmatch says it returns an int It's an old bug (since Python 2.7 or older) and it is now fixed. Thanks for the report Josh. -- ___ Python tracker rep...@bugs.python.org

[issue22542] Use arc4random under OpenBSD for os.urandom() if /dev/urandom is not present

2014-10-09 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- title: Use arc4random under OpenBSD for os.urandom() - Use arc4random under OpenBSD for os.urandom() if /dev/urandom is not present ___ Python tracker rep...@bugs.python.org

[issue22181] os.urandom() should use Linux 3.17 getrandom() syscall

2014-10-09 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- type: enhancement - security ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22181 ___ ___

[issue22585] os.urandom() should use getentropy() of OpenBSD 5.6

2014-10-09 Thread STINNER Victor
New submission from STINNER Victor: The future OpenBSD 5.6 (scheduled in november 2014) will have a new getentropy() syscall and a new getentropy() in their C library which avoid the need of a file descriptor:

[issue22585] os.urandom() should use getentropy() of OpenBSD 5.6

2014-10-09 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +700eb415, rpointel ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22585 ___ ___

[issue22181] os.urandom() should use Linux 3.17 getrandom() syscall

2014-10-09 Thread STINNER Victor
STINNER Victor added the comment: This issue is specific to Linux: it depends on the Linux kernel version and we are waiting until the new syscall is available in the C library (especially the glibc). For these reasons, I prefer to open a new specific issue for OpenBSD, since they release the

[issue21459] DragonFlyBSD support

2014-10-09 Thread Thomas Klausner
Thomas Klausner added the comment: The diff got even smaller -- one of the two chunks was applied in 3.4.2 without a reference to this bug report. Please apply the last chunk, it's completely straightforward. -- Added file: http://bugs.python.org/file36846/dragonfly.diff

[issue21459] DragonFlyBSD support

2014-10-09 Thread Thomas Klausner
Changes by Thomas Klausner t...@giga.or.at: Removed file: http://bugs.python.org/file35433/dragonfly.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21459 ___

[issue22585] os.urandom() should use getentropy() of OpenBSD 5.6

2014-10-09 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +alex ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22585 ___ ___ Python-bugs-list

[issue22542] Use arc4random under OpenBSD for os.urandom() if /dev/urandom is not present

2014-10-09 Thread STINNER Victor
STINNER Victor added the comment: title: Use syscall (eg. arc4random or getentropy) rather than /dev/urandom when possible - Use arc4random under OpenBSD for os.urandom() For the usage getentropy(), I created a dedicated issue: #22585. arc4random() should be avoided IMO, on many systems

[issue22181] os.urandom() should use Linux 3.17 getrandom() syscall

2014-10-09 Thread STINNER Victor
STINNER Victor added the comment: Since this is a Linux-specific issue (see the title), you should create a separate issue for OpenBSD support. 700eb415 opened the issue #22542 for arc4random(). -- ___ Python tracker rep...@bugs.python.org

[issue22542] Use arc4random under OpenBSD for os.urandom() if /dev/urandom is not present

2014-10-09 Thread STINNER Victor
STINNER Victor added the comment: Hopefully this could then be used as a template for getrandom() when implemented on Linux. Sorry, what is getrandom()? Linux 3.17 has a new getrandom() syscall, but the C API is not defined yet (see the issue #22181). OpenBSD 5.6 will have a getentropy()

[issue22583] Segmentation fault with string concatenation

2014-10-09 Thread STINNER Victor
STINNER Victor added the comment: Then, on Ubuntu 14.04, 32-bit: $ python mega_concat.py Segmentation fault (core dumped) What is your Python version? It looks like Ubuntu Trusty provides Python 2.7.6. I'm unable to reproduce the issue on ArchLinux 32-bit with Python 2.7.8. The issue was

[issue5843] Normalization error in urlunparse

2014-10-09 Thread Aaron Hill
Aaron Hill added the comment: In order to fix this, I think ParseResult needs to have two additional fields, indicating with an empty prefix or query string are used. Both ParseResult.fragment and ParseResult.query omit the leading '#' or '?' from their value. This makes it impossible to

[issue22524] PEP 471 implementation: os.scandir() directory scanning function

2014-10-09 Thread STINNER Victor
STINNER Victor added the comment: I cloned https://github.com/benhoyt/scandir. I understand that the --scandir command line option of benchmark.py are these choices: - generic = call listdir() and then use yield GenericDirEntry which caches os.stat() and os.lstat() results - python = ctypes

[issue22524] PEP 471 implementation: os.scandir() directory scanning function

2014-10-09 Thread STINNER Victor
STINNER Victor added the comment: I also ran the benchmark without cache on disk. It looks like my hard drive is too slow to see a real speedup of scandir(). The maximum speedup is 2.7 seconds lesser when testing the c scandir (24.089 = 21.374 seconds): 1.1x as fast. I modified the benchmark

[issue22583] Segmentation fault with string concatenation

2014-10-09 Thread Josh Rosenberg
Josh Rosenberg added the comment: You're supposed to use that code to create a file (the output file is just +...+). If you want something that won't MemoryError generating the file, this is a memory free version of the code to generate the file: import itertools, sys

[issue22524] PEP 471 implementation: os.scandir() directory scanning function

2014-10-09 Thread STINNER Victor
STINNER Victor added the comment: My previous benchmark runs were with the system Python 3.3. New benchmark with a Python 3.5 patched with scandir-1.patch (compiled in release mode: ./configure make). os (os.scandir) is 2 times faster than c (_scandir.scandir_helper): c=0.533 sec, os=0.268

[issue22524] PEP 471 implementation: os.scandir() directory scanning function

2014-10-09 Thread STINNER Victor
STINNER Victor added the comment: On Windows, I guess that benchmark.py --size is faster with scandir() than with os.walk(), because os.stat() is never called. benchmark.py has a bug in do_os_walk() when the --size option is used: attached do_os_walk_getsize.patch is needed. Sizes returned

[issue22583] C stack overflow in the Python 2.7 compiler

2014-10-09 Thread STINNER Victor
STINNER Victor added the comment: You're supposed to use that code to create a file (the output file is just +...+). Oh ok, the bug is in Python compiler. It's probably an overflow of the C stack. The bug was fixed in Python 3.3 by the issue #5765: see changeset ab02cd145f56. See

[issue22327] test_gdb failures on Ubuntu 14.10

2014-10-09 Thread STINNER Victor
STINNER Victor added the comment: Is it only a warning or python-gdb.py doesn't work at all? If it's a warning, attached test_gdb.patch should fix it. -- keywords: +patch nosy: +haypo Added file: http://bugs.python.org/file36849/test_gdb.patch ___

[issue22579] Posix module init function name should not be compiler-dependent

2014-10-09 Thread STINNER Victor
STINNER Victor added the comment: The patch looks good to me, but I would prefer that someone else double check. -- components: +Windows nosy: +haypo, loewis, pitrou versions: +Python 3.5 -Python 3.4 ___ Python tracker rep...@bugs.python.org

[issue22568] Use of utime as variable name in Modules/posixmodule.c causes errors

2014-10-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset 58601c36a357 by Victor Stinner in branch '3.4': Issue #22568: Fix compilation of posixmodule.c with Open Watcom: rename utime https://hg.python.org/cpython/rev/58601c36a357 New changeset 588657f910ac by Victor Stinner in branch 'default': (Merge

[issue22568] Use of utime as variable name in Modules/posixmodule.c causes errors

2014-10-09 Thread STINNER Victor
STINNER Victor added the comment: Patch LGTM. The patch is safe. Even if I don't care of the Open Watcom compiler, the patch is simple enough to be accepted. (It doesn't add crazy #ifdef WATCOM). I commited your change, thanks Jeffrey for your contribution. --

[issue22327] test_gdb failures on Ubuntu 14.10

2014-10-09 Thread Matěj Stuchlík
Matěj Stuchlík added the comment: While with Python3.5's test_gdb does fail when building in Koji [0], it seems to pass fine in our other build system - Copr [1]. Comparing the two [2][3], it seems the only big difference is the kernel version - 2.6.32 in Copr and 3.16.3 in Koji. Not sure how

[issue22198] Odd floor-division corner case

2014-10-09 Thread Petr Viktorin
Petr Viktorin added the comment: Apologies for the delay; I missed/did not get a notification. Alexander, I don't disagree, but I'd like my first patch to Python to not be a refactoring. As I said, I'd like to keep this patch focused. After that I'd like to provide tests the rest of

[issue22524] PEP 471 implementation: os.scandir() directory scanning function

2014-10-09 Thread Ben Hoyt
Ben Hoyt added the comment: Thanks, Victor and Antone. I'm somewhat surprised at the 2-3x numbers you're seeing, as I was consistently getting 4-5x in the Linux tests I did. But it does depend quite a bit on what file system you're running, what hardware, whether you're running in a VM, etc.

[issue22524] PEP 471 implementation: os.scandir() directory scanning function

2014-10-09 Thread Antoine Pitrou
Antoine Pitrou added the comment: Le 09/10/2014 14:35, Ben Hoyt a écrit : Anyway, where to from here? Are we agreed given the numbers that -- especially on Linux -- it makes good performance sense to use an all-C approach? I think so, yes. -- ___

[issue16177] Typing left parenthesis in IDLE causes intermittent Cocoa Tk crash on OS X

2014-10-09 Thread Brian Keegan
Brian Keegan added the comment: I was also using a dual-screen setup: laptop + external display. On Thu, Oct 9, 2014 at 1:07 AM, Ned Deily rep...@bugs.python.org wrote: Ned Deily added the comment: Thanks, Tom, nice writeup! If any of the other people who have seen this crash are still

[issue22564] ssl: post-commit review of the new memory BIO API

2014-10-09 Thread STINNER Victor
STINNER Victor added the comment: Here is a first patch for SSL documentation. If the patch looks fine, I will first apply revelant parts to Python 3.4 documentation. -- keywords: +patch Added file: http://bugs.python.org/file36850/ssl_doc.patch ___

[issue557704] netrc module can't handle all passwords

2014-10-09 Thread Martin Dengler
Martin Dengler added the comment: I know this is ancient, but the below patch handles spaces in passwords in 2.7.8 and 3.4 for me. If this is worth making into a new bug / proper patch I'm happy to do it. $ diff -uw /c/Python278/Lib/netrc.py{-orig,} --- /c/Python278/Lib/netrc.py-orig

[issue557704] netrc module can't handle all passwords

2014-10-09 Thread Martin Dengler
Martin Dengler added the comment: Sorry for the whitespace-unaware diff. The attached patch is the real one, with the obvious extra level of indentation around the critical password = lexer.get_token() line. -- keywords: +patch Added file:

[issue22524] PEP 471 implementation: os.scandir() directory scanning function

2014-10-09 Thread STINNER Victor
STINNER Victor added the comment: I'm somewhat surprised at the 2-3x numbers you're seeing, as I was consistently getting 4-5x in the Linux tests I did. But it does depend quite a bit on what file system you're running, what hardware, whether you're running in a VM, etc. Still, 2-3x

[issue22524] PEP 471 implementation: os.scandir() directory scanning function

2014-10-09 Thread Ben Hoyt
Ben Hoyt added the comment: I dunno, I'd be happy if you implement this, but it does mean *more* C code, not less. :-) I feel this would be a nice-to-have, but we should get the thing working first, and then do the multiple-OS-calls-in-one optimization. In any case, if you implement this, I

[issue22578] Add additional attributes to re.error

2014-10-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Matthew for your suggestions. Here is updated patch. -- Added file: http://bugs.python.org/file36852/re_error_attrs3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22578

[issue21049] Warning at interpreter exit triggers flood of “ImportWarning: sys.meta_path is empty”

2014-10-09 Thread Brett Cannon
Brett Cannon added the comment: I'm already planning to look into this problem in issue #21052 so feel free to follow over there. -- superseder: - Consider dropping ImportWarning for empty sys.path_hooks and sys.meta_path ___ Python tracker

[issue22407] re.LOCALE is nonsensical for Unicode

2014-10-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is simple patch which just deprecate using of the re.LOCALE flag with str patterns. It also deprecates using of the re.LOCALE flag with the re.ASCII flag (with bytes patterns) and adds some re.LOCALE related tests. -- versions: -Python 2.7,

[issue22586] urljoin allow_fragments doesn't work

2014-10-09 Thread Alex Parrill
New submission from Alex Parrill: Passing False to the allow_fragments argument to urljoin doesn't remove fragments. Is this a bug, or am I misunderstanding the allow_fragments parameter? It's not perfectly clear what fragment identifiers are not allowed means (strips them out? throws an

[issue22389] Add contextlib.redirect_stderr()

2014-10-09 Thread Yury Selivanov
Yury Selivanov added the comment: I think that Victor is right, it would be better to have two distinct entries in the docs. Besides that - LGTM. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22389

[issue22568] Use of utime as variable name in Modules/posixmodule.c causes errors

2014-10-09 Thread Georg Brandl
Georg Brandl added the comment: UTIME_TO_UTIMBUF actually still looks dodgy and UTIME_TO_TIME_T is completely broken. * There should be only one utimbuf structure, because it already contains both times (see man 2 utime). * UTIME_TO_TIME_T uses a type called struct timet which I don't think

[issue22568] Use of utime as variable name in Modules/posixmodule.c causes errors

2014-10-09 Thread Jeffrey Armstrong
Jeffrey Armstrong added the comment: My patch merely fixes broken code that wasn't being used by Python's supported compilers under most common configurations. It's really independent of compiler. I realize nobody here cares about Open Watcom as a supported compiler; the Python community

[issue22586] urljoin allow_fragments doesn't work

2014-10-09 Thread Georg Brandl
Georg Brandl added the comment: The not allowed should be clarified. What is meant is that if allow_fragments is false, a fragment is parsed as part of the path. This doesn't make a difference for urljoin if the fragment is part of the second part. It does make a difference for the first

[issue22568] Use of utime as variable name in Modules/posixmodule.c causes errors

2014-10-09 Thread Georg Brandl
Georg Brandl added the comment: Jeffrey: I did not mean to devalue your patch, I just wanted to bring even more issues to Victor's attention. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22568

[issue22587] os.path.abspath(None) behavior is inconsistent between platforms

2014-10-09 Thread Kevin Keating
New submission from Kevin Keating: On Windows, os.path.abspath() treats None as if it were an empty string, so os.path.abspath(None) returns the current working directory. On Linux, os.path.abspath(None) raises an AttributeError. With macpath, abspath(None) raises a TypeError. I've seen

[issue22568] Use of utime as variable name in Modules/posixmodule.c causes errors

2014-10-09 Thread Jeffrey Armstrong
Jeffrey Armstrong added the comment: Georg: Sorry, that wasn't directed at you. Your comment snuck in before mine. It was more general frustration. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22568

[issue22587] os.path.abspath(None) behavior is inconsistent between platforms

2014-10-09 Thread Kevin Keating
Kevin Keating added the comment: I just realized that even the behavior of ntpath.abspath() is inconsistent across platforms. On Windows, ntpath.abspath(None) returns the current working directory. On other OSs, ntpath.abspath(None) raises a TypeError. There are two different abspath

[issue22588] memory corrupted in test_capi refleaks test

2014-10-09 Thread Xavier de Gaye
New submission from Xavier de Gaye: This does not happen on tests run with '-R 22:22' or a lower run count, but occur systematically with '-R 23:23' or a greater run count. $ ./python Python 3.5.0a0 (default:1e1c6e306eb4, Oct 9 2014, 19:52:59) [GCC 4.9.1 20140903 (prerelease)] on linux Type

[issue18615] sndhdr.whathdr could return a namedtuple

2014-10-09 Thread Claudiu Popa
Changes by Claudiu Popa pcmantic...@gmail.com: -- stage: patch review - commit review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18615 ___ ___

[issue21986] Pickleability of code objects is inconsistent

2014-10-09 Thread Claudiu Popa
Claudiu Popa added the comment: Terry, can I do something to move this issue forward? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21986 ___

[issue21052] Consider dropping ImportWarning for empty sys.path_hooks and sys.meta_path

2014-10-09 Thread Quentin Pradet
Changes by Quentin Pradet quentin.pra...@gmail.com: -- nosy: +Quentin.Pradet ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21052 ___ ___

[issue16177] Typing left parenthesis in IDLE causes intermittent Cocoa Tk crash on OS X

2014-10-09 Thread Ned Deily
Ned Deily added the comment: Thanks for the confirmation, Brian. I certainly would not have thought to ask about multiple monitors. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16177

[issue22568] Use of utime as variable name in Modules/posixmodule.c causes errors

2014-10-09 Thread Larry Hastings
Larry Hastings added the comment: Georg, you want to take a swing at it, be my guest. The current mess is my doing, and I claim this is an *improvement* over what came before. -- ___ Python tracker rep...@bugs.python.org

[issue3068] IDLE - Add an extension configuration dialog

2014-10-09 Thread Terry J. Reedy
Terry J. Reedy added the comment: I think we should give each extension with options other than 'enablexx' a single 'option-help' option that gives the 'signature' of the extension. I suggest 'option-help', rather than just 'help', as the new 'reserved' option name as being more descriptive

[issue22522] sys.excepthook doesn't receive the traceback when called from code.InteractiveInterpreter

2014-10-09 Thread Claudiu Popa
Changes by Claudiu Popa pcmantic...@gmail.com: -- stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22522 ___ ___

[issue22568] Use of utime as variable name in Modules/posixmodule.c causes errors

2014-10-09 Thread Georg Brandl
Georg Brandl added the comment: I'm sure you've improved the code. Without looking at the hg history, you've likely just inherited the broken C code from the previous version and made it prettier :) Since this breakage has not been reported so far, the last two #elses appear to be a

[issue22589] mimetypes uses image/x-ms-bmp as the type for bmp files

2014-10-09 Thread Brian Matthews
New submission from Brian Matthews: In the file mimetypes.py the mime type for bmp files should be image/bmp for IE8 and later. the problem is that if the content header for 'nosniff' is set, then the bmp file fails to display due to the incorrect mime type. -- components: IO

[issue11694] xdrlib raises ConversionError in inconsistent way

2014-10-09 Thread Claudiu Popa
Claudiu Popa added the comment: Here's a refreshed patch: - raising_conversion_error is now raise_conversion_error - the decorator uses functools.wraps - the ConversionError is instantiated with the first argument of the caught expression - the reraising of ConversionError has the exception

[issue22590] math.copysign buggy with nan under Windows

2014-10-09 Thread Antoine Pitrou
New submission from Antoine Pitrou: Z:\c:\Python27\python.exe Python 2.7.8 (default, Jun 30 2014, 16:03:49) [MSC v.1500 32 bit (Intel)] on win32 Type help, copyright, credits or license for more information. import math math.copysign(0.0, float(nan)) -0.0 ^Z Z:\c:\Python34\python.exe

[issue22590] math.copysign buggy with nan under Windows

2014-10-09 Thread Mark Dickinson
Mark Dickinson added the comment: Why do you consider this a bug? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22590 ___ ___ Python-bugs-list

[issue22590] math.copysign buggy with nan under Windows

2014-10-09 Thread Mark Dickinson
Mark Dickinson added the comment: More info: the reason for the difference is that in Python 3.4, float(nan) and float(inf) create the float directly from the appropriate bit-pattern, rather than deferring to the platform's definition of nan. This change was introduced to avoid obscure

[issue22568] Use of utime as variable name in Modules/posixmodule.c causes errors

2014-10-09 Thread STINNER Victor
STINNER Victor added the comment: I realize nobody here cares about Open Watcom as a supported compiler; the Python community has made that *abundantly* clear. I only heard once about Open Watcom, maybe 1 or 2 years ago. I see on http://www.openwatcom.org/ that the latest release is 4 years

[issue22568] Use of utime as variable name in Modules/posixmodule.c causes errors

2014-10-09 Thread STINNER Victor
STINNER Victor added the comment: UTIME_TO_UTIMBUF actually still looks dodgy and UTIME_TO_TIME_T is completely broken. Agreed. It looks like dead code which was never used nor tested. @Jeffrey: Is your patch enough to compile posixmodule.c with OpenWatcom? If it's enough, I will close the

[issue22590] math.copysign buggy with nan under Windows

2014-10-09 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ah, apparently it was already reported as issue14521... Well, it's bug in as much as it shows different behaviour across platforms... AFAICT, we try to provide consistent math behaviour despite possible platform variations. --

[issue22590] math.copysign buggy with nan under Windows

2014-10-09 Thread Antoine Pitrou
Antoine Pitrou added the comment: Also, the fact that we support float('nan') and float('-nan') as producing different bit patterns means we should perhaps produce the right sign bit for each (it seems that's the problem here). import struct struct.pack(d, float(nan))

[issue22590] math.copysign buggy with nan under Windows

2014-10-09 Thread Mark Dickinson
Mark Dickinson added the comment: we should perhaps produce the right sign bit for each Perhaps. But given that signs of NaNs are pretty much meaningless anyway (the IEEE 754 standard explicitly refuses to attach any meaning to NaN sign bits, and the sign bit of a NaN result is not

[issue22588] memory corrupted in test_capi refleaks test

2014-10-09 Thread Stefan Krah
Stefan Krah added the comment: I cannot reproduce this here. Did you run make distclean before compiling? -- nosy: +skrah ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22588 ___

[issue22590] math.copysign buggy with nan under Windows

2014-10-09 Thread Antoine Pitrou
Antoine Pitrou added the comment: Yes, things are ok under 3.x. We'll probably disable our NaN tests under Windows anyway, since they aren't very useful as you point out. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22590

[issue22588] memory corrupted in test_capi refleaks test

2014-10-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset 5d87a6b38422 by Victor Stinner in branch '3.4': Issue #22588: Fix typo in _testcapi.test_incref_decref_API() https://hg.python.org/cpython/rev/5d87a6b38422 -- nosy: +python-dev ___ Python tracker

[issue22588] memory corrupted in test_capi refleaks test

2014-10-09 Thread STINNER Victor
STINNER Victor added the comment: but occur systematically with '-R 23:23' or a greater run count. I was able to reproduce the issue. I found that the error came from test_incref_decref_API(). After my change, it looks like test_capi doesn't crash anymore. $ ./python -m test -R 23:23

[issue21986] Pickleability of code objects is inconsistent

2014-10-09 Thread Terry J. Reedy
Terry J. Reedy added the comment: Here are the issues for me. 1. Except for your interest, this is a lower priority for me that most all of the other 125 Idle issues. 2. I am not familiar with pickling and wonder about the following in the patch. It deletes a statememt

[issue22568] Use of utime as variable name in Modules/posixmodule.c causes errors

2014-10-09 Thread Jeffrey Armstrong
Jeffrey Armstrong added the comment: The last official Open Watcom release (1.9) is indeed quite dated. The codebase was forked for a variety of reasons where development continues: https://github.com/open-watcom/open-watcom-v2 The current development release does indeed build on x86_64

[issue21986] Idle: disable pickleability of user code objects

2014-10-09 Thread Terry J. Reedy
Changes by Terry J. Reedy tjre...@udel.edu: -- title: Pickleability of code objects is inconsistent - Idle: disable pickleability of user code objects ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21986

[issue22579] Posix module init function name should not be compiler-dependent

2014-10-09 Thread Georg Brandl
Georg Brandl added the comment: There is also #if !defined(__QNX__) #if defined(MS_WINDOWS) || defined(__BORLANDC__) || defined(__WATCOMC__) || defined(__DJGPP__) #define SEP L'\\' #define ALTSEP L'/' #define MAXPATHLEN 256 #define DELIM L';' #endif #endif in Include/osdefs.h --

[issue18615] sndhdr.whathdr could return a namedtuple

2014-10-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset ef72142eb8a2 by R David Murray in branch 'default': #18615: Make sndhdr return namedtuples. https://hg.python.org/cpython/rev/ef72142eb8a2 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org

[issue18615] sndhdr.whathdr could return a namedtuple

2014-10-09 Thread R. David Murray
R. David Murray added the comment: Committed. Thanks, Claudiu. -- resolution: - fixed stage: commit review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18615

[issue22579] Posix module init function name should not be compiler-dependent

2014-10-09 Thread Antoine Pitrou
Antoine Pitrou added the comment: I would remove the || defined(__BORLANDC__) || defined(__WATCOMC__) || defined(__DJGPP__) part, since it's probably for MSDOS variants of those compilers. -- ___ Python tracker rep...@bugs.python.org

[issue21986] Pickleability of code objects is inconsistent

2014-10-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: 2. It is normal. The third argument of copyreg.pickle() is not used now. The patch LGTM. -- title: Idle: disable pickleability of user code objects - Pickleability of code objects is inconsistent ___ Python

[issue22591] Drop support of MS-DOS

2014-10-09 Thread STINNER Victor
New submission from STINNER Victor: In the C code of Python 3.5, there are still preprocessor commands checking for defines: - __BORLANDC__: Borland C compiler - __WATCOMC__: Watcom C compiler - __DJGPP__: MS-DOS port of GCC In 2014, it's time to drop this old code. OS/2 support was already

[issue22579] Posix module init function name should not be compiler-dependent

2014-10-09 Thread STINNER Victor
STINNER Victor added the comment: I would remove the || defined(__BORLANDC__) || defined(__WATCOMC__) || defined(__DJGPP__) part, since it's probably for MSDOS variants of those compilers. I agree, but IMO it is unrelated to this issue. Jeffrey wants to support a new C compiler

[issue17636] Modify IMPORT_FROM to fallback on sys.modules

2014-10-09 Thread Antoine Pitrou
Antoine Pitrou added the comment: By the way, my patch is currently using the package's __name__ attribute to build the fully-qualified name. Should it use the package's __package__ attribute instead? -- ___ Python tracker rep...@bugs.python.org

[issue22591] Drop support of MS-DOS

2014-10-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: AFAIK Borland and Watcom compilers supported Windows. -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22591 ___

[issue21986] Idle: disable pickleability of user code objects

2014-10-09 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- title: Pickleability of code objects is inconsistent - Idle: disable pickleability of user code objects ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21986

[issue21986] Idle: disable pickleability of user code objects

2014-10-09 Thread Claudiu Popa
Claudiu Popa added the comment: Thank you for your feedback, Terry. 1. IDLE is behaving differently than the builtin interpreter. It should be higher priority, because it leads beginners into believing that code objects are picklable. 2. No, wrapping code objects in a CodePickler with

[issue18176] Builtins documentation refers to old version of UCD.

2014-10-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset fd7994909c2d by R David Murray in branch '3.4': #18176: updated stdtypes UCD link, added reminder to makeunicodedata. https://hg.python.org/cpython/rev/fd7994909c2d New changeset 2551bdfff335 by R David Murray in branch 'default': Merge: #18176:

[issue18176] Builtins documentation refers to old version of UCD.

2014-10-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset 303861ce9ead by R David Murray in branch '3.4': #18176: fix another reference and add it to the makeunicodedata comment. https://hg.python.org/cpython/rev/303861ce9ead New changeset e9ec8d622a30 by R David Murray in branch 'default': Merge: #18176:

[issue22591] Drop support of MS-DOS

2014-10-09 Thread STINNER Victor
STINNER Victor added the comment: AFAIK Borland and Watcom compilers supported Windows. It looks like Borland C++ Builder 5.5 was released in 2000, 14 years ago. Yes, it supports Windows and MS-DOS, but do we really want to support this very old proprietary compiler? For Watcom, it's a

  1   2   >