[issue33677] Fix signatures of tp_clear handlers

2018-05-29 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

The tp_clear handler should be a pointer to the function that returns int.

typedef int (*inquiry)(PyObject *);

Two handlers in the stdlib (for AST and deque objects) return void instead. The 
following PR fixes this.

--
components: Extension Modules
messages: 317986
nosy: rhettinger, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Fix signatures of tp_clear handlers
type: behavior
versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33677] Fix signatures of tp_clear handlers

2018-05-29 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +6830
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32911] Doc strings no longer stored in body of AST

2018-05-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 2641ee5040abb090e66e4ff80c33b76729b36e75 by Serhiy Storchaka in 
branch '3.7':
bpo-32911: Revert bpo-29463. (GH-7121)
https://github.com/python/cpython/commit/2641ee5040abb090e66e4ff80c33b76729b36e75


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29463] Add `docstring` field to AST nodes

2018-05-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 2641ee5040abb090e66e4ff80c33b76729b36e75 by Serhiy Storchaka in 
branch '3.7':
bpo-32911: Revert bpo-29463. (GH-7121)
https://github.com/python/cpython/commit/2641ee5040abb090e66e4ff80c33b76729b36e75


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32911] Doc strings no longer stored in body of AST

2018-05-29 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +6831

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29463] Add `docstring` field to AST nodes

2018-05-29 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +6832

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33671] Efficient zero-copy for shutil.copy* functions (Linux, OSX and Win)

2018-05-29 Thread Giampaolo Rodola'


Giampaolo Rodola'  added the comment:

Yes, I tried changing benchmarks order and zero-copy variants are always 
faster. As for instantaneous CoW copy, it is debatable. E.g. "cp" command does 
not do it by default:   
https://unix.stackexchange.com/questions/80351/why-is-cp-reflink-auto-not-the-default-behaviour
I think shutil should follow the same lead, and perhaps provide a cow=bool 
argument in the future.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33654] asyncio: transports don't support switching between Protocol and BufferedProtocol

2018-05-29 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset 2179022d94937d7b0600b0dc192ca6fa5f53d830 by Andrew Svetlov (Yury 
Selivanov) in branch 'master':
bpo-33654: Support protocol type switching in SSLTransport.set_protocol() 
(#7194)
https://github.com/python/cpython/commit/2179022d94937d7b0600b0dc192ca6fa5f53d830


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33654] asyncio: transports don't support switching between Protocol and BufferedProtocol

2018-05-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +6833

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29463] Add `docstring` field to AST nodes

2018-05-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 73cbe7a01a22d02dbe1ec841e8779c775cad3d08 by Serhiy Storchaka in 
branch 'master':
bpo-32911: Revert bpo-29463. (GH-7121) (GH-7197)
https://github.com/python/cpython/commit/73cbe7a01a22d02dbe1ec841e8779c775cad3d08


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32911] Doc strings no longer stored in body of AST

2018-05-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 73cbe7a01a22d02dbe1ec841e8779c775cad3d08 by Serhiy Storchaka in 
branch 'master':
bpo-32911: Revert bpo-29463. (GH-7121) (GH-7197)
https://github.com/python/cpython/commit/73cbe7a01a22d02dbe1ec841e8779c775cad3d08


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33666] Document removal of os.errno

2018-05-29 Thread Petr Viktorin


Petr Viktorin  added the comment:

Nothing there strikes me to be as prevalent or as discoverable as os.errno.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33654] asyncio: transports don't support switching between Protocol and BufferedProtocol

2018-05-29 Thread miss-islington


miss-islington  added the comment:


New changeset be5d616e5529a1388a0b451bf6a65ad5bdb70d29 by Miss Islington (bot) 
in branch '3.7':
bpo-33654: Support protocol type switching in SSLTransport.set_protocol() 
(GH-7194)
https://github.com/python/cpython/commit/be5d616e5529a1388a0b451bf6a65ad5bdb70d29


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33666] Document removal of os.errno

2018-05-29 Thread INADA Naoki


INADA Naoki  added the comment:

Even if it is documented, arn't people know it by running their code on Python 
3.7?  How the document help them?
It's very easy to know `errno` module when find ImportError.  And it's much 
easier than checking "waht's new" document.  So I doubt it's worth.

And if people see the document, people may think "all removed subimports should 
be documented" although only os.errno is special.

If document os.errno removal, please note about all undocumented subimports are 
implementation detail and will be removed without any timing, even on micro 
version.  (We will remove subimports for various reasons; avoiding huge 
unnecessary dependency, fixing regression caused by circular imports, etc...)

--
nosy: +inada.naoki

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33197] Confusing error message when constructing invalid inspect.Parameters

2018-05-29 Thread Dong-hee Na


Dong-hee Na  added the comment:

PR 6636 is ready to be merged :)

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27500] ProactorEventLoop cannot open connection to ::1

2018-05-29 Thread Sebastien Bourdeauducq


Sebastien Bourdeauducq  added the comment:

Any chance someone could look into this bug?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33666] Document removal of os.errno

2018-05-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Actually removing re._pattern_type, uuid._uuid_generate_time and some private 
names in the typing module broke several third-party projects. See for example:

https://github.com/search?q=_pattern_type&type=Issues
https://github.com/search?q=_uuid_generate_time&type=Issues
https://github.com/bintoro/overloading.py/issues/5
https://github.com/hsolbrig/PyShEx/issues/17

I'm sure there are examples for other removed names. I don't understand why 
os.errno should be special.

Books can contain errors (e.g. the claim that Python 3 is not Turing complete).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33666] Document removal of os.errno

2018-05-29 Thread Petr Viktorin


Petr Viktorin  added the comment:

> Even if it is documented, arn't people know it by running their code on 
> Python 3.7?  How the document help them?

"What's new" is the right place to check if something breaks for you on Python 
3.7. Let's make it useful.

> It's very easy to know `errno` module when find ImportError.  And it's much 
> easier than checking "waht's new" document.  So I doubt it's worth.

I disagree. Sure, some people will find answers on Stack Overflow or blog 
posts, but all those should link to official docs.

> And if people see the document, people may think "all removed subimports 
> should be documented" although only os.errno is special.
> If document os.errno removal, please note about all undocumented subimports 
> are implementation detail and will be removed without any timing, even on 
> micro version.  (We will remove subimports for various reasons; avoiding huge 
> unnecessary dependency, fixing regression caused by circular imports, etc...)

+1. Let's make that the main point. Something like the text below?

Several undocumented internal imports were removed. One example is that 
`os.errno` is no longer available; use `import errno` directly instead.
Note that such undocumented internal imports may be removed any time without 
notice, even in micro version releases.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33666] Document removal of os.errno

2018-05-29 Thread Petr Viktorin


Petr Viktorin  added the comment:

> Actually removing re._pattern_type, uuid._uuid_generate_time and some private 
> names in the typing module broke several third-party projects.

Those have underscores; that explicitly marks them as private/use at your own 
risk/will break in future versions.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33678] selector_events.BaseSelectorEventLoop.sock_connect should preserve socket type

2018-05-29 Thread Sebastien Bourdeauducq


New submission from Sebastien Bourdeauducq :

The current behavior causes an exception to be raised when trying to create a 
datagram socket and _ipaddr_info returns None (since asyncio then calls 
loop.getaddrinfo with SOCK_STREAM and IPPROTO_UDP).

Preserving socket type is made difficult by https://bugs.python.org/issue21327; 
the proposed patch includes a dirty workaround. I do not know yet if it works 
on Windows.

--- selector_events.py  2018-05-11 10:01:42.011164837 +0800
+++ selector_events.py.new  2018-05-29 17:41:03.103155480 +0800
@@ -439,8 +439,9 @@
 raise ValueError("the socket must be non-blocking")
 
 if not hasattr(socket, 'AF_UNIX') or sock.family != socket.AF_UNIX:
+socktype = sock.type & 0xf  # WA https://bugs.python.org/issue21327
 resolved = base_events._ensure_resolved(
-address, family=sock.family, proto=sock.proto, loop=self)
+address, family=sock.family, type=socktype, proto=sock.proto, 
loop=self)
 if not resolved.done():
 yield from resolved
 _, _, _, _, address = resolved.result()[0]

--
components: asyncio
messages: 318001
nosy: asvetlov, sebastien.bourdeauducq, yselivanov
priority: normal
severity: normal
status: open
title: selector_events.BaseSelectorEventLoop.sock_connect should preserve 
socket type
type: behavior
versions: Python 3.5, Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33678] selector_events.BaseSelectorEventLoop.sock_connect should preserve socket type

2018-05-29 Thread Sebastien Bourdeauducq


Sebastien Bourdeauducq  added the comment:

Windows looks fine.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33674] asyncio: race condition in SSLProtocol

2018-05-29 Thread STINNER Victor


STINNER Victor  added the comment:

I fixed the main issue, so I remove the "release blocker" priority.

--
priority: release blocker -> 

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33674] asyncio: race condition in SSLProtocol

2018-05-29 Thread STINNER Victor


STINNER Victor  added the comment:

> bpo-33674: Pause the transport as early as possible (#7192)
> https://github.com/python/cpython/commit/f295587c45f96b62d24f9a12cef6931b0805f596

Is it ok to always resume reading? Previously reading was only resumed if the 
transport was reading.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33666] Document removal of os.errno

2018-05-29 Thread STINNER Victor


STINNER Victor  added the comment:

I like the idea of a generic sentence explaining that regularly we removed 
aliases to speedup Python startup time can remove aliases on purpose.

msg317876: "Here is a list of all names removed in 3.7 (except modules that was 
removed as a whole): (... long list ...)"

I agree that this list is very long. But I don't think that it would make sense 
to document all these removed symbols (aliases). IHMO it's more unlikely that 
someone gets the re module from "zipfile.re", than getting WeakSet from 
"abc.WeakSet". For "code.argparse", it's similar: the code module is a rarely 
used module, whereas argparse is a commonly used and known module.


My comments on the list.

Is already documented:

* os.stat_float_times: 
https://docs.python.org/dev/whatsnew/3.7.html#api-and-feature-removals
* collections.: 
https://docs.python.org/dev/whatsnew/3.7.html#id3
* token.ASYNC, token.AWAIT, tokenize.ASYNC, tokenize.AWAIT: they became keywords

Should be documented:

* os.errno: errno and os are tighly coupled, for example there is a 
os.strerror() function and OSError exception (named starting with "os") have an 
errno attribute

May be documented:

* inspect.ast: ast and inspect are tighly coupled to inspect code

Should not be documented:

* asyncio.*
* distutils.*
* concurrent.futures.*
* gettext.*

* code.argparse
* doctest.argparse
* profile.os
* ssl.ipaddress
* ssl.re
* ssl.textwrap
* statistics.decimal
* tabnanny.getopt
* zipfile.re

* email.utils.ecre
* functools.MappingProxyType
* functools.WeakKeyDictionary
* locale.collections
* ...

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33666] Document removal of os.errno

2018-05-29 Thread STINNER Victor


STINNER Victor  added the comment:

Petr Viktorin started a thread on python-ideas as well:
https://mail.python.org/pipermail/python-ideas/2018-May/051098.html

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29589] test_asyncio & test_multiprocessing_forkserver failed

2018-05-29 Thread STINNER Victor


STINNER Victor  added the comment:

For the test_asyncio.test_stdin_broken_pipe() failure: see bpo-33531.

For the test_multiprocessing_forkserver.test_ignore() failure: see bpo-33532.

--
nosy: +vstinner

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33532] test_multiprocessing_forkserver: TestIgnoreEINTR.test_ignore() fails on Travis CI

2018-05-29 Thread STINNER Victor


STINNER Victor  added the comment:

> FWIW, Issue29589 seems to be an older example of this failure.

It was a failure on Mageia 5 (Linux) at 2017-02-17:

== CPython 3.6.0 (default, Feb 17 2017, 15:26:31) [GCC 4.9.2]
==   Linux-4.4.13-desktop-1.mga5-x86_64-with-mageia-5-Official little-endian
==   hash algorithm: siphash24 64bit
==  cwd: /home/dima/bin/Python-3.6.0/build/test_python_8244
==  encodings: locale=UTF-8, FS=utf-8
Run tests sequentially
0:00:00 [1/1] test_multiprocessing_forkserver
...
==
ERROR: test_ignore (test.test_multiprocessing_forkserver.TestIgnoreEINTR)
--
Traceback (most recent call last):
  File "/home/dima/bin/Python-3.6.0/Lib/test/_test_multiprocessing.py", line 
3728, in test_ignore
os.kill(p.pid, signal.SIGUSR1)
ProcessLookupError: [Errno 3] No such process

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33679] IDLE: Configurable color on code context

2018-05-29 Thread Cheryl Sabella


New submission from Cheryl Sabella :

Item 9 from #33610:
Reenable user config of context colors

* Add context tag to themes in configuration.
* In codecontext, get theme and context color from configuration.
* Use the colors when creating the context label.
* In timer event, update colors if they have changed.
* Change name of font_timer_event function.
* Modify tests to include colors.

--
assignee: terry.reedy
components: IDLE
messages: 318009
nosy: cheryl.sabella, terry.reedy
priority: normal
severity: normal
status: open
title: IDLE: Configurable color on code context
type: enhancement
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33679] IDLE: Configurable color on code context

2018-05-29 Thread Cheryl Sabella


Change by Cheryl Sabella :


--
keywords: +patch
pull_requests: +6834
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33532] test_multiprocessing_forkserver: TestIgnoreEINTR.test_ignore() fails on Travis CI

2018-05-29 Thread STINNER Victor


STINNER Victor  added the comment:

I am unable to reproduce the issue on Fedora 28 (Linux kernel 4.16.11, glibc 
2.27):

I ran 6 jobs in parallel during 10 minutes:

* 2: ./python -m test test_multiprocessing_forkserver -m test_ignore -F
* 2: ./python -m test test_multiprocessing_forkserver -F
* 2: ./python -m test -j16 -r -F

The system load was around 30 which is very high (my CPU has 8 logicial 
threads, 4 physical cores).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33680] regrtest: re-run failed tests in a subprocess

2018-05-29 Thread STINNER Victor


New submission from STINNER Victor :

The -w option of regrtest (python -m test) re-run failed tests in verbose in 
the current process. Problem: if the test does crash, regrtest doesn't re-run 
following tests, it doesn't write the final tests result (like failing tests, 
total duration, etc.).

To make regrtest tolerant to such crashes, re-run tests should be run in 
verbose mode. The only constraint is to disable buffering on stdout and stderr 
to make sure that stdout and stderr order is kept in pipes. Or maybe stderr 
should be redirected to stdout to avoid ordering issue?

--
components: Tests
messages: 318011
nosy: vstinner
priority: normal
severity: normal
status: open
title: regrtest: re-run failed tests in a subprocess
versions: Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33610] IDLE: Make multiple improvements to CodeContext

2018-05-29 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

For item 9 - #33679

--
dependencies: +IDLE: Configurable color on code context

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33680] regrtest: re-run failed tests in a subprocess

2018-05-29 Thread STINNER Victor


STINNER Victor  added the comment:

A random example of such crash, process killed by faulthandler timeout:
http://buildbot.python.org/all/#/builders/118/builds/65

(...)
394 tests OK.

10 slowest tests:
- test_subprocess: 7 min 13 sec
- test_concurrent_futures: 2 min 47 sec
- test_multiprocessing_spawn: 2 min 29 sec
- test_urllib2net: 1 min 45 sec
- test_multiprocessing_forkserver: 1 min 34 sec
- test_nntplib: 1 min 29 sec
- test_smtpnet: 1 min 23 sec
- test_multiprocessing_fork: 1 min 22 sec
- test_tools: 1 min 19 sec
- test_tokenize: 1 min 13 sec

1 test failed:
test_asyncio

20 tests skipped:
test_dbm_gnu test_devpoll test_epoll test_gdb test_idle test_ioctl
test_msilib test_ossaudiodev test_spwd test_startfile test_tcl
test_tix test_tk test_ttk_guionly test_ttk_textonly test_turtle
test_winconsoleio test_winreg test_winsound test_zipfile64
Re-running failed tests in verbose mode
Re-running test 'test_asyncio' in verbose mode
(...)
test_sock_client_ops (test.test_asyncio.test_events.PollEventLoopTests) ... ok

Timeout (0:15:00)!
Thread 0x00080139a000 (most recent call first):
  File 
"/usr/home/buildbot/python/3.7.koobs-freebsd-current/build/Lib/selectors.py", 
line 415 in select
  File 
"/usr/home/buildbot/python/3.7.koobs-freebsd-current/build/Lib/asyncio/base_events.py",
 line 1713 in _run_once
  File 
"/usr/home/buildbot/python/3.7.koobs-freebsd-current/build/Lib/asyncio/base_events.py",
 line 523 in run_forever
  File 
"/usr/home/buildbot/python/3.7.koobs-freebsd-current/build/Lib/asyncio/base_events.py",
 line 555 in run_until_complete
  File 
"/usr/home/buildbot/python/3.7.koobs-freebsd-current/build/Lib/test/test_asyncio/test_events.py",
 line 2135 in run_loop
  File 
"/usr/home/buildbot/python/3.7.koobs-freebsd-current/build/Lib/test/test_asyncio/test_events.py",
 line 2249 in test_sock_sendfile_mix_with_regular_send
  (...)

test_sock_sendfile_mix_with_regular_send 
(test.test_asyncio.test_events.PollEventLoopTests) ... *** Error code 1
Stop.
make: stopped in /usr/home/buildbot/python/3.7.koobs-freebsd-current/build
program finished with exit code 1
elapsedTime=2612.384935

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33681] itertools.groupby() returned igroup is only callable once

2018-05-29 Thread Med Nezar BELLAZRAK


New submission from Med Nezar BELLAZRAK :

Hello,

So i discovered a small unusual behavior (tracking it down was time-consuming) 
when using itertools.groupby(), i have checked the documentation and it states 
that:

"The returned group is itself an iterator that shares the underlying iterable 
with groupby(). Because the source is shared, when the groupby() object is 
advanced, the previous group is no longer visible. So, if that data is needed 
later, it should be stored as a list"

I do agree with this statement, though i believe a call to igroup successively 
in the same iteration should yield the same result while now it returns the 
correct igroup in the first call while the following call returns an empty list.

Here's a small code snippet that illustrates this behavior:

Code:

import itertools

mylist = [(1,2), (1,3), (2,5)]

for key, igroup in itertools.groupby(mylist, lambda x: x[0]):
print(list(igroup)) # prints the expected igroup
print(list(igroup)) # prints an empty list
print(list(igroup)) # prints an empty list

Output:

[(1, 2), (1, 3)]
[]
[]
[(2, 5)]
[]
[]

Thanks in advance for anyone who works on this issue

--
components: Extension Modules
messages: 318014
nosy: Med Nezar BELLAZRAK
priority: normal
severity: normal
status: open
title: itertools.groupby() returned igroup is only callable once
type: behavior
versions: Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33681] itertools.groupby() returned igroup is only callable once

2018-05-29 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

This is standard behaviour for all iterators. Once you have iterated over them 
once, they are consumed, and iterating over them again returns nothing:

py> it = iter("abc")
py> print(list(it))
['a', 'b', 'c']
py> print(list(it))
[]

--
nosy: +steven.daprano
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33353] test_asyncio: test_sock_sendfile_mix_with_regular_send() hangs on FreeBSD

2018-05-29 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +6835
stage: resolved -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32131] Missing encoding parameter in urllib/parse.py

2018-05-29 Thread Cheryl Sabella


Change by Cheryl Sabella :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> urllib.parse.parse_qsl does not handle unicode data properly

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33670] Use errorlevel of Sphinx main() in Doc\make.bat

2018-05-29 Thread Andrés Delfino

Change by Andrés Delfino :


--
pull_requests: +6836
stage: backport needed -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33682] Optimize the bytecode for float(0) ?

2018-05-29 Thread Stéphane Wirtel

New submission from Stéphane Wirtel :

Hi,

Maybe already discussed with Victor but I think there is no optimization when 
we have this simple case for float(X) and int(X)

Example:

>>> import dis
>>> dis.dis("x = float(0)")
  1   0 LOAD_NAME0 (float)
  2 LOAD_CONST   0 (0)
  4 CALL_FUNCTION1
  6 STORE_NAME   1 (x)
  8 LOAD_CONST   1 (None)
 10 RETURN_VALUE
>>> dis.dis("x = 1 + 1")
  1   0 LOAD_CONST   0 (2)
  2 STORE_NAME   0 (x)
  4 LOAD_CONST   1 (None)
  6 RETURN_VALUE
>>> dis.dis("x = int(0)")
  1   0 LOAD_NAME0 (int)
  2 LOAD_CONST   0 (0)
  4 CALL_FUNCTION1
  6 STORE_NAME   1 (x)
  8 LOAD_CONST   1 (None)
 10 RETURN_VALUE
>>> 


There is an optim for x = 1 + 1

--
messages: 318016
nosy: matrixise, vstinner
priority: normal
severity: normal
status: open
title: Optimize the bytecode for float(0) ?
versions: Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13886] readline-related test_builtin failure

2018-05-29 Thread Xavier de Gaye


Xavier de Gaye  added the comment:

All checks have passed on PR 7133, even on macOs, and the PR is ready to be 
reviewed :-)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33682] Optimize the bytecode for float(0) ?

2018-05-29 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Victor, if you confirm, maybe you could help me for a mentoring for this issue?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33682] Optimize the bytecode for float(0) ?

2018-05-29 Thread STINNER Victor


STINNER Victor  added the comment:

float and int names can be replaced in the current namespace, so you cannot 
implement such optimization :-(

http://fatoptimizer.readthedocs.io/en/latest/optimizations.html#call-pure
http://fatoptimizer.readthedocs.io/en/latest/semantics.html#builtin-functions-replaced-in-the-middle-of-a-function

Example in the REPL:

>>> float=bool
>>> float(0)
False

>>> int=len
>>> int("hello world!")
12

I suggest to close this issue as NOTABUG. You need to implement guards at 
runtime to implement such optimizations without breaking the Python semantics. 
It is exactly what I implemented in my FAT Python project:
https://faster-cpython.readthedocs.io/fat_python.html

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33682] Optimize the bytecode for float(0) ?

2018-05-29 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

I'm sorry, it isn't clear what optimizations for float(X) and int(X) you are 
referring to.

I can only guess that you want to optimize:

float(0)

to use LOAD_CONST 0.0 instead of calling the float() function. If that is what 
you want, we can't do that because float() may have been shadowed or replaced. 
Optimizing 1+1 is safe because it involves only literals and operators, no name 
look-ups.

If that is not what you want, please explain what optimization you are 
referring to.

--
nosy: +steven.daprano

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33682] Optimize the bytecode for float(0) ?

2018-05-29 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33682] Optimize the bytecode for float(0) ?

2018-05-29 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

@Victor, Thanks and you are right, int and float are not keywords of Python, in 
this case, we can override them.

@Steven, in fact, the optimization was, when you see float/int (if they are 
keywords), don't call the function via the bytecode.

Thanks and I close this issue.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33353] test_asyncio: test_sock_sendfile_mix_with_regular_send() hangs on FreeBSD

2018-05-29 Thread STINNER Victor


STINNER Victor  added the comment:

Yury Selivanov made recent changes on sendfile(): bpo-32410, commit 
7165754b6b5f3b7c07050d921fa1c58bba5f0ff1.

I ran the following command on my FreeBSD VM:

  ./python -m test test_asyncio -m '*sendfile*' -v

Results:

* master (commit 73cbe7a01a22d02dbe1ec841e8779c775cad3d08): 22 min 28 sec (!!!)
* PR 7200 with BUF_SIZE = 1 KiB: 47 sec
* PR 7200 with BUF_SIZE = 4 KiB: 12 sec

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33353] test_asyncio: test_sock_sendfile_mix_with_regular_send() hangs on FreeBSD

2018-05-29 Thread STINNER Victor


STINNER Victor  added the comment:

Timing at my previous commit b97de3dd86046ac46567146d86a69d4f78ea09db: 3 min 40 
sec

It seems like Yury's commit 7165754b6b5f3b7c07050d921fa1c58bba5f0ff1 made 
sendfile tests of test_asyncio 6x slower on FreeBSD :-(

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33353] test_asyncio: test_sock_sendfile_mix_with_regular_send() hangs on FreeBSD

2018-05-29 Thread STINNER Victor


STINNER Victor  added the comment:

On my PR 7200, test_sendfile_close_peer_in_the_middle_of_receiving() fails on 
Windows (AppVeyor) :-(

For the SelectorEventLoop, it seems like sock.setsockopt(socket.SOL_SOCKET, 
socket.SO_SNDBUF, 1024) doesn't work as intented: sock.send(<16384 bytes>) 
returns 16384, as the 1024 limit is not taken in account :-(

Same issue for the ProactorEventLoop...

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33597] Compact PyGC_Head

2018-05-29 Thread Eitan Adler


Change by Eitan Adler :


--
nosy: +eitan.adler

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33674] asyncio: race condition in SSLProtocol

2018-05-29 Thread Yury Selivanov


Yury Selivanov  added the comment:

yes, the method is idempotent.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33623] Fix possible SIGSGV when asyncio.Future is created in __del__

2018-05-29 Thread STINNER Victor


STINNER Victor  added the comment:

> Would be great to merge this in 3.7.0.  The change is super safe to merge.

The 3.7rc1 is not supposed to be tagged on the current 3.7 branch?

--
nosy: +vstinner

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33597] Compact PyGC_Head

2018-05-29 Thread STINNER Victor


STINNER Victor  added the comment:

Are you sure that all memory allocators align at least on 8 bytes (to give up 3 
unused bits)? I don't know the answer, it's an open question.

--
nosy: +vstinner

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33597] Compact PyGC_Head

2018-05-29 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

> Are you sure that all memory allocators align at least on 8 bytes (to give up 
> 3 unused bits)?

If they don't then a simple double array will end up unaligned.  It's not 
impossible but extremely unlikely.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33353] test_asyncio: test_sock_sendfile_mix_with_regular_send() hangs on FreeBSD

2018-05-29 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 9551f7719213243fd96c4f284079243773c26b3c by Victor Stinner in 
branch 'master':
bpo-33353: test_asyncio use set_write_buffer_limits() (GH-7200)
https://github.com/python/cpython/commit/9551f7719213243fd96c4f284079243773c26b3c


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33353] test_asyncio: test_sock_sendfile_mix_with_regular_send() hangs on FreeBSD

2018-05-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +6837

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21327] socket.type value changes after using settimeout()

2018-05-29 Thread Yury Selivanov


Yury Selivanov  added the comment:

This issue is resolved in 3.7: https://bugs.python.org/issue32331

--
nosy: +yselivanov
resolution:  -> out of date
stage:  -> resolved
status: open -> closed
superseder:  -> Fix socket.type on OSes with SOCK_NONBLOCK
type:  -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33683] asyncio: sendfile tests ignore SO_SNDBUF on Windows

2018-05-29 Thread STINNER Victor


New submission from STINNER Victor :

Follow-up of bpo-33353: On my PR 7200, 
test_sendfile_close_peer_in_the_middle_of_receiving() failed on Windows 
(AppVeyor) :-(

For the SelectorEventLoop, it seems like sock.setsockopt(socket.SOL_SOCKET, 
socket.SO_SNDBUF, 1024) doesn't work as intented: sock.send(<16384 bytes>) 
returns 16384, as the 1024 limit is not taken in account :-(

Same issue for the ProactorEventLoop...

I'm not sure if it's a bug in asyncio, a bug (limitation) of Windows which 
ignores SO_SNDBUF, or something else...

--
components: Tests, Windows, asyncio
messages: 318031
nosy: asvetlov, paul.moore, steve.dower, tim.golden, vstinner, yselivanov, 
zach.ware
priority: normal
severity: normal
status: open
title: asyncio: sendfile tests ignore SO_SNDBUF on Windows
type: enhancement
versions: Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33353] test_asyncio: test_sock_sendfile_mix_with_regular_send() hangs on FreeBSD

2018-05-29 Thread STINNER Victor


STINNER Victor  added the comment:

"On my PR 7200, test_sendfile_close_peer_in_the_middle_of_receiving() fails on 
Windows (AppVeyor) (...)"

I worked around this bug in my commit 9551f7719213243fd96c4f284079243773c26b3c 
by using a buffer of 128 KiB instead of 64 KiB.

I created the issue bpo-33683 to discuss this weird behaviour.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29326] Blank lines in ._pth file are not ignored

2018-05-29 Thread Malcolm Smith


Malcolm Smith  added the comment:

> I'm not aware of any such issue with .pth files - the underscore in ._pth is 
> deliberate.

An identical issue *does* exist for .pth files. As you can see from examining 
site.addpackage, it does not ignore blank lines as the documentation says. 
Ammar's patch should also be applied.

--
nosy: +Malcolm Smith

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33683] asyncio: sendfile tests ignore SO_SNDBUF on Windows

2018-05-29 Thread STINNER Victor


STINNER Victor  added the comment:

The failure was:

FAIL: test_sendfile_close_peer_in_the_middle_of_receiving 
(test.test_asyncio.test_events.ProactorEventLoopTests)
--
Traceback (most recent call last):
  File "C:\projects\cpython\lib\test\test_asyncio\test_events.py", line 2506, 
in test_sendfile_close_peer_in_the_middle_of_receiving
self.file.tell())
AssertionError: False is not true : 65536

--

In bpo-33353, I worked around the bug in my commit 
9551f7719213243fd96c4f284079243773c26b3c by using a buffer of 128 KiB instead 
of 64 KiB.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3405] Add support for the new data option supported by event generate (Tk 8.5)

2018-05-29 Thread Matthias Kievernagel


Matthias Kievernagel  added the comment:

So I pulled, but it seems the CLA is stuck somewhere. Investigating...

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33353] test_asyncio: test_sock_sendfile_mix_with_regular_send() hangs on FreeBSD

2018-05-29 Thread miss-islington


miss-islington  added the comment:


New changeset 441afbd9c3ae3a9f1d6c985c8aa13e6205ba080b by Miss Islington (bot) 
in branch '3.7':
bpo-33353: test_asyncio use set_write_buffer_limits() (GH-7200)
https://github.com/python/cpython/commit/441afbd9c3ae3a9f1d6c985c8aa13e6205ba080b


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33607] [subinterpreters] Explicitly track object ownership (and allocator).

2018-05-29 Thread Eric Snow


Eric Snow  added the comment:

Note that I wouldn't call this issue absolutely specific to subinterpreters.  
The "ownership" part is, but tracking the allocator has practical application 
under a single interpreter.  I suppose I could split this issue apart.  I 
lumped the two together because I expected the solution would be the same for 
both.  However, that's not necessarily the case.  Would it help to open a 
separate issue for tracking the allocator?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33615] test__xxsubinterpreters crashed on x86 Gentoo Refleaks 3.x

2018-05-29 Thread Eric Snow


Eric Snow  added the comment:

I haven't been able to reproduce the issue thus far.  From the assert in the 
buildbot logs, it's clear that I've decref'ed an object one too many times.  
Given the relevant PR, it's probably something I changed in the channel 
implementation.  It could also be something that wasn't triggered until the 
tests added in the PR.

Any thoughts on what might be common to the 3 failing buildbots, such that 
they're the only ones to hit the assert?

* x86 Gentoo Refleaks 3.x
* ARMv7 Ubuntu 3.x
* PPC64 AIX 3.x

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33684] parse failed for mutibytes characters, encode will show in \xxx

2018-05-29 Thread zhou.ronghua


New submission from zhou.ronghua :

when type this command in windows(xp or win7, all the same):
python -m json.tool xxx.txt xxx.json
if xxx.txt contains Chinese(or other multibytes characters):
if xxx.txt is encoded in ansi, xxx.json will encode Chinese as \xxx, very bad 
to see what they are;
if xxx.txt is encoded in utf8(without bom for most of the time), because with 
no bom, json.tool will think it is encoded in ansi, and decode fail.

as now, utf8 is widely use, set default to utf8 for most of the time when auto 
detect encoding failed

--
messages: 318039
nosy: zhou.ronghua
priority: normal
severity: normal
status: open
title: parse failed for mutibytes characters, encode will show in \xxx

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33684] parse failed for mutibytes characters, encode will show in \xxx

2018-05-29 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
pull_requests: +6838
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33684] parse failed for mutibytes characters, encode will show in \xxx

2018-05-29 Thread zhou.ronghua


Change by zhou.ronghua :


--
components: +Unicode
nosy: +ezio.melotti, vstinner
type:  -> behavior
versions: +Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33656] IDLE: Turn on DPI awareness on Windows

2018-05-29 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

I'm not a Windows expert, but looking that the API description [1] the patch is 
not entirely correct. 

The API takes an integer with 3 valid values, the patch effectively passes the 
value 1 (which means the application claims to be DPI aware, but won't scale 
itself when the DPI changes for some reason).  

The API can fail, but that shouldn't cause an exception as ctypes won't 
automaticly convert error return values to exceptions.

P.S. The pull request seems to contain an unrelated change as well.

[1] 
https://msdn.microsoft.com/en-us/library/windows/desktop/dn302122(v=vs.85).aspx

--
nosy: +ronaldoussoren

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33197] Confusing error message when constructing invalid inspect.Parameters

2018-05-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +6839

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33197] Confusing error message when constructing invalid inspect.Parameters

2018-05-29 Thread Yury Selivanov


Yury Selivanov  added the comment:


New changeset a9cab433bbf02f3a1de59d14dc8f583181ffe2d5 by Yury Selivanov 
(Dong-hee Na) in branch 'master':
bpo-33197: Update a error message of invalid inspect.Parameters. (GH-6636)
https://github.com/python/cpython/commit/a9cab433bbf02f3a1de59d14dc8f583181ffe2d5


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33197] Confusing error message when constructing invalid inspect.Parameters

2018-05-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +6840

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33353] test_asyncio: test_sock_sendfile_mix_with_regular_send() hangs on FreeBSD

2018-05-29 Thread Yury Selivanov


Yury Selivanov  added the comment:

> It seems like Yury's commit 7165754b6b5f3b7c07050d921fa1c58bba5f0ff1 made 
> sendfile tests of test_asyncio 6x slower on FreeBSD :-(

Well, yeah, I kind of expected to see a performance regression here.  Before, 
we were reading from a file directly, which is a blocking operation and can 
potentially block the event loop.  Now we're using a thread pool to do the 
read, but its more overhead.

In this case I think we have to do it the *correct* way, even if it means 
sacrificing the performance.  As a workaround, I propose to rise the read 
buffer size to 1Mb.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32622] Implement loop.sendfile

2018-05-29 Thread Yury Selivanov


Yury Selivanov  added the comment:

Closing this issue. Open new ones to track regressions/bugs.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32610] asyncio.all_tasks() should return only non-finished tasks.

2018-05-29 Thread Yury Selivanov


Change by Yury Selivanov :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33623] Fix possible SIGSGV when asyncio.Future is created in __del__

2018-05-29 Thread Yury Selivanov


Change by Yury Selivanov :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33674] asyncio: race condition in SSLProtocol

2018-05-29 Thread Yury Selivanov


Yury Selivanov  added the comment:

Closing this one.  Please open new issues to track regressions.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33469] RuntimeError after closing loop that used run_in_executor

2018-05-29 Thread Yury Selivanov


Change by Yury Selivanov :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33197] Confusing error message when constructing invalid inspect.Parameters

2018-05-29 Thread Dong-hee Na


Change by Dong-hee Na :


--
pull_requests: +6841

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30945] loop.create_server does not detect if the interface is IPv6 enabled

2018-05-29 Thread Yury Selivanov


Yury Selivanov  added the comment:

> asyncio is picking ipv6 because of this code:

> https://github.com/python/cpython/blob/a445feb72902e4a3c5ae712f0c289309e1580d52/Lib/asyncio/base_events.py#L1334-L1340

> despite my host not actually having an ipv6 network hooked up.

Which should be fine; create_server enumerates all addresses and tries to 
connect to each one. IPV6_V6ONLY is only applied to one socket for one IPv6 
address.  I think Antoine's patch is OK.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30945] loop.create_server does not detect if the interface is IPv6 enabled

2018-05-29 Thread Yury Selivanov


Change by Yury Selivanov :


--
pull_requests: +6842
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33197] Confusing error message when constructing invalid inspect.Parameters

2018-05-29 Thread Yury Selivanov


Yury Selivanov  added the comment:


New changeset cb055bcc2bbfa5dcc6b0332305918a2118d9ebbc by Yury Selivanov (Miss 
Islington (bot)) in branch '3.7':
bpo-33197: Update a error message of invalid inspect.Parameters. (GH-6636) 
(GH-7204)
https://github.com/python/cpython/commit/cb055bcc2bbfa5dcc6b0332305918a2118d9ebbc


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33678] selector_events.BaseSelectorEventLoop.sock_connect should preserve socket type

2018-05-29 Thread Yury Selivanov


Yury Selivanov  added the comment:

Can you write a unittest that exposes the bug?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33622] Fix and improve errors handling in the garbage collector

2018-05-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset c4653c9bf159c3919a50f4ced32eef713e7e764e by Serhiy Storchaka in 
branch 'master':
bpo-33622: Add checks for exceptions leaks in the garbage collector. (GH-7126)
https://github.com/python/cpython/commit/c4653c9bf159c3919a50f4ced32eef713e7e764e


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33476] String index out of range in get_group(), email/_header_value_parser.py

2018-05-29 Thread Dong-hee Na


Dong-hee Na  added the comment:

@Cacadril

Please send a pull request(PR) through CPython 
GitHub(https://github.com/python/cpython)

It will be a great experience :)

--
nosy: +corona10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30483] urllib.parse.parse_qsl does not handle unicode data properly

2018-05-29 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

Would you be able to include an example for recreating this?

Looking at the code, it uses the ascii encoding for bytes (which can only 
contain ASCII literal characters) and should not be using that encoding for 
strings.

Thanks!

--
nosy: +cheryl.sabella
stage:  -> test needed
type:  -> behavior
versions: +Python 3.7, Python 3.8 -Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33597] Compact PyGC_Head

2018-05-29 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

Ok, I ran a subset of the benchmarks to record their memory footprint and got 
these results:

master-mem.perf
===

Performance version: 0.6.2
Python version: 3.8.0a0 (64-bit) revision 73cbe7a
Report on Linux-4.15.0-22-generic-x86_64-with-glibc2.9
Number of logical CPUs: 16
Start date: 2018-05-29 16:54:24.964539
End date: 2018-05-29 17:04:05.608437

methane-mem.perf


Performance version: 0.6.2
Python version: 3.8.0a0 (64-bit) revision 16c66ca
Report on Linux-4.15.0-22-generic-x86_64-with-glibc2.9
Number of logical CPUs: 16
Start date: 2018-05-29 17:15:00.936857
End date: 2018-05-29 17:24:33.755119

++-+--+---++
| Benchmark  | master-mem.perf | methane-mem.perf | Change| 
Significance   |
++=+==+===++
| 2to3   | 7121.8 kB   | 6944.4 kB| 1.03x smaller | 
Significant (t=31.59)  |
++-+--+---++
| chameleon  | 15.7 MB | 15.3 MB  | 1.02x smaller | 
Significant (t=24.25)  |
++-+--+---++
| html5lib   | 20.1 MB | 19.4 MB  | 1.04x smaller | 
Significant (t=67.15)  |
++-+--+---++
| json_dumps | 8282.2 kB   | 8021.4 kB| 1.03x smaller | 
Significant (t=234.01) |
++-+--+---++
| json_loads | 7671.2 kB   | 7494.0 kB| 1.02x smaller | 
Significant (t=37.43)  |
++-+--+---++
| pickle | 7883.4 kB   | 7698.6 kB| 1.02x smaller | 
Significant (t=28.64)  |
++-+--+---++
| pickle_pure_python | 7867.4 kB   | 7680.0 kB| 1.02x smaller | 
Significant (t=48.64)  |
++-+--+---++
| sqlalchemy_declarative | 18.4 MB | 17.9 MB  | 1.03x smaller | 
Significant (t=132.47) |
++-+--+---++
| sqlalchemy_imperative  | 17.8 MB | 17.3 MB  | 1.03x smaller | 
Significant (t=128.94) |
++-+--+---++
| tornado_http   | 24.5 MB | 24.0 MB  | 1.02x smaller | 
Significant (t=7.99)   |
++-+--+---++
| unpickle   | 7883.2 kB   | 7694.2 kB| 1.02x smaller | 
Significant (t=31.19)  |
++-+--+---++
| unpickle_pure_python   | 7891.6 kB   | 7699.4 kB| 1.02x smaller | 
Significant (t=63.68)  |
++-+--+---++
| xml_etree_generate | 12.0 MB | 11.5 MB  | 1.04x smaller | 
Significant (t=26.07)  |
++-+--+---++
| xml_etree_iterparse| 11.8 MB | 11.3 MB  | 1.04x smaller | 
Significant (t=146.82) |
++-+--+---++
| xml_etree_parse| 11.6 MB | 11.2 MB  | 1.03x smaller | 
Significant (t=116.08) |
++-+--+---++
| xml_etree_process  | 12.3 MB | 12.0 MB  | 1.02x smaller | 
Significant (t=49.04)  |
++-+--+---++

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33197] Confusing error message when constructing invalid inspect.Parameters

2018-05-29 Thread Yury Selivanov


Yury Selivanov  added the comment:


New changeset 5e9e9db9d9b648d2326e2853dc07377e12498e3f by Yury Selivanov (Miss 
Islington (bot)) in branch '3.6':
bpo-33197: Update a error message of invalid inspect.Parameters. (GH-6636) 
(#7205)
https://github.com/python/cpython/commit/5e9e9db9d9b648d2326e2853dc07377e12498e3f


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33656] IDLE: Turn on DPI awareness on Windows

2018-05-29 Thread Zachary Ware


Zachary Ware  added the comment:

Does Tcl/Tk have a function for this, and/or should we expose this as a 
function in Tkinter?  Do other platforms (macOS, X/Wayland) have similar 
functions?

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22087] asyncio: support multiprocessing (support fork)

2018-05-29 Thread Yury Selivanov


Change by Yury Selivanov :


--
pull_requests: +6843
stage: needs patch -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33353] test_asyncio: test_sock_sendfile_mix_with_regular_send() hangs on FreeBSD

2018-05-29 Thread STINNER Victor


STINNER Victor  added the comment:

With my latest change, all sendfile tests pass in 17 sec on my FreeBSD VM, so I 
think that it's fine. Let's see if this test now always pass on FreeBSD 
buildbots.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32458] test_asyncio: test_start_tls_server_1() fails randomly

2018-05-29 Thread Yury Selivanov


Yury Selivanov  added the comment:

Should we close this issue now?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33656] IDLE: Turn on DPI awareness on Windows

2018-05-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Perhaps the argument should be 2 for supporting multi-display configuration. 
Currently I can't do this, but will test this recipe with Hi-DPI monitor and 
multiple displays after 1-2 weeks.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33685] Instances bound methods with different memory addresses but sharing same id

2018-05-29 Thread Marcelo Alves

New submission from Marcelo Alves :

Different instances should have different bound method ids, since they have 
different memory addresses, isn’t it? Example:

I have a class and two instances:

class MyClass:
   def something():
  pass

a = MyClass()
b = MyClass()

If we print `a.something` and `b.something`, we can see that they have 
different memory addresses:

# a.something
>

# b.something
>

This clear indicates that they aren’t the same, and we can confirm that 
comparing both using the `is` operator:

>>> a.something is b.something
False

But the identity of both indicates that they are the same, according with the 
doc of `is` and `id`:

>>> id(a.something)
4350192008

>>> id(b.something)
4350192008

The documentation of `is` says:

The operators is and is not test for object identity: x is y is true if and 
only if x and y are the same object. x is not y yields the inverse truth value. 
[6]

ref: https://docs.python.org/2/reference/expressions.html#is

And the documentation of `id` says:

Return the “identity” of an object. This is an integer (or long integer) which 
is guaranteed to be unique and constant for this object during its lifetime. 
Two objects with non-overlapping lifetimes may have the same id() value.

CPython implementation detail: This is the address of the object in memory.

Thanks!

--
components: Interpreter Core
messages: 318057
nosy: celicoo
priority: normal
severity: normal
status: open
title: Instances bound methods with different memory addresses but sharing same 
id
type: behavior
versions: Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33685] Instances bound methods with different memory addresses but sharing same id

2018-05-29 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

ID numbers in Python are only guaranteed to be unique for the lifespan of the 
object. In CPython they can be re-used. (In other implementations, like Jython 
and IronPython, IDs are allocated as sequential numbers and won't be reused.)

The other fact you may be missing is that method objects are generated on the 
fly each time you look them up. So:


py> class X:
... def method(self): pass
...
py> x = X()
py> a = x.method
py> b = x.method
py> a is b
False

So your example is now understandable: you generate a method object, get its 
ID, and then the method object is garbage collected, allowing the ID to be 
reused. Which *in this case* it is. Whether it is or isn't re-used is an 
accident of implementation.

In other words: nothing to see here. Its not a bug, just the normal behaviour 
of IDs and garbage collection.

--
nosy: +steven.daprano
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32684] asyncio.gather(..., return_exceptions=True) swallows cancellation

2018-05-29 Thread Yury Selivanov


Change by Yury Selivanov :


--
keywords: +patch
pull_requests: +6844
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32684] asyncio.gather(..., return_exceptions=True) swallows cancellation

2018-05-29 Thread Yury Selivanov


Yury Selivanov  added the comment:

Thanks for reporting this. Agree, this is a bug and makes it hard (if not 
impossible) to use gather.  I've created a PR to address the issue.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32684] asyncio.gather(..., return_exceptions=True) swallows cancellation

2018-05-29 Thread Yury Selivanov


Change by Yury Selivanov :


--
versions:  -Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32653] AttributeError: 'Task' object has no attribute '_callbacks'

2018-05-29 Thread Yury Selivanov


Yury Selivanov  added the comment:

Closing this one as I believe it's fixed in all versions.

--
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32662] Implement Server.serve_forever and corresponding APIs

2018-05-29 Thread Yury Selivanov


Change by Yury Selivanov :


--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32751] wait_for(future, ...) should wait for the future (even if a timeout occurs)

2018-05-29 Thread Yury Selivanov


Yury Selivanov  added the comment:

+1 one to fix this in 3.7, Elvis is working on the patch.  

I don't think we should backport to 3.6 though as it's a behaviour change that 
people might not expect to get from a bug-fix release.

--
versions:  -Python 3.5, Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



  1   2   3   >