[issue29741] BytesIO methods don't accept integer types, while StringIO counterparts do

2017-03-06 Thread Oren Milman
New submission from Oren Milman: current state import io class IntLike(): def __init__(self, num): self._num = num def __index__(self): return self._num __int__ = __index__ io.StringIO('blah blah').read(IntLike(2)) io.StringIO('blah blah')

[issue29736] Optimize builtin types constructor

2017-03-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: float, list: issue20185. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue29742] asyncio get_extra_info() throws exception

2017-03-06 Thread Nikolay Kim
New submission from Nikolay Kim: https://github.com/python/asyncio/issues/494 -- messages: 289138 nosy: fafhrd91 priority: normal pull_requests: 435 severity: normal status: open title: asyncio get_extra_info() throws exception versions: Python 3.5, Python 3.6, Python 3.7 __

[issue29742] asyncio get_extra_info() throws exception

2017-03-06 Thread Nikolay Kim
Nikolay Kim added the comment: exception on get_extra_info() on closed ssl transport ``` Feb 18 13:18:09 btc electrumx_server.py[1732]: ERROR:ElectrumX:[15328] Traceback (most recent call last): Feb 18 13:18:09 btc electrumx_server.py[1732]: File "/usr/local/lib/python3.5/dist-packages/elect

[issue29742] asyncio get_extra_info() throws exception

2017-03-06 Thread R. David Murray
R. David Murray added the comment: Thanks for the report and PR, but your fix is not obviously correct. In general exceptions are the way in Python that errors are reported, and asking for extra_info on a closed stream is an error. The exception raised is not clear, so perhaps the asyncio fo

[issue29742] asyncio get_extra_info() throws exception

2017-03-06 Thread Nikolay Kim
Nikolay Kim added the comment: get_extra_info() returns optional transport information, I think it is ok to return None for closed transport. https://github.com/python/cpython/blob/master/Lib/asyncio/transports.py#L18 I propose this feature initially, during early tulip development but now I th

[issue29742] asyncio get_extra_info() throws exception

2017-03-06 Thread Yury Selivanov
Yury Selivanov added the comment: > Thanks for the report and PR, but your fix is not obviously correct. Not for this particular asyncio method though, see asyncio PEP [1]. But there's an actual bug in the PR, instead of returning `None` we should return `default`. [1] https://www.python.org

[issue29743] Closing transport during handshake process leaks open socket

2017-03-06 Thread Nikolay Kim
New submission from Nikolay Kim: https://github.com/python/asyncio/issues/487 https://github.com/KeepSafe/aiohttp/issues/1679 -- messages: 289143 nosy: fafhrd91 priority: normal pull_requests: 436 severity: normal status: open title: Closing transport during handshake process leaks open

[issue29581] __init_subclass__ causes TypeError when used with standard library metaclasses (such as ABCMeta)

2017-03-06 Thread Roundup Robot
Changes by Roundup Robot : -- pull_requests: +437 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

[issue29741] BytesIO methods don't accept integer types, while StringIO counterparts do

2017-03-06 Thread Martin Panter
Martin Panter added the comment: What is the use case? Unless changing the behaviour would be useful, I think the simplest solution would be to document that the methods should only be given instances of “int”, so that it is clear that other kinds of numbers are unsupported. -- nosy:

[issue27035] Cannot set exit code in atexit callback

2017-03-06 Thread Glyph Lefkowitz
Glyph Lefkowitz added the comment: I just bumped into this myself. If this really is only fixable in a major release, there ought to at least be a minor release for the *documentation* to update it to be correct. -- nosy: +glyph ___ Python tracker

[issue29742] asyncio get_extra_info() throws exception

2017-03-06 Thread Nikolay Kim
Changes by Nikolay Kim : -- pull_requests: +438 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.py

[issue29742] asyncio get_extra_info() throws exception

2017-03-06 Thread Guido van Rossum
Changes by Guido van Rossum : -- nosy: -gvanrossum ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue29744] memmap behavior changed

2017-03-06 Thread Andrea Giovannucci
New submission from Andrea Giovannucci: The previous version 2.7.12 was returning a memmap file when slicing with a list of integers, now it returns an array. This affects the behaviour of several functions in my package. Is that an aware choice or a side product of some other change? ---

[issue29745] asyncio: Make pause/resume_reading idepotent and no-op for closed transports

2017-03-06 Thread Nikolay Kim
New submission from Nikolay Kim: https://github.com/python/asyncio/issues/488 -- messages: 289147 nosy: fafhrd91 priority: normal pull_requests: 439 severity: normal status: open title: asyncio: Make pause/resume_reading idepotent and no-op for closed transports versions: Python 3.5, Py

[issue29744] memmap behavior changed

2017-03-06 Thread Andrea Giovannucci
Changes by Andrea Giovannucci : -- resolution: -> not a bug ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: ht

[issue29741] BytesIO methods don't accept integer types, while StringIO counterparts do

2017-03-06 Thread Oren Milman
Oren Milman added the comment: I don't have a use case for that. (I noticed this behavior by chance, while working on some other issue.) However, IIUC, commit 4fa88fa0ba35e25ad9be66ebbdaba9aca553dc8b, by Benjamin Peterson, Antoine Pitrou and Amaury Forgeot d'Arc, includes patching the aforementi

[issue29737] Optimize concatenating empty tuples

2017-03-06 Thread Raymond Hettinger
Raymond Hettinger added the comment: Is it at all common to concatenate empty tuples? This seems like optimizing something that rarely occurs. Also, the timings can be misleading if in real code these changes cause new branch mispredictions here which can slow the common case. See http://st

[issue28728] test_host_resolution in test_socket fails

2017-03-06 Thread Xiang Zhang
Changes by Xiang Zhang : -- pull_requests: +440 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.py

[issue29739] zipfile raises wrong exception for some incorrect passwords

2017-03-06 Thread Xiang Zhang
Changes by Xiang Zhang : -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue29744] memmap behavior changed

2017-03-06 Thread Xiang Zhang
Changes by Xiang Zhang : -- stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubs

[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-03-06 Thread Mariatta Wijaya
Changes by Mariatta Wijaya : -- pull_requests: +441 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue28728] test_host_resolution in test_socket fails

2017-03-06 Thread Xiang Zhang
Changes by Xiang Zhang : -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bugs-li

[issue29680] gdb/libpython.py does not work with gdb 7.2

2017-03-06 Thread Mariatta Wijaya
Changes by Mariatta Wijaya : -- pull_requests: +442 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue29676] C method is not profiled by lsprof

2017-03-06 Thread INADA Naoki
Changes by INADA Naoki : -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bugs-li

[issue29737] Optimize concatenating empty tuples

2017-03-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I agree with your comments Raymond, but let me to expose my reasons. An idea of optimizing empty tuple concatenating is inspired by partial(). It concatenates two tuples of arguments and it is common when one of tuple is empty. Current C implementation makes

[issue29741] BytesIO methods don't accept integer types, while StringIO counterparts do

2017-03-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Other objects in the io module use special-purposed converter _PyIO_ConvertSsize_t() which checks PyNumber_Check() and calls PyNumber_AsSsize_t(). I think StringIO implementation can be changed to reuse _PyIO_ConvertSsize_t() for simplicity. After that Byt

[issue29739] zipfile raises wrong exception for some incorrect passwords

2017-03-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: ZIP file has something like 8-bit control sum for checking the validity of the password. With the chance 1/256 the check is passed for wrong password. This is unavoidable. -- ___ Python tracker

[issue25996] Add support of file descriptor in os.scandir()

2017-03-06 Thread Eryk Sun
Eryk Sun added the comment: > There is no similar function taking a directory handle In 3.5+ the CRT has O_OBTAIN_DIR (0x2000) for opening a directory, i.e. to call CreateFile with backup semantics. A directory can be read via GetFileInformationByHandleEx [1] using the information classes Fil

[issue29741] BytesIO methods don't accept integer types, while StringIO counterparts do

2017-03-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Are there tests for accepting non-integers in other classes? If no then don't bother about tests. I suppose all this came from the implementation of the 'n' format unit in PyArg_Parse* functions. -- ___ Python tra

[issue29694] race condition in pathlib mkdir with flags parents=True

2017-03-06 Thread Armin Rigo
Armin Rigo added the comment: A different bug in the same code: if someone creates the directory itself between the two calls to ``self._accessor.mkdir(self, mode)``, then the function will fail with an exception even if ``exist_ok=True``. Attached is a patch that fixes both cases. --

<    1   2