[issue37224] test__xxsubinterpreters fails randomly

2019-11-22 Thread Kyle Stanley


Kyle Stanley  added the comment:

So, I was finally able to replicate a failure in test_still_running locally, it 
required using a rather ridiculous number of parallel workers:

$ ./python -m test test__xxsubinterpreters -j200 -F
...
Exception in thread Thread-7:
Traceback (most recent call last):
  File "/home/aeros/repos/aeros-cpython/Lib/threading.py", line 944, in 
_bootstrap_inner
self.run()
  File "/home/aeros/repos/aeros-cpython/Lib/threading.py", line 882, in run
self._target(*self._args, **self._kwargs)
  File "/home/aeros/repos/aeros-cpython/Lib/test/test__xxsubinterpreters.py", 
line 51, in run
interpreters.run_string(interp, dedent(f"""
RuntimeError: unrecognized interpreter ID 39
test test__xxsubinterpreters failed -- Traceback (most recent call last):
  File "/home/aeros/repos/aeros-cpython/Lib/test/test__xxsubinterpreters.py", 
line 766, in test_still_running
interpreters.destroy(interp)
AssertionError: RuntimeError not raised
...
== Tests result: FAILURE ==

94 tests OK.

1 test failed:
test__xxsubinterpreters

Total duration: 1 min 49 sec
Tests result: FAILURE

OS: Arch Linux x86_64
Kernel: 5.3.11
CPU: Intel i5-4460

I was able to consistently reproduce the above failure using 200 parallel 
workers, even without `-f`. 

I have a few different theories that I'd like to test for fixing the failure, 
I'll report back if any of them yield positive results.

--

___
Python tracker 

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



[issue38899] Document that virtual environment activation for fish should use `source`

2019-11-22 Thread miss-islington


miss-islington  added the comment:


New changeset 84b1ff65609c5910b4f838adbe1ead83baae7dbf by Miss Islington (bot) 
(Brett Cannon) in branch 'master':
bpo-38899: virtual environment activation for fish should use `source` 
(GH-17359)
https://github.com/python/cpython/commit/84b1ff65609c5910b4f838adbe1ead83baae7dbf


--
nosy: +miss-islington

___
Python tracker 

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



[issue38864] dbm: Can't open database with bytes-encoded filename

2019-11-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Low level functions inthe os module support both str and bytes paths (they 
support also path-like objects and often support open file descriptors). But 
high level functions support only str and maybe path-like objects. Use 
os.fsdecode if you need to convert  bytes path to str.

--
nosy: +serhiy.storchaka
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue37224] test__xxsubinterpreters fails randomly

2019-11-22 Thread Kyle Stanley


Kyle Stanley  added the comment:

> Sorry I haven't gotten back to you sooner, Kyle.  Thanks for working on this. 
>  I'm looking at your PR right now.

> BTW, Kyle, your problem-solving approach on this is on-track.  Don't get 
> discouraged.  This stuff is tricky. :)

No problem at all, and thank you for the words of encouragement. (:

> Regarding "is_running()", notice that it relies almost entirely on 
> "frame->f_executing".  That might not be enough (or maybe the behavior there 
> changed).  That would be worth checking out.

Hmm, that's an interesting point that I hadn't considered. 

> @aeros, feel free too keep investigating.  I'd be glad to help you out.  
> Otherwise I'll dive into this probably next week.

Sounds good, I'll do some further digging around, particularly anywhere that 
interacts with PyFrameObject's `f_executing` field. I think it's possible that 
there's a non-obvious issue with `_is_running()`, where it works correctly 99% 
of the time. That seems to be a significant commonality between the different 
areas where the intermittent failures are occurring, they all directly or 
indirectly call `_is_running()`.

Also, thanks again Eric for the PR review. Looking back it after Eric's 
analysis and having a couple of months to think it over, I don't think that 
GH-16293 is the correct solution. It seems unlikely that this is being caused 
by a lack of proper GIL acquisition, as that would likely be causing far more 
consistent build failures. I'm thinking that it's more likely to be an issue 
with either:

1) Subinterpreters occasionally disappearing due to premature cleanup (as Eric 
suggested)

2) _is_running() being incorrect a small percentage of the time

--

___
Python tracker 

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



[issue38878] os.PathLike subclasshook causes subclass checks true on abstract implementation

2019-11-22 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue38881] unexpected behaviour of random.choices with zero weights

2019-11-22 Thread Raymond Hettinger


Change by Raymond Hettinger :


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

___
Python tracker 

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



[issue38892] Audit Hook doc typos and confusion

2019-11-22 Thread Terry J. Reedy


Change by Terry J. Reedy :


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

___
Python tracker 

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



[issue38866] test_pyclbr replace asyncore

2019-11-22 Thread Inada Naoki


Change by Inada Naoki :


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



[issue38483] [venv] Add ~/.venvrc to change module defaults

2019-11-22 Thread Cooper Lees


Cooper Lees  added the comment:

I vote in the stdlib. This is the biggest win of venv over virtualenv The aim 
of this request is to allow developers to customize some of the venv defaults 
to make it easier to move from project to project.

To ensure a clean development environment, some days I create multiple venvs 
(virtual environments) a day. I treat my venv's ephemeral, and I am sure many 
other do too. Being able to set `--upgrade-deps` and/or other defaults via a 
config file just saves a few more key strokes and allows Python to be even more 
delightful to develop in over other languages.

In regards to you bringing up pyenv.cfg + metadata, this attacks a totally 
different problem. This is allowing developers to set some defaults for venv 
creation. It does not change any internal meta data and is just an optional 
optimization developers can choose to use.

--

___
Python tracker 

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



[issue37073] clarify functions docs in IO modules and Bytes Objects

2019-11-22 Thread Inada Naoki


Inada Naoki  added the comment:

> The function actually copies `len` bytes from string v instead of the whole 
> string. 

"and length *len*" means it.  So it is not a bug.

If you want to rewrite it to "the first *len* bytes of", you should remove "and 
length *len*".

But please note that every small change will break translations.
Unless you are sure it is better than the current version, please don't change 
it.

> _bufferediobase_readinto_generic(link 2) which may return NULL.

It doesn't return NULL.  NULL in C means it raises the error.
And we don't document it usually.  Otherwise, almost all document has "it may 
raise an exception when an error happens."

--
nosy: +inada.naoki

___
Python tracker 

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



[issue37073] clarify functions docs in IO modules and Bytes Objects

2019-11-22 Thread Inada Naoki


Change by Inada Naoki :


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



[issue38881] unexpected behaviour of random.choices with zero weights

2019-11-22 Thread Tim Peters


Tim Peters  added the comment:

There are a number of "obvious" properties that should obtain, given the 
intended meaning of weights:

- An input with weight 0 should never be returned.

- The distribution shouldn't be affected by adding a new input with weight 0.

- The distribution shouldn't be affected by removing an input with weight 0.

Especially because of the 3rd, the only sensible thing to do is to treat an 
input with weights all 0 much like an empty population - although, in context, 
ValueError would make more immediate sense for "all weights are 0" than the 
IndexError raised for an empty population.

Anything other than that is "too clever" by half, and I just don't believe 
would be of real use often enough to be worth violating the "obvious" 
properties above.

--

___
Python tracker 

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



[issue38892] Audit Hook doc typos and confusion

2019-11-22 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I agree on consistency.  I will make a PR for you to review.

Do you think a minimal code example might help?  Running ...

import sys

def hook(name, args):
if name.startswith('compile'):
print(name, args)

sys.addaudithook(hook)
compile('a = 1', '', 'exec')

# prints

compile (b'a = 1', '')

My own interest is learning about the socket connecting an IDLE GUI process and 
the user code run process.  The following in the two startup files:

def hook(name, args):
if name.startswith('socket'):
print('I', name, args)  # I/R in the IDLE/run processes.
sys.addaudithook(hook)

results in:

I socket.gethostname ()
R socket.gethostname ()
I socket.bind (, ('127.0.0.1', 0))
R socket.bind (, ('127.0.0.1', 0))
R socket.connect (, ('127.0.0.1', 62119))
I socket.__new__ (, 2, 1, 0)
R socket.__new__ (, 2, 1, 0)

To go further, I might wrap socket.socket.send/recv with functions that call 
sys.audit.

--

___
Python tracker 

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



[issue38500] Provide a way to get/set PyInterpreterState.frame_eval without needing to access interpreter internals

2019-11-22 Thread Ned Deily


Change by Ned Deily :


--
keywords: +3.8regression
nosy: +lukasz.langa
priority: normal -> critical

___
Python tracker 

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



[issue25872] multithreading traceback KeyError when modifying file

2019-11-22 Thread Roundup Robot


Change by Roundup Robot :


--
pull_requests: +16845
pull_request: https://github.com/python/cpython/pull/17360

___
Python tracker 

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



[issue38878] os.PathLike subclasshook causes subclass checks true on abstract implementation

2019-11-22 Thread Ammar Askar


Ammar Askar  added the comment:

Just for reference/existing behavior:

>>> class A(collections.abc.Iterable): pass
...
>>> class B:
...   def __iter__(): pass
...
>>> issubclass(B, A)
False
>>> issubclass(B, collections.abc.Iterable)
True
>>> issubclass(A, collections.abc.Iterable)
True

--
nosy: +ammar2

___
Python tracker 

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



[issue38896] Remove PyUnicode_ClearFreeList() function

2019-11-22 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



[issue38896] Remove PyUnicode_ClearFreeList() function

2019-11-22 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset d68b592dd67cb87c4fa862a8d3b3fd0a7d05e113 by Victor Stinner in 
branch 'master':
bpo-38896: Remove PyUnicode_ClearFreeList() function (GH-17354)
https://github.com/python/cpython/commit/d68b592dd67cb87c4fa862a8d3b3fd0a7d05e113


--

___
Python tracker 

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



[issue38878] os.PathLike subclasshook causes subclass checks true on abstract implementation

2019-11-22 Thread Ivan Levkivskyi


Ivan Levkivskyi  added the comment:

> So why is it bad that in the example class B is considered a "subclass" of 
> os.PathLike by implementing the protocol?

This is not bad, my understanding of the problem is that currently B is 
considered a subclass of A, while the latter should not be structural.

To give an analogy with PEP 544 (sorry, this is my favourite one :-)) consider 
this:

class P(Protocol):
def some(self): ...

class C:
def some(self): ...

Here C is obviously a "subclass" of P, but:

class Bad(P):  # <- this is _no_ a protocol, just a nominal class
pass   # explicitly subclassing P

class Good(P, Protocol):  # <- this is a subprotocol that
pass  # happened to be identical to P

So here C is a "subclass" of Good, but not a "subclass" of Bad.

--

___
Python tracker 

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



[issue36876] Global C variables are a problem.

2019-11-22 Thread Eric Snow


Eric Snow  added the comment:

And I *am* still working on the c-analyzer + a test to that runs it, so we can 
keep from adding more globals. :)

--

___
Python tracker 

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



[issue36876] Global C variables are a problem.

2019-11-22 Thread Eric Snow


Eric Snow  added the comment:

FYI, others have been tackling this in separate issues (e.g. Victor, anyone 
relative to PEP 384).

--

___
Python tracker 

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



[issue36876] Global C variables are a problem.

2019-11-22 Thread Eric Snow


Eric Snow  added the comment:

Thanks, Vinay!

--

___
Python tracker 

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



[issue37224] test__xxsubinterpreters fails randomly

2019-11-22 Thread Eric Snow


Eric Snow  added the comment:

Thus far these are the failures we've seen:

* not running when we expect it to be running:
   * interpreters.is_running(interp)
   * interpreters.run_string(interp, ...)
   * interpreters.destroy(interp)
* can't find the interpreter even though we expect it to exist
   * interpreters.run_string(interp, ...)
* finds it running when we expect it to not be running
   * interpreters.run_string(interp, ...)

Except for the last one (which might be a separate issue), they all look like 
they could be explained by the same thing: the subinterpreter stopped (or went 
away) prematurely.  That could be related to the code in 
_xxsubinterpretersmodule.c or it could be the cleanup code that makes sure 
interpreters get cleaned up at the end of tests (e.g. running too soon).  
Either way I expect the fix will be in the module code and not the tests.

Regarding "is_running()", notice that it relies almost entirely on 
"frame->f_executing".  That might not be enough (or maybe the behavior there 
changed).  That would be worth checking out.

@aeros, feel free too keep investigating.  I'd be glad to help you out.  
Otherwise I'll dive into this probably next week.

--

___
Python tracker 

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



[issue37224] test__xxsubinterpreters fails randomly

2019-11-22 Thread Eric Snow


Eric Snow  added the comment:

BTW, Kyle, your problem-solving approach on this is on-track.  Don't get 
discouraged.  This stuff is tricky. :)

--

___
Python tracker 

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



[issue38483] [venv] Add ~/.venvrc to change module defaults

2019-11-22 Thread Brett Cannon


Brett Cannon  added the comment:

Is this best served in the stdlib or in an external tool like how 
virtualenvwrapper is separate from virtualenv? While I get the convenience of 
not having to install another tool to do this, it does bring in some complexity 
that does not directly tie into the metadata required by venv to write out to 
pyvenv.cfg or the directories and files that it creates.

--
nosy: +brett.cannon

___
Python tracker 

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



[issue38899] Document that virtual environment activation for fish should use `source`

2019-11-22 Thread Brett Cannon


Change by Brett Cannon :


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

___
Python tracker 

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



[issue38899] Document that virtual environment activation for fish should use `source`

2019-11-22 Thread Brett Cannon


New submission from Brett Cannon :

https://fishshell.com/docs/current/commands.html#source

--
assignee: brett.cannon
components: Documentation
messages: 357346
nosy: brett.cannon
priority: low
severity: normal
status: open
title: Document that virtual environment activation for fish should use `source`

___
Python tracker 

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



[issue37224] test__xxsubinterpreters fails randomly

2019-11-22 Thread Eric Snow


Eric Snow  added the comment:

Sorry I haven't gotten back to you sooner, Kyle.  Thanks for working on this.  
I'm looking at your PR right now.

--

___
Python tracker 

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



[issue37224] test__xxsubinterpreters fails randomly

2019-11-22 Thread Eric Snow


Change by Eric Snow :


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

___
Python tracker 

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



[issue38748] 32 bit ctypes stdcall callback fails to restore stack pointer

2019-11-22 Thread Steve Dower


Steve Dower  added the comment:

I would guess this is due to the updated libffi, and probably it's a case that 
is not sufficiently tested.

Adding tests is the first step. It'll probably have to enumerate many parameter 
types (in case there's something weird here like misaligning the double after 
the int and not clearing it up, as opposed to a constant 4-byte offset).

Hopefully then the issue is on our side and not part of libffi, but it could be 
anywhere.

--
stage:  -> test needed
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



[issue38686] WWW-Authenticate qop="auth,auth-int" rejected by urllib

2019-11-22 Thread Senthil Kumaran


Change by Senthil Kumaran :


--
resolution:  -> fixed
stage: patch review -> 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



[issue38877] Python 3.9 build fails under Debian 9.11

2019-11-22 Thread Ned Deily


Ned Deily  added the comment:

Glad you got it working.  In general, it is probably a good idea to do a "make 
clean" before or after re-running ./configure in a particular build directory.  
 Ideally, the Makefile dependencies should detect and do the right thing 
automatically so that a manual "make clean" would not be necessary but, with as 
complicated a build system as we have, that goal might be unrealistic (PRs 
welcome though!). In any case adding something to the devguide steps would also 
be a good idea. Again, an issue and/or a PR against the devguide would be 
welcome (https://github.com/python/devguide).

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

___
Python tracker 

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



[issue38686] WWW-Authenticate qop="auth,auth-int" rejected by urllib

2019-11-22 Thread miss-islington


miss-islington  added the comment:


New changeset 07432c33a0cab9d40ec71b274ec4bca5c57ca6e9 by Miss Islington (bot) 
in branch '3.7':
bpo-38686: fix HTTP Digest handling in request.py (GH-17045)
https://github.com/python/cpython/commit/07432c33a0cab9d40ec71b274ec4bca5c57ca6e9


--

___
Python tracker 

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



[issue38878] os.PathLike subclasshook causes subclass checks true on abstract implementation

2019-11-22 Thread Brett Cannon


Brett Cannon  added the comment:

I just realized one problem with this is it explicitly requires subclassing the 
ABC while os.PathLike is supposed to represent a protocol (before 
typing.Protocol was a thing).

So why is it bad that in the example class B is considered a "subclass" of 
os.PathLike by implementing the protocol? Since it implements the expected 
protocol what exactly is being lost by not checking for an explicit 
registration or subclass?

--
nosy: +levkivskyi

___
Python tracker 

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



[issue38721] modulefinder should use import hooks properly

2019-11-22 Thread Dominic Littlewood


Dominic Littlewood <11dlittlew...@gmail.com> added the comment:

In regards to the "unnecessary refactoring", here's a full list of what I've 
changed.

1. Previously, the module revolved around passing files and file descriptors 
around. Now, it uses specs. This means all the functions that used file 
descriptors have to be updated.

2. Due to the previous issue, several functions had to change their call 
signatures. The functions that called them had to change to react.

3. Packages work differently now. They do not have to have an __init__ 
submodule any more, so there's no need for a load_package function - it's 
integrated with load_module.

4. determine_parent was having trouble finding where the relative imports were 
relative to. I changed it to use _calc___package__, same as the import system. 
Half of determine_parent was deleted, because I couldn't understand how it 
worked and eventually worked out that there was literally no way it could ever 
run, so it didn't matter.

5. Modules with no __path__ attribute are not packages. Modules with a __path__ 
attribute of None *are* packages. Code had to be changed to reflect that. 
Looking back, this is possibly a pedantic enough point that these changes could 
be removed and hopefully nothing will go wrong.

6. fix_sys was used to update sys.path (although I have since changed it so it 
does not) and sys.modules. Code had to be changed to make use of it.

7. The only other thing I can think of is that I changed which modules were 
imported in the first few lines of modulefinder, since some had become 
unnecessary. (In fact types and warnings were already unnecessary, but never 
mind about that.)

--

___
Python tracker 

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



[issue38892] Audit Hook doc typos and confusion

2019-11-22 Thread Steve Dower


Steve Dower  added the comment:

Thanks Terry, this is great!

Agree with everything apart from not liking "raise" - I think "raise an event" 
is totally fine usage, and certainly better than "triggers an audit call" 
(since it may not, if nobody's listening). Plus PEP 578 is full of "raise", and 
we're not going to go edit all of that :)

--

___
Python tracker 

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



[issue38686] WWW-Authenticate qop="auth,auth-int" rejected by urllib

2019-11-22 Thread miss-islington


miss-islington  added the comment:


New changeset b9e5547f5814962964c4a5bd5cd36a2af8fbf974 by Miss Islington (bot) 
in branch '3.8':
bpo-38686: fix HTTP Digest handling in request.py (GH-17045)
https://github.com/python/cpython/commit/b9e5547f5814962964c4a5bd5cd36a2af8fbf974


--
nosy: +miss-islington

___
Python tracker 

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



[issue38686] WWW-Authenticate qop="auth,auth-int" rejected by urllib

2019-11-22 Thread Senthil Kumaran


Change by Senthil Kumaran :


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



[issue38686] WWW-Authenticate qop="auth,auth-int" rejected by urllib

2019-11-22 Thread Senthil Kumaran


Change by Senthil Kumaran :


--
versions: +Python 3.9 -Python 2.7, Python 3.7

___
Python tracker 

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



[issue38686] WWW-Authenticate qop="auth,auth-int" rejected by urllib

2019-11-22 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16841
pull_request: https://github.com/python/cpython/pull/17357

___
Python tracker 

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



[issue38686] WWW-Authenticate qop="auth,auth-int" rejected by urllib

2019-11-22 Thread Senthil Kumaran


Senthil Kumaran  added the comment:


New changeset 14a89c47983f2fb9e7fdf33c769e622eefd3a14a by Senthil Kumaran 
(PypeBros) in branch 'master':
bpo-38686: fix HTTP Digest handling in request.py (#17045)
https://github.com/python/cpython/commit/14a89c47983f2fb9e7fdf33c769e622eefd3a14a


--

___
Python tracker 

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



[issue38686] WWW-Authenticate qop="auth,auth-int" rejected by urllib

2019-11-22 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16842
pull_request: https://github.com/python/cpython/pull/17358

___
Python tracker 

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



[issue38686] WWW-Authenticate qop="auth,auth-int" rejected by urllib

2019-11-22 Thread Senthil Kumaran


Change by Senthil Kumaran :


--
versions: +Python 3.8 -Python 3.6

___
Python tracker 

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



[issue38384] An assertion failure in test_pickle

2019-11-22 Thread Tal Einat


Change by Tal Einat :


--
Removed message: https://bugs.python.org/msg357336

___
Python tracker 

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



[issue38384] An assertion failure in test_pickle

2019-11-22 Thread Tal Einat


Tal Einat  added the comment:

Good catch on this, Zackery!

For anyone readying this, Serhiy posted a minimal reproducer in a PR comment, 
and the PR now adds a test for this.

--

___
Python tracker 

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



[issue38384] An assertion failure in test_pickle

2019-11-22 Thread Tal Einat


Tal Einat  added the comment:

Good catch on this, Zackery!

For anyone readying this, Serhit posted a minimal reproducer in a PR comment, 
and the PR now adds a test for this.

--
nosy: +taleinat

___
Python tracker 

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



[issue37228] UDP sockets created by create_datagram_endpoint() allow by default multiple processes to bind the same port

2019-11-22 Thread Kyle Stanley


Kyle Stanley  added the comment:

> This was reported by a partner that was working porting our code to Android 
> but might be fixed current Android API levels. I cannot test this myself.

Thanks, it's helpful to be aware of potential incompatibilities either way. I 
don't think we directly support or test Android, based on 
https://buildbot.python.org/all/#/builders. There's some degree of _indirect_ 
support because Android kernels are based on Linux LTS kernels, but there are 
substantial differences.

> Fully agree, part of the reason why I was suggesting getting rid of 
> reuse_address and reuse_port completely on this higher level API. 

> But I'm happy with Antoine's proposal which effectively kills the 
> reuse_address parameter, just suggesting we also kill reuse_port as well.

Removing support for the *reuse_address* parameter can be justified with the 
security issue, but I don't think we have significant justification to also 
remove *reuse_port* in the same PR. In general, removing a parameter is not 
something taken lightly because of the backwards compatibility concerns. 

I think the argument for eventually deprecating *reuse_port* on the basis of it 
directly mapping to a low-level OS API could be worth further discussion, but 
that's a topic for an entirely separate issue IMO. If it is approved, it would 
have to go through the usual deprecation process, likely starting in 3.9 with a 
DeprecationWarning and a removal no sooner than 3.11.

--

___
Python tracker 

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



[issue38865] Can Py_Finalize() be called if the current interpreter is not the main interpreter?

2019-11-22 Thread Eric Snow


Eric Snow  added the comment:

I could swear the topic of destroy-everything-in-PyFinalize has come up before 
but I don't remember anything specific.  Doing so there sure makes sense 
though...

--

___
Python tracker 

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



[issue38524] functools.cached_property is not supported for setattr

2019-11-22 Thread Tal Einat


Tal Einat  added the comment:

Hi Florian! We'd be happy to have you do this, please go ahead.

When you have a PR ready, you're welcome to request my review.

--

___
Python tracker 

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



[issue38865] Can Py_Finalize() be called if the current interpreter is not the main interpreter?

2019-11-22 Thread Eric Snow


Eric Snow  added the comment:

> * Is Python supposed to magically destroy the 3 interpreters?

Doesn't it?  Gah.  I guess I was thinking of PyOS_AfterFork_Child(), which 
calls _PyInterpreterState_DeleteExceptMain(). :/  In September there was a nice 
comment right above Py_FinalizeEx() saying that we do not clean up other 
interpreters or threads, but I haven't checked when it got removed.

--

___
Python tracker 

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



[issue38865] Can Py_Finalize() be called if the current interpreter is not the main interpreter?

2019-11-22 Thread Eric Snow


Eric Snow  added the comment:

tl;dr Py_Finalize() probably *should* only be allowed under the main 
interpreter.

As you know well, when the runtime starts we do it at first relative to a 
partially initialized main interpreter and the finish initialization with a 
fully operational main interpreter.  My expectation is that some of the global 
runtime state relies somehow on the main interpreter's state.  Consequently, 
finalization would then need to happen under the main interpreter.

The same idea applies to fork-without-exec, where we destroy all interpreters 
but the current one.  We now only allow os.fork() in the main interpreter.  So 
I'd expect the same treatement for finalization.

On the other hand, if the "main" interpreter isn't special after runtime init 
is done (i.e. a subinterpreter is effectively indistinguishable by nature) then 
it certainly would not matter which one finalizes (or is active during fork() 
for that matter).  On top of that, the effort we are making to identify the 
main interpreter (both in the code and in the docs) becomes unnecessary.

If we look at it from that angle, though, we do have cases where the main 
interpreter is still significant (regardless of the relationship between the 
main interpreter and the global runtime state).  At the very least, the main 
interpreter is solely responsible for some global resources, like signals.  So 
the main interpreter cannot go away until nothing else in the runtime relies on 
those resources.  I expect that we won't go down that route, which means 
finalization should happen only under the main interpreter.

Also keep in mind that this only matters relative to the C-API and I expect 
only embedders (not extensions) will be finalizing the runtime.  With PEP 554 
the only case where you would run into problems is when running subinterpreters 
in daemon threads.  And we already know about problems with daemon threads 
during runtime finalization! :)

--

___
Python tracker 

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



[issue30060] Crash with subinterpreters and Py_NewInterpreter()

2019-11-22 Thread Eric Snow


Eric Snow  added the comment:

Victor's comment [1] on that related issue, implies that this may no longer be 
a problem (on 3.8).  Please check.  Thanks!


[1] https://bugs.python.org/issue17978#msg355166

--
status: open -> pending

___
Python tracker 

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



[issue36854] GC operates out of global runtime state.

2019-11-22 Thread Eric Snow


Eric Snow  added the comment:

Did I mention that you're my hero? :)

--

___
Python tracker 

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



[issue17639] symlinking .py files creates unexpected sys.path

2019-11-22 Thread Guido van Rossum


Change by Guido van Rossum :


--
nosy:  -gvanrossum

___
Python tracker 

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



[issue36854] GC operates out of global runtime state.

2019-11-22 Thread Eric Snow


Eric Snow  added the comment:

Thanks so much for getting this done, Victor!

> I'm not fully happy with this solution

Should we have an issue open for finding a better solution?  Are there risks 
with what you did that we don't want long-term?

--

___
Python tracker 

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



[issue38804] Regular Expression Denial of Service in http.cookiejar

2019-11-22 Thread Ned Deily


Ned Deily  added the comment:


New changeset 0716056c49e9505041e30386dad9b2e788f67aaf by Ned Deily (Miss 
Islington (bot)) in branch '3.6':
bpo-38804: Fix REDoS in http.cookiejar (GH-17157) (#17343)
https://github.com/python/cpython/commit/0716056c49e9505041e30386dad9b2e788f67aaf


--
nosy: +ned.deily

___
Python tracker 

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



[issue37334] Add a cancel method to asyncio Queues

2019-11-22 Thread Emmanuel Arias


Change by Emmanuel Arias :


--
nosy: +eamanu

___
Python tracker 

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



[issue38878] os.PathLike subclasshook causes subclass checks true on abstract implementation

2019-11-22 Thread Bar Harel


Bar Harel  added the comment:

Done.

On Fri, Nov 22, 2019, 12:23 PM Bar Harel  wrote:

>
> Change by Bar Harel :
>
>
> --
> keywords: +patch
> pull_requests: +16820
> stage: resolved -> patch review
> pull_request: https://github.com/python/cpython/pull/17336
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue38840] incorrect __all__ list in multiprocessing.managers module

2019-11-22 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
nosy: +davin, pitrou

___
Python tracker 

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



[issue38524] functools.cached_property is not supported for setattr

2019-11-22 Thread Florian Dahlitz


Florian Dahlitz  added the comment:

It would be an honor for me to work on this issue (updating the docs) as my 
first CPython contribution.

--
nosy: +DahlitzFlorian

___
Python tracker 

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



[issue38889] Segmentation fault when using EPF Importer

2019-11-22 Thread Sebastian Szwarc


Sebastian Szwarc  added the comment:

I strongly disagree. Python 2.7 is 2.7 -> if some new errors appeared
after upgrading between minor version this is not expected behaviour,
and therefore it means there is error in interpreter itself.
upgrading from 2.7 to 2.7 is not the same as upgrading from swift 3 to swift 4.

And as I said in another comment - I dont understand your tendency to
"minimal example" - minimal example solves nothing because minimal !=
production.
On production there is of course 3rd party code - tool is written by
Apple and MysqlDB module by another 3rd party vendor. How can you even
expect to provide minimal example in such case?

Not to mention I got no errors in code - just SEGMENTATION FAULT which
indicates python interpreter after upgrade doing something very bad in
memory management ---> this is python issue.
Or give me solution to install specific version of 2.7 that was
available one year ago on Ubuntu.

On Fri, Nov 22, 2019 at 1:22 AM Eric V. Smith  wrote:
>
>
> Eric V. Smith  added the comment:
>
> I agree this doesn't look like a python bug.
>
> However, if the original poster can reproduce it with a short example with no 
> third party code, we could take another look. If so, please re-open this 
> issue.
>
> And just because the code worked on a different version of python doesn't 
> mean there's no bug in the code. I've written plenty of code where errors 
> were exposed in my code when updating python.
>
> --
> nosy: +eric.smith
> resolution:  -> third party
> stage:  -> resolved
> status: open -> closed
>
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue38898] Tkinter checkbutton switch on and off together

2019-11-22 Thread zaza hohonini


New submission from zaza hohonini :

Hello,

I am running python 3.8.0 and found a problem where multiple checkbuttons get 
switched when I click one. From observing it looks like each first check button 
in a frame is linked. And each second, etc. I ran the some program in python 
2.7.17 and it works as expected.

Basic program that show the problem:

import tkinter as tk

class Hello(tk.Frame): 
def __init__(self, parent=None):
tk.Frame.__init__(self, parent)
check = tk.Checkbutton(self, text='Checkbutton')
check.pack()

root = tk.Tk()
Hello(root).pack()
Hello(root).pack()
root.mainloop()

--
components: Tkinter
files: tkinter-checkbutton-bug.ogv
messages: 357323
nosy: zaza hohonini
priority: normal
severity: normal
status: open
title: Tkinter checkbutton switch on and off together
versions: Python 3.8
Added file: https://bugs.python.org/file48741/tkinter-checkbutton-bug.ogv

___
Python tracker 

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



[issue38538] dictobject dictviews don't return NotImplemented for unrecognized types.

2019-11-22 Thread Julien Palard


Julien Palard  added the comment:

Let's start slowly by warning when a non-set is given to the __or__ of dictview?

I think it is just a side effect of the current implementation, not a feature.

--

___
Python tracker 

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



[issue38858] new_interpreter() should reuse more Py_InitializeFromConfig() code

2019-11-22 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 2ec1a1b307cc893adae4662a32e1d2e94b6908e3 by Victor Stinner in 
branch 'master':
bpo-38858: new_interpreter() uses pycore_init_import_warnings() (GH-17353)
https://github.com/python/cpython/commit/2ec1a1b307cc893adae4662a32e1d2e94b6908e3


--

___
Python tracker 

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



[issue38882] IDLE should not make the about dialog be a transient of the withdrawn root window

2019-11-22 Thread Marc Culler


Marc Culler  added the comment:

One thing to keep in mind is that Apple's release of OSX 10.14.6 caused
Tk 8.6.8 to stop working on many systems in an extremely obnoxious way.
Starting a Tk Application would trigger a segfault in Apple's WindowServer
which would then cause the user to be immediately logged out. That does
not happen with 8.6.10.  (Other types of applications were also affected.)

Here is one of many bug reports:
 https://github.com/matplotlib/matplotlib/issues/14999

Whether the crash would occur depended on which Apple hardware was used.

--

___
Python tracker 

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



[issue38855] test_unpack.py does not catch the unpacking of a set

2019-11-22 Thread Zachary Ware


Zachary Ware  added the comment:

Absent clarification from the OP (though it appears some may have been added to 
bpo-38853), I'm closing the issue.

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

___
Python tracker 

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



[issue38650] Add constantness to PyStructSequence_UnnamedField

2019-11-22 Thread Eric Snow


Eric Snow  added the comment:

I wouldn't worry about the c-analyzer stuff for now.  I plan on re-generating 
the file in the near future.

--
nosy: +eric.snow

___
Python tracker 

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



[issue38882] IDLE should not make the about dialog be a transient of the withdrawn root window

2019-11-22 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I still want to look at what happens on 3.x.

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



[issue38882] IDLE should not make the about dialog be a transient of the withdrawn root window

2019-11-22 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Ned, is our last Mac installer for 2.7 going to use tk 8.6.10?

I am extremely reluctant to touch IDLE for 2.7 since beginners are nearly all 
using 3.x and any mistakes are forever.

--

___
Python tracker 

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



[issue38868] Shutil cannot delete a folder that contains an .ini file

2019-11-22 Thread Eryk Sun


Eryk Sun  added the comment:

The directory probably has the "readonly" attribute set. The documentation 
includes a basic remove_readonly error handler for rmtree [1]:

import os, stat
import shutil

def remove_readonly(func, path, _):
"Clear the readonly bit and reattempt the removal"
os.chmod(path, stat.S_IWRITE)
func(path)

shutil.rmtree(directory, onerror=remove_readonly)

That the readonly attribute prevents unlinking a directory is not particularly 
useful because a directory has to be empty anyway in order to unlink it. This 
is in contrast to the "immutable" file attribute in Linux, which prevents any 
modification of a directory, such as linking or unlinking files in it. Windows 
inherits its comparatively simplistic behavior for readonly directories from 
MS-DOS.

Since setting a directory as readonly is practically useless, the Windows shell 
reuses this attribute to indicate a customized folder [2]. If a directory is 
flagged readonly, the shell checks for and reads a "desktop.ini" file in it 
that can set a custom name, icon, tooltip, etc. Given you're copying a folder 
that contains a desktop.ini file, it's very likely that the readonly attribute 
is set. 

shutil.copytree will copy the readonly attribute to the destination directory 
via os.chmod. This is the only file attribute that gets copied (e.g. hidden and 
system aren't handled), due to a hack in the Windows CRT that conflates the 
readonly file attribute as a write 'permission' for chmod() and stat(). (Being 
readonly is an attribute of the file or directory, not a granted permission. 
os.access is the correct function to take both attributes and permissions into 
account, not os.stat.) Python inherits the CRT behavior in its own 
implementation of os.chmod and os.stat in Windows. It does so as an accident of 
history, not because it's justified.

[1] https://docs.python.org/3/library/shutil.html#rmtree-example
[2] 
https://docs.microsoft.com/en-us/windows/win32/shell/how-to-customize-folders-with-desktop-ini

--

___
Python tracker 

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



[issue38897] Example in socket documentation uses deprecated array.fromstring

2019-11-22 Thread David Coles


New submission from David Coles :

See the `recv_fds` example for `socket.recvmsg`.

This code produces a `DeprecationWarning` on current versions of Python.

https://docs.python.org/3.9/library/socket.html#socket.socket.recvmsg

--
assignee: docs@python
components: Distutils, Documentation
messages: 357314
nosy: corona10, dcoles, docs@python, dstufft, eric.araujo
priority: normal
pull_requests: 16840
severity: normal
status: open
title: Example in socket documentation uses deprecated array.fromstring
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



[issue38896] Remove PyUnicode_ClearFreeList() function

2019-11-22 Thread STINNER Victor


STINNER Victor  added the comment:

See also similar issue, bpo-37340 "Remove PyMethod_ClearFreeList() and 
PyCFunction_ClearFreeList() functions".

--

___
Python tracker 

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



[issue38896] Remove PyUnicode_ClearFreeList() function

2019-11-22 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue38896] Remove PyUnicode_ClearFreeList() function

2019-11-22 Thread STINNER Victor

New submission from STINNER Victor :

The PyUnicode_ClearFreeList() function does nothing since Python 3.3, since 
this change:

commit d63a3b8beb4a0841cb59fb3515347ccaab34b733
Author: Martin v. Löwis 
Date:   Wed Sep 28 07:41:54 2011 +0200

Implement PEP 393.

I propose attached PR to remove the function.

It seems like the function is part of the limited API and exported by 
PC/python3.def. But I don't see any usecase to explicitly clear the unicode 
freelist. Call gc.collect() to clear all free lists: no private API is needed.

--
components: Interpreter Core
messages: 357312
nosy: vstinner
priority: normal
severity: normal
status: open
title: Remove PyUnicode_ClearFreeList() function
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



[issue38858] new_interpreter() should reuse more Py_InitializeFromConfig() code

2019-11-22 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +16838
pull_request: https://github.com/python/cpython/pull/17353

___
Python tracker 

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



[issue38858] new_interpreter() should reuse more Py_InitializeFromConfig() code

2019-11-22 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 2582d46fbcf7bdf86b9cf4016850b8d155267ac6 by Victor Stinner in 
branch 'master':
bpo-38858: new_interpreter() reuses pycore_init_builtins() (GH-17351)
https://github.com/python/cpython/commit/2582d46fbcf7bdf86b9cf4016850b8d155267ac6


--

___
Python tracker 

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



[issue38500] Provide a way to get/set PyInterpreterState.frame_eval without needing to access interpreter internals

2019-11-22 Thread STINNER Victor


STINNER Victor  added the comment:

> @victor if we are going to ask folks to start using a setter and getter I say 
> we might as well get it right the first time and start taking the tstate now.

Done: New PR 17352 combines my two other PRs.

--

___
Python tracker 

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



[issue38818] Modify PyInterpreterState.eval_frame to pass tstate (PyThreadState)

2019-11-22 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +16837
pull_request: https://github.com/python/cpython/pull/17352

___
Python tracker 

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



[issue38500] Provide a way to get/set PyInterpreterState.frame_eval without needing to access interpreter internals

2019-11-22 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +16836
pull_request: https://github.com/python/cpython/pull/17352

___
Python tracker 

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



[issue38021] pep425 tag for AIX is inadequate

2019-11-22 Thread Paul Moore


Paul Moore  added the comment:

What complicates the issue for AIX (and reminds me very strongly of the MacOS 
and manylinux situations, both of which were defined after the original tag 
PEP, and so contain additional insights) is the business of certain tags being 
compatible across multiple AIX versions.

That's something that needs to be fairly clearly specified, so that 
implementors and maintainers understand the design. And even more so for a 
niche platform like AIX, as we can't rely on a platform expert being available. 
(Consider for example a pip issue "this wheel says it's compatible with AIX 
x.y.z, my machine is AIX x.y.w which is documented as compatible, why isn't it 
working?")

It's possible that all of this may not have any relevance to the specific 
change to core Python, but it's hard to be sure of that when there's nothing 
other than your explanation to go on. A tagging spec would act as a clear 
reference to work from (even if it's basically just you writing up your 
knowledge, doing so would at least allow people to say "hey - I don't follow 
that bit, can you clarify").

To put it another way, you need somebody to sign off on this change as correct. 
You'll have an easier time of getting that if there's a written up spec that 
Python developers can refer to, without having to go back to (and understand) 
all of the AIX source material that it's based on.

--

___
Python tracker 

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



[issue38500] Provide a way to get/set PyInterpreterState.frame_eval without needing to access interpreter internals

2019-11-22 Thread Brett Cannon


Brett Cannon  added the comment:

@greg I hope this goes into 3.8.1 since it was a breaking change.

@victor if we are going to ask folks to start using a setter and getter I say 
we might as well get it right the first time and start taking the tstate now.

--

___
Python tracker 

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



[issue37334] Add a cancel method to asyncio Queues

2019-11-22 Thread Yury Selivanov


Yury Selivanov  added the comment:

> 1. A CancelledError (or maybe`QueueCancelled`?) exception is raised in all 
> producers and consumers ) - this gives a producer a chance to handle the 
> error and do something with the waiting item that could not be `put()`

> 2. Items currently on the queue still get processed in the consumers before 
> the consumers exit.

This (especially 2) sounds quite tricky.

Maybe we should just add a method to Queue to get the list of current 
consumers, of pending consumers, and pending producers?  This way users can 
implement whatever semantics they want (probably :wink:).

--

___
Python tracker 

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



[issue38858] new_interpreter() should reuse more Py_InitializeFromConfig() code

2019-11-22 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +16835
pull_request: https://github.com/python/cpython/pull/17351

___
Python tracker 

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



[issue38858] new_interpreter() should reuse more Py_InitializeFromConfig() code

2019-11-22 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 82c83bd907409c287a5bd0d0f4598f2c0538f34d by Victor Stinner in 
branch 'master':
bpo-38858: _PyImport_FixupExtensionObject() handles subinterpreters (GH-17350)
https://github.com/python/cpython/commit/82c83bd907409c287a5bd0d0f4598f2c0538f34d


--

___
Python tracker 

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



[issue37334] Add a cancel method to asyncio Queues

2019-11-22 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

My point is that closing (or cancellation) should be one-way ticket.

Is there a case where continuing after stopping?

--

___
Python tracker 

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



[issue38021] pep425 tag for AIX is inadequate

2019-11-22 Thread Michael Felt


Michael Felt  added the comment:

@paul.moore - thanks for the comment.

I am trying to work from both 
https://packaging.python.org/specifications/platform-compatibility-tags/ which 
describes in a few words the goals of PEP425.

As to the PEP425 itself, it does not specify what a tag looks like. Within the 
EPE the only description is:

The platform tag is simply distutils.util.get_platform() with all hyphens - and 
periods . replaced with underscore _.

Like the platform-compatibility-tags reference says - the rational (aka 
requirement) 

"distributions should have a file naming convention that includes enough 
information to decide whether or not a particular archive is compatible with a 
particular implementation."

The tag I am proposing 'includes enough information'.

Further, as to the comparison of Linux and macos approaches to tags and 
deciding "whether or not a particular archive is compatible" AIX system 
architecture does not have to deal with the diversity that Linux platforms do - 
so it would be closer to macos approach.

Actually, deciding if a bdist is compatible or not will not be the hard part. 
However, I prefer to discuss that after a starting point - the platform tag 
itself - is achieved.

The last bit I am looking into is how, e.g., ``pip`` looks/searches pypi for 
candidates.

--

___
Python tracker 

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



[issue37334] Add a cancel method to asyncio Queues

2019-11-22 Thread Martin Teichmann


Martin Teichmann  added the comment:

Yes, in the one-producer-many-consumers situation on can indeed to the trick 
with the None. But this is just a clumsy hack, cancelling the tasks is IMHO 
more in line with asyncio.

In the many-producers-one-consumer scenario this does not work. The one dead 
consumer cannot feed back to the producers. Sure, there are still many hacks 
imaginable, but a closing or cancelling the queue is a very clear way of doing 
things.

As for the naming: I personally don't care, close() or cancel() are both fine 
with me.

--

___
Python tracker 

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



[issue38858] new_interpreter() should reuse more Py_InitializeFromConfig() code

2019-11-22 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +16834
pull_request: https://github.com/python/cpython/pull/17350

___
Python tracker 

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



[issue17639] symlinking .py files creates unexpected sys.path

2019-11-22 Thread Guido van Rossum

Guido van Rossum  added the comment:

You have a point — I was just responding to Nick’s last message without
noticing how old it was. I’ll remove myself from the nosy list.

On Fri, Nov 22, 2019 at 15:14 Kristján Valur Jónsson 
wrote:

>
> Kristján Valur Jónsson  added the comment:
>
> So you have already stated, and this issue is six years old now.
>
> While I no longer have a stake in this, I'd just like to reiterate that
> IMHO it breaks several good practices of architecture, particularly that of
> separation of roles.
>
> The abstraction called symbolic links is the domain of the filesystem.  An
> application should accept the image that the filesystem offers, not try to
> second-guess the intent of an operator by arbitrarily, and unexpectedly,
> unrolling that abstraction.
>
> While you present a use case, I argue that it isn't, and shouldn't be, the
> domain of the application to intervene in an essentially shell specific,
> and operator specific process of collecting his favorite shortcuts in a
> folder.  For that particular use case, a more sensible way would be for the
> user to simply create shell shortcuts, even aliases, for his favorite
> python scripts.  This behaviour is basically taking over what should be the
> role of the shell.  I'm unable to think of another program doing this sort
> of thin.
>
> I suppose that now, with the reworked startup process, it would be simpler
> to actually document this rather unexpected behaviour, and possibly provide
> a flag to override it.  I know that I some spent time on this and came away
> rather stumped.
>
> --
>
> ___
> Python tracker 
> 
> ___
>
-- 
--Guido (mobile)

--

___
Python tracker 

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



[issue38882] IDLE should not make the about dialog be a transient of the withdrawn root window

2019-11-22 Thread Marc Culler


Change by Marc Culler :


--
versions: +Python 2.7 -Python 3.7

___
Python tracker 

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



[issue29275] time module still has Y2K issues note

2019-11-22 Thread miss-islington


miss-islington  added the comment:


New changeset ca5fafc2bbda9373c9ab12b76d17614585cffc23 by Miss Islington (bot) 
in branch '3.8':
closes bpo-29275: Remove Y2K reference from time module docs (GH-17321)
https://github.com/python/cpython/commit/ca5fafc2bbda9373c9ab12b76d17614585cffc23


--

___
Python tracker 

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



[issue29275] time module still has Y2K issues note

2019-11-22 Thread miss-islington


miss-islington  added the comment:


New changeset c58a8116475fc9e90fe87b150cde4e535173ec1c by Miss Islington (bot) 
in branch '3.7':
closes bpo-29275: Remove Y2K reference from time module docs (GH-17321)
https://github.com/python/cpython/commit/c58a8116475fc9e90fe87b150cde4e535173ec1c


--
nosy: +miss-islington

___
Python tracker 

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



[issue29275] time module still has Y2K issues note

2019-11-22 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16833
pull_request: https://github.com/python/cpython/pull/17349

___
Python tracker 

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



[issue29275] time module still has Y2K issues note

2019-11-22 Thread Benjamin Peterson


Benjamin Peterson  added the comment:


New changeset 42bc60ead39c7be9f6bb7329977826e962f601eb by Benjamin Peterson 
(Callum Ward) in branch 'master':
closes bpo-29275: Remove Y2K reference from time module docs (GH-17321)
https://github.com/python/cpython/commit/42bc60ead39c7be9f6bb7329977826e962f601eb


--
nosy: +benjamin.peterson
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



[issue29275] time module still has Y2K issues note

2019-11-22 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16832
pull_request: https://github.com/python/cpython/pull/17348

___
Python tracker 

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



[issue38858] new_interpreter() should reuse more Py_InitializeFromConfig() code

2019-11-22 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset b00513636c9891deba4cae50217e25e8faf6c6ac by Victor Stinner in 
branch 'master':
bpo-38858: Add init_interp_main() subfunction (GH-17347)
https://github.com/python/cpython/commit/b00513636c9891deba4cae50217e25e8faf6c6ac


--

___
Python tracker 

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



[issue38895] performance degradation creating a mock object (by factor 7-8)

2019-11-22 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue38895] performance degradation creating a mock object (by factor 7-8)

2019-11-22 Thread Julian


Change by Julian :


--
title: performance degradation creating a mock object -> performance 
degradation creating a mock object (by factor 7-8)

___
Python tracker 

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



[issue38895] performance degradation creating a mock object

2019-11-22 Thread Julian


New submission from Julian :

There seems to be a performance issue when creating a Mock() object from 
unittest module.
The performance difference between 3.7.x and 3.8.0 is about 7-8 times slower in 
3.8

Heres the smalles sample i could generate:

Using python 3.7.5

```
python3 -m timeit -v --number=10 --setup="from unittest.mock import Mock" 
"Mock()"
raw times: 2.99 sec, 2.96 sec, 3.33 sec, 2.98 sec, 2.92 sec

10 loops, best of 5: 29.2 usec per loop
```


Using python 3.8.0
```
python3 -m timeit -v --number=10 --setup="from unittest.mock import Mock" 
"Mock()"
raw times: 16.9 sec, 17 sec, 17.7 sec, 18.1 sec, 16.3 sec

10 loops, best of 5: 163 usec per loop

```

I did not find that issue, but a co-worker.

--
messages: 357297
nosy: julianhille
priority: normal
severity: normal
status: open
title: performance degradation creating a mock object
type: performance
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



[issue38858] new_interpreter() should reuse more Py_InitializeFromConfig() code

2019-11-22 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +16831
pull_request: https://github.com/python/cpython/pull/17347

___
Python tracker 

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



  1   2   >