[issue37382] Improve conditional check for test_gdb

2019-06-26 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

> Maybe open an issue to attempt to install gdb on Travis CI?

I created PR 14395 for this.

--

___
Python tracker 

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



[issue37409] relative import without parent

2019-06-26 Thread Ben Lewis


Ben Lewis  added the comment:

>>> foo = 'oops'
>>> from . import foo as fubar   # should raise ImportError
>>> fubar
'oops'

After further investigation, the problem is that builtins.__import__ (the c 
port version) does not replicate the behaviour of importlib.__import__ (the 
python reference version):

>>> import builtins, importlib
>>> __package__ is None
True
>>> importlib.__import__('', globals(), locals(), ('foo',), 1)
ImportError
>>> builtins.__import__('', globals(), locals(), ('foo',), 1)


A further discrepancy is that for deeper relative imports, builtins.__import__ 
raises a ValueError instead of ImportError (contrary to expectation/spec):

>>> from .. import foo
ValueError

A simple work around uses the python implementation to restore expected 
behaviour:

>>> builtins.__import__ = importlib.__import__
>>> from .. import foo
ImportError
>>> from curses import ascii
>>> from . import ascii
ImportError

PS: Brett Cannon, to replicate please copy and paste lines in correct order :-)

--
resolution: rejected -> 
status: closed -> open
title: relative import_from without parent -> relative import without parent

___
Python tracker 

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



[issue37423] 2to3 wraps a already bracketed print statement with another brackets

2019-06-26 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

This is a duplicate of https://bugs.python.org/issue10375

--
nosy: +xtreak

___
Python tracker 

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



[issue37366] Add an "onitem" callback parameter to shutil.rmtree()

2019-06-26 Thread Jeffrey Kintscher


Change by Jeffrey Kintscher :


--
keywords: +patch
pull_requests: +14232
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/14419

___
Python tracker 

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



[issue37412] os.getcwdb() doesn't implement PEP 528 (UTF-8) on Windows

2019-06-26 Thread Eryk Sun


Eryk Sun  added the comment:

This update breaks long-path support in Windows. It includes the following 
unnecessary check, which is using the wrong comparison operator:

if (len >= PY_SSIZE_T_MAX / sizeof(wchar_t))

PyMem_RawMalloc already checks this and returns NULL if size > 
(size_t)PY_SSIZE_T_MAX. This bug is causing a MemoryError with long paths:

>>> p = 'C:/Temp/longpath' + ('/' + 'a' * 255) * 9
>>> os.chdir(p)
>>> len(os.getcwd())
Traceback (most recent call last):
  File "", line 1, in 
MemoryError

--

___
Python tracker 

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



[issue37423] 2to3 wraps a already bracketed print statement with another brackets

2019-06-26 Thread Eric V. Smith


Eric V. Smith  added the comment:

You might also want to look at python-modernize or similar tools.

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

___
Python tracker 

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



[issue37423] 2to3 wraps a already bracketed print statement with another brackets

2019-06-26 Thread Jim Li


Jim Li  added the comment:

Thanks Eric. That does make sense. The code wasn't really Python 3, it was 
migrated from 2.7, which uses some Python 3 syntax.

As a side note, if you run 2to3 on this instead of the previous 
`print(response.next_page_token)`

print(response)

Then 2to3 would say that nothing needs to be converted. It seems like the 
attribute plays a role here.

Thanks for the quick response. Feel free to close the issue.

--

___
Python tracker 

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



[issue37423] 2to3 wraps a already bracketed print statement with another brackets

2019-06-26 Thread Eric V. Smith


Eric V. Smith  added the comment:

2to3 is designed to convert python2 code to python3. It is not designed to work 
on python3 code.

I believe this behavior is correct.

--
nosy: +eric.smith

___
Python tracker 

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



[issue37422] Documentation on the change of __path__ in Python 3

2019-06-26 Thread Eric V. Smith


Eric V. Smith  added the comment:

Can you provide a short runnable example that used to work and now does not? 
And please show any error messages you're seeing.

--
nosy: +eric.smith

___
Python tracker 

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



[issue37423] 2to3 wraps a already bracketed print statement with another brackets

2019-06-26 Thread Jim Li


New submission from Jim Li :

I encountered this issue when I was running 2to3 on a package, Python version 
3.7.2, CentOS 7.

To reproduce this bug, create a file called test.py and paste the following 
code into it

def testSomeRequest(self):

request = {"someRequest": "request"}
response = self.sendSearchRequest(request)
print(response.next_page_token)

The 2to3 tool would do the following:

-print(response.next_page_token)
+print((response.next_page_token))

Is this behaviour expected? Thank you.

--
components: 2to3 (2.x to 3.x conversion tool)
messages: 346702
nosy: jimli
priority: normal
severity: normal
status: open
title: 2to3 wraps a already bracketed print statement with another brackets
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



[issue37421] Some tests leak temporary files

2019-06-26 Thread miss-islington


miss-islington  added the comment:


New changeset 7fe81ce47ff6725e2e4d667d499e23dac19834af by Miss Islington (bot) 
in branch '3.8':
bpo-37421: Fix test_shutil: don't leak temporary files (GH-14416)
https://github.com/python/cpython/commit/7fe81ce47ff6725e2e4d667d499e23dac19834af


--
nosy: +miss-islington

___
Python tracker 

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



[issue37422] Documentation on the change of __path__ in Python 3

2019-06-26 Thread Jim Li


New submission from Jim Li :

In Python 2, `__path__` used to be a list, so all of the operations available 
to list are available, e.g., `insert`; you can also do indexing; e.g., 
`__path__[0]`.

However, I believe that starting from Python 3, it seems to be a , and a lot of operations that 
worked previously stopped working.It seems so abruptive and I can't find any 
deprecation notice on this.

Previously, one is able to insert an additional path to the front of the list 
by doing

module.__path__.insert(0, 'src/mypath')

Now the only procedure allowed seems to be append. Is there any way to mimic 
the old behaviour? Sorry, this is my first question so maybe this issue doesn't 
deserve any more attention. If there is any documentation that talks about the 
change of type of the NamespacePath, please kindly lemme know.

Sincerely,

Related issues include https://bugs.python.org/issue35843

--
assignee: docs@python
components: Documentation
messages: 346701
nosy: docs@python, jimli
priority: normal
severity: normal
status: open
title: Documentation on the change of __path__ in Python 3
versions: 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



[issue35389] Use gnu_get_libc_version() in platform.libc_ver()?

2019-06-26 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +14231
pull_request: https://github.com/python/cpython/pull/14418

___
Python tracker 

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



[issue37421] Some tests leak temporary files

2019-06-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14230
pull_request: https://github.com/python/cpython/pull/14417

___
Python tracker 

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



[issue37421] Some tests leak temporary files

2019-06-26 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 4c26abd14f1b7242998eb2f7756aa375e0fe714f by Victor Stinner in 
branch 'master':
bpo-37421: Fix test_shutil: don't leak temporary files (GH-14416)
https://github.com/python/cpython/commit/4c26abd14f1b7242998eb2f7756aa375e0fe714f


--

___
Python tracker 

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



[issue37421] Some tests leak temporary files

2019-06-26 Thread STINNER Victor


STINNER Victor  added the comment:

Using PR 14415, the following test of test_multiprocessing_spawn emits a false 
alarm because multiprocessing use "Finalizer" objects which are only finalized 
"later":
test.test_multiprocessing_spawn.WithManagerTestMyManager.test_mymanager_context_prestarted


Workaround, call explicitly _run_finalizers():

diff --git a/Lib/test/_test_multiprocessing.py 
b/Lib/test/_test_multiprocessing.py
index eef262d723..bfecbab9ee 100644
--- a/Lib/test/_test_multiprocessing.py
+++ b/Lib/test/_test_multiprocessing.py
@@ -5651,6 +5651,7 @@ def install_tests_in_module_dict(remote_globs, 
start_method):
 if need_sleep:
 time.sleep(0.5)
 multiprocessing.process._cleanup()
+multiprocessing.util._run_finalizers()
 test.support.gc_collect()
 
 remote_globs['setUpModule'] = setUpModule

--
title: Tests leak temporary files -> Some tests leak temporary files

___
Python tracker 

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



[issue37386] [EASY] test_io: test_large_file_ops() failed on AMD64 Windows7 SP1 3.x with: [Errno 28] No space left on device

2019-06-26 Thread Giovanni Cappellotto


Giovanni Cappellotto  added the comment:

Serhiy, Victor:

I didn't get what's your suggested solution for this task.

Should we just close it as "wontfix", can I go ahead and merge the existing PR, 
or do you have a better suggestion on how to solve this issue?

--

___
Python tracker 

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



[issue37376] pprint for types.SimpleNamespace

2019-06-26 Thread Eric Snow


Eric Snow  added the comment:

Thanks, Carl Bordum Hansen!

--
nosy: +eric.snow
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



[issue37376] pprint for types.SimpleNamespace

2019-06-26 Thread miss-islington


miss-islington  added the comment:


New changeset 06a8916cf465f139dca958685b0da899364b8a8c by Miss Islington (bot) 
(Carl Bordum Hansen) in branch 'master':
bpo-37376: pprint support for SimpleNamespace (GH-14318)
https://github.com/python/cpython/commit/06a8916cf465f139dca958685b0da899364b8a8c


--
nosy: +miss-islington

___
Python tracker 

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



[issue37380] subprocess.Popen._cleanup() "The handle is invalid" error when some old process is gone

2019-06-26 Thread STINNER Victor


STINNER Victor  added the comment:

Here is a concrete example of ResourceWarning when debugging/stressing 
multiprocessing code, I interrupt (CTRL+c) test_resource_tracker while it's 
running:

vstinner@apu$ ./python -m test test_multiprocessing_spawn --fail-env-changed -v 
-m test_resource_tracker
== CPython 3.9.0a0 (heads/master:689830ee62, Jun 26 2019, 23:07:31) [GCC 9.1.1 
20190503 (Red Hat 9.1.1-1)]
== Linux-5.1.11-300.fc30.x86_64-x86_64-with-glibc2.29 little-endian
== cwd: /home/vstinner/prog/python/master/build/test_python_18573
== CPU count: 8
== encodings: locale=UTF-8, FS=utf-8
Run tests sequentially
0:00:00 load avg: 0.32 [1/1] test_multiprocessing_spawn
test_resource_tracker (test.test_multiprocessing_spawn.TestResourceTracker) ... 

^C

/home/vstinner/prog/python/master/Lib/subprocess.py:917: ResourceWarning: 
subprocess 18576 is still running
  _warn("subprocess %s is still running" % self.pid,
ResourceWarning: Enable tracemalloc to get the object allocation traceback
/home/vstinner/prog/python/master/Lib/test/libregrtest/runtest.py:283: 
ResourceWarning: unclosed file <_io.BufferedReader name=6>
  return INTERRUPTED
ResourceWarning: Enable tracemalloc to get the object allocation traceback

== Tests result: INTERRUPTED ==
Test suite interrupted by signal SIGINT.

1 test omitted:
test_multiprocessing_spawn

Total duration: 304 ms
Tests result: INTERRUPTED

--

___
Python tracker 

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



[issue37369] Issue with pip in venv on Powershell in Windows

2019-06-26 Thread Brooke Storm


Brooke Storm  added the comment:

To answer Steve's question, the ver command gives me:
Microsoft Windows [Version 10.0.18917.1000]

Thank you for looking into this.

--

___
Python tracker 

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



[issue37421] Tests leak temporary files

2019-06-26 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +pablogsal, serhiy.storchaka, zach.ware

___
Python tracker 

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



[issue37421] Tests leak temporary files

2019-06-26 Thread STINNER Victor


STINNER Victor  added the comment:

Test leaking a temporary file in test_urllib:
test.test_urllib.urlretrieve_HttpTests.test_short_content_raises_ContentTooShortError_without_reporthook

I'm not sure of my fix:

diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py
index f6ce9cb6d5..f6e2d8 100644
--- a/Lib/urllib/request.py
+++ b/Lib/urllib/request.py
@@ -283,6 +283,7 @@ def urlretrieve(url, filename=None, reporthook=None, 
data=None):
 reporthook(blocknum, bs, size)
 
 if size >= 0 and read < size:
+urlcleanup()
 raise ContentTooShortError(
 "retrieval incomplete: got only %i out of %i bytes"
 % (read, size), result)

--

___
Python tracker 

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



[issue37421] Tests leak temporary files

2019-06-26 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +14229
pull_request: https://github.com/python/cpython/pull/14416

___
Python tracker 

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



[issue37421] Tests leak temporary files

2019-06-26 Thread STINNER Victor


Change by STINNER Victor :


--
keywords: +patch
pull_requests: +14228
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/14415

___
Python tracker 

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



[issue37421] Tests leak temporary files

2019-06-26 Thread STINNER Victor


New submission from STINNER Victor :

When running tests, the tempoary directory is not left clean: there are 
temporary files which are not removed.

I wrote a PoC change to detect such bugs and I found that at least test_shutil 
and test_urllib leak such temporary files/directories.

--
components: Tests
messages: 346692
nosy: vstinner
priority: normal
severity: normal
status: open
title: Tests leak temporary files
versions: Python 3.9

___
Python tracker 

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



[issue37417] bytearray.extend does not handle errors during iteration.

2019-06-26 Thread Brandt Bucher


Change by Brandt Bucher :


--
pull_requests: +14227
pull_request: https://github.com/python/cpython/pull/14414

___
Python tracker 

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



[issue37420] os.sched_setaffinity does not handle errors during iteration.

2019-06-26 Thread Brandt Bucher


Change by Brandt Bucher :


--
keywords: +patch
pull_requests: +14226
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/14414

___
Python tracker 

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



[issue37420] os.sched_setaffinity does not handle errors during iteration.

2019-06-26 Thread Brandt Bucher


New submission from Brandt Bucher :

This is related to bpo-37417: os.sched_setaffinity doesn't properly handle 
errors that arise during iteration of the mask argument:

Python 3.9.0a0 (heads/master:d52a83a, Jun 26 2019, 15:13:41) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> bad_iter = map(int, "0X")
>>> os.sched_setaffinity(0, bad_iter)
ValueError: invalid literal for int() with base 10: 'X'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "", line 1, in 
SystemError:  returned a result with an 
error set

It looks like this bug is also present on all versions of Python 3. I've 
attached a patch with a fix and a regression test.

--
components: Library (Lib)
messages: 346691
nosy: brandtbucher
priority: normal
severity: normal
status: open
title: os.sched_setaffinity does not handle errors during iteration.
type: behavior
versions: Python 3.9

___
Python tracker 

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



[issue29412] IndexError thrown on email.message.Message.get

2019-06-26 Thread Barry A. Warsaw


Barry A. Warsaw  added the comment:


New changeset b950cdb4beabeb093fa3ccc35f53d51cc0193aba by Barry Warsaw (Miss 
Islington (bot)) in branch '3.7':
bpo-29412: Fix indexError when parsing a header value ending unexpectedly 
(GH-14387) (GH-14412)
https://github.com/python/cpython/commit/b950cdb4beabeb093fa3ccc35f53d51cc0193aba


--

___
Python tracker 

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



[issue29412] IndexError thrown on email.message.Message.get

2019-06-26 Thread Barry A. Warsaw


Barry A. Warsaw  added the comment:


New changeset 82654a037211a3466a294d53952926fc87f8403d by Barry Warsaw (Miss 
Islington (bot)) in branch '3.8':
bpo-29412: Fix indexError when parsing a header value ending unexpectedly 
(GH-14387) (GH-14411)
https://github.com/python/cpython/commit/82654a037211a3466a294d53952926fc87f8403d


--

___
Python tracker 

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



[issue37359] test_regrtest: test_list_cases() fails on x86 Gentoo Installed with X 3.x

2019-06-26 Thread STINNER Victor


STINNER Victor  added the comment:

Until a solution is found, I disabled cleantest to repair *again* the Gentoo 
buildbot worker:
https://github.com/python/buildmaster-config/commit/378f0e4daed2c26479ee9571bd869110a6733ecc

--

___
Python tracker 

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



[issue37359] test_regrtest: test_list_cases() fails on x86 Gentoo Installed with X 3.x

2019-06-26 Thread STINNER Victor


STINNER Victor  added the comment:

> * Another idea?

Another idea is to change the name of temporary directories to add a different 
prefix per Python branch. Like use "test_python_39_" for Python 3.9. But 
I'm not sure how custom jobs come into the play here. Python is not aware of 
"custom", it has a fixed version and Git branch.

--

___
Python tracker 

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



[issue37359] test_regrtest: test_list_cases() fails on x86 Gentoo Installed with X 3.x

2019-06-26 Thread STINNER Victor


STINNER Victor  added the comment:

Oh, this feature has an issue on buildbots. For the 2 workers which allows more 
than 1 job in parallel, cleantest removes working directories of other running 
tests...

"x86 Gentoo Installed with X 3.7" is fighting with "x86 Gentoo Installed with X 
3.8" for example: when a 3.8 job started, it removed working directories of 2 
tests of the 3.7 job. This buildbot uses a single temporary directory for all 
Python branches: /buildbot/tmp/tmpdir.

I'm not sure how to fix this issue:

* Modify buildbot configuration to ensure that each branch uses a dedicated 
temporary directory.
* Modify regrtest to check if process  is still running when deleting 
test_python_.
* Another idea?

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

___
Python tracker 

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



[issue37369] Issue with pip in venv on Powershell in Windows

2019-06-26 Thread Ned Deily


Ned Deily  added the comment:

OK, I"m bumping it to "deferred blocker" for now so it remains visible.

--
priority: critical -> deferred blocker

___
Python tracker 

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



[issue27071] unittest.TestCase.assertCountEqual is a very misleading name

2019-06-26 Thread Thomas Grainger


Thomas Grainger  added the comment:

How about assertIsPermutation?

https://www.fluentcpp.com/2019/06/25/understanding-the-implementation-of-stdis_permutation/

--
nosy: +graingert

___
Python tracker 

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



[issue37369] Issue with pip in venv on Powershell in Windows

2019-06-26 Thread Steve Dower


Steve Dower  added the comment:

This seems to be a change in Windows at some point, as it still works on one of 
my other PCs. I've pinged some colleagues to find out what might have happened, 
but it definitely looks like the lack of Read+Execute permission is working 
correctly now :(

One potential fix is to return the path under 
C:\Users\\AppData\Local\Microsoft\WindowsApp as sys.executable (and 
sys.exec_prefix?), but it only contains the executable launchers and none of 
the actual Python install. Making this work for venv might require new values 
in pyvenv.cfg (however, it also seems that the current sys.executable changes 
with each update, so if we can change it universally to point at the user's 
WindowsApp directory then that will stop).

The good news is that if you're trying to launch it from within Python it still 
works, so multiprocessing is not affected. It's only things that write 
sys.executable out and try to use it later, like venv.

Adding Ned FYI, as if I can come up with a fix for this before we ship 3.7.4 
I'd like to include it. No idea yet how possible that will be or what our fix 
will be though.

--
nosy: +ned.deily
priority: normal -> critical

___
Python tracker 

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



[issue37419] Possible segfaults when passing large sequences to os.posix_spawn()

2019-06-26 Thread miss-islington


miss-islington  added the comment:


New changeset 04d4692579cc4e0204c7fbced3692f8aa4bbb857 by Miss Islington (bot) 
in branch '3.8':
bpo-37419: Fix possible segfaults when passing large sequences to 
os.posix_spawn() (GH-14409)
https://github.com/python/cpython/commit/04d4692579cc4e0204c7fbced3692f8aa4bbb857


--
nosy: +miss-islington

___
Python tracker 

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



[issue37402] Fatal Python error: Cannot recover from stack overflow issues on Python 3.6 and 3.7

2019-06-26 Thread konstantin danilov


konstantin danilov  added the comment:

Same error, python3.7. I have attached minifyed code version. It runs into 
infinite recursion due to __setattr__ call inside 'with' statement on top of 
same object. As result:

> python /tmp/text.py 
Fatal Python error: Cannot recover from stack overflow.

Current thread 0x7f6bb073d740 (most recent call first):
  File "/tmp/text.py", line 10 in __getattr__
  ...
  File "/tmp/text.py", line 11 in __getattr__
  File "/tmp/text.py", line 28 in __exit__
  File "/tmp/text.py", line 13 in __getattr__
  ...
  File "/tmp/text.py", line 11 in __getattr__
  ...
[2]22121 abort (core dumped)  python /tmp/text.py

--
components: +Interpreter Core -asyncio
nosy: +konstantin danilov
versions:  -Python 3.8, Python 3.9
Added file: https://bugs.python.org/file48439/text.py

___
Python tracker 

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



[issue37411] testEnviron (test.test_wsgiref.HandlerTests) fails when environment variable X is set

2019-06-26 Thread STINNER Victor


STINNER Victor  added the comment:

Ok, the bug is now fixed in 2.7, 3.7, 3.8 and master branches. Thanks Miro for 
the report. I also enhanced the test to test all variables of handler.environ.

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



[issue37419] Possible segfaults when passing large sequences to os.posix_spawn()

2019-06-26 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset d52a83a3d471ff3c7e9ebfa1731765e5334f7c24 by Pablo Galindo 
(Zackery Spytz) in branch 'master':
bpo-37419: Fix possible segfaults when passing large sequences to 
os.posix_spawn() (GH-14409)
https://github.com/python/cpython/commit/d52a83a3d471ff3c7e9ebfa1731765e5334f7c24


--
nosy: +pablogsal

___
Python tracker 

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



[issue37419] Possible segfaults when passing large sequences to os.posix_spawn()

2019-06-26 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



[issue37419] Possible segfaults when passing large sequences to os.posix_spawn()

2019-06-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14225
pull_request: https://github.com/python/cpython/pull/14413

___
Python tracker 

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



[issue37411] testEnviron (test.test_wsgiref.HandlerTests) fails when environment variable X is set

2019-06-26 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset dfa9499ccbc14a4227ca8d0c1728e2beacbb45c6 by Victor Stinner (Miss 
Islington (bot)) in branch '2.7':
[2.7] bpo-37411: Rewrite test_wsgiref.testEnviron() (GH-14394) (GH-14404)
https://github.com/python/cpython/commit/dfa9499ccbc14a4227ca8d0c1728e2beacbb45c6


--

___
Python tracker 

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



[issue37417] bytearray.extend does not handle errors during iteration.

2019-06-26 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue36738] Add 'array_hook' for json module

2019-06-26 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
versions: +Python 3.9 -Python 3.8

___
Python tracker 

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



[issue37163] dataclasses.replace() fails with the field named "obj"

2019-06-26 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue37417] bytearray.extend does not handle errors during iteration.

2019-06-26 Thread miss-islington


miss-islington  added the comment:


New changeset 5c4ce3e2fa73125fb6f9c501e6c4c8512216b7e1 by Miss Islington (bot) 
in branch '3.8':
bpo-37417: Fix error handling in bytearray.extend. (GH-14407)
https://github.com/python/cpython/commit/5c4ce3e2fa73125fb6f9c501e6c4c8512216b7e1


--

___
Python tracker 

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



[issue29412] IndexError thrown on email.message.Message.get

2019-06-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14224
pull_request: https://github.com/python/cpython/pull/14412

___
Python tracker 

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



[issue29412] IndexError thrown on email.message.Message.get

2019-06-26 Thread Barry A. Warsaw


Barry A. Warsaw  added the comment:


New changeset 7213df7bbfd85378c6e42e1ac63144d5974bdcf6 by Barry Warsaw 
(Abhilash Raj) in branch 'master':
bpo-29412: Fix indexError when parsing a header value ending unexpectedly 
(GH-14387)
https://github.com/python/cpython/commit/7213df7bbfd85378c6e42e1ac63144d5974bdcf6


--

___
Python tracker 

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



[issue29412] IndexError thrown on email.message.Message.get

2019-06-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14223
pull_request: https://github.com/python/cpython/pull/14411

___
Python tracker 

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



[issue23014] Don't have importlib.abc.Loader.create_module() be optional

2019-06-26 Thread Anthony Sottile


Anthony Sottile  added the comment:

yeah I guess I'm just curious why this bug (seemingly intentionally) made the 
implementation diverge from PEP 451 and require an empty `create_module` (and 
where I would have found that except by searching bugs.python.org)

Everyone I've shown this bit of code has essentially said: "*headscratch* -- 
that's weird?" 
https://github.com/pytest-dev/pytest/blob/6a2d844c5d3e1e692d5bb6fa065c0d753d1dd7d1/src/_pytest/assertion/rewrite.py#L92-L93

why require the function at all I guess

--

___
Python tracker 

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



[issue37163] dataclasses.replace() fails with the field named "obj"

2019-06-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 6ef103fbdbc05adbc20838c94b1f0c40fa6c159a by Serhiy Storchaka in 
branch '3.7':
[3.7] bpo-37163: dataclasses.replace() now supports the field named "obj". 
(GH-13877) (GH-14405)
https://github.com/python/cpython/commit/6ef103fbdbc05adbc20838c94b1f0c40fa6c159a


--

___
Python tracker 

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



[issue23014] Don't have importlib.abc.Loader.create_module() be optional

2019-06-26 Thread Brett Cannon


Brett Cannon  added the comment:

> Mostly looking for something that says how `create_module` should / shouldn't 
> be implemented

Basically you only need to provide the method if you want to use a custom 
object for the module itself. So as long as the object can quack like a module 
object you should be fine.

> (and why `return None` is necessary)

The "return None for default semantics" is there for two reasons (if I remember 
correctly). One, it makes it very easy to implement the default semantics. :) 
Two, it sends a very clear signal that nothing out of the ordinary is going on 
and so you can assume nothing special is expected (which is why LazyLoader 
requires this since it mucks with the object directly in a very specific way).

--

___
Python tracker 

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



[issue37417] bytearray.extend does not handle errors during iteration.

2019-06-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14222
pull_request: https://github.com/python/cpython/pull/14410

___
Python tracker 

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



[issue37412] os.getcwdb() doesn't implement PEP 528 (UTF-8) on Windows

2019-06-26 Thread STINNER Victor


STINNER Victor  added the comment:

Ok, it's merged into 3.8. Thanks for the review Steve. One less deprecation 
warning.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.9

___
Python tracker 

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



[issue37411] testEnviron (test.test_wsgiref.HandlerTests) fails when environment variable X is set

2019-06-26 Thread miss-islington


miss-islington  added the comment:


New changeset bdbd5e895ddf9aefcb79cdc52341f0697ad6aea0 by Miss Islington (bot) 
in branch '3.8':
bpo-37411: Rewrite test_wsgiref.testEnviron() (GH-14394)
https://github.com/python/cpython/commit/bdbd5e895ddf9aefcb79cdc52341f0697ad6aea0


--

___
Python tracker 

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



[issue37411] testEnviron (test.test_wsgiref.HandlerTests) fails when environment variable X is set

2019-06-26 Thread miss-islington


miss-islington  added the comment:


New changeset 814c7aefc2b8e9892bce3d59c0ab39563d658aa2 by Miss Islington (bot) 
in branch '3.7':
bpo-37411: Rewrite test_wsgiref.testEnviron() (GH-14394)
https://github.com/python/cpython/commit/814c7aefc2b8e9892bce3d59c0ab39563d658aa2


--
nosy: +miss-islington

___
Python tracker 

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



[issue37419] Possible segfaults when passing large sequences to os.posix_spawn()

2019-06-26 Thread Zackery Spytz


Change by Zackery Spytz :


--
keywords: +patch
pull_requests: +14221
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/14409

___
Python tracker 

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



[issue37419] Possible segfaults when passing large sequences to os.posix_spawn()

2019-06-26 Thread Zackery Spytz


New submission from Zackery Spytz :

parse_file_actions() uses an int as it loops over the passed sequence, but it 
should use a Py_ssize_t. If the sequence is large enough, the int will overflow.

--
components: Extension Modules
messages: 346669
nosy: ZackerySpytz
priority: normal
severity: normal
status: open
title: Possible segfaults when passing large sequences to os.posix_spawn()
type: crash
versions: Python 3.8, Python 3.9

___
Python tracker 

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



[issue37417] bytearray.extend does not handle errors during iteration.

2019-06-26 Thread miss-islington


miss-islington  added the comment:


New changeset 7675bca4b56c532875d8bc6a7832e3c51d71278f by Miss Islington (bot) 
in branch '3.7':
bpo-37417: Fix error handling in bytearray.extend. (GH-14407)
https://github.com/python/cpython/commit/7675bca4b56c532875d8bc6a7832e3c51d71278f


--
nosy: +miss-islington

___
Python tracker 

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



[issue37418] Code execution without calling it

2019-06-26 Thread SilentGhost


SilentGhost  added the comment:

The whole file is executed on import, you might as well have taken the "evil" 
code and placed in the global scope and not in the function. If you want to 
learn how to use decorators, again I suggest following a tutorial, SO or 
python-help. This is not a security issue.

--

___
Python tracker 

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



[issue37418] Code execution without calling it

2019-06-26 Thread Paul Ganssle


Change by Paul Ganssle :


--
nosy:  -p-ganssle

___
Python tracker 

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



[issue37418] Code execution without calling it

2019-06-26 Thread Paul Ganssle


Paul Ganssle  added the comment:

> why the code is executed?
> I could do a library or a package and include evil code instead of a
> print...

The code is executed because the decorator syntax

@decorator
def f():
   ...

Is equivalent to

def f():
   ...

f = decorator(f)

So you are indeed calling the `decorator` function.

It is true that you could put evil code in the decorator function, but it's 
also true that you can execute evil code directly in the Python function as 
well, e.g.:

execute_evil_code()

def f():
...

Importing such a package would call `execute_evil_code()`.

--
nosy: +p-ganssle

___
Python tracker 

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



[issue37417] bytearray.extend does not handle errors during iteration.

2019-06-26 Thread SilentGhost


Change by SilentGhost :


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



[issue37418] Code execution without calling it

2019-06-26 Thread Emilio López Arias

Emilio López Arias  added the comment:

why the code is executed?
I could do a library or a package and include evil code instead of a
print...

El mié., 26 jun. 2019 a las 21:05, SilentGhost ()
escribió:

>
> SilentGhost  added the comment:
>
> It seems you're misunderstanding mechanics of decorators. Decorator is
> called when @decorator statement is executed and in that function *you* are
> calling the wrapped function. There are tutorials available on how to use
> this feature, I'd suggest you try them.
>
> --
> nosy: +SilentGhost
> resolution:  -> not a bug
> stage:  -> resolved
> status: open -> closed
> type: security -> behavior
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue37417] bytearray.extend does not handle errors during iteration.

2019-06-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14220
pull_request: https://github.com/python/cpython/pull/14408

___
Python tracker 

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



[issue37417] bytearray.extend does not handle errors during iteration.

2019-06-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 2a7d596f27b2342caf168a03c95ebf3b56e5dbbd by Serhiy Storchaka 
(Brandt Bucher) in branch 'master':
bpo-37417: Fix error handling in bytearray.extend. (GH-14407)
https://github.com/python/cpython/commit/2a7d596f27b2342caf168a03c95ebf3b56e5dbbd


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue37418] Code execution without calling it

2019-06-26 Thread SilentGhost


SilentGhost  added the comment:

It seems you're misunderstanding mechanics of decorators. Decorator is called 
when @decorator statement is executed and in that function *you* are calling 
the wrapped function. There are tutorials available on how to use this feature, 
I'd suggest you try them.

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

___
Python tracker 

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



[issue23014] Don't have importlib.abc.Loader.create_module() be optional

2019-06-26 Thread Anthony Sottile


Anthony Sottile  added the comment:

Mostly looking for something that says how `create_module` should / shouldn't 
be implemented (and why `return None` is necessary)

--

___
Python tracker 

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



[issue37418] Code execution without calling it

2019-06-26 Thread Emilio López Arias

New submission from Emilio López Arias :

Create a new python file: example.py

def my_decorator(f):
print("before")
f()
print("after")


@my_decorator
def my_function():
print("hello world")


If you execute the file example.py you should see some output you shouldn't:
(base) C:\Users\emilio\curso_python>python --version
Python 3.7.3
(base) C:\Users\emilio\curso_python>python ejemplo.py
before
hello world
after

--
messages: 346661
nosy: Emilio López Arias
priority: normal
severity: normal
status: open
title: Code execution without calling it
type: security
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



[issue23014] Don't have importlib.abc.Loader.create_module() be optional

2019-06-26 Thread Brett Cannon


Brett Cannon  added the comment:

The import machinery docs are split between the language reference and 
importlib itself. It really depends on what you're looking for.

--

___
Python tracker 

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



[issue37391] MacOS Touchpad scrolling crashes IDLE

2019-06-26 Thread Ned Deily


Ned Deily  added the comment:

> Does IDLE every run long enough with Apple's tk before failure to make 
> continuing useful?

Yes, depending on what you are doing, IDLE *may* run just fine with the system 
Tk.  But you may may run into this issue depending on how you scroll.  Or, 
among the worst bugs, if you try to type in characters not directly available 
on the keyboard by using one of the available composition characters, like 
opt-u followed by a vowel to produced an "umlauted" vowel with the US keyboard 
layout, Tk will immediately crash taking IDLE with it and with no opportunity 
to save any work in progress.  Many people will not run into those bugs but it 
can be very painful to those who do.

> Any comments here before I open a new issue?

I don't think changing the message is going to make much of a difference.  
There isn't much an end user can do other to avoid the known behaviors that 
cause problems, install another version of Python (which may not be an option 
for many novice users), or not use IDLE.  Back when we did not ship our own 
copy of Tcl/Tk with the python.org macOS installers, there *was* something else 
you might be able to do: install a more up-to-date third-party Tcl/Tk that 
would then be automatically used. But that's not longer an option nor is it 
needed.

I think the best thing we can do is help make it easier for people building 
Python to not link with the broken system Python and improve the using Python 
on macOS documentation.  I have issues opened for both of those.

--

___
Python tracker 

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



[issue23014] Don't have importlib.abc.Loader.create_module() be optional

2019-06-26 Thread Anthony Sottile


Anthony Sottile  added the comment:

Where can I find up to date best practices / docs for the import machinery? I 
couldn't find a mention of this in docs.python.org

--

___
Python tracker 

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



[issue37369] Issue with pip in venv on Powershell in Windows

2019-06-26 Thread Steve Dower


Steve Dower  added the comment:

Okay, this definitely used to work, but now it's broken for me too.

What version of Windows are you on (copy-paste from cmd.exe's ver command)?

--

___
Python tracker 

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



[issue23014] Don't have importlib.abc.Loader.create_module() be optional

2019-06-26 Thread Brett Cannon


Brett Cannon  added the comment:

PEPs are not living documents unless they are marked as Active (which PEP 451 
is not).

--

___
Python tracker 

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



[issue37417] bytearray.extend does not handle errors during iteration.

2019-06-26 Thread Brandt Bucher


New submission from Brandt Bucher :

bytearray.extend doesn't properly handle errors that arise during iteration of 
the argument:

Python 3.9.0a0 (heads/master:5150d32, Jun 26 2019, 10:55:32) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> array = bytearray()
>>> bad_iter = map(int, "X")
>>> array.extend(bad_iter)
ValueError: invalid literal for int() with base 10: 'X'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "", line 1, in 
SystemError:  returned a result with an 
error set

As far as I can tell, this bug is present on all versions of Python 3. I've 
attached a patch with a fix and a regression test.

--
components: Interpreter Core
messages: 346655
nosy: brandtbucher
priority: normal
severity: normal
status: open
title: bytearray.extend does not handle errors during iteration.
type: behavior
versions: Python 3.9

___
Python tracker 

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



[issue37417] bytearray.extend does not handle errors during iteration.

2019-06-26 Thread Brandt Bucher


Change by Brandt Bucher :


--
keywords: +patch
pull_requests: +14219
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/14407

___
Python tracker 

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



[issue37409] relative import_from without parent

2019-06-26 Thread Brett Cannon


Brett Cannon  added the comment:

I can't reproduce:

>>> from importlib import abc
>>> from . import util
Traceback (most recent call last):
  File "", line 1, in 
ImportError: cannot import name 'util' from '__main__' (unknown location)
>>> import importlib.util
>>>

Did you happen to do an `import *` prior to this in your REPL? If so that might 
explain it as you could have pulled in __package__ and such and that's used to 
resolve relative imports.

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



[issue37416] If threading is not imported from the main thread it sees the wrong thread as the main thread.

2019-06-26 Thread Fabio Zadrozny


New submission from Fabio Zadrozny :

I'm attaching a snippet which shows the issue (i.e.: threading.main_thread() 
and threading.current_thread() should be the same and they aren't).

What I'd see as a possible solution is that the initial thread ident would be 
stored when the interpreter is initialized and then when threading is imported 
the first time it would get that indent to initialize the main thread instead 
of calling `threading._MainThread._set_ident` in the wrong thread.

I'm not sure if this is possible if CPython is embedded in some other C++ 
program, but it seems to be the correct approach when Python is called from the 
command line.

As a note, I found this when doing an attach to pid for the `pydevd` debugger 
where a thread is created to initialize the debugger (the issue on the debugger 
is reported at: https://github.com/microsoft/ptvsd/issues/1542).

--
components: Interpreter Core
files: snippet.py
messages: 346653
nosy: fabioz
priority: normal
severity: normal
status: open
title: If threading is not imported from the main thread it sees the wrong 
thread as the main thread.
type: behavior
versions: Python 3.7
Added file: https://bugs.python.org/file48438/snippet.py

___
Python tracker 

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



[issue37390] Generate table of audit events for docs

2019-06-26 Thread Steve Dower


Steve Dower  added the comment:

I think my PR is ready. I had to go through and update all the audit-event tags 
that existed, since the argument parsing in Sphinx didn't work the way I first 
thought it did, but now we can provide a back reference manually (or let it 
auto-generate one to the line with the event).

I also updated some of the event names I recently added so they are more 
consistent with the existing ones - e.g. poplib.POP3 -> poplib.connect for 
consistency with socket.connect.

--

___
Python tracker 

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



[issue37390] Generate table of audit events for docs

2019-06-26 Thread Steve Dower


Change by Steve Dower :


--
keywords: +patch
pull_requests: +14218
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/14406

___
Python tracker 

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



[issue37376] pprint for types.SimpleNamespace

2019-06-26 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

+1 This would be a nice improvement.

--
nosy: +rhettinger

___
Python tracker 

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



[issue37179] asyncio loop.start_tls() provide support for TLS in TLS

2019-06-26 Thread Cooper Lees


Cooper Lees  added the comment:

@fantix - Is there anything I can do to help this progress. I'd be happy to 
potentially even do parts of the back porting if you're swamped. Would just 
need some guidance.

I need this as I'm looking to add auth to some internal HTTP(S) proxies I use 
and in order to allow aiohttp to be able to do client TLS auth, this is 
required.

--

___
Python tracker 

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



[issue37163] dataclasses.replace() fails with the field named "obj"

2019-06-26 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +14217
pull_request: https://github.com/python/cpython/pull/14405

___
Python tracker 

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



[issue37411] testEnviron (test.test_wsgiref.HandlerTests) fails when environment variable X is set

2019-06-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14216
pull_request: https://github.com/python/cpython/pull/14404

___
Python tracker 

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



[issue37411] testEnviron (test.test_wsgiref.HandlerTests) fails when environment variable X is set

2019-06-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14215
pull_request: https://github.com/python/cpython/pull/14403

___
Python tracker 

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



[issue37411] testEnviron (test.test_wsgiref.HandlerTests) fails when environment variable X is set

2019-06-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14214
pull_request: https://github.com/python/cpython/pull/14402

___
Python tracker 

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



[issue37411] testEnviron (test.test_wsgiref.HandlerTests) fails when environment variable X is set

2019-06-26 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 5150d327924959639215ed0a78feffc0d88258da by Victor Stinner in 
branch 'master':
bpo-37411: Rewrite test_wsgiref.testEnviron() (GH-14394)
https://github.com/python/cpython/commit/5150d327924959639215ed0a78feffc0d88258da


--

___
Python tracker 

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



[issue37412] os.getcwdb() doesn't implement PEP 528 (UTF-8) on Windows

2019-06-26 Thread miss-islington


miss-islington  added the comment:


New changeset 63429c839b19c6fe604deddcb12497443ca01a9a by Miss Islington (bot) 
in branch '3.8':
bpo-37412: os.getcwdb() now uses UTF-8 on Windows (GH-14396)
https://github.com/python/cpython/commit/63429c839b19c6fe604deddcb12497443ca01a9a


--
nosy: +miss-islington

___
Python tracker 

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



[issue37414] Remove undocumented and deprecated sys.callstats() function

2019-06-26 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



[issue37163] dataclasses.replace() fails with the field named "obj"

2019-06-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 2d88e63bfcf7bccba925ab80b3f47ccf8b7aefa8 by Serhiy Storchaka in 
branch 'master':
bpo-37163: Make the obj argument of dataclasses.replace() a positional-only. 
(GH-14390)
https://github.com/python/cpython/commit/2d88e63bfcf7bccba925ab80b3f47ccf8b7aefa8


--

___
Python tracker 

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



[issue28799] Drop CALL_PROFILE special build?

2019-06-26 Thread STINNER Victor


STINNER Victor  added the comment:

I removed the function from Python 3.9 in bpo-37414.

--

___
Python tracker 

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



[issue37414] Remove undocumented and deprecated sys.callstats() function

2019-06-26 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 69150669f224a1fc47de483557736e725ac5b2a1 by Victor Stinner in 
branch 'master':
bpo-37414: Remove sys.callstats() (GH-14398)
https://github.com/python/cpython/commit/69150669f224a1fc47de483557736e725ac5b2a1


--

___
Python tracker 

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



[issue37386] [EASY] test_io: test_large_file_ops() failed on AMD64 Windows7 SP1 3.x with: [Errno 28] No space left on device

2019-06-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Yes, it is a solution.

In this particular case it may be that the disk is fulled by test files leaked 
from the past test runs.

--

___
Python tracker 

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



[issue37406] Disable runtime checks in release mode

2019-06-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I think that the public C API should have runtime checks for its arguments, 
except performance sensitive functions and macros (like PyTuple_GET_ITEM). The 
internal C API can use just asserts.

I have a work-in-progress patch which adds tests for the public C API, 
including calls with invalid arguments.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue37386] [EASY] test_io: test_large_file_ops() failed on AMD64 Windows7 SP1 3.x with: [Errno 28] No space left on device

2019-06-26 Thread STINNER Victor


STINNER Victor  added the comment:

Serhiy:
> The test suite fails if there is less than 500 or 600 MB of RAM, not counting 
> bigmem tests. It is not a Python bug, but an environment issue. A buildbot 
> worker should have some free disk space and RAM, and set tests running 
> options correspondingly.

How do you plan to fix buildbots? Contact each buildbot owner and asks them to 
ensure that largefile is only used with at least 2 GiB of free space? And maybe 
install monitor to get an alarm if it's no longer the case?

Maybe some buildbot owners will just remove largefile, which would not be the 
expected reaction, no?

--

___
Python tracker 

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



[issue37386] [EASY] test_io: test_large_file_ops() failed on AMD64 Windows7 SP1 3.x with: [Errno 28] No space left on device

2019-06-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

The test suite fails if there is less than 500 or 600 MB of RAM, not counting 
bigmem tests. It is not a Python bug, but an environment issue. A buildbot 
worker should have some free disk space and RAM, and set tests running options 
correspondingly.

--

___
Python tracker 

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



[issue37413] Deprecate sys._enablelegacywindowsfsencoding()?

2019-06-26 Thread Steve Dower


Steve Dower  added the comment:

It's probably worth at least a post to python-dev to expand the audience, but 
unless someone speaks up with some really good reason why they must update to 
Python 3.10 without updating their own code then let's deprecate it.

FWIW, even with the flag the behaviour changed in 3.6. Previously it would use 
the *A APIs and let Windows do the encoding, but then it changed to the *W APIs 
and Python would encode with our own mbcs:replace, where mbcs is just calling 
through to the WideCharToMultiByte API. So there isn't really anything to 
maintain long term apart from the additional options.

--

___
Python tracker 

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



[issue37415] Error build Python with Intel compiler

2019-06-26 Thread STINNER Victor


STINNER Victor  added the comment:

atomic_uintptr_t is used if HAVE_STD_ATOMIC defined is defined. Can you please 
check in pyconfig.h if it's defined?

So  doesn't provide atomic_uintptr_t with ICC?

--
nosy: +vstinner

___
Python tracker 

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



  1   2   >