[issue23556] Scope for raise without argument is different in Python 2 and 3

2015-12-23 Thread John Mark Vandenberg
John Mark Vandenberg added the comment: In pyflakes we've looked at some of the strange scenarios where a raise without argument is 'legal'. A patch to report errors for some of these was rejected because they are legal. See https://github.com/pyflakes/pyflakes/pull/57 The worst example of

[issue25911] Regression: os.walk now using os.scandir() breaks bytes filenames on windows

2015-12-23 Thread Steve Dower
Steve Dower added the comment: Did we want a deprecation warning too? I don't see it in the patch. Otherwise, LGTM. -- ___ Python tracker ___

[issue25381] Doc: Use of old description of raise in Python3

2015-12-23 Thread John Mark Vandenberg
Changes by John Mark Vandenberg : -- nosy: +jayvdb ___ Python tracker ___ ___

[issue25911] Regression: os.walk now using os.scandir() breaks bytes filenames on windows

2015-12-23 Thread Eryk Sun
Eryk Sun added the comment: Considering there's no plan to implement bytes paths for scandir on Windows, then the following line in the os docs needs to be modified: "All functions accepting path or file names accept both bytes and string objects, and result in an object of the same type, if

[issue25410] Clean up and fix OrderedDict

2015-12-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: And even simpler example: list(od.keys()) is [1, 3] in 3.4 and [0, 1, 2, 3, 4] in 3.5. -- ___ Python tracker ___

[issue25928] Improve performance of statistics._decimal_to_ratio and fractions.from_decimal

2015-12-23 Thread Stefan Krah
Changes by Stefan Krah : -- nosy: +steven.daprano ___ Python tracker ___ ___

[issue25928] Improve performance of statistics._decimal_to_ratio and fractions.from_decimal

2015-12-23 Thread Stefan Krah
Stefan Krah added the comment: I guess there's some version mixup here: From Python 3.3 on the integrated C version of decimal does not store the digits as a string and does not have the private _int method. -- nosy: +skrah ___ Python tracker

[issue25932] Windows installer ships an outdated and insecure curl.exe

2015-12-23 Thread Ismail Donmez
New submission from Ismail Donmez: Installed Python 3.5.1 windows x64 version and ended up having C:\Users\ismail\AppData\Local\Programs\Python\Python35\curl.exe which is outdated: C:\Users\ismail>C:\Users\ismail\AppData\Local\Programs\Python\Python35\curl.exe -V curl 7.37.0 (Windows)

[issue25864] collections.abc.Mapping should include a __reversed__ that raises TypeError

2015-12-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I agree that by default calling reversed() on mapping should raise a TypeError. But for now issubclass(collections.abc.Mapping, typing.Reversible) returns False. If add default __reversed__ implementation this test will return True. We have to find other

[issue25420] "import random" blocks on entropy collection on Linux with low entropy

2015-12-23 Thread Thomas Petazzoni
Thomas Petazzoni added the comment: I can confirm that I'm affected by the same issue. Booting a simple Linux system on a Qemu ARM platform, the python startup hangs during 25 seconds due to the call to getrandom(). I am not doing anything with Python, just starting the Python interpreter: #

[issue25157] Installing Python 3.5.0 32bit on Windows 8.1 64bit system gives Error 0x80240017

2015-12-23 Thread Joakim Karlsson
Joakim Karlsson added the comment: I got this working on a Windows 8.1 box with the following mess. Hopefully someone more capable than me can piece together a viable fix from this. I downloaded and executed the Visual C++ Redistributable for VS 2015 here:

[issue25911] Regression: os.walk now using os.scandir() breaks bytes filenames on windows

2015-12-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There is open issue16700 for the documentation. -- ___ Python tracker ___

[issue25928] Improve performance of statistics._decimal_to_ratio and fractions.from_decimal

2015-12-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: May be implement the as_integer_ratio() method and/or numerator and denominator attributes in the Decimal class? -- nosy: +serhiy.storchaka ___ Python tracker

[issue24726] OrderedDict has strange behaviour when dict.__setitem__ is used.

2015-12-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch that fixes an infinite loop reported in msg254071. May be this is not the best solution. It makes the behavior of Python and C implementation differ (the former just iterates a linked list, the latter raises an error). But to reproduce

[issue25420] "import random" blocks on entropy collection on Linux with low entropy

2015-12-23 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> rhettinger ___ Python tracker ___ ___

[issue25928] Improve performance of statistics._decimal_to_ratio and fractions.from_decimal

2015-12-23 Thread Stefan Krah
Changes by Stefan Krah : -- versions: -Python 3.5 ___ Python tracker ___ ___

[issue12484] The Py_InitModule functions no longer exist, but remain in the docs

2015-12-23 Thread Anish Shah
Anish Shah added the comment: Can anyone review the patch? -- ___ Python tracker ___ ___ Python-bugs-list

[issue25420] "import random" blocks on entropy collection on Linux with low entropy

2015-12-23 Thread Thomas Petazzoni
Thomas Petazzoni added the comment: Obviously I did my math wrong: it waits 45 seconds in getrandom(), not 25 seconds. See my strace log. -- ___ Python tracker

[issue25932] Windows installer ships an outdated and insecure curl.exe

2015-12-23 Thread Zachary Ware
Zachary Ware added the comment: I have no idea how you got a curl.exe there, but it didn't come from our installer. Where did you get your 3.5.1 installer from? -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python

[issue25410] Clean up and fix OrderedDict

2015-12-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Following code prints X([(1, 1), (3, 3)]) on 3.4 and X([(0, 0), (1, 1), (2, 2), (3, 3), (4, 4)]) on 3.5+. from collections import OrderedDict class X(OrderedDict): def __iter__(self): for k in OrderedDict.__iter__(self): if k % 2:

[issue25920] PyOS_AfterFork should reset socketmodule's lock

2015-12-23 Thread Ronald Oussoren
Ronald Oussoren added the comment: #25924 is related to this, I filed this after reading the blog post. The lock might not be necessary on OSX, and possibly on the other systems as well. Yury: resetting the lock in the child should be safe because after the fork the child only has a single

[issue25157] Installing Python 3.5.0 32bit on Windows 8.1 64bit system gives Error 0x80240017

2015-12-23 Thread Joakim Karlsson
Joakim Karlsson added the comment: My previous fix works for me when I install for current user only. When I attempt to install for all users, I get an error stating that "api-ms-win-crt-runtime-I1-1-0.dll" is missing during the "Precompililng standard library" phase. --

[issue25157] Installing Python 3.5.0 32bit on Windows 8.1 64bit system gives Error 0x80240017

2015-12-23 Thread Joakim Karlsson
Joakim Karlsson added the comment: ...and I seem not to have a working installation even when installing for a single user. The installation completes without complaining, but running python ends up in an error message telling me that "api-ms-win-crt-heap-l1-1-0.dll" is missing. --

[issue25932] Windows installer ships an outdated and insecure curl.exe

2015-12-23 Thread Ismail Donmez
Ismail Donmez added the comment: Indeed, I am sorry! It was pycurl. -- ___ Python tracker ___ ___

[issue19475] Add timespec optional flag to datetime isoformat() to choose the precision

2015-12-23 Thread Skip Montanaro
Changes by Skip Montanaro : -- nosy: -skip.montanaro ___ Python tracker ___ ___

[issue25933] Unhandled exception (TypeError) with ftplib in function retrbinary/retrlines causes inoperable behavior without crashing

2015-12-23 Thread Sam Adams
New submission from Sam Adams: Hello, I believe that I found a bug in ftplib.py in version 3.3.6. Whenever a user opens a file for writing in nonbinary mode and then proceeds to call the retrbinary function, or opens the file in binary mode and proceeds to call the retrlines fuction, then

[issue25933] Unhandled exception (TypeError) with ftplib in function retrbinary/retrlines causes inoperable behavior without crashing

2015-12-23 Thread Sam Adams
Sam Adams added the comment: I don't have access to 3.5 where I am now. I can try later on, but it appears after a quick glance that the code for this function between 3.3 and 3.5 is the same for calling the callback function. -- ___ Python tracker

[issue25933] Unhandled exception (TypeError) with ftplib in function retrbinary/retrlines causes inoperable behavior without crashing

2015-12-23 Thread SilentGhost
SilentGhost added the comment: With the default branch I get regular TypeError exception, without any extras. To me it seems that its responsibility of the caller to provide the correct callback for the type of data being retrieved. So, I'm not exactly sure that this is a bug at all.

[issue25420] "import random" blocks on entropy collection on Linux with low entropy

2015-12-23 Thread STINNER Victor
STINNER Victor added the comment: getrandom() is used to initialize the randomized hash function. Set PYTHONHASHSEED env var to not use getrandom() at startup. But the hash function will not randomized anymore :-/ -- ___ Python tracker

[issue1753718] base64 "legacy" functions violate RFC 3548

2015-12-23 Thread R. David Murray
R. David Murray added the comment: Thanks everyone. -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker

[issue20782] base64 module docs do not use the terms 'bytes' and 'string' consistently.

2015-12-23 Thread Roundup Robot
Roundup Robot added the comment: New changeset 105bf5dd93b8 by R David Murray in branch '3.5': #1753718: clarify RFC compliance and bytes/string argument types. https://hg.python.org/cpython/rev/105bf5dd93b8 -- nosy: +python-dev ___ Python tracker

[issue1753718] base64 "legacy" functions violate RFC 3548

2015-12-23 Thread Roundup Robot
Roundup Robot added the comment: New changeset 105bf5dd93b8 by R David Murray in branch '3.5': #1753718: clarify RFC compliance and bytes/string argument types. https://hg.python.org/cpython/rev/105bf5dd93b8 New changeset 92760d2edc9e by R David Murray in branch 'default': Merge: #1753718:

[issue25933] Unhandled exception (TypeError) with ftplib in function retrbinary/retrlines causes inoperable behavior without crashing

2015-12-23 Thread Sam Adams
Sam Adams added the comment: Silent: The issue that i see is how the error is handled. I can trap the TypeError easily, however, if I keep the socket open, the behavior of ftplib will not be as intended. For example: fileTest = open('filename1', 'wb') ftp.retrlines('RETR README.html',

[issue20782] base64 module docs do not use the terms 'bytes' and 'string' consistently.

2015-12-23 Thread R. David Murray
R. David Murray added the comment: Everything here should be covered by the fix committed for #1753718. If I missed anything let me know :) -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue25936] Improve FastChildWatcher with WNOWAIT?

2015-12-23 Thread WGH
New submission from WGH: The problem with FastChildWatcher lies in the fact that it can accidentally reap processes that it doesn't watch. However, os module includes waitid function (since Python 3.3), and it has WNOWAIT flags, which means "return status, let process remain waitable (=don't

[issue25937] DIfference between utf8 and utf-8 when i define python source code encoding.

2015-12-23 Thread 王杰
New submission from 王杰: I use CentOS 7.0 and change LANG=gbk. I has a file "gbk-utf-8.py" and it's encoding is GBK. # -*- coding:utf-8 -*- import chardet if __name__ == '__main__': s = '中文' print s, chardet.detect(s) I execute it and everything is ok. However it raise "SyntaxError"

[issue25933] Unhandled exception (TypeError) with ftplib in function retrbinary/retrlines causes inoperable behavior without crashing

2015-12-23 Thread Sam Adams
Changes by Sam Adams : -- type: -> behavior ___ Python tracker ___ ___

[issue25928] Improve performance of statistics._decimal_to_ratio and fractions.from_decimal

2015-12-23 Thread John Walker
John Walker added the comment: > I guess there's some version mixup here: From Python 3.3 on > the integrated C version of decimal does not store the digits > as a string and does not have the private _int method. Stefan, _int is a slot in Lib/_pydecimal.py. It should be defined on python 3.5

[issue25928] Improve performance of statistics._decimal_to_ratio and fractions.from_decimal

2015-12-23 Thread Stefan Krah
Stefan Krah added the comment: On Wed, Dec 23, 2015 at 09:01:22PM +, John Walker wrote: > Stefan, _int is a slot in Lib/_pydecimal.py. It should be defined on python > 3.5 and tip, unsure about other versions. > > Python 3.5.1 (default, Dec 7 2015, 12:58:09) > [GCC 5.2.0] on linux > Type

[issue25928] Improve performance of statistics._decimal_to_ratio and fractions.from_decimal

2015-12-23 Thread John Walker
John Walker added the comment: > No, the regular build uses the libmpdec that is shipped with > Python. The external libmpdec.so only comes into play if you > compile --with-system-libmpdec. Oh, OK. I see whats happening. My distro deletes the shipped version and compiles

[issue12484] The Py_InitModule functions no longer exist, but remain in the docs

2015-12-23 Thread Berker Peksag
Berker Peksag added the comment: The patch looks good to me. _PyImport_FixupExtension does not exist in Python 3, but it's still documented in Doc/c-api/import.rst. We need to remove it, too. (Or we could document _PyImport_FixupExtensionObject since there are already documented internal

[issue25928] Add Decimal.as_integer_ratio()

2015-12-23 Thread Stefan Krah
Stefan Krah added the comment: Let's re-target this issue: Implementing as_integer_ratio() sounds reasonable, but let's hope people won't try to convert Decimal('1E+99'). Mark, was there perhaps a reason not to add the method? -- assignee: -> skrah nosy:

[issue24999] ICC compiler: ICC treats denormal floating point numbers as 0.0

2015-12-23 Thread Stefan Krah
Stefan Krah added the comment: The current issue description should have been fixed by #25827. Is the segfault in test_re still happening? -- ___ Python tracker

[issue25934] ICC compiler: ICC treats denormal floating point numbers as 0.0

2015-12-23 Thread Stefan Krah
New submission from Stefan Krah: Zachary in #24999: "If that's the case, would anyone (in particular, Steve, Tim or Tim) mind if we just made the default (for MSVC as well as ICC) /fp:strict? It would be much easier to just change the global default than to try to either make it settable or

[issue25935] OrderedDict prevents garbage collection if a circulary referenced class is used as key

2015-12-23 Thread Simon Charette
New submission from Simon Charette: I attached a file with a reproduction test case that passes on Python 2.7 and 3.4 but fails on 3.5.0 and 3.5.1 This might be solved by the improvement planed in #25410. -- components: Extension Modules files: test.py messages: 256945 nosy: charettes

[issue25157] Installing Python 3.5.0 32bit on Windows 8.1 64bit system gives Error 0x80240017

2015-12-23 Thread Steve Dower
Steve Dower added the comment: Joakim, your operating system is corrupted somehow. I'd suggest getting in touch with Microsoft support, as you should be able to install that update. (Or maybe you've done something to block Windows Update?) -- ___

[issue24999] Segfault in test_re.test_sre_character_class_literals() when Python is compiled by ICC

2015-12-23 Thread Stefan Krah
Changes by Stefan Krah : -- title: ICC compiler: ICC treats denormal floating point numbers as 0.0 -> Segfault in test_re.test_sre_character_class_literals() when Python is compiled by ICC ___ Python tracker

[issue25933] Unhandled exception (TypeError) with ftplib in function retrbinary/retrlines causes inoperable behavior without crashing

2015-12-23 Thread R. David Murray
R. David Murray added the comment: Can you test this against 3.5? I guessing it hasn't been fixed, but we did do some bytes/string fixes since 3.3, so it might have been. -- nosy: +r.david.murray ___ Python tracker

[issue25928] Improve performance of statistics._decimal_to_ratio and fractions.from_decimal

2015-12-23 Thread Stefan Krah
Stefan Krah added the comment: No, the regular build uses the libmpdec that is shipped with Python. The external libmpdec.so only comes into play if you compile --with-system-libmpdec. -- ___ Python tracker

[issue24999] Segfault in test_re.test_sre_character_class_literals() when Python is compiled by ICC

2015-12-23 Thread Zachary Ware
Zachary Ware added the comment: Unfortunately, #25827 has no effect on Windows, which is where this issue occurs. There are still several segfaults on Windows, including test_re. -- ___ Python tracker

[issue25928] Improve performance of statistics._decimal_to_ratio and fractions.from_decimal

2015-12-23 Thread John Walker
John Walker added the comment: > That should only happen if the C version did not build for some reason: Ahh, gotcha. I assume one instance where this happens is when the machine doesn't have libmpdec.so -- ___ Python tracker

[issue25928] Improve performance of statistics._decimal_to_ratio and fractions.from_decimal

2015-12-23 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Wed, Dec 23, 2015 at 03:18:28PM +, Serhiy Storchaka wrote: > May be implement the as_integer_ratio() method and/or numerator and > denominator attributes in the Decimal class? That would also be good as it will decrease the API differences between

[issue24999] Segfault in test_re.test_sre_character_class_literals() when Python is compiled by ICC

2015-12-23 Thread Stefan Krah
Stefan Krah added the comment: I see, thanks. I've opened #25934 to keep the issues separate. -- ___ Python tracker ___

[issue1753718] base64 "legacy" functions violate RFC 3548

2015-12-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: While we are here, may be update docstrings too? -- nosy: +serhiy.storchaka ___ Python tracker ___

[issue25938] if sentence doesn't work with input()

2015-12-23 Thread Benjamin Peterson
Benjamin Peterson added the comment: In Python 2, input() is basically equivalent to eval(raw_input()). In Python 3, input() is the same as raw_input() in Python 2. This explains the difference. -- nosy: +benjamin.peterson resolution: -> not a bug status: open -> closed

[issue25938] if sentence doesn't work with input()

2015-12-23 Thread Kozo Oeda
New submission from Kozo Oeda: if sentence doesn't work well with input() in Python 3(I confirmed 3.4.3 and 3.5.1 on OS X 10.10.5). I also confirmed Python 2.7.11 works well. I think the code which I wrote in the lower section explains what happened enough. I couldn't get the proper

[issue20440] Use the Py_SETREF macro

2015-12-23 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- title: Use Py_REPLACE/Py_XREPLACE macros -> Use the Py_SETREF macro ___ Python tracker ___

[issue25934] ICC compiler: ICC treats denormal floating point numbers as 0.0

2015-12-23 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- components: +Build, Windows type: -> crash versions: +Python 3.5, Python 3.6 ___ Python tracker

[issue15068] fileinput requires two EOF when reading stdin

2015-12-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > It's more a question of whether the entire change is appropriate for 2.7. What is your answer? To me there is a bug and we can fix it. -- ___ Python tracker

[issue25919] htp.client PUT method ignores error responses sent immediatly after headers

2015-12-23 Thread SilentGhost
SilentGhost added the comment: All the tests pass now, not sure why your patch doesn't get associated rietveld link, it applies cleanly using hg patch --no-commit -- ___ Python tracker

[issue25860] os.fwalk() silently skips remaining directories when error occurs

2015-12-23 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue25911] Regression: os.walk now using os.scandir() breaks bytes filenames on windows

2015-12-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch that restores the ability of os.walk() to work with bytes filenames on Windows. -- keywords: +patch stage: test needed -> patch review Added file: http://bugs.python.org/file41397/walks_bytes.patch