[issue15786] IDLE code completion window can hang or misbehave with mouse

2016-05-12 Thread Terry J. Reedy
Terry J. Reedy added the comment: I experimented more with 3.5.1, Win 10 and formulated a question and hypothesis. In a text widget, pressing button 1 (usually the left) moves the cursor to the nearest between-character slice line. Hold the button down allows selecting text. Releasing and

[issue24550] maxint on 64 bit platforms breaks os.read

2016-05-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There is more specific issue for 32-bit reads in 2.7 (with patch): issue21199. I think this issue can be closed as a duplicate of two other issues. -- resolution: -> duplicate stage: -> resolved status: open -> closed

[issue21313] Py_GetVersion() is broken when using mqueue and a long patch name

2016-05-12 Thread Martin Panter
Martin Panter added the comment: >>> Py_GetBuildInfo = pythonapi.Py_GetBuildInfo >>> Py_GetBuildInfo.restype = c_char_p >>> Py_GetBuildInfo() # Not truncated 'qbase qtip subprocess-stderr_redirect_with_no_stdout_redirect-2.diff tip:0b641285389d+, May 13 2016, 02:10:26' Demo of my problem with

[issue21313] Py_GetVersion() is broken when using mqueue and a long patch name

2016-05-12 Thread Martin Panter
Martin Panter added the comment: Currently Py_GetBuildInfo() just returns a long untruncated string. Perhaps it would be safer to leave that as it is, and just make the parsing in the “platform” module more tolerant. What do you think? I never really cared about the details in

[issue26647] ceval: use Wordcode, 16-bit bytecode

2016-05-12 Thread Demur Rumed
Changes by Demur Rumed : Added file: http://bugs.python.org/file42835/wpy8.patch ___ Python tracker ___

[issue6422] timeit called from within Python should allow autoranging

2016-05-12 Thread Nick Coghlan
Nick Coghlan added the comment: Good point - given that, +1 from me for the callback based version, especially since exception chaining will still disambiguate failures in the callback from other errors. -- ___ Python tracker

[issue26826] Expose new copy_file_range() syscall in os module.

2016-05-12 Thread Martin Panter
Martin Panter added the comment: Another option could be to use Serhiy’s proposed partial keywords support in Issue 26282. It is not yet committed, but it looks like it will go ahead, and then you could make “in” and “out” positional-only parameters, and the rest keywords. But IMO “src” and

[issue26993] Copy idlelib *.py files with new names

2016-05-12 Thread Terry J. Reedy
Terry J. Reedy added the comment: Both Serhiy and Ned have expressed concern about the difficulty of merging patches from 3.5 to 3.6 once the 3.6 files are renamed. To me, this is a non-issue since I don't expect to do that more than a few times, and some may be null merges of backports of

[issue27003] Python 3.5.1 fails at HTTPSTest with SSL CERT error

2016-05-12 Thread Martin Panter
Changes by Martin Panter : -- components: +Tests -Extension Modules ___ Python tracker ___

[issue27003] Python 3.5.1 fails at HTTPSTest with SSL CERT error

2016-05-12 Thread Martin Panter
Martin Panter added the comment: After 3.5.1 was released, there were some SSL certificate changes with a server (ab)used in the test suite. See Issue 25940. The result was that I changed some tests over to use the https://self-signed.pythontest.net/ server, and I had to enable the CA flag in

[issue24550] maxint on 64 bit platforms breaks os.read

2016-05-12 Thread Martin Panter
Martin Panter added the comment: Yes 3.5 should do 64-bit reads (if you have enough memory) thanks to revision 0c57aba6b1a3 (Argument Clinic conversion): >>> os.read(0, 2**32) Traceback (most recent call last): File "", line 1, in MemoryError >>> os.read(0, 2**63) Traceback (most recent

[issue26993] Copy idlelib *.py files with new names

2016-05-12 Thread Terry J. Reedy
Terry J. Reedy added the comment: In response to Nick's point 4: To me, these are important aspects of 'in the stdlib'. First is having issues on this tracker. As Guido said in his King Day speech, non-trivial software is a collective project. IDLE needs continued access to dependency

[issue26993] Copy idlelib *.py files with new names

2016-05-12 Thread Terry J. Reedy
Terry J. Reedy added the comment: I should have explained my usage of 'idle2' and 'idle3'. 'Idle1' was the original IDLE that executed user code in the idle process. 'Idle2' was the re-write, still in use, that executes user code in a separate process. 'Idle3' is intended to be a re-write

[issue26439] ctypes.util.find_library fails when ldconfig/glibc not available (e.g., AIX)

2016-05-12 Thread Martin Panter
Martin Panter added the comment: Thanks for trying to move the directory in the new patch, but it does not seem to have been picked up by Rietveld. I have only seen patches generated with Mercurial and Git work, but I don’t exactly know _why_ they work :) Here is a summary of what I would be

[issue24254] Make class definition namespace ordered by default

2016-05-12 Thread Eric Snow
Eric Snow added the comment: Here's a refresh of the patch that only sets the default definition namespace (and does not introduce __definition_order__). -- Added file: http://bugs.python.org/file42834/just-default-to-odict.diff ___ Python tracker

[issue24254] Make class definition namespace ordered by default

2016-05-12 Thread Eric Snow
Changes by Eric Snow : Removed file: http://bugs.python.org/file39456/just-default-to-odict.diff ___ Python tracker ___

[issue26999] Add child separator keyword to logging.basicConfig and use it in Logger.getChild()

2016-05-12 Thread Vinay Sajip
Vinay Sajip added the comment: > However, if you still think that this is not, what the logging library is > meant for, I'd appreciate to know. Confirmed. I would advise against using logger names in this way. -- ___ Python tracker

[issue26359] CPython build options for out-of-the box performance

2016-05-12 Thread Brett Cannon
Brett Cannon added the comment: The patch LGTM but I'm not a configure/make expert. Anyone else want to have a look? Alecsandru, if no one takes a look within the next week then just assign the issue to me. -- ___ Python tracker

[issue26970] Replace OpenSSL's CPRNG with system entropy source

2016-05-12 Thread Christian Heimes
Christian Heimes added the comment: I have to replace _PyOS_URandom with a variant that doesn't need the GIL, https://mail.python.org/pipermail/cryptography-dev/2016-May/000595.html -- ___ Python tracker

[issue26839] Python 3.5 running in a virtual machine with Linux kernel 3.17+ can block at startup or on importing the random module on getrandom()

2016-05-12 Thread Colm Buckley
Colm Buckley added the comment: Oh; it's not actually hashlib which is calling getrandom(), it's the main runtime - the initialization of the per-process secret hash seed in _PyRandom_Init Don't know enough about the internal logic here to comment on what the Right Thing is; but I second the

[issue22970] asyncio: Cancelling wait() after notification leaves Condition in an inconsistent state

2016-05-12 Thread Guido van Rossum
Guido van Rossum added the comment: Presumably. :-( -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue26632] __all__ decorator

2016-05-12 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: Now with docs and tests. -- Added file: http://bugs.python.org/file42833/26632-in-c-5.diff ___ Python tracker ___

[issue26839] Python 3.5 running in a virtual machine with Linux kernel 3.17+ can block at startup or on importing the random module on getrandom()

2016-05-12 Thread Colm Buckley
Colm Buckley added the comment: It's worth noting that this issue now affects every installation of Debian testing track with systemd and systemd-cron installed; the python program /lib/systemd/system-generators/systemd-crontab-generator is called very early in the boot process; it imports

[issue26556] Update expat to 2.2.1

2016-05-12 Thread Christian Heimes
Christian Heimes added the comment: Another critical bug fix will be released next Tuesday. -- ___ Python tracker ___

[issue26556] Update expat to 2.2.1

2016-05-12 Thread Ned Deily
Ned Deily added the comment: Any progress on this? It is still flagged as a Release Blocker and releases are approaching. -- ___ Python tracker ___

[issue22970] asyncio: Cancelling wait() after notification leaves Condition in an inconsistent state

2016-05-12 Thread Ned Deily
Ned Deily added the comment: Is this still a Release Blocker for 3.6? -- nosy: +ned.deily ___ Python tracker ___

[issue26556] Update expat to 2.2.1

2016-05-12 Thread Ned Deily
Changes by Ned Deily : -- nosy: +ned.deily ___ Python tracker ___ ___ Python-bugs-list

[issue27012] Rename the posix module to _os

2016-05-12 Thread Brett Cannon
Brett Cannon added the comment: You're correct that it could break code checking the module's __name__ value if that was changed. As for why I care, it sucks trying to import this module for any reason. Any place you touch this module you have to proper try/except ImportError checks to work

[issue27012] Rename the posix module to _os

2016-05-12 Thread R. David Murray
R. David Murray added the comment: I know you know this, but to be clear for other readers, the module naming happens at compile time, not runtime. If you alias the module, it's __name__ will still be '_os', won't it? Might that not have backward compatibility issues? And if you also change

[issue27012] Rename the posix module to _os

2016-05-12 Thread Brett Cannon
New submission from Brett Cannon: It's always bugged me that the posix module changes its name based on what OS you're running under. I think it would be better to name the module _os as that it's consistent. We can alias the name to posix/nt for backwards compatibility (and even do this in

[issue27010] email library could "recover" from bad mime boundary like (some?) email clients do

2016-05-12 Thread R. David Murray
R. David Murray added the comment: I'm going to change the title of this and see if anyone wants to propose a patch. It'll probably end up getting closed as not a bug if no one does for a while, though. -- title: Attachments not detected from email library -> email library could

[issue27011] Identation error

2016-05-12 Thread Stepan
Changes by Stepan : -- files: ident.patch keywords: patch nosy: Ma3aXaKa priority: normal severity: normal status: open title: Identation error type: enhancement versions: Python 3.6 Added file: http://bugs.python.org/file42832/ident.patch

[issue6422] timeit called from within Python should allow autoranging

2016-05-12 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Thu, May 12, 2016 at 04:49:59AM +, Nick Coghlan wrote: > The embedded side-effects were my main concern with Scott's original > patch, so Steven's callback-based approach strikes me as a definite > improvement. However, the awkwardness of the revised

[issue27010] Attachments not detected from email library

2016-05-12 Thread Fedele Mantuano
Fedele Mantuano added the comment: Hi David, I use email library to detect malicious attachments, so: message = email.message_from_file(open('mail')) for i in message.walk(): do somethings Not detected means that in for loop I can't see these attachments. The same problem there is with

[issue19711] add test for changed portions after reloading a namespace package

2016-05-12 Thread Mark Lawrence
Changes by Mark Lawrence : -- nosy: -BreamoreBoy ___ Python tracker ___ ___

[issue27010] Attachments not detected from email library

2016-05-12 Thread R. David Murray
R. David Murray added the comment: When you say the attachment is not detected, what do you mean? What call are you making to the email library that you are expecting to see the attachment in that it is not in? Your 'parsed' pastebin isn't something the library produces, so I assume that's

[issue27008] error message of ord is not intuitive

2016-05-12 Thread R. David Murray
R. David Murray added the comment: All right, we'll close this then. -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker

[issue22570] Better stdlib support for Path objects

2016-05-12 Thread Guido van Rossum
Guido van Rossum added the comment: Reopening as we need to rename the path attribute to __fspath__ once Brett's PEP is accepted (which will be soon). https://github.com/brettcannon/path-pep/blob/master/pep-0NNN.rst The 3.4 and 3.5 versions of this should probably just be reversed before

[issue27010] Attachments not detected from email library

2016-05-12 Thread Fedele Mantuano
New submission from Fedele Mantuano: We are receiving a lot of mail with attachments not detected from email library. I also tested Tika parser and it have the same issue: mail: http://pastebin.com/kSEJnzSa mail parsed: http://pastebin.com/7HaVPcTq I can read only these content types:

[issue26526] In parsermodule.c, replace over 2KLOC of hand-crafted validation code, with a DFA

2016-05-12 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- stage: -> patch review ___ Python tracker ___ ___

[issue26415] Fragmentation of the heap memory in the Python parser

2016-05-12 Thread A. Skrobov
A. Skrobov added the comment: Ping? This patch is two months old now. -- ___ Python tracker ___ ___

[issue26526] In parsermodule.c, replace over 2KLOC of hand-crafted validation code, with a DFA

2016-05-12 Thread A. Skrobov
A. Skrobov added the comment: Ping? This patch is two months old now. -- ___ Python tracker ___ ___

[issue19711] add test for changed portions after reloading a namespace package

2016-05-12 Thread Eric Snow
Changes by Eric Snow : -- versions: +Python 3.6 -Python 3.5 ___ Python tracker ___

[issue25452] Add __bool__() method to subprocess.CompletedProcess

2016-05-12 Thread Richard Neumann
Richard Neumann added the comment: Thank you for the hint. I never before contributed code to the python foundation and thus am not familiar with the process. I will look into it when I find the time. -- ___ Python tracker

[issue27008] error message of ord is not intuitive

2016-05-12 Thread Xiang Zhang
Xiang Zhang added the comment: I also notice the document. I get surprised when I see the implementation also supports bytes while the doc says one unicode character. But then I tell myself that maybe unicode character also includes bytes? I am not sure about the English description. But

[issue18864] Implementation for PEP 451 (importlib.machinery.ModuleSpec)

2016-05-12 Thread Eric Snow
Eric Snow added the comment: The last dependencies have now been closed! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue21099] Switch applicable importlib tests to use PEP 451 API

2016-05-12 Thread Eric Snow
Changes by Eric Snow : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.6 -Python 3.4, Python 3.5 ___ Python tracker

[issue26765] Factor out common bytes and bytearray implementation

2016-05-12 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +haypo ___ Python tracker ___ ___

[issue21099] Switch applicable importlib tests to use PEP 451 API

2016-05-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset fceaa0dc715e by Eric Snow in branch 'default': Issue #21099: Switch applicable importlib tests to use PEP 451 API. https://hg.python.org/cpython/rev/fceaa0dc715e -- nosy: +python-dev ___ Python tracker

[issue25452] Add __bool__() method to subprocess.CompletedProcess

2016-05-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is not enough. New feature should be documented (in new method docstring, in subprocess documentation and in What's New document) and tested. And please sign a Contributor Licensing Agreement. http://www.python.org/psf/contrib/contrib-form/

[issue26826] Expose new copy_file_range() syscall in os module.

2016-05-12 Thread Marcos Dione
Marcos Dione added the comment: I settled for s/in/src/ and s/out/dst/, fixed typos, made sure the docs are in sync (parameters in the docstring were out of order), rephrased paragraph about flags parameter and included the configure.ac code for detecting availability of the syscall. I'm also

[issue25452] Add __bool__() method to subprocess.CompletedProcess

2016-05-12 Thread Richard Neumann
Richard Neumann added the comment: Please excuse my ambiguous phrasing. What I meant was I created the patch _from_ the Python 3.5.1 module _for_ Python 3.6. -- ___ Python tracker

[issue24550] maxint on 64 bit platforms breaks os.read

2016-05-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The 32-bit size limit in multiprocessing is issue17560. AFAIK read() and write() now support 64-bit size on 64-bit systems. -- nosy: +haypo, serhiy.storchaka ___ Python tracker

[issue21199] Python on 64-bit Windows uses signed 32-bit type for read length

2016-05-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Ping? -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue27008] error message of ord is not intuitive

2016-05-12 Thread R. David Murray
R. David Murray added the comment: You are right, if it is too big a job to do it all at once, then we can fix them as we find them. Do you want to propose a patch? However, in this case I think there is arguably not a bug. It looks as though the intent is that ord only support strings (see

[issue27009] multiprocessing Connection data length limited to max(int32)

2016-05-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is a duplicate of issue17560. -- nosy: +serhiy.storchaka resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> problem using multiprocessing with really big objects? ___ Python

[issue26369] unicode.decode and str.encode are unnecessarily confusing for non-ascii

2016-05-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: If str.encode() raises a decoding exception, this is a programming bug. It would be bad to hide it. FYI, the default encoding is not hardcoded 'ascii'. Google "Changing default encoding in Python". Maybe this will help in your program. --

[issue20371] datetime.datetime.replace bypasses a subclass's __new__

2016-05-12 Thread R. David Murray
R. David Murray added the comment: To summarize, it looks like there are three issues here: (1) the python and C versions are out of sync behavior wise (the python should work like the C in this case, it seems) (2) there are some missing tests, since we are running the same tests against both

[issue20371] datetime.datetime.replace bypasses a subclass's __new__

2016-05-12 Thread R. David Murray
Changes by R. David Murray : -- stage: -> needs patch type: -> behavior versions: +Python 3.5, Python 3.6 -Python 3.3, Python 3.4 ___ Python tracker

[issue27009] multiprocessing Connection data length limited to max(int32)

2016-05-12 Thread Hartmann
Changes by Hartmann : -- versions: +Python 3.5 -Python 3.6 ___ Python tracker ___ ___

[issue23640] int.from_bytes() is broken for subclasses

2016-05-12 Thread R. David Murray
R. David Murray added the comment: @eltoder: Ah, you are right, I was looking at the python version. There's an open issue about this, #20371, which indicates that the design decision was to support subclasses. Clearly I was remembering the conversation backward based on looking at the

[issue23640] int.from_bytes() is broken for subclasses

2016-05-12 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: -pitrou ___ Python tracker ___ ___ Python-bugs-list

[issue27009] multiprocessing Connection data length limited to max(int32)

2016-05-12 Thread Hartmann
New submission from Hartmann: I wonder if size restriction for the data blobs send via multiprocessing.Connection is intentionally. Otherwise it would be nice to get rid of that restriction. File "python3.5/multiprocessing/connection.py", line 393, in _send_bytes header =

[issue26369] unicode.decode and str.encode are unnecessarily confusing for non-ascii

2016-05-12 Thread Ben Spiller
Ben Spiller added the comment: I'm proposing that str.encode() should _not_ throw a 'decode' exception for non-ascii characters and be effectively a no-op, to match what it already does for ascii characters - which therefore shouldn't break behavior anyone will be depending on. This could be

[issue26369] unicode.decode and str.encode are unnecessarily confusing for non-ascii

2016-05-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What do you propose? Note that str.encode() doesn't raise an exception. Ascii unicode and 8-bit strings are interchangeable. Ascii unicode strings can be packed in str for less memory consumption (see xmlrpclib or ElementTree), a lot of str constant are

[issue25452] Add __bool__() method to subprocess.CompletedProcess

2016-05-12 Thread STINNER Victor
STINNER Victor added the comment: It's a new feature, it should only go to Python 3.6. -- ___ Python tracker ___

[issue26369] unicode.decode and str.encode are unnecessarily confusing for non-ascii

2016-05-12 Thread Ben Spiller
Ben Spiller added the comment: yes the situation is loads better in python 3, this issue is specific to 2.x, but like many people sadly we're not able to move to 3 for the time being. Since making this mistake is quite common and there's some sensible behaviour that would make it disappear

[issue25452] Add __bool__() method to subprocess.CompletedProcess

2016-05-12 Thread Richard Neumann
Richard Neumann added the comment: I took the liberty to create a patch for Python v3.5.1. -- keywords: +patch nosy: +Richard Neumann Added file: http://bugs.python.org/file42828/subprocess.patch ___ Python tracker

[issue26999] Add child separator keyword to logging.basicConfig and use it in Logger.getChild()

2016-05-12 Thread Richard Neumann
Changes by Richard Neumann : Added file: http://bugs.python.org/file42827/logger.patch ___ Python tracker ___

[issue26369] unicode.decode and str.encode are unnecessarily confusing for non-ascii

2016-05-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Note that with the -3 option Python 2.7 already warns about incompatibilities. >>> 'abc'.encode('base64') __main__:1: DeprecationWarning: 'base64' is not a text encoding; use codecs.encode() to handle arbitrary codecs 'YWJj\n' >>> 'YWJj\n'.decode('base64')

[issue26369] unicode.decode and str.encode are unnecessarily confusing for non-ascii

2016-05-12 Thread Ben Spiller
Ben Spiller added the comment: Thanks that's really helpful Having thought about it some more, I think if possible it'd be really so much better to actually 'fix' the behaviour for the unicode<->str standard codecs (i.e. not base64) rather than just documenting around it. The current

[issue26039] More flexibility in zipfile write interface

2016-05-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your contribution Thomas. I'll push the patch with fixed writestr in short time unless Martin left comments. -- stage: patch review -> commit review ___ Python tracker

[issue27007] Alternate constructors bytes.fromhex() and bytearray.fromhex() return an instance of base type

2016-05-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch. -- keywords: +patch stage: -> patch review Added file: http://bugs.python.org/file42826/bytes_fromhex.patch ___ Python tracker

[issue26039] More flexibility in zipfile write interface

2016-05-12 Thread Thomas Kluyver
Thomas Kluyver added the comment: Thanks Serhiy. I'm quite happy with that set of constraints. I had a look over your patch set, and just spotted one thing in writestr that I have overlooked all along. -- ___ Python tracker

[issue26999] Add child separator keyword to logging.basicConfig and use it in Logger.getChild()

2016-05-12 Thread Richard Neumann
Changes by Richard Neumann : Removed file: http://bugs.python.org/file42825/logger.patch ___ Python tracker ___

[issue26999] Add child separator keyword to logging.basicConfig and use it in Logger.getChild()

2016-05-12 Thread Richard Neumann
Richard Neumann added the comment: Added proposed patch -- keywords: +patch Added file: http://bugs.python.org/file42825/logger.patch ___ Python tracker

[issue27008] error message of ord is not intuitive

2016-05-12 Thread Xiang Zhang
Xiang Zhang added the comment: Ohh, you have tried to do that. It must be a large work. But on the other hand, if this is a too large work, why not solve this case by case? This work is too large to get someone work on it, even you, the most active developer in the community I see have

[issue26999] Add child separator keyword to logging.basicConfig and use it in Logger.getChild()

2016-05-12 Thread Richard Neumann
Richard Neumann added the comment: PS: @vinay.sajip You do realize that I want this argument to be optional and to retain '.' as default setting in order to keep the current behaviour?! -- ___ Python tracker

[issue27008] error message of ord is not intuitive

2016-05-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: In any case it doesn't make much sense to change just one separate docstring. If you want to avoid misleading and support consistent wording, you should examine all occurrences of the word "string" in the documentation, docstrings, error messages and

[issue26999] Add child separator keyword to logging.basicConfig and use it in Logger.getChild()

2016-05-12 Thread Richard Neumann
Richard Neumann added the comment: I am using loggers and sub-loggers (getChild()) in classes, which contain sub-classes, wich contain sub-sub-classes and so on for complex data processing. Hence I was using the logging library with sub-loggers to see in which of the (sub-)classes things

[issue27008] error message of ord is not intuitive

2016-05-12 Thread Xiang Zhang
Xiang Zhang added the comment: BTW, what do you think about the second TypeError in ``ord``. Shouldn't it be ValueError? -- ___ Python tracker ___

[issue26999] Add child separator keyword to logging.basicConfig and use it in Logger.getChild()

2016-05-12 Thread Vinay Sajip
Vinay Sajip added the comment: This is a change with wide-ranging ramifications. I don't propose to do this, as the use of '.' as a logging separator mirrors the separator used in the Python package namespace. Logger names are supposed to indicate the "where" of a logging event - nothing

[issue27008] error message of ord is not intuitive

2016-05-12 Thread Xiang Zhang
Xiang Zhang added the comment: If you think it's OK, it's fine. Please close this thread. -- ___ Python tracker ___

[issue27008] error message of ord is not intuitive

2016-05-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This not the only place where "string" means unicode string or bytes string. I don't think this is large issue. -- nosy: +serhiy.storchaka ___ Python tracker

[issue27008] error message of ord is not intuitive

2016-05-12 Thread Xiang Zhang
New submission from Xiang Zhang: The error message of ``ord`` is not that right. It says 'ord() expected string of length 1'. I don't think in Py3.x string can refer to both bytes and unicodes. -- messages: 265376 nosy: xiang.zhang priority: normal severity: normal status: open title:

[issue27007] Alternate constructors bytes.fromhex() and bytearray.fromhex() return an instance of base type

2016-05-12 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: According to the discussion on Python-Dev [1] alternate constructors should return an instance of the subclass (else why invoke it through the subclass). bytes.fromhex() and bytearray.fromhex() are the only exceptions. I think bytes.fromhex() and

[issue27005] Faster float.fromhex()

2016-05-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: A mistake in using PyObject_CallFunctionObjArgs() caused a crash in using fromhex() for subclasses. New tests added in issue23640 covers this case. -- ___ Python tracker

[issue23640] int.from_bytes() is broken for subclasses

2016-05-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Discussion on Python-Dev: http://comments.gmane.org/gmane.comp.python.devel/157649 . The conclusion is that alternate constructors should return an instance of the subclass, and either call constructor or use pickling machinery for creating an object in

[issue23640] int.from_bytes() is broken for subclasses

2016-05-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset 0af15b8ef3b2 by Serhiy Storchaka in branch '3.5': Issue #23640: int.from_bytes() no longer bypasses constructors for subclasses. https://hg.python.org/cpython/rev/0af15b8ef3b2 New changeset df14ea17a517 by Serhiy Storchaka in branch 'default':

[issue27005] Faster float.fromhex()

2016-05-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset 1bae2a6bb37c by Serhiy Storchaka in branch 'default': Issue #27005: Fixed the call of PyObject_CallFunctionObjArgs(). https://hg.python.org/cpython/rev/1bae2a6bb37c -- ___ Python tracker

[issue27005] Faster float.fromhex()

2016-05-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset 3b19660611a4 by Serhiy Storchaka in branch 'default': Issue #27005: Optimized the float.fromhex() class method for exact float. https://hg.python.org/cpython/rev/3b19660611a4 -- nosy: +python-dev ___

[issue27005] Faster float.fromhex()

2016-05-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Mark. -- assignee: -> serhiy.storchaka resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue27006] C implementation of Decimal.from_float() bypasses __new__ and __init__

2016-05-12 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Python implementation of Decimal.from_float() calls __new__ and __init__ methods of subclass. >>> from _pydecimal import Decimal >>> class D(Decimal): ... def __new__(cls, *args, **kwargs): ... print('__new__') ... return

[issue27005] Faster float.fromhex()

2016-05-12 Thread Mark Dickinson
Mark Dickinson added the comment: LGTM -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue27005] Faster float.fromhex()

2016-05-12 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Proposed patch makes float.fromhex() faster for exact float. $ ./python -m timeit -s "h = float.hex(1.23)" -- "float.fromhex(h)" Unpatched: 100 loops, best of 3: 0.886 usec per loop Patched: 100 loops, best of 3: 0.519 usec per loop --

[issue26993] Copy idlelib *.py files with new names

2016-05-12 Thread Nick Coghlan
Nick Coghlan added the comment: +1 for Ned's point that PEP 434 grants the IDLE developers *permission* to backport IDLE enhancements to maintenance releases, but doesn't *oblige* them to provide such backports. For Python 3.6, another point to keep in mind is that if anyone particularly

[issue26807] mock_open()().readline() fails at EOF

2016-05-12 Thread Robert Collins
Robert Collins added the comment: So something like for line in _state[0]: yield line while True: yield '' Will probably do it just fine. -- ___ Python tracker