[issue33605] Detect accessing event loop from a different thread outside of _debug

2018-05-24 Thread Hrvoje Nikšić

Hrvoje Nikšić  added the comment:

I would definitely not propose or condone sacrificing performance.

Part of the reason why I suggested the check is that it can be done efficiently 
- it is literally a comparison of two integers, both of which are obtained 
trivially. I would hope that it doesn't affect performance at all, but only 
measurements will show.

I looked at the implementation of threading.get_ident(), and it looks just as 
one would hope - a cast of pthread_self() to unsigned long, and a call to 
PyLong_FromUnsignedLong. If needed, it might be further improved by caching the 
resulting PyObject * in a __thread variable on platforms that support them, but 
hopefully that is not necessary. (It would require additional code to Py_CLEAR 
the cached PyObject * when the thread exits.) 

> I very doubt that correct asyncio program have problems like this.

That is true by definition, since what we're discussing is incorrect in 
asyncio. But we could be better at diagnosing the incorrect use, and we could 
do so (or so I hope) very efficiently. Failure to emit a diagnostic leads to 
bugs that are discovered much later or never.

As for why people use multi-threading with asyncio, keep in mind that many 
libraries create threads behind the scenes without the user being aware of it. 
Like me, you are a regular at python-asyncio tag, so you've seen those. In some 
cases you can write it off as the user doing something stupid and not reading 
the docs, but in many others, the mistake is far from obvious, especially for 
users who are not (yet) asyncio experts.

--

___
Python tracker 

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



[issue33631] [ValueError] _strptime.py can't handle 12-hr format strings using '0' instead of '12' for noon and midnight

2018-05-24 Thread CatPaw Freed

New submission from CatPaw Freed :

I have to process some data which date was specified in 12-hour format, eg. 
9/24/2017 0:39:41 PM.
I call datetime.datetime.strptime with "%m/%d/%Y %I:%M:%S %p" format.
However, it throws me an error [File "C:\Python27\lib\_strptime.py", line 332, 
in _strptime (data_string, format)) ValueError: time data '9/24/2017 0:39:41 
PM' does not match format '%m/%d/%Y %I:%M:%S %p'].
Then, I found out that, in _strptime.py, the regex patterns are defined as 
below.

'd': r"(?P3[0-1]|[1-2]\d|0[1-9]|[1-9]| [1-9])",
'f': r"(?P[0-9]{1,6})",
'H': r"(?P2[0-3]|[0-1]\d|\d)",
'I': r"(?P1[0-2]|0[1-9]|[1-9])",
'j': 
r"(?P36[0-6]|3[0-5]\d|[1-2]\d\d|0[1-9]\d|00[1-9]|[1-9]\d|0[1-9]|[1-9])",
'm': r"(?P1[0-2]|0[1-9]|[1-9])",
'M': r"(?P[0-5]\d|\d)",
'S': r"(?P6[0-1]|[0-5]\d|\d)",
'U': r"(?P5[0-3]|[0-4]\d|\d)",
'w': r"(?P[0-6])",

I'm a newbie in python world. Is it a bug?
I changed regex pattern of 'I' to r"(?P1[0-2]|0[0-9]|[0-9])" and it works.
I would like to know why 0 is excluded.
May be, I have missed something.

--
messages: 317541
nosy: CatPaw Freed
priority: normal
severity: normal
status: open
title: [ValueError] _strptime.py can't handle 12-hr format strings using '0' 
instead of '12' for noon and midnight
type: crash

___
Python tracker 

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



[issue33631] [ValueError] _strptime.py can't handle 12-hr format strings using '0' instead of '12' for noon and midnight

2018-05-24 Thread Ammar Askar

Ammar Askar  added the comment:

0 is excluded because it is not a valid hour in the 12 hour clock.

0:39pm is not a valid time on a 12 hour clock. After 11am you reach 12pm, then 
1pm. See the table on the right here: 
https://en.wikipedia.org/wiki/12-hour_clock

Your data source is encoding the time incorrectly, see this thread here for 
some solutions: https://stackoverflow.com/a/33317167

--
nosy: +ammar2
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type: crash -> behavior

___
Python tracker 

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



[issue33622] Fix errors handling in the garbage collector

2018-05-24 Thread Antoine Pitrou

Change by Antoine Pitrou :


--
priority: normal -> low

___
Python tracker 

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



[issue33621] repr(threading._DummyThread) always fails.

2018-05-24 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Can you post the actual exception you are getting?

Here I have:

>>> import threading
>>> repr(threading._DummyThread())
'<_DummyThread(Dummy-1, started daemon 140345620215552)>'

--
nosy: +pitrou

___
Python tracker 

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



[issue33627] test-complex of test_numeric_tower.test_complex() crashes intermittently on Ubuntu buildbots

2018-05-24 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Those two builders are using Ubuntu 14.04 specifically (with different CPU 
architectures).  I couldn't reproduce on my 16.04 machine.  Perhaps something 
odd on 14.04?

Do we have builds with Adress Sanatizer or Undefined Behavior Sanitizer?

--
nosy: +gregory.p.smith, pitrou

___
Python tracker 

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



[issue33632] undefined behaviour: signed integer overflow in threadmodule.c

2018-05-24 Thread Antoine Pitrou

New submission from Antoine Pitrou :

Modules/_threadmodule.c:52:47: runtime error: signed integer overflow: 
2387971499048 + 92233720360 cannot be represented in type 'long'

--
components: Library (Lib)
messages: 317545
nosy: pitrou
priority: normal
severity: normal
status: open
title: undefined behaviour: signed integer overflow in threadmodule.c
type: behavior
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



[issue33609] Document that dicts preserve insertion order

2018-05-24 Thread INADA Naoki

Change by INADA Naoki :


--
keywords: +patch
pull_requests: +6729
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



[issue33631] [ValueError] _strptime.py can't handle 12-hr format strings using '0' instead of '12' for noon and midnight

2018-05-24 Thread CatPaw Freed

CatPaw Freed  added the comment:

Thanks for answering my question and giving me a solution.
This issue has been dawned on me that these convention are quite strange. I 
feel confused when thinking of 12:00am/pm vs 0:00am/pm. (@_@) (^~^)

--

___
Python tracker 

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



[issue33462] reversible dict

2018-05-24 Thread INADA Naoki

INADA Naoki  added the comment:

I'm not sure it's worth enough for adding more builtin classes.

Adding builtin class means Python interpreter core makes more fat, slow to 
start, and hard to maintain.

--

___
Python tracker 

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



[issue33462] reversible dict

2018-05-24 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

This change does add built-in types but I think it's a reasonable expectation 
as a python user to be able to do reversed(dict(a=1, b=20) since the order is 
know defined in the specifications. It seems inconsistent to have an order on 
dict, views and not have reversed work on them.

It does increase fat in the interpreter, but the change is really simple and 
does not really increase its complexity or make it really harder to maintain.

--

___
Python tracker 

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



[issue33462] reversible dict

2018-05-24 Thread INADA Naoki

INADA Naoki  added the comment:

> I think it's a reasonable expectation as a python user to be able to do 
> reversed(dict(a=1, b=20) since the order is know defined in the 
> specifications.

I agree about "reasonable expectation".  But I'm interested in is it really 
useful in real world?

> It seems inconsistent to have an order on dict, views and not have reversed 
> work on them.

"Have an order" doesn't mean "reversible".  For example, single linked list is 
ordered, but not reversible.

While CPython implementation can provide efficient __reverse__, adding 
__reverse__ means **all** Python implementation is expected to provide it.
For example, some Python implementation may be able to implement dict with 
hashmap + single linked list.  If __reverse__ is added, it's not possible 
anymore.

"Preserve insertion order" is very useful for many people.  So it's guaranteed.
Then how useful "reversible" in real world, for many people?

--

___
Python tracker 

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



[issue33633] smtplib msg['To] = appends instead of assigning

2018-05-24 Thread Xavier Bonaventura

New submission from Xavier Bonaventura :

The behavior when you assign an email to 'To' is counter intuitive.
When you do:

msg['To'] = 'f...@mail.com'

this appends the email instead of really assigning it.
This is because the assignment operator is overwritten.

Imagine that you have code like this:

msg = MIMEText("The report at *link* has been updated")
for recipient in recipient_list:
msg['To'] = recipient_email
server.sendmail(from_address, recipient_email, msg.as_string())

This will send the email to the first person N times, to the second N-1, etc.

In case that you want to debug, it is also a problem. In case that the append 
is the expected behaviour, one would expect that at least if you do a print 
like this you see the full list.

print(msg['To'])

Instead of that, in this example of code:
msg['To'] = 'f...@mail.com'
msg['To'] = 'f...@mail.com'
print(msg['To'])

It will print:
f...@mail.com

But the message will be sent two times.

--
components: Library (Lib)
messages: 317550
nosy: Xavier Bonaventura
priority: normal
severity: normal
status: open
title: smtplib msg['To] = appends instead of assigning
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue33462] reversible dict

2018-05-24 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

>> I think it's a reasonable expectation as a python user to be able to do 
>> reversed(dict(a=1, b=20) since the order is know defined in the 
>> specifications.

> I agree about "reasonable expectation".  But I'm interested in is it really 
> useful in real world?

I do agree it's certainly used than the conservation of order but it's not 
useless either. For example, it could help to get the latest section defined in 
a YAML or INI file once parsed. 

>> It seems inconsistent to have an order on dict, views and not have reversed 
>> work on them.

> "Have an order" doesn't mean "reversible".  For example, single linked list 
> is ordered, but not reversible.

> While CPython implementation can provide efficient __reverse__, adding 
> __reverse__ means **all** Python implementation is expected to provide it.
> For example, some Python implementation may be able to implement dict with 
> hashmap + single linked list.  If __reverse__ is added, it's not possible 
> anymore.

Indeed they would have to use a double-linked-list here.

> "Preserve insertion order" is very useful for many people.  So it's 
> guaranteed.
> Then how useful "reversible" in real world, for many people?

While this is true, the same argument could be said about the dict views. Many 
many people don't know about them but they are still an interesting feature 
that has its place in the standard library.

It definitely won't be the most used feature in Python nor a killer feature but 
it seemed important enough to be included in OrderedDict 
(https://github.com/python/cpython/blob/master/Lib/collections/__init__.py#L63) 
since 3.5 and a C implementation of OrderedDict has been added in the same 
release so it seems to have mattered at the time.

Having this feature in the built-in dicts could actually help to simplify the 
implementation of the collections module in this case.

--

___
Python tracker 

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



[issue33621] repr(threading._DummyThread) always fails.

2018-05-24 Thread Fabio Zadrozny

Fabio Zadrozny  added the comment:

Python 3.6.0 |Continuum Analytics, Inc.| (default, Dec 23 2016, 11:57:41) [MSC 
v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import threading
>>> repr(threading._DummyThread())
Traceback (most recent call last):
  File "", line 1, in 
  File "C:\tools\Miniconda\envs\pyqt5\lib\threading.py", line 819, in __repr__
self.is_alive() # easy way to get ._is_stopped set when appropriate
  File "C:\tools\Miniconda\envs\pyqt5\lib\threading.py", line 1115, in is_alive
self._wait_for_tstate_lock(False)
  File "C:\tools\Miniconda\envs\pyqt5\lib\threading.py", line 1071, in 
_wait_for_tstate_lock
assert self._is_stopped
AssertionError

--

___
Python tracker 

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



[issue33621] repr(threading._DummyThread) always fails.

2018-05-24 Thread Fabio Zadrozny

Fabio Zadrozny  added the comment:

Actually, I tried on a more recent version of Python 3.6 (3.6.5) and it doesn't 
happen there (so, just happens in 3.6.0 -- i.e.: in the old conda env I had 
around).

Sorry for the noise. Closing issue as it's already fixed.

--
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



[issue33632] undefined behaviour: signed integer overflow in threadmodule.c

2018-05-24 Thread Martin Panter

Martin Panter  added the comment:

Looks like this is what my thread.patch was fixing in 
. You’re welcome to use my patch, 
but I won’t have time to work on it myself.

--
nosy: +martin.panter

___
Python tracker 

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



[issue33462] reversible dict

2018-05-24 Thread INADA Naoki

INADA Naoki  added the comment:

> Rémi Lapeyre  added the comment:

> >> I think it's a reasonable expectation as a python user to be able to
do reversed(dict(a=1, b=20) since the order is know defined in the
specifications.

> > I agree about "reasonable expectation".  But I'm interested in is it
really useful in real world?

> I do agree it's certainly used than the conservation of order but it's
not useless either. For example, it could help to get the latest section
defined in a YAML or INI file once parsed.

For rare cases, OrderedDict can be used.

> >> It seems inconsistent to have an order on dict, views and not have
reversed work on them.

> > "Have an order" doesn't mean "reversible".  For example, single linked
list is ordered, but not reversible.

> > While CPython implementation can provide efficient __reverse__, adding
__reverse__ means **all** Python implementation is expected to provide it.
> > For example, some Python implementation may be able to implement dict
with hashmap + single linked list.  If __reverse__ is added, it's not
possible anymore.

> Indeed they would have to use a double-linked-list here.

Doubly linked list is memory inefficient than singly linked list.
And memory efficiency of builtin type is very important, than types in
library like OrderedDict.

> > "Preserve insertion order" is very useful for many people.  So it's
guaranteed.
> > Then how useful "reversible" in real world, for many people?

> While this is true, the same argument could be said about the dict views.
Many many people don't know about them but they are still an interesting
feature that has its place in the standard library.

It's different problem and out of scope of this discussion.

> It definitely won't be the most used feature in Python nor a killer
feature but it seemed important enough to be included in OrderedDict (
https://github.com/python/cpython/blob/master/Lib/collections/__init__.py#L63)
since 3.5 and a C implementation of OrderedDict has been added in the same
release so it seems to have mattered at the time.

OrderedDict is more about "preserving insertion order".  It provides O(1)
`popitem(last=False)` and `move_to_end(last=False)`.
So "Reversible is essential for OrderedDict" is not enough reason for
"Reversible is essential for dict".

> Having this feature in the built-in dicts could actually help to simplify
the implementation of the collections module in this case.

Would you elaborate more?

--

___
Python tracker 

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



[issue33632] undefined behaviour: signed integer overflow in threadmodule.c

2018-05-24 Thread STINNER Victor

STINNER Victor  added the comment:

> Modules/_threadmodule.c:52:47: runtime error: signed integer overflow: 
> 2387971499048 + 92233720360 cannot be represented in type 'long'

How do you reproduce the issue? The thread module should limit the maximum 
timeout to PY_TIMEOUT_MAX. Maybe PY_TIMEOUT_MAX is too big?

--
nosy: +vstinner

___
Python tracker 

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



[issue33625] Disable GIL on getpwnam and getpwuid

2018-05-24 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Functions getpwnam() and getpwuid() are not reentrant. This is not a problem if 
their use is guarded with GIL and extensions don't call them directly. But if 
release GIL, we should use reentrant getpwnam_r() and getpwuid_r() instead. 
There may be an open issue for this, but I can't find it now.

If getpwnam_r() and getpwuid_r() are not available (are there such modern 
platforms?) we should use getpwnam() and getpwuid() without releasing GIL.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue33634] Buildbot configuration issue on Windows7 buildbots

2018-05-24 Thread STINNER Victor

New submission from STINNER Victor :

http://buildbot.python.org/all/#/builders/90/builds/342

D:\cygwin\home\db3l\buildarea\3.6.bolen-windows7\build>"D:\cygwin\home\db3l\buildarea\3.6.bolen-windows7\build\PCbuild\win32\python_d.exe"
  -u -Wd -E -bb -m test  -uall -rwW --slowest --timeout 1200 -j1 -j2 -uall -cpu 
-largefile --timeout 900 
usage: python -m test [options] [test_name1 [test_name2 ...]]
python path/to/Lib/test/regrtest.py [options] [test_name1 [test_name2 ...]]
regrtest.py: error: argument -l/--findleaks: ignored explicit argument 
'argefile'
Pass -h or --help for complete help.

--
components: Tests
messages: 317558
nosy: ned.deily, vstinner, zach.ware
priority: normal
severity: normal
status: open
title: Buildbot configuration issue on Windows7 buildbots
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



[issue33462] reversible dict

2018-05-24 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I concur with Inada. It is a "nice to have" feature, but it has too high cost. 
PR 6827 adds around 300 lines of new code in dictobject.c. Too large for rarely 
used feature. And dictobject.c is critically important, adding new code here 
can make the compiler generating less optimal code for other parts. That is 
besides increasing the maintenance cost.

I may have a case for iterating dict in the reversed order (see issue1), 
but adding three new types requires adding too much boilerplate code. In the 
current form PR 6827 can't be merged, and I don't see a way how to make the 
code much shorter without impact on the current code. :-(

--

___
Python tracker 

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



[issue33462] reversible dict

2018-05-24 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Since there seems to be a consensus about this change being too much, should we 
go back to the first proposal to implement dict.__reversed__ only and not 
reversed for the views, this would greatly reduce the bload or dump the PR as a 
whole ?

--

___
Python tracker 

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



[issue33634] Buildbot configuration issue on Windows7 buildbots

2018-05-24 Thread STINNER Victor

STINNER Victor  added the comment:

Ned comment:

This is a side effect of our attempt to fix the test failures on this 
(Windows7) buildbot caused by "largefile" tests (see 
https://bugs.python.org/issue33355 ).  It should go away once the buildbot 
config gets manually updated.

https://github.com/python/buildmaster-config/pull/34
https://github.com/python/buildmaster-config/pull/35

--

___
Python tracker 

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



[issue30773] async generator receives wrong value when shared between coroutines

2018-05-24 Thread Jan

Jan  added the comment:

I've reproduced the problem also in 3.7 branch.

```
import asyncio

loop = asyncio.get_event_loop()


async def consumer():
while True:
await asyncio.sleep(0)
message = yield
print('received', message)


async def amain():
agenerator = consumer()
await agenerator.asend(None)

fa = asyncio.create_task(agenerator.asend('A'))
fb = asyncio.create_task(agenerator.asend('B'))
await fa
await fb


loop.run_until_complete(amain())
```

Output:
```
received A
received None
```

If the line `await asyncio.sleep(0)` is omitted the output is ok:
```
received A
received B
```

--
nosy: +jan.cespivo
versions: +Python 3.7

___
Python tracker 

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



[issue33462] reversible dict

2018-05-24 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

This would make the feature incomplete and will add a pressure of implementing 
support for dict views. And even one new type adds much bloat.

--

___
Python tracker 

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



[issue33462] reversible dict

2018-05-24 Thread INADA Naoki

INADA Naoki  added the comment:

> Since there seems to be a consensus about this change being too much, should 
> we go back to the first proposal to implement dict.__reversed__ only and not 
> reversed for the views, this would greatly reduce the bload or dump the PR as 
> a whole ?

Since API of builtin type is part of language (not only CPython), I want 
agreement on python-dev before adding it.

--

___
Python tracker 

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



[issue33547] Relative imports do not replace local variables

2018-05-24 Thread Rolf Campbell

Rolf Campbell  added the comment:

Is there any way to use relative imports and explicitly request a sub-module?
>From PEP 328: "import <> is always absolute"

So it sounds like there is no way to duplicate the explicit request for a 
sub-module when using relative imports.

--

___
Python tracker 

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



[issue33635] OSError when using pathlib.Path.rglob() to list device files

2018-05-24 Thread Victor Domingos

New submission from Victor Domingos :

This method fails with an error when it finds a character or block device (like 
those found in /dev on macOS). However, in the same machine, with the same 
Python version, the alternative os.walk() performs basically the same job with 
no errors. I am not sure if that error is the expected behaviour, but I wasn't 
able to find a clear explanation in the docs. Anyway, it seems to me, as a 
user, that the os.walk() error-less behaviour is more desirable.

```
$ python3
Python 3.7.0b4 (v3.7.0b4:eb96c37699, May  2 2018, 04:13:13) 
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> from pathlib import Path
>>> [f for f in Path(os.path.expanduser('/dev')).rglob("*") if f.is_file()]
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 1, in 
  File 
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/pathlib.py", 
line 1344, in is_file
return S_ISREG(self.stat().st_mode)
  File 
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/pathlib.py", 
line 1140, in stat
return self._accessor.stat(self)
OSError: [Errno 9] Bad file descriptor: '/dev/fd/3'
>>> 
```

--
components: Library (Lib)
messages: 317566
nosy: Victor Domingos
priority: normal
severity: normal
status: open
title: OSError when using pathlib.Path.rglob() to list device files
type: crash
versions: Python 3.7

___
Python tracker 

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



[issue33622] Fix errors handling in the garbage collector

2018-05-24 Thread miss-islington

Change by miss-islington :


--
pull_requests: +6730

___
Python tracker 

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



[issue33622] Fix errors handling in the garbage collector

2018-05-24 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 301e3cc8a5bc68c5347ab6ac6f83428000d31ab2 by Serhiy Storchaka in 
branch 'master':
bpo-33622: Fix issues with handling errors in the GC. (GH-7078)
https://github.com/python/cpython/commit/301e3cc8a5bc68c5347ab6ac6f83428000d31ab2


--

___
Python tracker 

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



[issue33622] Fix errors handling in the garbage collector

2018-05-24 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests: +6731

___
Python tracker 

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



[issue33622] Fix errors handling in the garbage collector

2018-05-24 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests: +6732

___
Python tracker 

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



[issue33622] Fix errors handling in the garbage collector

2018-05-24 Thread miss-islington

miss-islington  added the comment:


New changeset 2fe940c727802ad54cff9486c658bc38743f7bfc by Miss Islington (bot) 
in branch '3.7':
bpo-33622: Fix issues with handling errors in the GC. (GH-7078)
https://github.com/python/cpython/commit/2fe940c727802ad54cff9486c658bc38743f7bfc


--
nosy: +miss-islington

___
Python tracker 

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



[issue33530] Implement Happy Eyeball in asyncio

2018-05-24 Thread twisteroid ambassador

Change by twisteroid ambassador :


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

___
Python tracker 

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



[issue33630] test_posix: TestPosixSpawn fails on PPC64 Fedora 3.x

2018-05-24 Thread twisteroid ambassador

Change by twisteroid ambassador :


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

___
Python tracker 

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



[issue33622] Fix errors handling in the garbage collector

2018-05-24 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset f0e04b2ae27a4da940a76ae522f0438f80ce5d5a by Serhiy Storchaka in 
branch '3.6':
[3.6] bpo-33622: Fix issues with handling errors in the GC. (GH-7078) (GH-7095)
https://github.com/python/cpython/commit/f0e04b2ae27a4da940a76ae522f0438f80ce5d5a


--

___
Python tracker 

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



[issue33633] smtplib msg['To] = appends instead of assigning

2018-05-24 Thread Xavier Bonaventura

Xavier Bonaventura  added the comment:

I've seen that in the documentation is quite clear with it. The question would 
be if the print should behave different, it is quite difficult to debug if not.

__setitem__(name, val)
Add a header to the message with field name name and value val. The field is 
appended to the end of the message’s existing fields.

Note that this does not overwrite or delete any existing header with the same 
name. If you want to ensure that the new header is the only one present in the 
message with field name name, delete the field first, e.g.:

del msg['subject']
msg['subject'] = 'Python roolz!'

--

___
Python tracker 

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



[issue28547] Python to use Windows Certificate Store

2018-05-24 Thread Jean-Philippe Landry

Change by Jean-Philippe Landry :


--
resolution:  -> third party
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



[issue33634] Buildbot configuration issue on Windows7 buildbots

2018-05-24 Thread STINNER Victor

STINNER Victor  added the comment:

The configuration change is to fix bpo-33355.

--

___
Python tracker 

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



[issue33636] Unexpected behavior with * and arrays

2018-05-24 Thread nathan rogers

New submission from nathan rogers :

https://repl.it/repls/ColorfulFlusteredPercent

Here you can see the unexpected behavior I was speaking of. This behavior is 
NOT useful compared to the expected behavior. If I reference position 0 in the 
array, I expect position 0 to be appended. The sensible behavior, from my view, 
would be to make n unique values, not n duplicates.

--
messages: 317572
nosy: nanthil
priority: normal
severity: normal
status: open
title: Unexpected behavior with * and arrays
type: behavior
versions: Python 3.7

___
Python tracker 

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



[issue33635] OSError when using pathlib.Path.rglob() to list device files

2018-05-24 Thread Victor Domingos

Change by Victor Domingos :


--
components: +IO, macOS
nosy: +ned.deily, ronaldoussoren

___
Python tracker 

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



[issue33611] Fatal Python error: Py_Initialize: unable to load the file system codec

2018-05-24 Thread STINNER Victor

STINNER Victor  added the comment:

msg317525, s (sm): "Guys, (...)"

In the future please use gender-neutral words such as "folks" and "y'all" 
instead of "guys". Thanks.

--

___
Python tracker 

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



[issue31453] Debian Sid/Buster: Cannot enable TLS 1.0/1.1 with PROTOCOL_TLS

2018-05-24 Thread Christian Heimes

Christian Heimes  added the comment:

The problem no longer affects Python 3.7 and 3.8. It may affects Python 3.6 and 
2.7 if Debian to decide to disable TLS 1.0 and 1.1 again. If Debian uses the 
new OpenSSL 1.1.0 API to disable the protocols, then I have to backport 
https://bugs.python.org/issue32609 to 2.7 and 3.6.

--

___
Python tracker 

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



[issue32947] Support OpenSSL 1.1.1

2018-05-24 Thread Christian Heimes

Christian Heimes  added the comment:

3.7 and 3.8 support OpenSSL 1.1.1-pre7-dev. For 3.6 and 2.7 I have to backport 
some test fixes and documentation.

I prefer to wait until both TLS 1.3 and OpenSSL 1.1.1 have been finalized. Once 
1.1.1 is out, I'll fix the outstanding issues on master and then backport all 
fixes to 3.6 / 2.7.

--
versions:  -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



[issue32706] test_check_hostname() of test_ftplib started to fail randomly

2018-05-24 Thread STINNER Victor

STINNER Victor  added the comment:

Oh. I forgot about this change. The test is still skipped :-(

--

___
Python tracker 

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



[issue33625] Release GIL for grp.getgr{nam, gid} and pwd.getpw{nam, uid}

2018-05-24 Thread William Grzybowski

William Grzybowski  added the comment:

I have updated the PR to used the re-entrant versions.

Let me know what you guys think. Thanks!

--
title: Disable GIL on getpwnam and getpwuid -> Release GIL for 
grp.getgr{nam,gid} and pwd.getpw{nam,uid}

___
Python tracker 

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



[issue33611] Fatal Python error: Py_Initialize: unable to load the file system codec

2018-05-24 Thread STINNER Victor

STINNER Victor  added the comment:

Slava doesn't seem to want to provide any useful information to debug his 
event, whereas Naoki asked multiple times gently. I also dislike Slava's tone 
in answers, trolling Python 3 doesn't help to fix your issue...

There are millions of Python 3 users on Windows, and it's the first time that I 
see this bug on Windows. So it's likely something very specific to your setup.

It's very unlikely a bug in the Windows installer of Python, so I close the 
issue.

--
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



[issue33627] test-complex of test_numeric_tower.test_complex() crashes intermittently on Ubuntu buildbots

2018-05-24 Thread STINNER Victor

STINNER Victor  added the comment:

> Do we have builds with Adress Sanatizer or Undefined Behavior Sanitizer?

Gregory recently added new USBan builders. Example:
http://buildbot.python.org/all/#/builders/135

It's something very new, there are millions of logged warnings :-)

--

___
Python tracker 

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



[issue33636] Unexpected behavior with * and arrays

2018-05-24 Thread Steven D'Aprano

Steven D'Aprano  added the comment:

This is not a bug, it is the documented behaviour: the * operator does not copy 
the lists, it duplicates references to the same list. There's even a FAQ for it:

https://docs.python.org/3/faq/programming.html#how-do-i-create-a-multidimensional-list

--
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



[issue33630] test_posix: TestPosixSpawn fails on PPC64 Fedora 3.x

2018-05-24 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests:  -6734

___
Python tracker 

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



[issue33530] Implement Happy Eyeball in asyncio

2018-05-24 Thread STINNER Victor

Change by STINNER Victor :


--
nosy: +njs

___
Python tracker 

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



[issue32493] UUID Module - FreeBSD build failure

2018-05-24 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +6735
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



[issue33636] Unexpected behavior with * and arrays

2018-05-24 Thread nathan rogers

nathan rogers  added the comment:

Can anyone give me a legitimate answer as to why this would be expected 
behavior? When at any point would you ever need that? 

If the list is local, you already have the thing. If it isn't local, you can 
pass it to a function by reference. So then, why would you ever need N 
references to the same thing?

Are you going to run out? 

Are your functions buying tickets to the reference of my thing show, and you're 
afraid those tickets will run out?

What is this?

--

___
Python tracker 

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



[issue32493] UUID Module - FreeBSD build failure

2018-05-24 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Is AIX big-endian?

On *BSD systems uuid_t is a structure of integers with platform-depending 
endianess. Thus on little-endian platform UUID should be called with the 
bytes_le argument. This doesn't fix test on OpenBSD and NetBSD, but at least 
the result is stable (version=4).

Using bytes_le on Linux breaks tests. Seems uuid_generate_time_safe() always 
returns bytes in big-endian order.

PR 7098 adds _uuid.little_endian which is true on little-endian platforms using 
uuid_create(), and false otherwise. Actually there are many ways of solving 
this problem, the choice of this design was arbitrary. 
_uuid.generate_time_safe() could return a 3-tuple instead of 2-tuple, or there 
could be two separate functions: _uuid.generate_time_safe() and _uuid.create().

--
stage: patch review -> needs patch

___
Python tracker 

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



[issue32493] UUID Module - FreeBSD build failure

2018-05-24 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
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



[issue33636] Unexpected behavior with * and arrays

2018-05-24 Thread nathan rogers

nathan rogers  added the comment:

[[], [], [], [], []] 

How is it expected behavior  in python, that

when I update position 0, 

it decides to update positions 1-infinity as well?

That is nonsense, and there is not a use case for this behavior. If you have 
already created the value, you have the value locally, and don't need 
N-REFERENCES to that thing. When calling functions as well, there will never be 
a time when you need more than 1 reference to the thing. 

How is this useful, and in what context could this ever be intuitive? If this 
is not a bug, it countermands the zen of python on almost every alternate line.

--
status: closed -> open

___
Python tracker 

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



[issue33611] Fatal Python error: Py_Initialize: unable to load the file system codec

2018-05-24 Thread s

s  added the comment:

:)
sure. if you want to close it - it's up to you.
if you however, want to fix it, please tell me what information do you need
me to provide.
I don't think my tone was bad/offensive. ...and it's still  a bug,
regardless of my tone or anything else.
and by the way, I don't like yours tone.

I used brew and pip

bash --version
GNU bash, version 4.4.12(1)-release (x86_64-apple-darwin16.3.0)
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 

which python
/usr/bin/python

env
_system_type=Darwin
OPT=/opt
LANG=en_US.UTF-8
XPC_FLAGS=0x0
DISPLAY=/private/tmp/com.apple.launchd.XNIGqOXCBz/org.macosforge.xquartz:0
rvm_bin_path=/Users//.rvm/bin
TERM_SESSION_ID=781A3902-E266-48B2-8BDF-0114DE0CAC97
rvm_version=1.26.11 (latest)
RUBY_VERSION=ruby-2.2.3
GEM_HOME=/Users//.rvm/gems/ruby-2.2.3
JAVA_HOME=/usr
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.tIfMUtKKFM/Listeners
GVM_ROOT=/Users//.gvm
STDLIB=/usr/local/lib
USER=
RBENV_SHELL=bash
GOPATH=/Users//working/golang/projects
PWD=/Users//working/python/scripts/passman/db
_system_version=10.13
HOME=/Users/
GOROOT=/usr/local/go
LC_CTYPE=en_US.UTF-8
_system_name=OSX
rvm_user_install_flag=1
TERM_PROGRAM=Apple_Terminal
TERM_PROGRAM_VERSION=404
Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.zL9jzzDVzY/Render
_system_arch=x86_64
GEM_PATH=/Users//.rvm/gems/ruby-2.2.3:/Users//.rvm/gems/ruby-2.2.3@global
TMPDIR=/var/folders/g8/xflwp75s5nv0lc4wmhz2t270gn/T/
rvm_stored_umask=0022
rvm_loaded_flag=1
rvm_path=/Users//.rvm
XPC_SERVICE_NAME=0
SHELL=/bin/bash
TERM=xterm-256color
SECURITYSESSIONID=186a7
rvm_prefix=/Users/
SHLVL=2
PYENV_SHELL=bash
PYTHONPATH=/usr/local/lib/python2.7/site-packages
LOGNAME=
LDFLAGS=/usr/local/opt/bison/lib
GOBIN=/usr/local/go/bin
STDINCLUDE=/usr/local/include
MY_RUBY_HOME=/Users//.rvm/rubies/ruby-2.2.3
PATH=/opt/:/usr/local/lib:/usr/local/include:/usr/local/opt/bison/bin:/usr/local/opt/e2fsprogs/sbin:/Users//.pyenv/shims:/Users//.rvm/gems/ruby-2.2.3/bin:/Users//.rvm/gems/ruby-2.2.3@global
/bin:/Users//.rvm/rubies/ruby-2.2.3/bin:/Users//.rbenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/opt/X11/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Applications/Wireshark.app/Contents/MacOS:/Applications/Postgres.app/Contents/Versions/latest/bin/:/Users//.rvm/bin:/usr/local/go/bin:/Users//working/golang/projects:/usr/local/go/bin:/usr/local/include:/opt:/usr/local/lib:/Users//.rvm/bin:/usr/local/go/bin:/usr/local:/opt
IRBRC=/Users//.rvm/rubies/ruby-2.2.3/.irbrc
GOROOT_BOOTSTRAP=/usr/local/go
_=/usr/bin/env

On Thu, May 24, 2018 at 7:27 AM, STINNER Victor 
wrote:

>
> STINNER Victor  added the comment:
>
> Slava doesn't seem to want to provide any useful information to debug his
> event, whereas Naoki asked multiple times gently. I also dislike Slava's
> tone in answers, trolling Python 3 doesn't help to fix your issue...
>
> There are millions of Python 3 users on Windows, and it's the first time
> that I see this bug on Windows. So it's likely something very specific to
> your setup.
>
> It's very unlikely a bug in the Windows installer of Python, so I close
> the issue.
>
> --
> resolution:  -> not a bug
> stage:  -> resolved
> status: open -> closed
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue33611] Fatal Python error: Py_Initialize: unable to load the file system codec

2018-05-24 Thread Ned Deily

Ned Deily  added the comment:

>  PYTHONPATH=/usr/local/lib/python2.7/site-packages

That looks pretty suspicious right there. It's pulling in 2.7 modules. Normally 
you should never need to set PYTHONPATH in a shell initialization script, like 
.profile, rarely elsewhere.

--

___
Python tracker 

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



[issue33396] IDLE: Improve and document help doc viewer

2018-05-24 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Point 1 is #33397.

--

___
Python tracker 

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



[issue33355] Windows 10 buildbot: 15 min timeout on test_mmap.test_large_filesize()

2018-05-24 Thread Ned Deily

Ned Deily  added the comment:

The Windows7 buildbot now runs the test suite with the "largefile" resource 
disabled and no longer timed out on test_mmap.  So that immediate problem is 
now resolved.  Before closing the issue, it would be good to discuss whether we 
should do the same for some of the other Windows buildbots (perhaps allow 
"largefile" only on the buildbot with the most capacity?) and/or disabling 
"largefile" on all Windows CI tests (if not done already).

--
priority: deferred blocker -> high

___
Python tracker 

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



[issue33633] smtplib msg['To] = appends instead of assigning

2018-05-24 Thread R. David Murray

R. David Murray  added the comment:

smtplib doesn't define any behavior for messages.  I presume you are talking 
about the email library?

Vis the print behavior, dict-style lookup is defined to return the first 
matching header.  If you want to see all of them, you can use get_all.  For 
debugging, you should print the whole message, which would show the duplicate 
headers:

>>> from email.message import Message
>>> msg = Message()
>>> msg['To'] = 'a...@xyz.com'
>>> msg['To'] = 'x...@abc.com'
>>> print(msg)
To: a...@xyz.com
To: x...@abc.com



With the new API this is better, at least in terms of debugging:

>>> from email.message import EmailMessage
>>> msg = EmailMessage()
>>> msg['To'] = 'a...@xyz.com'
>>> print(msg)
To: a...@xyz.com


>>> msg['To'] = 'x...@abc.com'
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/rdmurray/python/p38/Lib/email/message.py", line 408, in 
__setitem__
"in a message".format(max_count, name))
ValueError: There may be at most 1 To headers in a message


This can't be changed in the old API for backward compatibility reasons.

--
nosy: +r.david.murray
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



[issue33637] pip cannot build extensions for debug Python

2018-05-24 Thread Ivan Pozdeev

New submission from Ivan Pozdeev :

(the output is for 2.7 head; for master, it's the same save for paths, library 
versions and DeprecationWarning's)

>python.bat -m ensurepip
Running Debug|x64 interpreter...
Looking in links: c:\users\sasha\appdata\local\temp\tmpiysoby
Collecting setuptools
Collecting pip
Installing collected packages: setuptools, pip
Successfully installed pip-10.0.1 setuptools-39.0.1
>python.bat -m pip install scandir
Running Debug|x64 interpreter...
Collecting scandir
  Using cached 
https://files.pythonhosted.org/packages/13/bb/e541b74230bbf7a20a3949a2ee6631be299378a784f5445aa5d0047c192b/scandir-1.7.tar.gz
Installing collected packages: scandir
  Running setup.py install for scandir ... error
Complete output from command 
C:\Users\Sasha\Documents\cpython\PCBuild\amd64\python_d.exe -u -c "import 
setuptools, 
tokenize;__file__='c:\\users\\sasha\\appdata\\local\\temp\\pip-install-xafnbn\\scandir\\setup.py';f=getattr(tokenize,
 'open', open)(__file__);code=f.read().replace('\r\n', 
'\n');f.close();exec(compile(code, __file__, 'exec'))" install --record 
c:\users\sasha\appdata\local\temp\pip-record-gbe0kk\install-record.txt 
--single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build\lib.win-amd64-2.7-pydebug
copying scandir.py -> build\lib.win-amd64-2.7-pydebug
running build_ext
building '_scandir' extension
creating build\temp.win-amd64-2.7-pydebug
creating build\temp.win-amd64-2.7-pydebug\Release
c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\amd64\cl.exe /c 
/nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\Users\Sasha\Documents\cpython\include 
-IC:\Users\Sasha\Documents\cpython\PC /Tc_scandir.c 
/Fobuild\temp.win-amd64-2.7-pydebug\Release\_scandir.obj
_scandir.c
c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\amd64\link.exe 
/DLL /nologo /INCREMENTAL:NO /LIBPATH:C:\Users\Sasha\Documents\cpython\libs 
/LIBPATH:C:\Users\Sasha\Documents\cpython\PCbuild\amd64 
/LIBPATH:C:\Users\Sasha\Documents\cpython\PC\VS9.0\amd64 /EXPORT:init_scandir 
build\temp.win-amd64-2.7-pydebug\Release\_scandir.obj 
/OUT:build\lib.win-amd64-2.7-pydebug\_scandir.pyd 
/IMPLIB:build\temp.win-amd64-2.7-pydebug\Release\_scandir.lib 
/MANIFESTFILE:build\temp.win-amd64-2.7-pydebug\Release\_scandir.pyd.manifest
LINK : fatal error LNK1104: cannot open file 'python27.lib'
error: command 'c:\\Program Files (x86)\\Microsoft Visual Studio 
9.0\\VC\\BIN\\amd64\\link.exe' failed with exit status 1104


Command "C:\Users\Sasha\Documents\cpython\PCBuild\amd64\python_d.exe -u -c 
"import setuptools, 
tokenize;__file__='c:\\users\\sasha\\appdata\\local\\temp\\pip-install-xafnbn\\scandir\\setup.py';f=getattr(tokenize,
 'open', open)(__file__);code=f.read().replace('\r\n', 
'\n');f.close();exec(compile(code, __file__, 'exec'))" install --record 
c:\users\sasha\appdata\local\temp\pip-record-gbe0kk\install-record.txt 
--single-version-externally-managed --compile" failed with error code
1 in c:\users\sasha\appdata\local\temp\pip-install-xafnbn\scandir\



The cause is that distutils' `build_ext` looks at the --debug switch instead of 
the running Python to decide which Python runtime to link against.

A workaround is thus to run setup.py by hand with the --debug switch.


Suggested fix is to split compiler options into optimization options and 
linking options and:

* for debug Python, build without optimizations and against debug C runtime + 
Python runtime regardless of --debug
* for release Python,
* build without optimizations but against release C runtime + Python 
runtime with --debug


Rationale:

* It doesn't make sense to try to build against a different runtime than the 
running Python -- this will always fail because include/lib paths, preprocessor 
directives and such that build_ext generates is for the running Python.
* Must build against the same C runtime that Python uses in any case since 
using two different runtimes will break things, especially in 2.7 that relies 
on stdio.
* Building an extension without optimizations will allow to diagnose problems 
in it. Debug facilities of the runtime like malloc tracking and probably 
tracing will not work, but at least one will see all the variables and call 
hierarchy.

--
components: Distutils
messages: 317589
nosy: Ivan.Pozdeev, dstufft, eric.araujo
priority: normal
severity: normal
status: open
title: pip cannot build extensions for debug Python
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



[issue33636] Unexpected behavior with * and arrays

2018-05-24 Thread Mark Dickinson

Mark Dickinson  added the comment:

@nanthil: If you want to discuss the reasons behind this design decision 
further, I'd suggest asking on one of the mailing lists, e.g. 
https://mail.python.org/mailman/listinfo/python-list

This is not the right forum for this discussion. Please don't re-open this 
issue.

--
nosy: +mark.dickinson
status: open -> closed

___
Python tracker 

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



[issue33174] error building the _sha3 module with Intel 2018 compilers

2018-05-24 Thread William Scullin

William Scullin  added the comment:

Hi Kenneth:

I can recreate this issue on Haswell, Skylake-X, and KNL running SLES 12, Clear 
Linux, and Centos 7.5. I've tried 18.1 and 18.2. It's still present across the 
board with Intel C/C++ 18.0.2.199. On the Centos 7.5.1804 image, the build will 
seemingly complete, but since _sha3 didn't actually compile, the regression 
tests will fail with errors of the form:

$ /dev/shm/testinstall/icc/python/3.6.5/bin/python3 -m test
ERROR:root:code for hash sha3_224 was not found.
Traceback (most recent call last):
  File "/dev/shm/testinstall/icc/python/3.6.5/lib/python3.6/hashlib.py", line 
121, in __get_openssl_constructor
f = getattr(_hashlib, 'openssl_' + name)
AttributeError: module '_hashlib' has no attribute 'openssl_sha3_224'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/dev/shm/testinstall/icc/python/3.6.5/lib/python3.6/hashlib.py", line 
243, in 
globals()[__func_name] = __get_hash(__func_name)
  File "/dev/shm/testinstall/icc/python/3.6.5/lib/python3.6/hashlib.py", line 
128, in __get_openssl_constructor
return __get_builtin_constructor(name)
  File "/dev/shm/testinstall/icc/python/3.6.5/lib/python3.6/hashlib.py", line 
113, in __get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha3_224
ERROR:root:code for hash sha3_256 was not found.
Traceback (most recent call last):
  File "/dev/shm/testinstall/icc/python/3.6.5/lib/python3.6/hashlib.py", line 
121, in __get_openssl_constructor
f = getattr(_hashlib, 'openssl_' + name)
AttributeError: module '_hashlib' has no attribute 'openssl_sha3_256'

...

Searching about, it looks like you may have seen something similar in EasyBuild:

https://github.com/easybuilders/easybuild-easyconfigs/pull/5086

but it doesn't look like the root cause was sussed out.

- William

--

___
Python tracker 

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



[issue32493] UUID Module - FreeBSD build failure

2018-05-24 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests: +6736

___
Python tracker 

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



[issue32493] UUID Module - FreeBSD build failure

2018-05-24 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

PR 7099 is an alternate solution. I uses uuid_enc_be() which is not part of the 
DCE 1.1 RPC specification but exists on all *BSD.


Both solutions gives the same result on *BSD and AIX. I have no idea what 
solution is appropriate for little-endian non-BSD platform (if there is such 
platform supporting uuid_create()).

--

___
Python tracker 

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



[issue33636] Unexpected behavior with * and arrays

2018-05-24 Thread R. David Murray

R. David Murray  added the comment:

I wrote up a response before Mark closed the issue, so despite his excellent no 
discussion suggestion I'm going to post it for the edification of anyone 
reading the issue later rather than waste the work :)

Nathan: this is *long* established behavior of python.  It is baked in to the 
language.  Even if we thought it was a good idea to change it, that cannot be 
done for backward compatibility reasons.

As for why it works the way it does, consider the following (potentially 
useful!) cases:

  > [1, 2] * 5
  [1, 2, 1, 2, 1, 2, 1, 2, 1, 2]
  > [(1, 2)] * 5
  [(1, 20), (1, 20), (1, 20), (1, 20), (1, 20)]

What Python is doing is filling the created list with *copies of the pointers 
to the listed values*, which is much more sensible than creating, say, multiple 
copies in memory of the integers 1 and 2.  That is, you are observing a 
specific, non-intuitive and rarely useful result of a general rule that *is* 
useful and intuitive.  Also note that *even if* we wanted to try to make 
exceptions for "mutable" verses "non-mutable" elements when doing this 
replication, we can't, because there's a difference between 'copy' and 
'deepcopy' in Python, and Python refuses to guess.  So, if you want copies of a 
list, *you* have to make the correct kind of copies for your application.  
Python just copies the pointers like it does for every other type of object 
multiplied into a list.

By the way, when a core dev closes an issue, the convention is that you can 
present an argument for it being reopened, but you don't reopen it yourself.  
(No way for you to know that that is our convention, which is why I'm telling 
you :)  

But as should be clear by now, this is a closed issue and further discussion 
here would be counter-productive for all of us.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue33614] Compilation of Python fails on AMD64 Windows8.1 Refleaks 3.x

2018-05-24 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I think the underlying issue is not fixed still. Adding new symbols in 
python3.def will break this buildbot (as well as users worktrees) again.

--

___
Python tracker 

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



[issue33612] Assertion failure in PyThreadState_Clear

2018-05-24 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Thank you for fixing this Victor!

--

___
Python tracker 

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



[issue33636] Unexpected behavior with * and arrays

2018-05-24 Thread Steven D'Aprano

Steven D'Aprano  added the comment:

Nathan, the bug tracker is not the place to debate Python behaviour. For 
the purposes of the bug tracker, all we need say is that it is 
documented behaviour and not a bug. If you want to change that 
behaviour, there is a process to follow, and asking snarky questions on 
the tracker isn't part of it.

The principle of having multiple references to the same object is 
fundamental to Python, and very often useful. It's how objects are 
passed to functions, it is used for many forms of shared data. Your 
description of object sharing as "nonsense" and having no use-case is 
way off the mark.

But if it makes you feel better, the SPECIFIC example you ran into:

[[]]*5  # makes 5 references to the same [] object

is rarely directly useful itself. It is certainly a "gotcha" that most 
Python programmers will stumble against at one time or another. But the 
behaviour follows from some fundamental designs of the language.

Copying objects is expensive, and often unnecessary. The Python 
interpreter does not automatically make copies of objects. The 
list.__mul__ method cannot know whether you require shallow copies, or 
deep copies, and for the majority of use-cases for list replication, 
copying would be unnecessary. So the * operator simply duplicates 
references. If you want copies, you have to copy the objects yourself.

--

___
Python tracker 

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



[issue33614] Compilation of Python fails on AMD64 Windows8.1 Refleaks 3.x

2018-05-24 Thread Steve Dower

Steve Dower  added the comment:

Considering we didn't change anything in the sources, I wouldn't expect it to 
be fixed.

It doesn't have to block 3.7 if Ned's okay with it, but I'd like to keep this 
open and fix the build scripts.

--
resolution: fixed -> 
stage: resolved -> needs patch
status: closed -> open
versions:  -Python 3.7

___
Python tracker 

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



[issue33614] Compilation of Python fails on AMD64 Windows8.1 Refleaks 3.x

2018-05-24 Thread Ned Deily

Ned Deily  added the comment:

Sorry, I *did* close the issue prematurely; thanks for noticing!

--

___
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-24 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

With #33628 merged, I consider the next priorities to be 5. #22703 (overt bug, 
highest), 7, and 8, to make the feature more usable.

10. is a vague speculative feature that would use get_indent_firstword but 
would actually be for the editor.  Update problem: It requires a representation 
of the structure of the entire code, and any edit could change that.  The 
saving grace of code context is that it only maintains information about the 
invisible lines above the cursor.

More feasible than item 10 would be

14. Block structure navigation: As near as I can tell, Alt-arrowkey is 
currently the same as arrowkey.  Have Alt-Up and Alt-Down move to the next 
block line above or below with the same indent and Alt-Left, Alt-Right move up 
and out (smaller indent) or down and in (larger indent).

15. (Instead of 4b. One font loop for class.) Replace font loop with 
font-change notification by the editor when the editor gets such a notification 
(which is very rare).

16. (Instead of 4a. One font loop for class.)  The current loops update every 
window 10 times a second, which is about the upper limit for a great typist or 
normal scroller.  But only an active editor window needs updating, and there is 
at most 1.  Most checks are wasted.

16A. Replace update loop with notification of visible display changes.  Pro: We 
already monitor key and mouse actions.  Anti: the event loop is simple.

16B. Only run update loop in active window.  Anti: I don't think we currently 
monitor window focus.  Pro: if we don't, we will need to for a multipane, 
multitab IDLE.  (Stopping should be easy: check status before after call in 
callback.  This automatically does a last update after focus gone.)

--

___
Python tracker 

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



[issue33637] pip cannot build extensions for debug Python

2018-05-24 Thread Ivan Pozdeev

Ivan Pozdeev  added the comment:

>one will see all the variables and call hierarchy

and be able to step through the code. With optimizations, the current line 
jumps unpredictably, and some lines can't be visited because they're optimized 
away.

--

___
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-24 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

I've started looking at #22703, more specifically, I've been trying to recreate 
it.  Since the config changes in 3.6/3.7 where the flag was removed from config 
dialog, the code context needs to be turned on explicitly for each editor.  3.5 
has the old behavior.

So, I think the current change would be to add it back to config but with the 
behavior defined in #22703.  

I hope to have a PR within the next few days.

--

___
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-24 Thread Yury Selivanov

Yury Selivanov  added the comment:

> Then we should find what callable is NULL and fix the place where it is 
> called. _PyObject_FastCallDict() should never be called with NULL.

My understanding is that the interpreter is being shutdown and half of the 
objects are freed. We're still holding a reference to *something* in Python 
space and try calling it.  The obvious fix for that is simply avoid capturing 
tracebacks if a Future object is created during finalization of the interpreter 
(it's pointless to capture it anyways at that point).

--

___
Python tracker 

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



[issue30773] async generator receives wrong value when shared between coroutines

2018-05-24 Thread Yury Selivanov

Yury Selivanov  added the comment:

Thanks Jan. Thanks a lot for a short script to reproduce this bug.

The actual problem here is that asynchronous generators don't control their 
'asend' and 'athrow' coroutines in any way. So if you have two of them 
iterating *in parallel* they will cause their asynchronous generator to be in 
an inconsistent state.

The most obvious solution to this problem is to prohibit iterating 
'asend'/'athrow' objects in parallel by throwing an exception.  

Nathaniel, what are your thoughts on this?

--
nosy: +njs

___
Python tracker 

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



[issue30773] async generator receives wrong value when shared between coroutines

2018-05-24 Thread Yury Selivanov

Change by Yury Selivanov :


--
assignee:  -> yselivanov
components: +Interpreter Core -asyncio
priority: normal -> high
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



[issue33638] condition lock not re-acquired

2018-05-24 Thread christof

New submission from christof :

Hello,

I have a simple code which triggers a timeout if a task did not complete

import asyncio

async def task_timeout():
condition = asyncio.Condition()
with await condition:
try:
await asyncio.wait_for(condition.wait(), timeout=4)
except asyncio.TimeoutError as e:
 
print("timeout reached")
# uncomment this line to make the code work
# await asyncio.sleep(0)


f = asyncio.ensure_future(task_timeout())

loop= asyncio.get_event_loop()
loop.run_until_complete(f)

It throws an exception when leaving the scope for the condition because it 
expects the lock to be acquired:

RuntimeError: Lock is not acquired.

If you uncomment the line to sleep, it will work because it will continue in 
the coroutine Condition.wait and call:
 yield from self.acquire() => locks.py line 355

I think this is a bug and that this behaviour is not the expected one.

--
components: asyncio
messages: 317604
nosy: asvetlov, christof, yselivanov
priority: normal
severity: normal
status: open
title: condition lock not re-acquired
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



[issue30773] async generator receives wrong value when shared between coroutines

2018-05-24 Thread Nathaniel Smith

Nathaniel Smith  added the comment:

My thoughts: https://bugs.python.org/issue32526#msg309783

--

___
Python tracker 

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



[issue33355] Windows 10 buildbot: 15 min timeout on test_mmap.test_large_filesize()

2018-05-24 Thread David Bolen

David Bolen  added the comment:

For my buildbots, I suspect win8/win10 should be ok at this point.  Among any 
other changes their local disk appears to be an SSD now, which makes a big 
difference.  I observed steady 250-300MB/s write I/O for the duration of the 
mmap test, for example, so no wonder that test highlights any I/O bottlenecks.  

Those two buildbots are independent so it's more a question of running the 
tests at all versus just on one.

On the other hand, win7/winxp compete on the same host, with traditional disks. 
 So including winxp as a slow windows build together with win7 couldn't hurt, 
although as 2.7 only, winxp runs far fewer tests nowadays.

--

___
Python tracker 

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



[issue30773] async generator receives wrong value when shared between coroutines

2018-05-24 Thread Yury Selivanov

Yury Selivanov  added the comment:

Thanks, I'll look into adding ag_running properly.

--

___
Python tracker 

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



[issue33629] test_importlib creates a coredump on AMD64 FreeBSD 10.x Shared 3.7

2018-05-24 Thread Brett Cannon

Change by Brett Cannon :


--
nosy: +ncoghlan, petr.viktorin

___
Python tracker 

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



[issue33638] condition lock not re-acquired

2018-05-24 Thread christof

christof  added the comment:

In my previous comment, what I want to implement is not a timeout for a task to 
complete but more precisely a timeout triggered if the coroutine was not wake 
up by a notify on the condition.

--

___
Python tracker 

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



[issue22703] Idle Code Context: separate changing current and future editors

2018-05-24 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

[In #33610, msg317601, Cheryl Sabella wrote, copying here:]

I've started looking at #22703, more specifically, I've been trying to recreate 
it.  Since the config changes in 3.6/3.7 where the flag was removed from config 
dialog, the code context needs to be turned on explicitly for each editor.  3.5 
has the old behavior.

So, I think the current change would be to add it back to config but with the 
behavior defined in #22703.  

I hope to have a PR within the next few days.

[ I will respond in a new message after investigating the current situation, 
versus 3 1/2 years ago.]

--
nosy: +cheryl.sabella
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



[issue31453] Debian Sid/Buster: Cannot enable TLS 1.0/1.1 with PROTOCOL_TLS

2018-05-24 Thread Kurt Roeckx

Kurt Roeckx  added the comment:

Note that the version in experimental only supports TLS 1.2 and 1.3 with the 
default config. It's moved from fixed in the code, to the default config file. 
I expect to upload that to unstable "soon", at which point people will be 
affected by this again.

--
nosy: +kroeckx

___
Python tracker 

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



[issue33634] Buildbot configuration issue on Windows7 buildbots

2018-05-24 Thread Zachary Ware

Zachary Ware  added the comment:

This was fixed by https://github.com/python/buildmaster-config/pull/36

--
resolution:  -> fixed
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



[issue33639] Use high-performance os.sendfile() in shutil.copy*

2018-05-24 Thread Giampaolo Rodola'

New submission from Giampaolo Rodola' :

This is a follow up of #25063 and similar to socket.sendfile() (#17552). It 
provides a 20/25% speedup when copying files with shutil.copyfile(), 
shutil.copy() and shutil.copy2(). Differently from #25063 this is used for 
filesystem files only and copyfileobj() is left alone.

Unmerged #26826 is also related to this. I applied #26826 patch and built a 
wrapper around copy_file_range() and the speedup is basically the same. 
Nevertheless, even when #26826 gets merged it probably makes sense to rely on 
sendfile() in case copy_file_range() is not available (it was introduced in 
2016) or the UNIX platform supports file-to-file copy via sendfile(2) (even 
though I'm not aware of any, so this would basically be Linux-only).

Some benchmarks:

$ dd if=/dev/urandom of=/tmp/f1 bs=1K count=128
$ time ./python -m timeit -s 'import shutil; p1 = "/tmp/f1"; p2 = 
"/tmp/f2"' 'shutil.copyfile(p1, p2)'

128K copy
=

--- without patch:

2000 loops, best of 5: 160 usec per loop

real0m2.353s
user0m0.454s
sys 0m1.435s

--- with patch:

2000 loops, best of 5: 187 usec per loop

real0m2.724s
user0m0.627s
sys 0m1.634s

8MB copy


$ dd if=/dev/urandom of=/tmp/f1 bs=1M count=8

--- without patch:

50 loops, best of 5: 9.51 msec per loop

real0m3.392s
user0m0.343s
sys 0m2.478s

--- with patch:

50 loops, best of 5: 7.75 msec per loop

real0m2.878s
user0m0.105s
sys 0m2.187s

512MB copy
==

--- without patch:

1 loop, best of 5: 872 msec per loop

real0m5.574s
user0m0.402s
sys 0m3.115s

--- with patch:

1 loop, best of 5: 646 msec per loop

real0m5.475s
user0m0.037s
sys 0m2.959s

--
components: Library (Lib)
messages: 317611
nosy: StyXman, desbma, facundobatista, giampaolo.rodola, martin.panter, 
ncoghlan, neologix, petr.viktorin, python-dev, r.david.murray, vstinner
priority: normal
severity: normal
stage: patch review
status: open
title: Use high-performance os.sendfile() in shutil.copy*
type: performance
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



[issue33639] Use high-performance os.sendfile() in shutil.copy*

2018-05-24 Thread Giampaolo Rodola'

Change by Giampaolo Rodola' :


--
keywords: +patch
pull_requests: +6737

___
Python tracker 

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



[issue33612] Assertion failure in PyThreadState_Clear

2018-05-24 Thread STINNER Victor

STINNER Victor  added the comment:

> Thank you for fixing this Victor!

You're welcome. It's always a pleasure to remove code!

--

___
Python tracker 

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



[issue33629] test_importlib creates a coredump on AMD64 FreeBSD 10.x Shared 3.7

2018-05-24 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 483000e164ec68717d335767b223ae31b4b720cf by Victor Stinner in 
branch 'master':
bpo-33629: Prevent coredump in test_importlib (GH-7090)
https://github.com/python/cpython/commit/483000e164ec68717d335767b223ae31b4b720cf


--

___
Python tracker 

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



[issue32374] Document that m_traverse for multi-phase initialized modules can be called with m_state=NULL

2018-05-24 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 483000e164ec68717d335767b223ae31b4b720cf by Victor Stinner in 
branch 'master':
bpo-33629: Prevent coredump in test_importlib (GH-7090)
https://github.com/python/cpython/commit/483000e164ec68717d335767b223ae31b4b720cf


--

___
Python tracker 

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



[issue33629] test_importlib creates a coredump on AMD64 FreeBSD 10.x Shared 3.7

2018-05-24 Thread miss-islington

Change by miss-islington :


--
pull_requests: +6738

___
Python tracker 

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



[issue32374] Document that m_traverse for multi-phase initialized modules can be called with m_state=NULL

2018-05-24 Thread miss-islington

Change by miss-islington :


--
pull_requests: +6739

___
Python tracker 

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



[issue33629] test_importlib creates a coredump on AMD64 FreeBSD 10.x Shared 3.7

2018-05-24 Thread miss-islington

Change by miss-islington :


--
pull_requests: +6740

___
Python tracker 

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



[issue32374] Document that m_traverse for multi-phase initialized modules can be called with m_state=NULL

2018-05-24 Thread miss-islington

Change by miss-islington :


--
pull_requests: +6741

___
Python tracker 

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



[issue32374] Document that m_traverse for multi-phase initialized modules can be called with m_state=NULL

2018-05-24 Thread STINNER Victor

STINNER Victor  added the comment:

MultiPhaseExtensionModuleTests.test_bad_traverse() of 
Lib/test/test_importlib/extension/test_loader.py runs the following code:
---
import importlib.util as util
spec = util.find_spec('_testmultiphase')
spec.name = '_testmultiphase_with_bad_traverse'
m = spec.loader.create_module(spec)
---

And then check that the Python "failed": that the exit code is non-zero...

That's a weak test: if the script fails before calling 
spec.loader.create_module(), the test also pass. If the function raises an 
exception but don't crash, the test pass as well.

More generally, I'm not sure about the idea of making sure that doing bad stuff 
with traverse does crash. What is the purpose of the test?

In the meanwhile, I fixed bpo-33629 by adding 
test.support.SuppressCrashReport().

I'm not asking to do something. Maybe it's fine to keep the current test.

--

___
Python tracker 

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



[issue33622] Fix errors handling in the garbage collector

2018-05-24 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 9044cd675902b438bc500908e410382ff48299d8 by Serhiy Storchaka in 
branch '2.7':
[2.7] bpo-33622: Fix issues with handling errors in the GC. (GH-7078) (#7096)
https://github.com/python/cpython/commit/9044cd675902b438bc500908e410382ff48299d8


--

___
Python tracker 

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



[issue31453] Debian Sid/Buster: Cannot enable TLS 1.0/1.1 with PROTOCOL_TLS

2018-05-24 Thread Christian Heimes

Christian Heimes  added the comment:

Thanks Kurt,

which API are you using to disable TLS 1.0 and 1.1? Is it the old 
SSL_CTX_set_options() or the new SSL_CTX_set_min/max_proto_version() API?

--

___
Python tracker 

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



  1   2   >