[issue28701] Replace PyUnicode_CompareWithASCIIString with _PyUnicode_EqualToASCIIString

2016-11-16 Thread Roundup Robot
Roundup Robot added the comment: New changeset 386c682dcd75 by Serhiy Storchaka in branch '3.5': Issue #28701: Replace PyUnicode_CompareWithASCIIString with _PyUnicode_EqualToASCIIString. https://hg.python.org/cpython/rev/386c682dcd75 New changeset 72d07d13869a by Serhiy Storchaka in branch '3.

[issue28000] Build fails on AIX with _LINUX_SOURCE_COMPAT flag

2016-11-16 Thread Matthieu S
Changes by Matthieu S : -- versions: +Python 3.7 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue28000] Build fails on AIX with _LINUX_SOURCE_COMPAT flag

2016-11-16 Thread Matthieu S
Matthieu S added the comment: Thanks ! -- resolution: fixed -> status: closed -> open versions: -Python 3.7 ___ Python tracker ___ _

[issue28000] Build fails on AIX with _LINUX_SOURCE_COMPAT flag

2016-11-16 Thread Matthieu S
Changes by Matthieu S : -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsub

[issue28701] Replace PyUnicode_CompareWithASCIIString with _PyUnicode_EqualToASCIIString

2016-11-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thanks Xiang and Inada for your reviews. The patch fixes a bug: error is not checked after PyUnicode_CompareWithASCIIString(). The patch is not applicable to 2.7 since PyUnicode_CompareWithASCIIString() is Python 3 only. -- assignee: -> serhiy.stor

[issue28711] IDLE doesn't open

2016-11-16 Thread Terry J. Reedy
Terry J. Reedy added the comment: Run IDLE from Command Prompt with 'python -m idlelib.idle' (or 'py -2 -m idlelib.idle') and you should see an error message. Post it here. What do you mean by 'change the key settings'? What, specifically, did you do? -- ___

[issue26072] pdb fails to access variables closed over

2016-11-16 Thread Xavier de Gaye
Xavier de Gaye added the comment: It seems that the last patch in issue 21161 fixes all the problems described here, msg 149096 explains why. Can you confirm that this is a duplicate of issue 21161. -- ___ Python tracker

[issue27945] Various segfaults with dict

2016-11-16 Thread INADA Naoki
INADA Naoki added the comment: 0001-Issue-27945-fix-PyDict_MergeFromSeq2-use-after-free.patch: LGTM. I've checked it can be applied to 2.7 and 3.5 branch and passes `make quicktest`. -- ___ Python tracker

[issue27945] Various segfaults with dict

2016-11-16 Thread INADA Naoki
INADA Naoki added the comment: 0001-Issue-27945-fix-dictitems_contains-use-after-free.patch LGTM. This patch can be applied to 2.7 and 3.5, without conflict against previous patch. It passes `make quicktest`. -- ___ Python tracker

[issue26072] pdb fails to access variables closed over

2016-11-16 Thread Chun-Yu Tseng
Chun-Yu Tseng added the comment: The last patch in #21161 fixes some problems but also brings up critical issues: (Pdb) list . 1 y = 2 2 3 def f(): 4 y = 9 5 z = 10 6 -> import pdb; pdb.set_trace(); 7 f() [EOF] (Pdb) globals()['y'] 9 (Pdb) glob

[issue28701] Replace PyUnicode_CompareWithASCIIString with _PyUnicode_EqualToASCIIString

2016-11-16 Thread STINNER Victor
STINNER Victor added the comment: (I reopen the issue to ask my question :-)) +/* Test whether a unicode is equal to ASCII string. Return 1 if true, + 0 otherwise. Return 0 if any argument contains non-ASCII characters. + Any error occurs inside will be cleared before return. */ Can you p

[issue28701] Replace PyUnicode_CompareWithASCIIString with _PyUnicode_EqualToASCIIString

2016-11-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > Can you please also document the behaviour if you pass two non-ASCII strings > which are equal? What mean "equal"? The left argument is a Unicode string, but the right argument is a byte string. For comparing them we should decode right argument or encode

[issue21449] Replace _PyUnicode_CompareWithId with _PyUnicode_CompareWithIdEqual

2016-11-16 Thread Xiang Zhang
Xiang Zhang added the comment: > _PyUnicode_CompareWithId is a private function. We can remove it if it has > issues. It doesn't. But once there is _PyUnicode_EqualToASCIIId, it's can be rarely used. The new patch implements a version of _PyUnicode_EqualToASCIIId. -- Added file: http

[issue27945] Various segfaults with dict

2016-11-16 Thread INADA Naoki
INADA Naoki added the comment: 0001-Issue-27945-fix-dictiter_iternextitem-use-after-free.patch LGTM and OK too. But 0001-Issue-27945-Fixed-segfaults-in-dict.fromkeys-when-it.patch cause conflict. I want to commit first three patches. For another reviewer, here is the patch merging three pat

[issue27585] asyncio.Lock deadlock after cancellation

2016-11-16 Thread Mathieu Sornay
Mathieu Sornay added the comment: Fix attempt : https://github.com/python/asyncio/pull/467 -- ___ Python tracker ___ ___ Python-bugs-l

[issue28595] shlex.shlex should not augment wordchars

2016-11-16 Thread R. David Murray
R. David Murray added the comment: Per our conversation on IRC: since this is not a regression, it is unlikely to be addressed at this stage of the 3.6 release cycle. I'm adding the release manager as nosy just in case, but I don't expect him to want this to be addressed now. IMO if the beha

[issue27945] Various segfaults with dict

2016-11-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I worry about performance. Additional increment/decrement of reference counter can add significant overhead in critical places of Python interpreter. Before committing any patches we should measure the performance lost. -- __

[issue28670] PEP 235: Implement on every POSIX system, and clean up the C code for `import'

2016-11-16 Thread Nick Coghlan
Nick Coghlan added the comment: Michael, please do not reopen feature requests that have been declared out of scope for maintenance releases. Python 2.7 DOES NOT support filesystem semantics that differ from the "default" semantics for the host operating system. Even Python 3 requires that the

[issue21449] Replace _PyUnicode_CompareWithId with _PyUnicode_CompareWithIdEqual

2016-11-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: LGTM. Except that _PyUnicode_EqualToASCIIString() could be used for simplicity. > _PyUnicode_CompareWithId is a private function. We can remove it if it has > issues. I would left it in maintained releases and removed it in 3.7 (or 3.6?). -- assigne

[issue27945] Various segfaults with dict

2016-11-16 Thread INADA Naoki
INADA Naoki added the comment: OK, I'll run benchmark in this week. But three patches seems don't affects to performance critical APIs. -- ___ Python tracker ___

[issue28712] Non-Windows mappings for a couple of Windows code pages

2016-11-16 Thread Mingye Wang
Mingye Wang added the comment: Ugh... This is weird. Attached is a correct version use Python 3.6's 'code page' methods. I have modified the script a little to make sure it runs on Py3. -- Added file: http://bugs.python.org/file45501/win10_14959_py36.txt ___

[issue28712] Non-Windows mappings for a couple of Windows code pages

2016-11-16 Thread Mingye Wang
Changes by Mingye Wang : Added file: http://bugs.python.org/file45502/pycp.py ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubsc

[issue28712] Non-Windows mappings for a couple of Windows code pages

2016-11-16 Thread Mingye Wang
Changes by Mingye Wang : Removed file: http://bugs.python.org/file45497/pycp.py ___ Python tracker ___ ___ Python-bugs-list mailing list Unsub

[issue28701] Replace PyUnicode_CompareWithASCIIString with _PyUnicode_EqualToASCIIString

2016-11-16 Thread STINNER Victor
STINNER Victor added the comment: I suggest "return 0 in release build and crash in debug build". -- ___ Python tracker ___ ___ Python

[issue28701] Replace PyUnicode_CompareWithASCIIString with _PyUnicode_EqualToASCIIString

2016-11-16 Thread Roundup Robot
Roundup Robot added the comment: New changeset faf04a995031 by Serhiy Storchaka in branch '3.5': Issue #28701: Replace _PyUnicode_CompareWithId with _PyUnicode_EqualToASCIIId. https://hg.python.org/cpython/rev/faf04a995031 New changeset ff3dacc98b3a by Serhiy Storchaka in branch '3.6': Issue #28

[issue28701] Replace PyUnicode_CompareWithASCIIString with _PyUnicode_EqualToASCIIString

2016-11-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The correct issue for above commits is issue21449. -- ___ Python tracker ___ ___ Python-bugs-list

[issue21449] Replace _PyUnicode_CompareWithId with _PyUnicode_CompareWithIdEqual

2016-11-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset faf04a995031 by Serhiy Storchaka in branch '3.5': Issue #28701: Replace _PyUnicode_CompareWithId with _PyUnicode_EqualToASCIIId. https://hg.python.org/cpython/rev/faf04a995031 New changeset ff3dacc98b3a by Serhiy Storchaka in branch '3.6': Issue

[issue2504] Add gettext.pgettext() and variants support

2016-11-16 Thread Tristan Fisher
Changes by Tristan Fisher : -- nosy: +Tristan.Fisher ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue28712] Non-Windows mappings for a couple of Windows code pages

2016-11-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What is the output of new script? -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsu

[issue21449] Replace _PyUnicode_CompareWithId with _PyUnicode_CompareWithIdEqual

2016-11-16 Thread Roundup Robot
Roundup Robot added the comment: New changeset b995a6950139 by Serhiy Storchaka in branch '3.6': Issue #21449: Removed private function _PyUnicode_CompareWithId. https://hg.python.org/cpython/rev/b995a6950139 New changeset 9b053d3c74dc by Serhiy Storchaka in branch 'default': Issue #21449: Remov

[issue21449] Replace _PyUnicode_CompareWithId with _PyUnicode_CompareWithIdEqual

2016-11-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Josh and Xiang for your contribution. -- dependencies: -Replace PyUnicode_CompareWithASCIIString with _PyUnicode_EqualToASCIIString resolution: -> fixed ___ Python tracker

[issue21449] Replace _PyUnicode_CompareWithId with _PyUnicode_CompareWithIdEqual

2016-11-16 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bugs-list ma

[issue28670] PEP 235: Implement on every POSIX system, and clean up the C code for `import'

2016-11-16 Thread Michael Witten
Michael Witten added the comment: * This is not a feature request; this is a bug fix for errant behavior. However, in the interest of civility, I have not re-opened this issue. * > Python 2.7 DOES NOT support filesystem semantics that differ > from the "default" semantics for the host ope

[issue28701] Replace PyUnicode_CompareWithASCIIString with _PyUnicode_EqualToASCIIString

2016-11-16 Thread Roundup Robot
Roundup Robot added the comment: New changeset b607f835f170 by Serhiy Storchaka in branch '3.5': Fixed an off-by-one error in _PyUnicode_EqualToASCIIString (issue #28701). https://hg.python.org/cpython/rev/b607f835f170 New changeset 1369e51182b7 by Serhiy Storchaka in branch '3.6': Fixed an off-

[issue28712] Non-Windows mappings for a couple of Windows code pages

2016-11-16 Thread Mingye Wang
Mingye Wang added the comment: The output is already attached as win10_14959_py36.txt. PS: after playing with ctypes, I got a version of pycp that works with Py < 3.3 too (attached with comment). -- Added file: http://bugs.python.org/file45503/pycp_ctypes.py __

[issue28699] Imap from ThreadPool behaves unexpectedly

2016-11-16 Thread Davin Potts
Davin Potts added the comment: To tie in the example given by @elias in issue28625, this inconsistency in behavior is not limited to ThreadPool -- it appears with a process Pool as well: from multiprocessing import Pool def double(x): return 2 * x def get_numbers(): raise Exception(

[issue28625] multiprocessing.Pool.imap swallows exceptions thrown by generators

2016-11-16 Thread Davin Potts
Davin Potts added the comment: In issue28699, an important clue has been identified (a variation on the generator triggers a different, inconsistent behavior). I will merge this issue into that one to keep us all on the same page. -- superseder: -> Imap from ThreadPool behaves unexpe

[issue28699] Imap from ThreadPool behaves unexpectedly

2016-11-16 Thread Davin Potts
Davin Potts added the comment: This inconsistent behavior in imap on both Pool and ThreadPool is not what I would expect. -- versions: +Python 3.6, Python 3.7 ___ Python tracker ___

[issue28712] Non-Windows mappings for a couple of Windows code pages

2016-11-16 Thread Mingye Wang
Changes by Mingye Wang : Removed file: http://bugs.python.org/file45502/pycp.py ___ Python tracker ___ ___ Python-bugs-list mailing list Unsub

[issue28714] Addition to Documentation of configparser.ConfigParser.write() documentaion

2016-11-16 Thread George Fischhof
New submission from George Fischhof: Hi There, I used configparser.ConfigParser.write() to update a config file. And I found that my config wa duplicated. The file was opened with mode 'r+' I figured out that write (I mean the write method of configparser) writes at actual file position. I

[issue28696] imap from ThreadPool hangs by an exception in a generator function

2016-11-16 Thread Davin Potts
Changes by Davin Potts : -- superseder: -> Imap from ThreadPool behaves unexpectedly ___ Python tracker ___ ___ Python-bugs-list mail

[issue28714] Addition to Documentation of configparser.ConfigParser.write()

2016-11-16 Thread George Fischhof
Changes by George Fischhof : -- title: Addition to Documentation of configparser.ConfigParser.write() documentaion -> Addition to Documentation of configparser.ConfigParser.write() ___ Python tracker _

[issue28670] PEP 235: Implement on every POSIX system, and clean up the C code for `import'

2016-11-16 Thread Nick Coghlan
Nick Coghlan added the comment: We work closely with Linux distribution providers, and a number of us work *for* commercial Linux distributors (most notably Red Hat and Canonical). Linux distributions have already agreed that Python 2.7 is in maintenance mode, and already influence the process

[issue28713] Recent tutorial for recent Python3 still uses IOError.

2016-11-16 Thread Kushal Das
Kushal Das added the comment: This following one line change should fix this one. -- keywords: +patch nosy: +kushal.das Added file: http://bugs.python.org/file45504/issue28713.patch ___ Python tracker _

[issue28713] Recent tutorial for recent Python3 still uses IOError.

2016-11-16 Thread Roundup Robot
Roundup Robot added the comment: New changeset 3375c111d1ff by Kushal Das in branch '3.6': Closes #28713 uses OSError in the tutorial https://hg.python.org/cpython/rev/3375c111d1ff New changeset 15e5e476e4a1 by Kushal Das in branch 'default': Closes #28713 uses OSError in the tutorial https://hg

[issue28701] Replace PyUnicode_CompareWithASCIIString with _PyUnicode_EqualToASCIIString

2016-11-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Following patch adds checks in debug mode that the right argument of _PyUnicode_EqualToASCIIString and _PyUnicode_EqualToASCIIId is ASCII-only string. -- Added file: http://bugs.python.org/file45505/_PyUnicode_EqualToASCII-runtime-check.diff __

[issue28712] Non-Windows mappings for a couple of Windows code pages

2016-11-16 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware ___ Python tracker ___ ___

[issue28712] Non-Windows mappings for a couple of Windows code pages

2016-11-16 Thread Steve Dower
Steve Dower added the comment: So is this a bug in the hardcoded encoding tables in Python? I briefly considered making them all use the OS functions, but then they'll be inconsistent with other platforms (where the tables should work fine). Do you have a proposed fix? That will help illustrat

[issue28670] PEP 235: Implement on every POSIX system, and clean up the C code for `import'

2016-11-16 Thread Michael Witten
Michael Witten added the comment: * Bugs, by their very nature, are often obscure; some of the worst in history have lain dormant, unseen, for years or perhaps even decades. Unsurprisingly, then, this bug is also a corner case that would be unknowingly triggered in practice only rarely;

[issue28712] Non-Windows mappings for a couple of Windows code pages

2016-11-16 Thread Mingye Wang
Mingye Wang added the comment: Yes, it's a table issue. My suggested fix is to replace them all with WindowsBestFit tables, where MS currently redirects https://msdn.microsoft.com/en-us/globalization/mt767590 visitors to. These old "WINDOWS" tables appear abandoned since long ago. --

[issue28693] No HKSCS support in Windows cp950

2016-11-16 Thread Mingye Wang
Mingye Wang added the comment: Update: the test script at issue28712 can be modified to show this issue too. -- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware ___ Python tracker

[issue28343] Bad encoding alias cp936 -> gbk: euro sign

2016-11-16 Thread Mingye Wang
Changes by Mingye Wang : -- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware ___ Python tracker ___ ___ Pyth

[issue28343] Bad encoding alias cp936 -> gbk: euro sign

2016-11-16 Thread Mingye Wang
Mingye Wang added the comment: Update: the test script at issue28712 can be modified to show this issue too. -- ___ Python tracker ___ ___

[issue28712] Non-Windows mappings for a couple of Windows code pages

2016-11-16 Thread Mingye Wang
Mingye Wang added the comment: ... On the other hand, I am happy to use these Win32 functions if they are faster, but still the table should be made correct in the first place. (See also issue28343 (936) and issue28693 (950) for problems with DBCS Chinese code pages.) --

[issue28712] Non-Windows mappings for a couple of Windows code pages

2016-11-16 Thread Steve Dower
Steve Dower added the comment: No idea which is faster, but the tables have better compatibility. However, I'm not sure that changing the tables in already released versions is a great idea, since it could "corrupt" programs without warning. Adding the release managers to weigh in - my gut fee

[issue28715] Check result of PyUnicode_AsUTF8

2016-11-16 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: The function PyUnicode_AsUTF8() can fail, but not all callers check for error. Proposed patch adds missed checks. In some places the code is rewritten to not use PyUnicode_AsUTF8() at all. -- components: Extension Modules, Interpreter Core files: c

[issue28712] Non-Windows mappings for a couple of Windows code pages

2016-11-16 Thread Ned Deily
Ned Deily added the comment: I'm not qualified to offer a technical opinion on Windows matters like this so, for 3.6, I leave it to your discretion, Steve. If you do decide to push this change, please do so before 3.6.0b4 on Monday. -- ___ Python t

[issue28712] Non-Windows mappings for a couple of Windows code pages

2016-11-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Codecs are strict by default in Python. Call MultiByteToWideChar() with the MB_ERR_INVALID_CHARS flag as Python does. You also could use _codecs.code_page_decode(). -- ___ Python tracker

[issue28701] Replace PyUnicode_CompareWithASCIIString with _PyUnicode_EqualToASCIIString

2016-11-16 Thread STINNER Victor
STINNER Victor added the comment: _PyUnicode_EqualToASCII-runtime-check.diff LGTM. -- ___ Python tracker ___ ___ Python-bugs-list mail

[issue28701] Replace PyUnicode_CompareWithASCIIString with _PyUnicode_EqualToASCIIString

2016-11-16 Thread Roundup Robot
Roundup Robot added the comment: New changeset 6dd22ed7140e by Serhiy Storchaka in branch '3.6': Issue #28701: _PyUnicode_EqualToASCIIId and _PyUnicode_EqualToASCIIString now https://hg.python.org/cpython/rev/6dd22ed7140e New changeset 44874b20e612 by Serhiy Storchaka in branch 'default': Issue

[issue28701] Replace PyUnicode_CompareWithASCIIString with _PyUnicode_EqualToASCIIString

2016-11-16 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue28716] Fractions instantiation revisited

2016-11-16 Thread Wolfgang Maier
New submission from Wolfgang Maier: I've spent a bit of time lately trying to optimize the instantiation of Fractions. This is related to Issue22464, but instead of focusing on constructing Fractions from ints, my attempts revolve around improving instantiation from strings, floats and decimal

[issue28685] Optimizing list.sort() by performing safety checks in advance

2016-11-16 Thread Elliot Gorokhovsky
Changes by Elliot Gorokhovsky : Added file: http://bugs.python.org/file45508/fastsort.patch ___ Python tracker ___ ___ Python-bugs-list mailin

[issue28670] PEP 235: Implement on every POSIX system, and clean up the C code for `import'

2016-11-16 Thread Brett Cannon
Changes by Brett Cannon : -- nosy: -brett.cannon ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

[issue28685] Optimizing list.sort() by performing safety checks in advance

2016-11-16 Thread Elliot Gorokhovsky
Elliot Gorokhovsky added the comment: So thanks for pointing out that perf has a --compare_to option: it turns out I had calculated the times wrong! Specifically, I had used (ref-dev)/ref while I should have used ref/dev which is what perf --compare_to uses. Anyway, the actual times are even

[issue21449] Replace _PyUnicode_CompareWithId with _PyUnicode_EqualToASCIIId

2016-11-16 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- title: Replace _PyUnicode_CompareWithId with _PyUnicode_CompareWithIdEqual -> Replace _PyUnicode_CompareWithId with _PyUnicode_EqualToASCIIId ___ Python tracker ___

[issue28716] Fractions instantiation revisited

2016-11-16 Thread R. David Murray
Changes by R. David Murray : -- nosy: +mark.dickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue28712] Non-Windows mappings for a couple of Windows code pages

2016-11-16 Thread Eryk Sun
Eryk Sun added the comment: Serhiy, single-byte codepages map every byte value, even if it's just to a Unicode C1 control code [1]. For example: import ctypes kernel32 = ctypes.WinDLL('kernel32', use_last_error=True) MB_ERR_INVALID_CHARS = 0x0008 def mbtwc_errcheck(resul

[issue28712] Non-Windows mappings for a couple of Windows code pages

2016-11-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thanks Eryk. Could you please run following script and attach the output? import codecs codepages = [424, 856, 857, 864, 869, 874, 932, 949, 950, 1250, 1251, 1252, 1253, 1254, 1255, 1257, 1258] for cp in codepages: table = [] for i in range(256):

[issue28716] Fractions instantiation revisited

2016-11-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Profiling give you only approximate results. In normal execution the effect of your changes can be opposite. Could you please provide benchmarks without using profiling? -- nosy: +serhiy.storchaka ___ Python track

[issue28715] Check result of PyUnicode_AsUTF8

2016-11-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: _PyUnicode_AsString is just an outdated alias to PyUnicode_AsUTF8. -- ___ Python tracker ___ ___ P

[issue28712] Non-Windows mappings for a couple of Windows code pages

2016-11-16 Thread Eryk Sun
Eryk Sun added the comment: How about just the ASCII repr of the 256 decoded characters in CSV? I don't think the list of 2-tuple results is useful. For these single-byte codepages it's always 1 byte consumed. -- ___ Python tracker

[issue28717] rounding error in % operator

2016-11-16 Thread William McIlhagga
New submission from William McIlhagga: '%.1f' % 0.25 yields the string '0.2' '%.1f' % 0.75 yields the string '0.8' This is wrong. -- messages: 280984 nosy: William McIlhagga priority: normal severity: normal status: open title: rounding error in % operator type: behav

[issue28718] '*' matches entire path in fnmatch.translate

2016-11-16 Thread Jim Nasby
New submission from Jim Nasby: A '*' in fnmatch.translate is converted into '.*', which will greedily match directory separators. This doesn't match shell behavior, which is that * will only match file names: decibel@decina:[14:07]~$ls ~/tmp/*/1|head ls: /Users/decibel/tmp/*/1: No such file or

[issue28712] Non-Windows mappings for a couple of Windows code pages

2016-11-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This would be helpful too if every byte is decoded to exactly 1 character. -- ___ Python tracker ___ _

[issue28685] Optimizing list.sort() by performing safety checks in advance

2016-11-16 Thread Elliot Gorokhovsky
Elliot Gorokhovsky added the comment: Oh wait... uh... never mind... we want "faster" to refer to total time taken, so 1-def/ref is indeed the correct formula. I just got confused because perf outputs ref/dev, but that doesn't make sense for percents. -- __

[issue26072] pdb fails to access variables closed over

2016-11-16 Thread Xavier de Gaye
Xavier de Gaye added the comment: This patch fixes the problems raised in this issue and allows accessing the globals at the Pdb prompt with the globals() dictionary: (Pdb) list 1 y = 2 2 3 def f(): 4 y = 9 5 z = 10 6 -> import pdb; pdb.set_trace(); 7

[issue28712] Non-Windows mappings for a couple of Windows code pages

2016-11-16 Thread Eryk Sun
Eryk Sun added the comment: I don't think the 2nd tuple element is useful when decoding a single byte. It either works or it doesn't, such as failing for non-ASCII bytes with multibyte codepages such as 932 and 950. I'm attaching the output from the following, which you should be able to open

[issue28712] Non-Windows mappings for a couple of Windows code pages

2016-11-16 Thread Eryk Sun
Changes by Eryk Sun : Removed file: http://bugs.python.org/file45510/codepage_table.csv ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue28712] Non-Windows mappings for a couple of Windows code pages

2016-11-16 Thread Eryk Sun
Eryk Sun added the comment: I rewrote it using the csv module since I can't remember the escaping rules. -- Added file: http://bugs.python.org/file45511/codepage_table.csv ___ Python tracker ___

[issue18235] _sysconfigdata.py wrong on AIX installations

2016-11-16 Thread Michael Felt
Michael Felt added the comment: As this is the issue still open with regard to issues with ld_so_aix... The current release Python3-3.5.2 does not include ld_so_aix in the "make install DESTDIR=xxx output ("make install" also neglects to install ld_so_aix) Installation Summary

[issue28719] zipfile increase in size

2016-11-16 Thread Bert JW Regeer
New submission from Bert JW Regeer: I am the current maintainer of WebOb, and noticed that on Python 3.6 and 3.7 I noticed that a test started failing. Granted, the test is checking the size of the file created and it is not the brightest idea in a test, but it's been stable since Python 2.5..

[issue28720] Add collections.abc.AsyncGenerator

2016-11-16 Thread Yury Selivanov
New submission from Yury Selivanov: This patch adds collections.abc.AsyncGenerator (closely modelled after collections.abc.Generator). Ned, is it OK if this goes into 3.6? This is something I completely forgot to do as part of PEP 525. This ABC is needed for asynchronous generators compiled

[issue28720] Add collections.abc.AsyncGenerator

2016-11-16 Thread Yury Selivanov
Changes by Yury Selivanov : Added file: http://bugs.python.org/file45513/agen_abc.patch ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue28720] Add collections.abc.AsyncGenerator

2016-11-16 Thread Yury Selivanov
Changes by Yury Selivanov : Removed file: http://bugs.python.org/file45512/agen_abc.patch ___ Python tracker ___ ___ Python-bugs-list mailing

[issue28717] rounding error in % operator

2016-11-16 Thread Mark Dickinson
Mark Dickinson added the comment: You don't say why you think this behaviour is wrong, or what you'd expect to see instead. Nevertheless, this behaviour is by design: the code `'%.1f' % x` rounds `x` to the nearest one-digit-after-the-point decimal number, and returns a string representation

[issue28716] Fractions instantiation revisited

2016-11-16 Thread Wolfgang Maier
Wolfgang Maier added the comment: sure, I just happened to have the profiling available since I used it to optimize things. Here's similar microbenchmarks using perf: STRINGS === $ python -m perf timeit -s "from fractions import Fraction" "Fraction('1.23456e-7')" . Med

[issue28717] rounding error in % operator

2016-11-16 Thread William McIlhagga
William McIlhagga added the comment: OK, not wrong, just unexpected. Is this behaviour documented? Or are you just expected to know what C does? On 16 November 2016 at 21:37, Mark Dickinson wrote: > > Mark Dickinson added the comment: > > You don't say why you think this behaviour is wrong, o

[issue28716] Fractions instantiation revisited

2016-11-16 Thread Josh Rosenberg
Josh Rosenberg added the comment: Might it make sense to make instantiation from numbers.Rational duck typing based as well? Just try to get the numerator and denominator attributes, on AttributeError, skip it and move on. Unless there is some concern that a non-Rational type might have both a

[issue28716] Fractions instantiation revisited

2016-11-16 Thread Josh Rosenberg
Josh Rosenberg added the comment: Similarly, type checking for int might be replaced with calling operator.index on the input and handling the TypeError; that way, anything that has declared itself logically int-like is handled without explicit type checking at all. -- ___

[issue28716] Fractions instantiation revisited

2016-11-16 Thread Wolfgang Maier
Wolfgang Maier added the comment: No, I don't think the numeric tower ABC should be replaced by duck-typing. One of the very reasons the fractions module exists is that it showcases how to use the numeric tower. If you want a class to be picked up as a Rational it should be registered as such.

[issue28719] zipfile increase in size

2016-11-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Could you get a dump of rbo data? -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bug

[issue28719] zipfile increase in size

2016-11-16 Thread Bert JW Regeer
Bert JW Regeer added the comment: It's literally the string written: writer.writestr('zinfo_or_arcname', b'foo') rbo in this case is a simple file like object. I can get dumps from Python 3.5 and Python 3.6 if necessary. -- ___ Python tracker

[issue28717] rounding error in % operator

2016-11-16 Thread Mark Dickinson
Mark Dickinson added the comment: > Is this behaviour documented? Or are you just expected to know what C does? Indeed, it's not as well documented as it should be. I think that's partly for historical reasons: before Python 2.7, Python's % formatting more-or-less delegated directly to the und

[issue28720] Add collections.abc.AsyncGenerator

2016-11-16 Thread Ned Deily
Ned Deily added the comment: OK for 3.6.0b4 -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyt

[issue28719] zipfile increase in size

2016-11-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Please make a dump. It should include not just literally the string written, but headers and other special fields. I tried with rbo = io.BytesIO(), and get rbo.tell() == 133. Should be a difference between io.BytesIO and ResponseBodyFile. Maybe ResponseBodyF

[issue28710] Sphinx incompatible markup in configparser.ConfigParser.

2016-11-16 Thread Patrick Lehmann
Patrick Lehmann added the comment: How can I supply a fix? I have a branch with lots of fixes. https://github.com/Paebbels/cpython/tree/paebbels/issue-28710?ts=2 Why don't you accept pull requests via GitHub? Kind regards Patrick -- ___ Python

[issue28719] zipfile increase in size

2016-11-16 Thread Bert JW Regeer
Bert JW Regeer added the comment: Here's a dump from Python 3.6: b'PK\x03\x04\x14\x00\x08\x00\x00\x00\xc0~pI\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00zinfo_or_arcnamefoo!es\x8c\x03\x00\x00\x00\x03\x00\x00\x00PK\x01\x02\x14\x03\x14\x00\x08\x00\x00\x00\xc0~pI!es\x8c\x03\x00\x

[issue28710] Sphinx incompatible markup in configparser.ConfigParser.

2016-11-16 Thread R. David Murray
R. David Murray added the comment: We will accept github pull requests in the future (the transition is underway). For now, you can create a diff file (using hg diff by preference, but git diff will work) and uploaded it to the issue. For this issue, please only upload the docstring changes.

[issue28721] Fix asynchronous generators athrow() and aclose() to handle StopAsyncIteration

2016-11-16 Thread Yury Selivanov
New submission from Yury Selivanov: 1. aclose() should not propagate StopAsyncIteration: async def agen(): try: yield except: pass gen = agen() await agen.asend(None) await agen.aclose() # <- this shouldn't raise StopAsyncIteration 2. athrow() should propagat

  1   2   >