[issue20239] Allow repeated deletion of unittest.mock.Mock attributes

2019-01-21 Thread Chris Withers


Chris Withers  added the comment:


New changeset 222d303ade8aadf0adcae5190fac603bdcafe3f0 by Chris Withers (Pablo 
Galindo) in branch 'master':
bpo-20239: Allow repeated deletion of unittest.mock.Mock attributes (#11057)
https://github.com/python/cpython/commit/222d303ade8aadf0adcae5190fac603bdcafe3f0


--

___
Python tracker 

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



[issue20239] Allow repeated deletion of unittest.mock.Mock attributes

2019-01-21 Thread miss-islington


Change by miss-islington :


--
pull_requests: +11395

___
Python tracker 

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



[issue20239] Allow repeated deletion of unittest.mock.Mock attributes

2019-01-21 Thread miss-islington


Change by miss-islington :


--
pull_requests: +11395, 11396

___
Python tracker 

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



[issue20239] Allow repeated deletion of unittest.mock.Mock attributes

2019-01-21 Thread miss-islington


Change by miss-islington :


--
pull_requests: +11395, 11396, 11397

___
Python tracker 

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



[issue35772] test_tarfile fails on ppc64le when using tmpfs filesystem

2019-01-21 Thread miss-islington


Change by miss-islington :


--
pull_requests: +11398, 11399

___
Python tracker 

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



[issue35772] test_tarfile fails on ppc64le when using tmpfs filesystem

2019-01-21 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset b2385458ceddaf3d0d91456923716259d3915023 by Victor Stinner in 
branch 'master':
bpo-35772: Fix test_tarfile on ppc64 (GH-11606)
https://github.com/python/cpython/commit/b2385458ceddaf3d0d91456923716259d3915023


--

___
Python tracker 

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



[issue35772] test_tarfile fails on ppc64le when using tmpfs filesystem

2019-01-21 Thread miss-islington


Change by miss-islington :


--
pull_requests: +11398

___
Python tracker 

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



[issue35425] test_eintr fails randomly on AMD64 FreeBSD 10-STABLE Non-Debug 3.7: TypeError: 'int' object is not callable

2019-01-21 Thread STINNER Victor


STINNER Victor  added the comment:

Another recent failure:

https://buildbot.python.org/all/#/builders/167/builds/488

...
test_kqueue (__main__.SelectEINTRTest) ... ok
test_poll (__main__.SelectEINTRTest) ... ok
test_select (__main__.SelectEINTRTest) ... test_all 
(test.test_eintr.EINTRTests) ... 
--- run eintr_tester.py ---
--- eintr_tester.py completed: exit code -14 ---
FAIL

==
FAIL: test_all (test.test_eintr.EINTRTests)
--
Traceback (most recent call last):
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd10.nondebug/build/Lib/test/test_eintr.py",
 line 31, in test_all
self.fail("eintr_tester.py failed")
AssertionError: eintr_tester.py failed

--

___
Python tracker 

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



[issue20239] Allow repeated deletion of unittest.mock.Mock attributes

2019-01-21 Thread Chris Withers


Chris Withers  added the comment:


New changeset d358a8cda75446a8e0b5d99149f709395d5eae19 by Chris Withers (Miss 
Islington (bot)) in branch '3.7':
bpo-20239: Allow repeated deletion of unittest.mock.Mock attributes (GH-11629)
https://github.com/python/cpython/commit/d358a8cda75446a8e0b5d99149f709395d5eae19


--

___
Python tracker 

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



[issue35168] shlex punctuation_chars inconsistency

2019-01-21 Thread Roundup Robot


Change by Roundup Robot :


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



[issue35168] shlex punctuation_chars inconsistency

2019-01-21 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch, patch
pull_requests: +11400, 11401
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



[issue35168] shlex punctuation_chars inconsistency

2019-01-21 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch, patch, patch, patch
pull_requests: +11400, 11401, 11402, 11403
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



[issue35168] shlex punctuation_chars inconsistency

2019-01-21 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch, patch, patch
pull_requests: +11400, 11401, 11402
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



[issue35772] test_tarfile fails on ppc64le when using tmpfs filesystem

2019-01-21 Thread miss-islington


miss-islington  added the comment:


New changeset d1dd6be613381b996b9071443ef081de8e5f3aff by Miss Islington (bot) 
in branch '3.7':
bpo-35772: Fix test_tarfile on ppc64 (GH-11606)
https://github.com/python/cpython/commit/d1dd6be613381b996b9071443ef081de8e5f3aff


--
nosy: +miss-islington

___
Python tracker 

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



[issue35772] test_tarfile fails on ppc64le when using tmpfs filesystem

2019-01-21 Thread STINNER Victor


Change by STINNER Victor :


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



[issue35781] `logger.warn` method is used in "Logging HOWTO" documentation though `logger.warn` method is deprecated in Python 3.7

2019-01-21 Thread Yuuji KAWAMATSU


Yuuji KAWAMATSU  added the comment:

Thank you!
I will create PR.

--
nosy: +Yuuji KAWAMATSU

___
Python tracker 

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



[issue35707] time.sleep() should support objects with __float__

2019-01-21 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

To avoid code duplication, it's tempting to merge _PyTime_FromObject and 
_PyTime_ObjectToDenominator

These two functions almost do the same, but not quite.

--

___
Python tracker 

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



[issue35707] time.sleep() should support objects with __float__

2019-01-21 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

As a late response to msg333416 and msg333547, I don't agree with looking at 
__index__ in _PyTime_FromObject.  

The __index__ method is used when an object can be used as the index for a 
sequence, but should not silently convert to int or float.  See 
.

--
nosy: +ronaldoussoren

___
Python tracker 

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



[issue35707] time.sleep() should support objects with __float__

2019-01-21 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

The motivation for PEP 357 was certainly using an object as the index for a 
sequence, but that's not the only use case.

In fact PEP 357 states "For example, the slot can be used any time Python 
requires an integer internally"

So despite the name __index__, I think that this is now the de facto standard 
for "convert the object (which is some kind of integer) to a Python int without 
loss of precision".

--

___
Python tracker 

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



[issue35794] test_posix.py test failure

2019-01-21 Thread Jeroen Demeyer


New submission from Jeroen Demeyer :

This test was recently added (PR 6332):

def test_no_such_executable(self):
no_such_executable = 'no_such_executable'
try:
pid = posix.posix_spawn(no_such_executable,
[no_such_executable],
os.environ)
except FileNotFoundError as exc:
self.assertEqual(exc.filename, no_such_executable)

On my system, it fails with

PermissionError: [Errno 13] Permission denied: 'no_such_executable'

--
messages: 334123
nosy: jdemeyer
priority: normal
severity: normal
status: open
title: test_posix.py test failure

___
Python tracker 

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



[issue35795] test_pkgutil test_zipapp fail in AMD64 Windows7 SP1 3.x and AMD64 Windows7 SP1 3.7 buildbots

2019-01-21 Thread Pablo Galindo Salgado


New submission from Pablo Galindo Salgado :

test_pkgutil test_zipapp fail in AMD64 Windows7 SP1 3.x and AMD64 Windows7 SP1 
3.7 buildbots:

https://buildbot.python.org/all/#/builders/40/builds/1525
https://buildbot.python.org/all/#/builders/130/builds/636


==
ERROR: test_create_archive_filter_exclude_dir (test.test_zipapp.ZipAppTest)
--
Traceback (most recent call last):
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\tempfile.py", line 
806, in cleanup
_shutil.rmtree(self.name)
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\shutil.py", line 681, 
in rmtree
return _rmtree_unsafe(path, onerror)
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\shutil.py", line 569, 
in _rmtree_unsafe
onerror(os.rmdir, path, sys.exc_info())
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\shutil.py", line 567, 
in _rmtree_unsafe
os.rmdir(path)
OSError: [WinError 145] The directory is not empty: 
'C:\\Users\\Buildbot\\AppData\\Local\\Temp\\tmpe1ubc15t'
==
ERROR: test_create_archive_with_compression (test.test_zipapp.ZipAppTest)
--
Traceback (most recent call last):
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\tempfile.py", line 
806, in cleanup
_shutil.rmtree(self.name)
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\shutil.py", line 681, 
in rmtree
return _rmtree_unsafe(path, onerror)
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\shutil.py", line 569, 
in _rmtree_unsafe
onerror(os.rmdir, path, sys.exc_info())
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\shutil.py", line 567, 
in _rmtree_unsafe
os.rmdir(path)
OSError: [WinError 145] The directory is not empty: 
'C:\\Users\\Buildbot\\AppData\\Local\\Temp\\tmp5wemewtr'
==
ERROR: test_main_only_written_once (test.test_zipapp.ZipAppTest)
--
Traceback (most recent call last):
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\tempfile.py", line 
806, in cleanup
_shutil.rmtree(self.name)
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\shutil.py", line 681, 
in rmtree
return _rmtree_unsafe(path, onerror)
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\shutil.py", line 569, 
in _rmtree_unsafe
onerror(os.rmdir, path, sys.exc_info())
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\shutil.py", line 567, 
in _rmtree_unsafe
os.rmdir(path)
OSError: [WinError 145] The directory is not empty: 
'C:\\Users\\Buildbot\\AppData\\Local\\Temp\\tmp3am6ham9'
==
ERROR: test_main_written (test.test_zipapp.ZipAppTest)
--
Traceback (most recent call last):
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\tempfile.py", line 
806, in cleanup
_shutil.rmtree(self.name)
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\shutil.py", line 681, 
in rmtree
return _rmtree_unsafe(path, onerror)
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\shutil.py", line 569, 
in _rmtree_unsafe
onerror(os.rmdir, path, sys.exc_info())
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\shutil.py", line 567, 
in _rmtree_unsafe
os.rmdir(path)
OSError: [WinError 145] The directory is not empty: 
'C:\\Users\\Buildbot\\AppData\\Local\\Temp\\tmpyg_dqrb3'
--

I have rebuilt older commits that succeded and they now fail, which points to a 
failure in the builder itself. These builders are on the same machine:

kloth-win64

--
components: Tests
messages: 334124
nosy: pablogsal
priority: normal
severity: normal
status: open
title: test_pkgutil test_zipapp  fail in AMD64 Windows7 SP1 3.x and AMD64 
Windows7 SP1 3.7 buildbots
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



[issue35707] time.sleep() should support objects with __float__

2019-01-21 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

Using __index__ here doesn't feel right, although I can't explain why yet.

--

___
Python tracker 

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



[issue35794] test_posix.py test failure

2019-01-21 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Hi,

Thank you for opening the issue. Without providing more information we cannot 
help debugging the issue. Can you provide more information like what is your 
system, What OS, version of python, architecture...etc

Is the only test that fails?

--
nosy: +pablogsal

___
Python tracker 

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



[issue35794] test_posix.py test failure

2019-01-21 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
components: +Tests

___
Python tracker 

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



[issue20239] Allow repeated deletion of unittest.mock.Mock attributes

2019-01-21 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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



[issue35794] test_posix.py test failure

2019-01-21 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

It's a relatively old Gentoo GNU/Linux system:

Linux tamiyo 3.17.7-gentoo #2 SMP PREEMPT Fri Dec 23 18:13:49 CET 2016 x86_64 
Intel(R) Core(TM) i7-2640M CPU @ 2.80GHz GenuineIntel GNU/Linux

The problem occurs when there are directories on $PATH which are not 
accessible. For example, I can reproduce this as follows:

$ env PATH="/root" no_such_executable
env: no_such_executable: Permission denied

> Is the only test that fails?

At least it's the only test related to posix_spawnp() which fails.

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



[issue35707] time.sleep() should support objects with __float__

2019-01-21 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

If __index__ doesn't "feel" right, what do you propose then to fix this issue, 
keeping in mind the concerns of https://bugs.python.org/issue35707#msg333401

--

___
Python tracker 

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



[issue35707] time.sleep() should support objects with __float__

2019-01-21 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

In other words: if we can only use __float__ and __int__, how do we know which 
one to use?

--

___
Python tracker 

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



[issue35794] test_posix.py test failure

2019-01-21 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I think that test should check for PermissionError as well.

--

___
Python tracker 

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



[issue35794] test_posix.py test failure

2019-01-21 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy: +vstinner

___
Python tracker 

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



[issue35707] time.sleep() should support objects with __float__

2019-01-21 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

> If we want to support other numerical types with loss in double rounding

Looking at the existing code, I can already see several double-rounding "bugs" 
in the code, so I wouldn't be too much concerned here...

--

___
Python tracker 

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



[issue35794] test_posix.py test failure

2019-01-21 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
keywords: +patch, patch, patch
pull_requests: +11404, 11405, 11406
stage:  -> patch review

___
Python tracker 

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



[issue35794] test_posix.py test failure

2019-01-21 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue35794] test_posix.py test failure

2019-01-21 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
keywords: +patch, patch
pull_requests: +11404, 11405
stage:  -> patch review

___
Python tracker 

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



[issue35796] time.localtime returns error for negative values

2019-01-21 Thread Mba


New submission from Mba :

Steps to reproduce the bug:
```
>>> import sys
>>> sys.version
'3.6.7 (v3.6.7:6ec5cf24b7, Oct 20 2018, 13:35:33) [MSC v.1900 64 bit (AMD64)]'

>>> import datetime
>>> print(datetime.datetime.now().astimezone().tzinfo)
datetime.timezone(datetime.timedelta(0, 3600), 'Central European Standard Time')

>>> import time
>>> time.localtime(0)
time.struct_time(tm_year=1970, tm_mon=1, tm_mday=1, tm_hour=1, tm_min=0, 
tm_sec=0, tm_wday=3, tm_yday=1, tm_isdst=0)
>>> time.localtime(-1)
Traceback (most recent call last):
  File "", line 1, in 
OSError: [Errno 22] Invalid argument
```

On Ubuntu it works fine:
```
>>> time.localtime(-1)
time.struct_time(tm_year=1970, tm_mon=1, tm_mday=1, tm_hour=0, tm_min=59, 
tm_sec=59, tm_wday=3, tm_yday=1, tm_isdst=0)
```

--
components: Windows
messages: 334132
nosy: mba, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: time.localtime returns error for negative values
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



[issue35796] time.localtime returns error for negative values

2019-01-21 Thread STINNER Victor


STINNER Victor  added the comment:

It's a limitation of the Windows C library. I'm quite sure that Python 2 has a 
the same issue, it shouldn't be a regression.

--
nosy: +vstinner

___
Python tracker 

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



[issue35795] test_pkgutil test_zipapp fail in AMD64 Windows7 SP1 3.x and AMD64 Windows7 SP1 3.7 buildbots

2019-01-21 Thread STINNER Victor


STINNER Victor  added the comment:

Old fixed rmtree issue: bpo-22022, bpo-30334.

This one is different. tempfile calls shutil.rmtree(). The test doesn't call 
rmtree() directly.

--
nosy: +vstinner

___
Python tracker 

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



[issue34814] makesetup: must link C extensions to libpython when compiled in shared mode

2019-01-21 Thread STINNER Victor


STINNER Victor  added the comment:

Another Fedora on Python2:
https://bugzilla.redhat.com/show_bug.cgi?id=1667914

--

___
Python tracker 

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



[issue35707] time.sleep() should support objects with __float__

2019-01-21 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

> In other words: if we can only use __float__ and __int__, how do we know 
> which one to use?

I guess __index__. I've read the definition of object.__index__ in the data 
model documentation, and using __index__ for this conversion is fine. I need to 
educate my sense for when it's right to use this method...

Sorry about the noise.

--

___
Python tracker 

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



[issue35707] time.sleep() should support objects with __float__

2019-01-21 Thread Jeroen Demeyer


Change by Jeroen Demeyer :


--
pull_requests: +11407

___
Python tracker 

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



[issue35707] time.sleep() should support objects with __float__

2019-01-21 Thread Jeroen Demeyer


Change by Jeroen Demeyer :


--
pull_requests: +11407, 11408

___
Python tracker 

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



[issue35707] time.sleep() should support objects with __float__

2019-01-21 Thread Jeroen Demeyer


Change by Jeroen Demeyer :


--
pull_requests: +11407, 11408, 11409

___
Python tracker 

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



[issue35794] test_posix.py test failure

2019-01-21 Thread STINNER Victor


STINNER Victor  added the comment:

To be clear, only os.posix_spawnp() (with "P") fails:

$ PATH=/root ./python -m test -v test_posix 
...
ERROR: test_no_such_executable (test.test_posix.TestPosixSpawnP)
--
Traceback (most recent call last):
  File "/home/vstinner/prog/python/master/Lib/test/test_posix.py", line 1522, 
in test_no_such_executable
pid = self.spawn_func(no_such_executable,
PermissionError: [Errno 13] Permission denied: 'no_such_executable'


Test with os.posix_spawn() is fine:

$ PATH=/root ./python -m test -v test_posix -m 
test.test_posix.TestPosixSpawn.test_no_such_executable
...
test_no_such_executable (test.test_posix.TestPosixSpawn) ... ok
...
Tests result: SUCCESS

--

___
Python tracker 

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



[issue35794] test_posix.py test failure

2019-01-21 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

> Test with os.posix_spawn() is fine:

Indeed, the difference between posix_spawn() and posix_spawnp() is that only 
the latter uses $PATH to look up the executable.

--

___
Python tracker 

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



[issue34294] re module: wrong capturing groups

2019-01-21 Thread Ma Lin


Ma Lin  added the comment:

Original post's bug was introduced in Python 3.7.0

When investigate the code, I found another bug about capturing groups. This bug 
exists since very early version.
regex module doesn't have this bug.

Python 3.4.4 (v3.4.4:737efcadf5a6, Dec 20 2015, 19:28:18) [MSC v.1600 32 bit 
(Intel)] on win32
>>> import re
>>> re.search(r"\b(?=(\t)|(x))x", "a\tx").groups()
('', 'x')

Expected result: (None, 'x')

Python 3.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 23:09:28) [MSC v.1916 64 bit 
(AMD64)] on win32
>>> import regex
>>> regex.search(r"\b(?=(\t)|(x))x", "a\tx").groups()
(None, 'x')

--
title: re.finditer and lookahead bug -> re module: wrong capturing groups

___
Python tracker 

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



[issue35794] test_posix.py test failure

2019-01-21 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset e9b185f2a493cc54f0d49eac44bf21e8d7de2990 by Pablo Galindo in 
branch 'master':
bpo-35794: Catch PermissionError in test_no_such_executable (GH-11635)
https://github.com/python/cpython/commit/e9b185f2a493cc54f0d49eac44bf21e8d7de2990


--

___
Python tracker 

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



[issue35794] test_posix.py test failure

2019-01-21 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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



[issue19660] decorator syntax: allow testlist instead of just dotted_name

2019-01-21 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

There is again some discussion about this at 
https://discuss.python.org/t/why-are-some-expressions-syntax-errors/420

--

___
Python tracker 

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



[issue35797] concurrent.futures.ProcessPoolExecutor does not work in venv on Windows

2019-01-21 Thread Christian Ullrich


New submission from Christian Ullrich :

Using concurrent.futures.ProcessPoolExecutor on Windows fails immediately with 
a lot of exceptions of the "access denied", "file not found", and "invalid 
handle" varieties. Running the script that creates the ProcessPoolExecutor from 
the main system-wide installation works correctly.

Due to Windows' infamous lack of fork(), ProcessPoolExecutor launches its 
worker processes by setting up an inheritable handle to a pipe and passing the 
handle on the command line.

In a venv situation, it appears that the venv's python.exe internally launches 
the parent environment's python.exe and passes on its command line, but not its 
handle table. This sub-subprocess therefore does not have the original handle, 
and may have a different handle at the same index.


Output of the ProcessPoolExecutor example program from the docs when run with 
the main installation:

C:\Daten>py cft.py
112272535095293 is prime: True
112582705942171 is prime: True
112272535095293 is prime: True
115280095190773 is prime: True
115797848077099 is prime: True
1099726899285419 is prime: False


Output when run using a venv:

C:\Daten>pyv\v37\Scripts\python.exe cft.py
Process SpawnProcess-4:
Traceback (most recent call last):
  File "C:\Program Files\Python37\lib\multiprocessing\process.py", line 297, in 
_bootstrap
self.run()
  File "C:\Program Files\Python37\lib\multiprocessing\process.py", line 99, in 
run
self._target(*self._args, **self._kwargs)
  File "C:\Program Files\Python37\lib\concurrent\futures\process.py", line 226, 
in _process_worker
call_item = call_queue.get(block=True)
  File "C:\Program Files\Python37\lib\multiprocessing\queues.py", line 93, in 
get
with self._rlock:
  File "C:\Program Files\Python37\lib\multiprocessing\synchronize.py", line 95, 
in __enter__
return self._semlock.__enter__()
PermissionError: [WinError 5] Access is denied
Process SpawnProcess-5:
Traceback (most recent call last):
  File "C:\Program Files\Python37\lib\multiprocessing\process.py", line 297, in 
_bootstrap
self.run()
  File "C:\Program Files\Python37\lib\multiprocessing\process.py", line 99, in 
run
self._target(*self._args, **self._kwargs)
  File "C:\Program Files\Python37\lib\concurrent\futures\process.py", line 226, 
in _process_worker
call_item = call_queue.get(block=True)
  File "C:\Program Files\Python37\lib\multiprocessing\queues.py", line 93, in 
get
with self._rlock:
  File "C:\Program Files\Python37\lib\multiprocessing\synchronize.py", line 95, 
in __enter__
return self._semlock.__enter__()
PermissionError: [WinError 5] Access is denied
Traceback (most recent call last):
  File "cft.py", line 28, in 
main()
  File "cft.py", line 24, in main
for number, prime in zip(PRIMES, executor.map(is_prime, PRIMES)):
  File "C:\Program Files\Python37\lib\concurrent\futures\process.py", line 476, 
in _chain_from_iterable_of_lists
for element in iterable:
  File "C:\Program Files\Python37\lib\concurrent\futures\_base.py", line 586, 
in result_iterator
yield fs.pop().result()
  File "C:\Program Files\Python37\lib\concurrent\futures\_base.py", line 432, 
in result
return self.__get_result()
  File "C:\Program Files\Python37\lib\concurrent\futures\_base.py", line 384, 
in __get_result
raise self._exception
concurrent.futures.process.BrokenProcessPool: A process in the process pool was 
terminated abruptly while the future was running or pending.

--
assignee: docs@python
components: Documentation, Library (Lib), Windows
messages: 334142
nosy: chrullrich, docs@python, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: concurrent.futures.ProcessPoolExecutor does not work in venv on Windows
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



[issue35798] duplicate SyntaxWarning: "is" with a literal

2019-01-21 Thread Jakub Wilk


New submission from Jakub Wilk :

$ python3.8 -c 'if object() is 42: pass'
:1: SyntaxWarning: "is" with a literal. Did you mean "=="?
:1: SyntaxWarning: "is" with a literal. Did you mean "=="?

I'd like only one copy of this warning, not two.

Tested with git master (e9b185f2a493cc54f0d49eac44bf21e8d7de2990).

--
components: Interpreter Core
messages: 334143
nosy: jwilk, serhiy.storchaka
priority: normal
severity: normal
status: open
title: duplicate SyntaxWarning: "is" with a literal
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



[issue35798] duplicate SyntaxWarning: "is" with a literal

2019-01-21 Thread STINNER Victor


STINNER Victor  added the comment:

The warning has been introduced by bpo-34850: commit 
3bcbedc9f1471d957a30a90f9d1251516b422416.

--
nosy: +vstinner

___
Python tracker 

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



[issue34850] Emit a syntax warning for "is" with a literal

2019-01-21 Thread STINNER Victor


STINNER Victor  added the comment:

The warning is emited twice, see: bpo-35798.

--
nosy: +vstinner

___
Python tracker 

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



[issue35795] test_pkgutil test_zipapp fail in AMD64 Windows7 SP1 3.x and AMD64 Windows7 SP1 3.7 buildbots

2019-01-21 Thread Jeremy Kloth


Jeremy Kloth  added the comment:

This is an old, but recurring issue with Windows and directory tree removal: 
see issue15496

Basically, for stable (Windows) buildbots, directory tree removal needs to go 
through support.rmtree, not any of the stdlib methods for doing so.  In a 
nutshell, the tests need to be changed to do this.  Or, I suppose, we finally 
bite the bullet and incorporate the support.rmtree logic into the stdlib 
somehow.

In other words, the buildbot is fine, the tests are broken.

--
nosy: +jkloth

___
Python tracker 

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



[issue35633] test_eintr fails on AIX since fcntl functions were modified

2019-01-21 Thread Michael Felt


Michael Felt  added the comment:

Done.

> On 1/15/2019 11:23 AM, STINNER Victor wrote:
> I would prefer to simply skip the lockf() test rather than ignoring 
> PermissionError for flock() and lockf() on all platforms. Can you please 
> write a PR for that?
> 
> There is no need to add a NEWS entry, I will add "skip news". If you want to 
> add a NEWS entry, mention at least the fixed test and AIX.

--

___
Python tracker 

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



[issue35788] smtpd.PureProxy and smtpd.MailmanProxy broken by extra kwargs, bytes and more

2019-01-21 Thread R. David Murray


R. David Murray  added the comment:

It is documented as deprecated, but only in the 'seealso' note at the top.  I 
think it would be reasonable to open an issue to add an actual 'deprecated' 
ReST tag to the docs.

For your 1 and 2, the stdlib smtpd forwarding is also blocking; that code 
appears to be copied verbatim from stdlib smtpd.  It needs to be replaced with 
calls to aiosmtplib.  Feel free to submit a PR :)

For your 3, that design is so that you can run the smtpd server as part of a 
non-asyncio application (eg: for testing, which has always been the main 
purpose of this module).  For an asyncio-only application you would not use a 
Controller (unless you wanted to offload the smtp traffic to a different 
thread, of course, then it would be useful :)

--

___
Python tracker 

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



[issue35788] smtpd.PureProxy and smtpd.MailmanProxy broken by extra kwargs, bytes and more

2019-01-21 Thread Samuel Colvin


Samuel Colvin  added the comment:

Thanks for the response.

I've created issues on aiosmtpd for both these things. There are much better 
ways of running the controller than threading, but that's a discussion for 
https://github.com/aio-libs/aiosmtpd/issues/160. I'll try and work on aiosmtpd 
in the future.

Regarding smtpd, please could you respond to:

> More generally I understand the idea of deprecated code that doesn't get 
> updated to conform to latest conventions, but surely if the code exists in 
> the standard lib. it should at least work as it was originally intended or be 
> removed?

Of course, I know part of this is my wish to get my PR merged into cpython, but 
I really don't see any argument for leaving completely broken code in the 
standard library.

Surely either it should be removed before the next minor release or fixed?

I would say PureProxy could still be useful and should be left in place while 
MailmanProxy should be removed.

--

___
Python tracker 

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



[issue35699] distutils cannot find Build Tools 2017 since 3.7.2

2019-01-21 Thread Steve Dower


Steve Dower  added the comment:

There is one buildbot 
(https://buildbot.python.org/all/#builders/40/builds/1524) that started 
randomly failing unrelated tests with this change - usually one of zipapp, 
pkgutil, or zipimport. I don't have any idea what the relationship here is, 
unless the distutils tests have stopped skipping on those machines and are 
affecting some sort of global state (which they shouldn't, and the other tests 
shouldn't be relying on, but here we are).

I haven't looked at the actual tests (from my phone) yet. Anyone have any 
better ideas?

--
nosy: +pablogsal

___
Python tracker 

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



[issue35797] concurrent.futures.ProcessPoolExecutor does not work in venv on Windows

2019-01-21 Thread Steve Dower


Steve Dower  added the comment:

Good catch! I'm surprised we don't have any tests for this, but I guess we 
don't really create any virtual environments in our test suite. A shame nobody 
hit it during RC.

I don't actually know the best fix for this. The venv python.exe script is the 
same as the py.exe launcher, which means neither is passing on inherited 
handles. Any ideas?

--
assignee: docs@python -> 
components:  -Documentation
keywords: +3.7regression
nosy: +davin, eryksun, ned.deily, pitrou -docs@python
priority: normal -> release blocker
stage:  -> test needed
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



[issue35788] smtpd.PureProxy and smtpd.MailmanProxy broken by extra kwargs, bytes and more

2019-01-21 Thread R. David Murray


R. David Murray  added the comment:

The mailman proxy has been abandoned for a long time now, so no fixes there.  I 
have some sympathy to fixing PureProxy, but since the stdlib itself doesn't use 
it, not a lot :)

At some point we will start cleaning up old code (probably a while after 2.7 is 
dead) after going through a release-deprecation-cycle, but that time hasn't 
arrived yet.  smtpd itself will stay because the stdlib test suite uses it, but 
you are right that MailmanProxy can be removed, as well as PrueProxy if we 
don't fix it.

We are not in general going to fix bugs in it that don't impact the stdlib 
itself, but if Barry (or someone else) wants to review and accept the PureProxy 
PR that's fine with me.  I don't myself have time to review it, I'm afraid.

--

___
Python tracker 

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



[issue35788] smtpd.PureProxy and smtpd.MailmanProxy broken by extra kwargs, bytes and more

2019-01-21 Thread Samuel Colvin


Samuel Colvin  added the comment:

Ok. Thanks for your explanation. Makes sense.

--

___
Python tracker 

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



[issue35797] concurrent.futures.ProcessPoolExecutor does not work in venv on Windows

2019-01-21 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

Hmm... Out of curiosity, why is the venv's python.exe not simply a symlink to 
the original python.exe?  What is the point of going through py.exe here?

Also, is this a regression? Otherwise I don't think it has to be a release 
blocker.

--

___
Python tracker 

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



[issue35788] smtpd.PureProxy and smtpd.MailmanProxy broken by extra kwargs, bytes and more

2019-01-21 Thread R. David Murray


R. David Murray  added the comment:

Actually, thinking about it some more, you are right.  If PureProxy doesn't at 
least function according to the current docs it should either be fixed or we 
should deprecate-and-remove it in 3.8 or 3.9 (depending on how strongly people 
feel about the deprecation cycle), and we should remove MailmanProxy.  Feel 
free to open new, targeted issues for these.

--

___
Python tracker 

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



[issue35799] fix or remove smtpd.PureProxy

2019-01-21 Thread Samuel Colvin


New submission from Samuel Colvin :

smtpd.PureProxy.process_message is defined to not receive the extra kwargs 
which it is called with.

It also expects "data" to be str when it's actually bytes.

PureProxy should either be removed for fixed. 

Personally, I think it should be fixed as the fix is pretty simple and 
PureProxy can be very useful.

Created from https://bugs.python.org/issue35788

Happy to create a PR if this is agreed.

--
components: email
messages: 334156
nosy: barry, r.david.murray, samuelcolvin
priority: normal
severity: normal
status: open
title: fix or remove smtpd.PureProxy
type: crash
versions: Python 3.5, 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



[issue35800] remove smtpd.MailmanProxy

2019-01-21 Thread Samuel Colvin


New submission from Samuel Colvin :

smtpd.MailmanProxy is completely broken, it takes the wrong arguments but also 
assumes the existence of a "Mailman" module which doesn't exist.

It should be removed in 3.8 or 3.9.

Created from https://bugs.python.org/issue35788

Happy to create a PR if this is agreed.

--
components: email
messages: 334157
nosy: barry, r.david.murray, samuelcolvin
priority: normal
severity: normal
status: open
title: remove smtpd.MailmanProxy
versions: Python 3.5, 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



[issue35788] smtpd.PureProxy and smtpd.MailmanProxy broken by extra kwargs, bytes and more

2019-01-21 Thread Samuel Colvin


Samuel Colvin  added the comment:

Great, https://bugs.python.org/issue35799 and 
https://bugs.python.org/issue35800 created.

--

___
Python tracker 

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



[issue35797] concurrent.futures.ProcessPoolExecutor does not work in venv on Windows

2019-01-21 Thread Steve Dower


Steve Dower  added the comment:

You can't create symlinks on Windows without additional user permissions, and 
the old method of copying most of the binaries was slow and made DLL hell 
worse, as well as simply not working with the Windows Store model that does not 
let random executables load DLLs from within the app.

Because of the last one, I backported the fix (which is an independent 
executable that launches the correct one with additional context to know it's a 
venv) that was mostly there for 3.8 already. This also fixes the issue where 
upgrading Python would force you to recreate every virtual environment to avoid 
mismatched binary versions (which is also why it wasn't an incompatible change 
- the update was already incompatible).

So all in all, an overall positive change. It's unfortunate that this problem 
slipped through testing, and I assume it's going to exist for many cases using 
handle inheritance. When I get a chance I'll be looking up ways to simply flag 
the new Python process it creates as "inherit everything", but there may be 
other data structures that don't transfer automatically (such as file 
descriptors, which the OS knows nothing about and can't do automatically).

--

___
Python tracker 

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



[issue27035] Cannot set exit code in atexit callback

2019-01-21 Thread Christopher Hunt


Change by Christopher Hunt :


--
nosy: +chrahunt
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



[issue35777] mismatched eval() and ast.literal_eval() behavior with unicode_literals

2019-01-21 Thread jez


jez  added the comment:

I take the point about breaking backward compatibility. The problem, then, is 
in the `ast` documentation, and may not be confined to Python 2.7

The `literal_eval` doc  
states no more than that the function evaluates a "string containing a Python 
literal".  The future statement effectively changes the definition of "a Python 
literal" but of course, as the official `__future__` doc 
 explains, this 
is done for the compilation of each "particular module" in isolation. The 
question is left open whether the occurrence of this term in `ast` 
documentation should be read as "a Python literal (as defined by the ast module 
itself at compile time)",  or "a Python literal (as defined by the caller at 
compile time)".

More generally, future statements effectively change the definition of the term 
"Python syntax", sometimes also simply referred to as "Python".  Unfortunately, 
the `ast` documentation uses these terms loosely throughout, without 
acknowledging that they are mutable. I propose that the `ast` module 
documentation flag cases in which the `ast` module's own definitions of 
"Python" and "Python syntax" may not match those of a caller who has included 
`__future__` statements, leading to unexpected behavior.

I am insufficiently familiar with the full functionality of `ast` to be able to 
identify where this is and is not an issue, except in `literal_eval`, but I can 
see it could in principle affect Python 3.x too.

--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python
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



[issue35797] concurrent.futures.ProcessPoolExecutor does not work in venv on Windows

2019-01-21 Thread Eryk Sun


Eryk Sun  added the comment:

The launchers have inheritance enabled (for the duplicated standard handles, 
which should be made inheritable via SetHandleInformation instead, but that's a 
separate issue). However, multiprocessing doesn't use inheritable handles. 
Spawning processes with inheritance would be a problem in a general-purpose 
library. Instead it depends on either the parent manually duplicating the 
handle to the child or vice versa (via the child opening the parent PID that's 
passed to it). The problem for a virtual environment that's using the launcher 
is the former, where the parent duplicates to the child (e.g. for the SemLock 
semaphore). We need a way to allow multiprocessing to spawn the real python.exe 
instead of the launcher executable that's set as sys.executable.

--

___
Python tracker 

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



[issue35797] concurrent.futures.ProcessPoolExecutor does not work in venv on Windows

2019-01-21 Thread Steve Dower


Steve Dower  added the comment:

> We need a way to allow multiprocessing to spawn the real python.exe instead 
> of the launcher executable that's set as sys.executable.

Got to a computer and had just reached the same conclusion.

Given the environment is inherited, it's easy to do:

>>> import _winapi
>>> import multiprocessing.spawn
>>> multiprocessing.spawn.set_executable(_winapi.GetModuleFileName(0))

This may interfere with others who currently override sys.executable when 
hosting Python, since they'll get their override by default. But changing 
sys.executable to _not_ be the venv one will break anyone who doesn't correctly 
inherit environment variables (specifically, __PYVENV_LAUNCHER__, but this is 
deliberately not documented ;) ). 

Perhaps we just change the multiprocessing default on Windows when 
sys.base_prefix != sys.prefix?

--
assignee:  -> steve.dower

___
Python tracker 

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



[issue35797] concurrent.futures.ProcessPoolExecutor does not work in venv on Windows

2019-01-21 Thread Christian Ullrich


Christian Ullrich  added the comment:

I have two ideas, but no idea if either is remotely feasible:

1. Replicate the launcher's selection logic in multiprocessing and
   avoid the intermediate step via sys.executable. Perhaps put it
   into pythonXX.dll or export it from the launcher executable so
   the C implementation can be shared by both users.

2. Handle the command line argument(s) that control how 
   multiprocessing pulls the handle from the parent process in the
   launcher and perform the operation so the sub-subprocess can in
   turn get it from the launcher.

I had a third one, but it was so crazy I must have preemptively forgotten it.

Finally, I do not think this is a regression in 3.7 (although I have not tested 
it with anything earlier), but unless the implementation of multiprocessing has 
changed radically in 3.7 I cannot see how it could have (not) worked any 
differently before.

On the other hand, venv is essentially the "official" way of installing Python 
applications these days, so the issue should have a high priority for fixing 
anyway.

--

___
Python tracker 

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



[issue35801] venv in 3.7 references python3 executable

2019-01-21 Thread Paul Watson


New submission from Paul Watson :

The documentation for venv in Python 3.7 references using `python3` to run 
venv. I do not find a `python3` executable in the kit.

https://docs.python.org/3.7/library/venv.html#module-venv

--
assignee: docs@python
components: Documentation
messages: 334165
nosy: Paul Watson, docs@python
priority: normal
severity: normal
status: open
title: venv in 3.7 references python3 executable
type: enhancement
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



[issue35699] distutils cannot find Build Tools 2017 since 3.7.2

2019-01-21 Thread Tzu-ping Chung

Tzu-ping Chung  added the comment:

I read a few of the logs, and all errors roots in the same place, when the test 
case tries to remove the tempdir during teardown/cleanup. The Windows (and 
other platforms not supporting directory fds) implementation of rmtree can have 
race conditions if files are added while the directory being walked, causing 
the error.

I don’t know the case of CPython, but Pipenv has a similar problem when running 
concurrent tests with subprocesses. We never solved it (but simply wrap the 
rmtree call inside a try block and look away).

--

___
Python tracker 

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



[issue35797] concurrent.futures.ProcessPoolExecutor does not work in venv on Windows

2019-01-21 Thread Steve Dower


Steve Dower  added the comment:

The first idea makes sense, but because of how we've already architected things 
(and the direction we're trying to rearchitect things) it isn't really that 
feasible.

The second idea could be good. It isn't that hard to make globally named 
handles that can be reopened in the child process, and that avoids the need for 
a coherent inheritance chain of processes. Maybe it could break other scenarios 
that do rely on inheritance though? (But aren't those already broken? All this 
is *just* outside the edge of my experience, so I'd have to try them all out to 
be sure.)

It's a regression in 3.7.2, which is when the venv script changed. As I said, 
updating from 3.7.1 to 3.7.2 was going to change the venv "script" anyway 
(which was just the main Python executable and its binaries), so it should have 
been no more breaking than that. But it was, so I consider it a regression (in 
venv, to be clear, not in multiprocessing).

--

___
Python tracker 

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



[issue35798] duplicate SyntaxWarning: "is" with a literal

2019-01-21 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue35798] duplicate SyntaxWarning: "is" with a literal

2019-01-21 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
keywords: +patch, patch, patch
pull_requests: +11410, 11411, 11412
stage:  -> patch review

___
Python tracker 

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



[issue35798] duplicate SyntaxWarning: "is" with a literal

2019-01-21 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
keywords: +patch, patch
pull_requests: +11410, 11411
stage:  -> patch review

___
Python tracker 

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



[issue35782] Missing whitespace after comma in randrange raise error

2019-01-21 Thread miss-islington


miss-islington  added the comment:


New changeset 2433a2ab705e93f9a44f01c260d351b205a73e9d by Miss Islington (bot) 
(Kumar Akshay) in branch 'master':
bpo-35782: Fix error message in randrange (GH-11620)
https://github.com/python/cpython/commit/2433a2ab705e93f9a44f01c260d351b205a73e9d


--
nosy: +miss-islington

___
Python tracker 

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



[issue35782] Missing whitespace after comma in randrange raise error

2019-01-21 Thread miss-islington


Change by miss-islington :


--
pull_requests: +11413, 11414

___
Python tracker 

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



[issue35782] Missing whitespace after comma in randrange raise error

2019-01-21 Thread miss-islington


Change by miss-islington :


--
pull_requests: +11413

___
Python tracker 

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



[issue35782] Missing whitespace after comma in randrange raise error

2019-01-21 Thread miss-islington


Change by miss-islington :


--
pull_requests: +11413, 11414, 11415

___
Python tracker 

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



[issue35798] duplicate SyntaxWarning: "is" with a literal

2019-01-21 Thread Kumar Akshay


Kumar Akshay  added the comment:

can I work on this?

--
nosy: +kakshay

___
Python tracker 

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



[issue35797] concurrent.futures.ProcessPoolExecutor does not work in venv on Windows

2019-01-21 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

Hmm, if multiprocessing exhibits the problem, I wouldn't be surprised if some 
third-party libraries also do.  I think `sys.executable` should really point to 
the proper executable.

> But changing sys.executable to _not_ be the venv one will break anyone who 
> doesn't correctly inherit environment variables (specifically, 
> __PYVENV_LAUNCHER__, but this is deliberately not documented ;) ). 

Well, it will also break if other environment variables are required, e.g. 
PYTHONPATH.  Usually you want to inherit environment variables (including such 
fundamental stuff such as HOME), because you don't know which ones are actually 
required for a given workload.

So I think "breaking if environment variables are not inherited" is a less 
severe failure mode than this issue is.

--

___
Python tracker 

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



[issue35797] concurrent.futures.ProcessPoolExecutor does not work in venv on Windows

2019-01-21 Thread Steve Dower


Steve Dower  added the comment:

> So I think "breaking if environment variables are not inherited" is a less 
> severe failure mode than this issue is.

ISTR that having sys.executable point to a path outside of sys.prefix breaks 
the site module in some way, so that would move the fix over there. But again, 
going from memory - I'd have to try it (and doubtful that I'm getting to it 
today).

--

___
Python tracker 

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



[issue35797] concurrent.futures.ProcessPoolExecutor does not work in venv on Windows

2019-01-21 Thread Eryk Sun


Eryk Sun  added the comment:

multiprocessing could be redesigned to make the child process responsible for 
duplicating all handles from its logical parent (by PID passed on the command 
line -- regardless of whatever its real parent is). That avoids the problem of 
the parent mistakenly duplicating handles to a launcher child process that has 
no idea that the parent has done this and certainly doesn't have the 
architecture in place to deal with it. 

That said, inserting the launcher process as a middle man for every worker 
process is wasteful. Creating processes without fork is expensive. Also, 
relying on the "__PYVENV_LAUNCHER__" environment variable for this is 
problematic. Environment variables are inherited by default, so it leaks to a 
completely unrelated python.exe process. For example, if we run 
subprocess.call(r'C:\Program Files\Python37\python.exe') from a virtual 
environment, currently we end up with an overridden sys.executable. I would 
prefer a -X command-line option, such as "VIRTUAL_ENV". multiprocessing could 
propagate this option to worker processes.

--

___
Python tracker 

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



[issue35780] Recheck logic in the C version of the lru_cache()

2019-01-21 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It was the explanation of possible history, not the justification of bugs. Of 
course bugs should be fixed. Thank you for rechecking this code and for your 
fix.

As for the optimization in lru_cache_make_key(), consider the following example:

@lru_cache()
def f(x):
return x

print(f(1))
print(f(1.0))

Currently the C implementation memoizes only one result, and f(1.0) returns 1. 
With the Python implementation and with the proposed changes  it will return 
1.0. I do not say that any of answers is definitely wrong, but we should be 
aware of this, and it would be better if both implementation will be 
consistent. I am sure this example was already discussed, but I can not find it 
now.

I still did not analyze the new code for adding to the cache. The old code 
contains flaws, agree.

I am not sure about an addition _PyDict_GetItem_KnownHash(). Every of dict 
operations can cause executing an arbitrary code and re-entering the execution 
of bounded_lru_cache_wrapper(). Could not the API that atomically checks and 
updates the dict (like getdefault()/setdefault()) be useful here?

--
assignee: serhiy.storchaka -> 

___
Python tracker 

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



[issue35661] Store the venv prompt in pyvenv.cfg

2019-01-21 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

I've made the changes suggested by Brett to store the raw value instead of the 
formatted prompt.  

I also have been looking into issues Steve raised about using the prompt value 
from `pyvenv.cfg` instead of having the prompt hard-coded into the activate 
scripts.  Since these scripts are .bat, bash, Powershell, etc scripts, I didn't 
know if there was anything special that needed to be taken into account (such 
as encoding) to use the values from the config file.  As Steve said, I could 
see this being opened as a bug in the future, so I don't mind working on it now 
in this issue or a separate one, whichever is the better option.  I just don't 
have much experience with those types of scripts, so I'm sure any changes I 
make will require some time and a lot of code review.  Plus, those changes add 
complexity to this change that Brett said he doesn't really need for his 
initial request.  Because of the possibility of changing those scripts soon, 
I've left the key name as `prompt` for now.  Fixing the activate scripts seems 
to be the right way to go instead of changing the name so it's no
 t misused.

One thing that I did find which may be a current bug is:
> PS N:\projects\cpython> python -m venv myvenv --prompt='this is my prompt'
> Running Release|Win32 interpreter...
> PS N:\projects\cpython> .\myvenv\Scripts\activate
> (this is my prompt) PS N:\projects\cpython> deactivate
> PS N:\projects\cpython> python -m venv myvenv --upgrade --prompt='new prompt'
> Running Release|Win32 interpreter...
> PS N:\projects\cpython> .\myvenv\Scripts\activate
> (this is my prompt) PS N:\projects\cpython>

--upgrade changes the prompt on `pyvenv.cfg`, but doesn't update activate 
scripts, so the prompt doesn't really change.

And for reference, there is another bug issue for storing the --prompt value in 
an environment variable (#35328).

--

___
Python tracker 

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



[issue35780] Recheck logic in the C version of the lru_cache()

2019-01-21 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

For the test you can use "nonlocal".

--

___
Python tracker 

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



[issue34656] [CVE-2018-20406] memory exhaustion in Modules/_pickle.c:1393

2019-01-21 Thread STINNER Victor


Change by STINNER Victor :


--
title: memory exhaustion in Modules/_pickle.c:1393 -> [CVE-2018-20406] memory 
exhaustion in Modules/_pickle.c:1393

___
Python tracker 

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



[issue35758] Disable x87 control word for MSVC ARM compiler

2019-01-21 Thread Antoine Pitrou


Antoine Pitrou  added the comment:


New changeset 7a2368063f25746d4008a74aca0dc0b82f86ff7b by Antoine Pitrou 
(Minmin Gong) in branch 'master':
bpo-35758: Fix building on ARM + MSVC (gh-11531)
https://github.com/python/cpython/commit/7a2368063f25746d4008a74aca0dc0b82f86ff7b


--
nosy: +pitrou

___
Python tracker 

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



[issue14802] Python fails to compile with VC11 ARM configuration

2019-01-21 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

Fixed in master branch.  Thank you, Minmin Gong!

I don't think this is a candidate for a 3.7 backport. If you think otherwise, 
though, please say so. You'll also need to check that the backport enables 
proper compilation on ARM.

--
nosy: +ned.deily, pitrou
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +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



[issue31506] Improve the error message logic for object_new & object_init

2019-01-21 Thread Sanyam Khurana


Change by Sanyam Khurana :


--
pull_requests: +11416
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



[issue31506] Improve the error message logic for object_new & object_init

2019-01-21 Thread Sanyam Khurana


Change by Sanyam Khurana :


--
pull_requests: +11416, 11417
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



[issue31506] Improve the error message logic for object_new & object_init

2019-01-21 Thread Sanyam Khurana


Change by Sanyam Khurana :


--
pull_requests: +11416, 11417, 11418
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



[issue35746] [ssl][CVE-2019-5010] TALOS-2018-0758 Denial of Service

2019-01-21 Thread STINNER Victor


STINNER Victor  added the comment:

Does someone work on backporting the fix to 3.4 and 3.5 branches?

Note: I added the vulnerability to:
https://python-security.readthedocs.io/vuln/ssl-crl-dps-dos.html

--

___
Python tracker 

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



[issue34656] [CVE-2018-20406] memory exhaustion in Modules/_pickle.c:1393

2019-01-21 Thread STINNER Victor


STINNER Victor  added the comment:

Python 2.7 is not affected:

* Python 2.7 has no C accelerator _pickle (Modules/_pickle.c)
* Python 2.7 doesn't support protocol 4 (attached proof of concept)

I reopen the issue because the issue should be fixed in 3.4 and 3.5 as well, 
since it has been marked as a vulnerability (it got a CVE number).

--
nosy: +vstinner
resolution: fixed -> 
status: closed -> open
versions: +Python 3.4, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue35798] duplicate SyntaxWarning: "is" with a literal

2019-01-21 Thread Kumar Akshay


Change by Kumar Akshay :


--
pull_requests: +11419

___
Python tracker 

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



[issue35798] duplicate SyntaxWarning: "is" with a literal

2019-01-21 Thread Kumar Akshay


Change by Kumar Akshay :


--
pull_requests: +11419, 11420

___
Python tracker 

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



[issue35798] duplicate SyntaxWarning: "is" with a literal

2019-01-21 Thread Kumar Akshay


Change by Kumar Akshay :


--
pull_requests: +11419, 11420, 11421

___
Python tracker 

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



[issue35794] test_posix.py test failure

2019-01-21 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks for the quickfix Pablo ;-)

--

___
Python tracker 

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



  1   2   >