[issue38945] Remove newline characters from uu encoding methods

2020-03-20 Thread Larry Hastings


Larry Hastings  added the comment:


New changeset 8835f465fa94f114dcf865429c0410821d365dae by Ned Deily in branch 
'3.5':
bpo-38945: UU Encoding: Don't let newline in filename corrupt the output format 
(GH-17418) (GH-17444) (#17445)
https://github.com/python/cpython/commit/8835f465fa94f114dcf865429c0410821d365dae


--
nosy: +larry

___
Python tracker 

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



[issue40025] enum: _generate_next_value_ is not called if its definition occurs after calls to auto()

2020-03-20 Thread Ethan Onstott


Change by Ethan Onstott :


--
keywords: +patch
nosy: +Ethan Onstott
nosy_count: 5.0 -> 6.0
pull_requests: +18458
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/19098

___
Python tracker 

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



[issue40012] Avoid Python 2 documentation to appear in Web search results

2020-03-20 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

See also the approach to use robots.txt 
https://github.com/python/pythondotorg/issues/1030

--
nosy: +xtreak

___
Python tracker 

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



[issue21760] inspect documentation describes module type inaccurately

2020-03-20 Thread Furkan Önder

Change by Furkan Önder :


--
keywords: +patch
nosy: +furkanonder
nosy_count: 3.0 -> 4.0
pull_requests: +18457
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/19097

___
Python tracker 

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



[issue40017] Please support CLOCK_TAI in the time module.

2020-03-20 Thread Russell Owen


Change by Russell Owen :


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

___
Python tracker 

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



[issue32173] linecache.py add lazycache to __all__ and use dict.clear to clear the cache

2020-03-20 Thread A.M. Kuchling


A.M. Kuchling  added the comment:

Patch has been applied.

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



[issue20459] No Argument Clinic documentation on how to specify a return converter

2020-03-20 Thread Furkan Önder

Furkan Önder  added the comment:

I couldn't understand your problem.Can you explain more?

--
nosy: +furkanonder

___
Python tracker 

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



[issue40022] 关于列表的基础算法问题

2020-03-20 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Test01.py runs as expected with no exceptions.  This issue appears to be based 
on a misunderstanding of one or both of two things:
a) multiplying an empty list does nothing other than returning a new empty list.
b) list.insert(index, value) treats the index as a slice index.  This is 
specified in the doc by "same as s[index:index] = [value]". (I spelled out the 
parameter names.)
https://docs.python.org/3/library/stdtypes.html#mutable-sequence-types

>>> l1, l2 = [], []
>>> l1.insert(6, 0); l2[6:6] = [0]
>>> l1, l2
([0], [0])

--
nosy: +terry.reedy
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



[issue40012] Avoid Python 2 documentation to appear in Web search results

2020-03-20 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I completely agree with the goal.  But I think that this is duplicate of at one 
previous issue either here or on the website tracker.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue40011] Tkinter widget events become tuples

2020-03-20 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

IDLE uses tkinter extensively and runs fine on 3.0 to the upcoming 3.9.  Events 
remain Events and event.type, event.widget, event.x, and so on continue to work 
as appropriate for the event type.  As far as I know, the only directly 
tkinter-related changes were the import names for tkinter and its subpackages.

The same has been true for countless other tkinter users. So until you or 
someone can produce a short example that only imports tkinter and definitely 
not anything outside of the stdlib, I (and I think 'we') will assume that the 
problem is with your code or one of the modules you import or possibly a 
system-specific bad compilation of tcl/tk/_tkinter.c or mangled tkinter.py.

Some notes to maybe help:
1. When reporting an exception, one should nearly always paste the complete 
traceback.

2. The first post-import statement in tboplayer.py monkey-patches tkinter with
  tk.CallWrapper = ExceptionCatcher
where ExceptionCatcher must be a class from one of the 3rd party * imports.

To see if one of the 3rd party modules is replacing tk.Event when imported, put 
'print(Event)' after 'from tkinter import *'.  You should see "".  If not, move the import and debug print up.  If so, put 
debug prints down in your code.

3. Passing non-Events (like False) as the event argument, especially when this 
unusually possibility is not documented.  A common idiom would be
def select_track(event=None):
...
if event is not None: ...
A reader should be able to assume that any non-None event is really an event.

Python-list, which I read, would be one good place for any further discussion.

--
nosy: +terry.reedy -gpolo
resolution:  -> third party
stage:  -> resolved
status: open -> closed
title: Tkinter widget events are of type Tuple -> Tkinter widget events become 
tuples

___
Python tracker 

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



[issue40028] Math module method to find prime factors for non-negative int n

2020-03-20 Thread Tim Peters


Tim Peters  added the comment:

Good idea, but yet another that really belongs in an `imath` module (which 
doesn't yet exist).

How ambitious should it be?  Sympy supplies a `factorint()` function for this, 
which uses 4 approaches under the covers:  perfect power, trial division, 
Pollard rho, and Pollard p-1.  All relatively simple to code with trivial 
memory burden, but not really practical (too slow) for "hard" composites well 
within the practical range of advanced methods.

But I'd be happy enough to settle for that.

--
components: +Library (Lib)
nosy: +tim.peters
stage:  -> needs patch
type:  -> enhancement

___
Python tracker 

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



[issue40005] Getting different result in python 2.7 and 3.7.

2020-03-20 Thread Tim Peters


Change by Tim Peters :


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



[issue40005] Getting different result in python 2.7 and 3.7.

2020-03-20 Thread Eric V. Smith


Eric V. Smith  added the comment:

I agree it's not a bug. It's a known difference between Windows and Linux, due 
to fork() semantics.

--

___
Python tracker 

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



[issue40005] Getting different result in python 2.7 and 3.7.

2020-03-20 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Bharat, when responding by email, *please* delete from your response the the 
post you are responding to.  Your response is added below that message, and 
including it is duplicate noise.

Tim, you seem to be saying that this should be closed as 'not a bug'.  Correct?

--
nosy: +terry.reedy
type: compile error -> behavior
versions: +Python 3.7 -Python 2.7

___
Python tracker 

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



[issue40028] Math module method to find prime factors for non-negative int n

2020-03-20 Thread Mark Dickinson


Change by Mark Dickinson :


--
nosy: +mark.dickinson

___
Python tracker 

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



[issue40016] Clarify flag case in `re` module

2020-03-20 Thread Ram Rachum


Ram Rachum  added the comment:

I updated my PR to match.

--

___
Python tracker 

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



[issue22699] Module source files not found when cross-compiling

2020-03-20 Thread Steve Dower


Steve Dower  added the comment:

> the multiarch approach allows you to install libraries and headers for many 
> architectures in the same installation/chroot

That makes sense, but I'm not using it. So presumably I've added a configure 
option that I didn't need (either "--host=x86_64-my-linux" or "--build=x86_64").

I'm building against a Yocto SDK (like described at 
https://www.yoctoproject.org/docs/2.1/sdk-manual/sdk-manual.html#sdk-installing-the-sdk),
 and the --host option identifies the sysroot.

When I add just --host, I also have to add --build, and IIRC only x86_64 
worked. Could that have enabled the multiarch settings? Or it is always enabled 
because I'm building on an Ubuntu VM?

--

___
Python tracker 

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



[issue39988] Remove AugLoad and AugStore expression context from AST

2020-03-20 Thread Jack O'Connor


Jack O'Connor  added the comment:

Ah never mind, it looks like that's covered by 
https://bugs.python.org/issue3

--

___
Python tracker 

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



[issue39988] Remove AugLoad and AugStore expression context from AST

2020-03-20 Thread Jack O'Connor


Jack O'Connor  added the comment:

This change may have broken pyflakes on nightly Python. Is that expected or 
problematic?

Error message:

"pyflakes" failed during execution due to "module 'ast' has no attribute 
'AugLoad'"

Seen at: https://travis-ci.org/github/buildinspace/peru/jobs/665005023

--
nosy: +oconnor663

___
Python tracker 

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



[issue39975] Commands running in 3.7.6 Shell, but failing as script

2020-03-20 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

This tracker is for improving future versions of python.  Questions about using 
current python belong on python-list or other help forums, such as 
stackoverflow.  Reading the following will help you ask good questions.
https://stackoverflow.com/help/minimal-reproducible-example

A few notes:
1. The minimal example is likely 'import tensorflow as tf'.
2. The 'shell' part of your post is not copied from an interactive session 
(IDLE?), as there are no prompts.
3. The typical reason for the same import working and then not working is 
running the import with two different python binaries with different installed 
3rd-party packages.  If you ran twice in the same IDLE, once interactively and 
once from an editor, that would not be an issue, and I would not know why the 
difference.
4. Tensorflow keras assumes that it is outputting to a text terminal, which 
IDLE is not, so there may be glitches in output formatting.

--
nosy: +terry.reedy
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
title: Group of commands running in Python 3.7.6 Shell, but failing as Script 
file. -> Commands running in 3.7.6 Shell, but failing as script

___
Python tracker 

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



[issue40028] Math module method to find prime factors for non-negative int n

2020-03-20 Thread Ross Rhodes


New submission from Ross Rhodes :

Hello,

Thoughts on a new function in the math module to find prime factors for 
non-negative integer, n? After a brief search, I haven't found previous 
enhancement tickets raised for this proposal, and I am not aware of any 
built-in method within either Python's math module or numpy, but happy to be 
corrected on that front.

If there's no objection and the method does not already exist, I'm happy to 
implement it and open for review.

Ross

--
messages: 364711
nosy: trrhodes
priority: normal
severity: normal
status: open
title: Math module method to find prime factors for non-negative int n
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



[issue39971] Error in functional how-to example

2020-03-20 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Looking around further, examples meant to be executable as is are given 
interactive prompts and needed doctest directives

>>> gen  #doctest: +ELLIPSIS


I think that this example should get the same treatment.  Non-executable 
examples are usually clearly non-executable because then contain undefined 
names line 'expr2' and 'sequence2', whereas this example starts by defining 
'line_list'.

--

___
Python tracker 

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



[issue39971] Error in functional how-to example

2020-03-20 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Working on PR.  The example 1 further on has a stray meaningless ellipsis.

 for expr3 in sequence3 ...
 if condition3

Perhaps this was meant to follow the next line, but I will remove it.

--

___
Python tracker 

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



[issue39971] Error in functional how-to example

2020-03-20 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

In think examples should run and that '...' should be replaced by something 
like "' \n', ''".  The blank string looks ahead to the next example, which adds 
' if line != ""' to the comprehension.

--
nosy: +terry.reedy
stage:  -> needs patch
title: Error on documentation  -  Quick fix. -> Error in functional how-to 
example
versions: +Python 3.7, Python 3.9

___
Python tracker 

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



[issue40025] enum: _generate_next_value_ is not called if its definition occurs after calls to auto()

2020-03-20 Thread Ethan Furman


Ethan Furman  added the comment:

Immediate solution is to raise an exception if `_generate_next_value_` is 
defined after members.

Possible future solution is to save all member definitions until after class is 
defined.

The exception-raising solution would require a check in `_EnumDict` where 
`_generate_next_value_` is saved -- if any members already exist, raise.

--
assignee: docs@python -> ethan.furman
keywords: +easy
stage:  -> needs patch
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



[issue22699] Module source files not found when cross-compiling

2020-03-20 Thread Matthias Klose


Matthias Klose  added the comment:

the multiarch approach allows you to install libraries and headers for many 
architectures in the same installation/chroot.  This can then be used to 
cross-build stuff.

you can check that on WSL with having Debian or Ubuntu installed. A short 
reference is https://wiki.debian.org/Multiarch/HOWTO
you don't need to build packages, you can build upstream sources as well, just 
use apt to install the required packages for the target architecture.

--

___
Python tracker 

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



[issue39380] ftplib uses latin-1 as default encoding

2020-03-20 Thread Giampaolo Rodola'


Giampaolo Rodola'  added the comment:

+1 from me as well. @SebastianGPedersen could you update the PR (constructor + 
doc changes)?

--

___
Python tracker 

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



[issue39380] ftplib uses latin-1 as default encoding

2020-03-20 Thread Eric V. Smith


Eric V. Smith  added the comment:

I agree with Victor.

--

___
Python tracker 

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



[issue39939] Add str methods to remove prefixes or suffixes

2020-03-20 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

Just posted it.

--

___
Python tracker 

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



[issue39966] mock 3.9 bug: Wrapped objects without __bool__ raise exception

2020-03-20 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
stage:  -> test needed

___
Python tracker 

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



[issue39963] Subclassing slice objects

2020-03-20 Thread Terry J. Reedy


Change by Terry J. Reedy :


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



[issue39380] ftplib uses latin-1 as default encoding

2020-03-20 Thread STINNER Victor


STINNER Victor  added the comment:

I'm now fine with changing the default. But I would still prefer to have an 
encoding parameter in the constructor. Making these two changes at once now 
makes sense to me.

--

___
Python tracker 

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



[issue39939] Add str methods to remove prefixes or suffixes

2020-03-20 Thread STINNER Victor


STINNER Victor  added the comment:

Where should I leave comments on the PEP? Do you plan to post it on python-dev 
soon?

--

___
Python tracker 

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



[issue39360] python3.8 regression - ThreadPool join via __del__ hangs forever

2020-03-20 Thread Arkadiusz Miśkiewicz

Arkadiusz Miśkiewicz  added the comment:

So only this test (from first commit) should be added on master to check for 
further regressions in the area, right?

--

___
Python tracker 

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



[issue40027] re.sub inconsistency beginning with 3.7

2020-03-20 Thread Wayne Davison


Wayne Davison  added the comment:

Another argument in favor of this being a bug, this does not exhibit the same 
doubling:

txt = ' test'
txt = re.sub(r'^\s*', '^', txt)

That always substitutes once.

--

___
Python tracker 

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



[issue39360] python3.8 regression - ThreadPool join via __del__ hangs forever

2020-03-20 Thread STINNER Victor


STINNER Victor  added the comment:

If you want to get a reliable behavior, don't rely on destructors. Python 
finalization is not determistic and destructors can be called while Python is 
not longer fully functional.

Release ressources explicitly. For example, use multiprocessing.Pool with a 
context manager, or even call close() and join() methods explicitly.

--

___
Python tracker 

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



[issue40027] re.sub inconsistency beginning with 3.7

2020-03-20 Thread Wayne Davison


Wayne Davison  added the comment:

This is not the same thing because the match is anchored, so it is not adjacent 
to the prior match -- it is the same match. I think that r'\s*\Z' should behave 
the same way as r'\s*x' due to the anchor point. The current behavior is 
matching the same \Z twice.

--

___
Python tracker 

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



[issue22497] msiexec not creating msvcr90.dll with python -2.7.6.msi

2020-03-20 Thread Steve Dower


Change by Steve Dower :


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

___
Python tracker 

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



[issue39360] python3.8 regression - ThreadPool join via __del__ hangs forever

2020-03-20 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Ok, so sadly it seems that we need to close this issue as is fixed in master 
but the backport is risky.

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



[issue39360] python3.8 regression - ThreadPool join via __del__ hangs forever

2020-03-20 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
resolution:  -> fixed

___
Python tracker 

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



[issue39360] python3.8 regression - ThreadPool join via __del__ hangs forever

2020-03-20 Thread STINNER Victor


STINNER Victor  added the comment:

commit 4d96b4635aeff1b8ad41d41422ce808ce0b971c8
"bpo-39511: PyThreadState_Clear() calls on_delete (GH-18296)"

"(...) The release_sentinel() function is now called when the C API is still
fully working."

This change is "safer" than the other one, but there is still a risk of 
introducing a regression.

The problem is that this commit is part of a larger effort to make the Python 
finalization more reliable. The commit makes sense in the serie of commits 
pushed into the master branch, but I'm not sure that it makes sense if it's 
taken alone.

I don't have the bandwidth right now to investigate this issue, to identify the 
root issue, and suggest which commits should be backported or not.

--

___
Python tracker 

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



[issue40027] re.sub inconsistency beginning with 3.7

2020-03-20 Thread Matthew Barnett


Matthew Barnett  added the comment:

Duplicate of Issue39687.

See https://docs.python.org/3/library/re.html#re.sub and 
https://docs.python.org/3/whatsnew/3.7.html#changes-in-the-python-api.

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



[issue22699] Module source files not found when cross-compiling

2020-03-20 Thread Steve Dower


Steve Dower  added the comment:

> I think the patch is wrong.  why would you want to differentiate between 
> native and cross builds?

Because the multiarch headers are incompatible with my SDK's headers, and 
because of the -I ordering they override mine. I tried swapping the order of 
calls without a difference, but excluding them entirely made it work.

I'll happily take suggestions for a better patch. I don't even know what the 
multiarch headers are for, but I don't seem to need them here.

--

___
Python tracker 

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



[issue39360] python3.8 regression - ThreadPool join via __del__ hangs forever

2020-03-20 Thread STINNER Victor


STINNER Victor  added the comment:

> Victor, are you OK if we backport both changes to 3.8?

Let me look at commit 9ad58acbe8b90b4d0f2d2e139e38bb5aa32b7fb6:
"bpo-19466: Py_Finalize() clears daemon threads earlier (GH-18848)"

Calling _PyThreadState_DeleteExcept() in Py_FinalizeEx() is really dangerous. 
It frees PyThreadState memory of daemon threads. Daemon threads continue to run 
while Py_FinalizeEx() is running (which takes an unknown amount of time, we 
only know that it's larger than 0 seconds). When a daemon thread attempts to 
acquire the GIL, it will likely crash if its PyThreadState memory is freed. 
This memory can be overriden by another memory allocation, or dereferencing the 
pointer can trigger a segmentation fault.

This change caused multiple regressions in the master branch. I had hard time 
to fix all crashes: I modified take_gil() 4 times, and I'm still not sure that 
my fix is correct. I had to modify take_gil() function which acquire the GIL: 
this function is really fragile and I would prefer to not touch it in a stable 
branch. See bpo-39877 changes to have an idea of the complexity of the problem.

Python finalization is really fragile: 
https://pythondev.readthedocs.io/finalization.html

--

___
Python tracker 

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



[issue39998] [C API] Remove PyEval_AcquireLock() and PyEval_ReleaseLock() functions

2020-03-20 Thread STINNER Victor


STINNER Victor  added the comment:

Oh no,  PyEval_AcquireLock() and PyEval_ReleaseLock() are part of the limited C 
API (and so the stable ABI). Sadly, we have to keep them. I close the issue as 
rejected.


> We cannot just remove functions from stable ABI.

Alright, sadly it's part of the limited C API :-(

> We can undocument them, remove their declaration from header files, but we 
> can't remove the implementation. Just make them always failing.

Since I found a few projects using these functions, I'm no longer sure that 
it's worth it to remove these functions.

Continuing to maintain these functions is not really a major maintenance burden 
right now. So I simply close this issue.

If someone disagree, you can propose an implementation of Serhiy's suggestion.

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



[issue39998] [C API] Remove PyEval_AcquireLock() and PyEval_ReleaseLock() functions

2020-03-20 Thread STINNER Victor


STINNER Victor  added the comment:

(Trashcan is somehow off-topic here, but let me comment anyway ;-))

> See for example _PyTrash_deposit_object.

I know that this one is kept for ABI backward compatibility... but the TRASHCAN 
API is excluded from the limited API. So I'm not sure that it is worth it to 
keep _PyTrash_deposit_object() in the ABI.

I modified the TRASHCAN API in Python 3.9 to no longer leak implementation 
details (access PyThreadState structure fields). The implementation now only 
uses function calls.

=> commit 38965ec5411da60d312b59be281f3510d58e0cf1

--

___
Python tracker 

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



[issue40027] re.sub inconsistency beginning with 3.7

2020-03-20 Thread Wayne Davison


New submission from Wayne Davison :

There is an inconsistency in re.sub() when substituting at the end of a string 
using a prior match with a '*' qualifier: the substitution now occurs twice.  
For example:

txt = re.sub(r'\s*\Z', "\n", txt)

This should work like txt.rstrip() + "\n", but beginning in 3.7, the re.sub 
version now matches twice and changes any non-empty whitespace into "\n\n" 
instead of "\n". (If there is no trailing whitespace it only matches once.)

The bug is the same if '$' is used instead of '\Z', but it does not happen if 
an actual character is specified (e.g. a substitution of r'\s*x' does not 
substitute twice if x has preceding whitespace).

I tested 2.7.17, 3.6.9, 3.7.7, 3.8.2, and 3.9.0a4, and it starts to fail in 
3.7.7 and beyond.

Attached is a test program.

--
components: Regular Expressions
files: sub-bug.py
messages: 364688
nosy: Wayne Davison, ezio.melotti, mrabarnett
priority: normal
severity: normal
status: open
title: re.sub inconsistency beginning with 3.7
type: behavior
versions: Python 3.7, Python 3.8, Python 3.9
Added file: https://bugs.python.org/file48990/sub-bug.py

___
Python tracker 

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



[issue39998] [C API] Remove PyEval_AcquireLock() and PyEval_ReleaseLock() functions

2020-03-20 Thread STINNER Victor


STINNER Victor  added the comment:

Hum, I found multiple projects using PyEval_AcquireLock() and 
PyEval_ReleaseLock(). Many of them look abandonned. But a few were modified 
earlier than 1 year old.

--

ntripcaster2: Latest commit on Jun 2019 

https://github.com/rinex20/ntripcaster2/blob/ef45763c4c0b063e46ef3bbfc9d63bafcd76e421/src/interpreter.c

Example:

  PyEval_AcquireLock ();

  maininterpreterstate = mainthreadstate->interp;
  newthreadstate = PyThreadState_New (maininterpreterstate);

  PyEval_ReleaseLock ();

--

I found usage of PyEval_AcquireLock() in an old version of pygame (1.9.1, 
latest is 1.9.6):

PyEval_AcquireLock ();
oldstate = PyThreadState_Swap (helper->thread);
...
result = PyObject_CallFunction (helper->tell, NULL);
...
PyThreadState_Swap (oldstate);
PyEval_ReleaseLock ();

https://github.com/z-pan/pygame_tankScout/blob/7977cc6756e948c37cb4aa56fb1009a74288b65c/pygame-1.9.1release/src/rwobject.c

pygame changed to "PyGILState_Ensure() ... PyGILState_Release()" instead.

--

giljoy (Latest commit in 2013): it seems to override symloads using LD_PRELOAD 
to measure time when the GIL is acquired and released.

https://github.com/itamarst/giljoy/blob/master/giljoy.c

--

xmlbus: Latest commit in 2014.

https://github.com/olger/xmlbus/blob/148692997a481d10827a1aa86dc0ed3d70d84209/server/xmlbusd/pyrunner/pyrunner.c

Example:

PyEval_AcquireLock();
mainInterpreterState = mainThreadState->interp;
PyThreadState_Swap(mainThreadState);

myThreadState = PyThreadState_New(mainInterpreterState);
PyEval_ReleaseLock();

--

___
Python tracker 

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



[issue22699] Module source files not found when cross-compiling

2020-03-20 Thread Matthias Klose


Matthias Klose  added the comment:

I think the patch is wrong.  why would you want to differentiate between native 
and cross builds?  There should be a generic way to pick up those for both 
cross and native builds.

--

___
Python tracker 

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



[issue22699] Module source files not found when cross-compiling

2020-03-20 Thread Steve Dower


Steve Dower  added the comment:

The values that are used are (apparently) correct, but most of sysconfig is 
not. That's very confusing, and makes it difficult to debug. I'm glad I get to 
maintain the *other* monster (MSBuild) :)

I would much rather sysconfig had a single variable pointing directly to 
whatever source of information it needs to tell everything about any Python 
install, whether that's _sysconfigdata or something else.

But I've also got my stuff working with only a minimal patch, so I'm not too 
concerned here. I'll go invest my time in improving the Windows 
cross-compilation support.

--

___
Python tracker 

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



[issue22699] Module source files not found when cross-compiling

2020-03-20 Thread Steve Dower


Steve Dower  added the comment:

So it's possible that my first few attempts didn't have a matched build of 
Python on the host - the cross-build certainly relies on mixing the installed 
runtime with the source stdlib, so that could have been an early cause of 
issues. I can only suspect that it was a factor in all the earlier reports too. 
Maybe we should detect this situation and fail faster?

The final problem in my case is that the multiarch paths conflict with the 
cross-compiling paths. The change below to configure_compiler() got me through 
a full build:

 if CROSS_COMPILING:
 self.add_cross_compiling_paths()
-self.add_multiarch_paths()
+else:
+self.add_multiarch_paths()
 self.add_ldflags_cppflags()

I have no idea whether this is a safe change in general. Anyone able to weigh 
in?

--

___
Python tracker 

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



[issue39998] [C API] Remove PyEval_AcquireLock() and PyEval_ReleaseLock() functions

2020-03-20 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

See for example _PyTrash_deposit_object.

--

___
Python tracker 

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



[issue22699] Module source files not found when cross-compiling

2020-03-20 Thread Xavier de Gaye


Xavier de Gaye  added the comment:

> Is that epic line automatically generated?

When cross compiling it is generated by the configure script and configure 
replaces the right hand side of "PYTHON_FOR_BUILD=@PYTHON_FOR_BUILD@" of 
Makefile.pre.in with the generated value into Makefile.pre.

I think you may be missing the point that when this 'epic line' is being used 
then PYTHONPATH points to the location of the sysconfig module that has been 
newly built for the target platform, and so the values should be correct.

--

___
Python tracker 

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



[issue39998] [C API] Remove PyEval_AcquireLock() and PyEval_ReleaseLock() functions

2020-03-20 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

We cannot just remove functions from stable ABI. We can undocument them, remove 
their declaration from header files, but we can't remove the implementation. 
Just make them always failing.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue39939] Add str methods to remove prefixes or suffixes

2020-03-20 Thread STINNER Victor


STINNER Victor  added the comment:

> https://github.com/python/peps/pull/1332

Thank you. And good luck for handling incoming discussions on the PEP ;-)

--

___
Python tracker 

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



[issue39946] Remove _PyThreadState_GetFrame

2020-03-20 Thread STINNER Victor


STINNER Victor  added the comment:

I removed the function.

FYI I asked Armin Rigo, the author of _PyThreadState_GetFrame, if PyPy uses it: 
no, it doesn't. Moreover, psyco project is outdated, only supports Python 2.6 
and older, and is superseded by PyPy.

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



[issue39946] Remove _PyThreadState_GetFrame

2020-03-20 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 6723e933c4d90a408cf3818362a0e4de6d84c932 by Victor Stinner in 
branch 'master':
bpo-39946: Remove _PyThreadState_GetFrame (GH-19094)
https://github.com/python/cpython/commit/6723e933c4d90a408cf3818362a0e4de6d84c932


--

___
Python tracker 

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



[issue39998] [C API] Remove PyEval_AcquireLock() and PyEval_ReleaseLock() functions

2020-03-20 Thread STINNER Victor


STINNER Victor  added the comment:

PyEval_AcquireLock() is declared with Py_DEPRECATED(3.2) since Python 3.7

PyEval_ReleaseLock() is not declared with Py_DEPRECATED(), but 
PyEval_ReleaseLock() cannot be used without PyEval_AcquireLock().

--

___
Python tracker 

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



[issue39946] Remove _PyThreadState_GetFrame

2020-03-20 Thread STINNER Victor


Change by STINNER Victor :


--
title: Is it time to remove _PyThreadState_GetFrame() hook? -> Remove 
_PyThreadState_GetFrame

___
Python tracker 

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



[issue39946] Is it time to remove _PyThreadState_GetFrame() hook?

2020-03-20 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue39946] Is it time to remove _PyThreadState_GetFrame() hook?

2020-03-20 Thread STINNER Victor


STINNER Victor  added the comment:

It looks safe to remove this feature.

I failed to find any recent user of _PyThreadState_GetFrame.

Moreover, _PyRuntime.getframe and _PyThreadState_GetFrame have been moved to 
the internal C API in Python 3.7. This C API was not accessible by third-party 
projects in Python 3.7. The internal C API can only be used by third-party 
projects since Python 3.8 and it's tricky to use it... on purpose. I don't 
recall any complain about _PyThreadState_GetFrame becoming inaccessible.

--

I searched for "_PyThreadState_GetFrame" in C code on GitHub. I only found 
copies of Python/pystate.c files in the first 10 pages of search results, with 
one exception. I found one file:

https://github.com/Mistobaan/pdb-clone/blob/517f6d19902b64395b4c7218cbbbecfa5a1de607/lib/pdb_clone/_pdbhandler-py27.c

It's an old (latest commit on Mar 31, 2015) debugger project written by Xavier 
de Gaye.

It seems like the following flavor is more recent (latest commit on Apr 20, 
2019):

https://github.com/corpusops/pdbclone/

Note: the project contains 4 .c files, but only _pdbhandler-py27.c uses 
_PyThreadState_GetFrame: _pdbhandler-py3.c which is for Python 3 doesn't use 
_PyThreadState_GetFrame. But Python 2.7 reached its end of life, it's no longer 
supported.

Copy of the code:

/* Disable the Python 2 restricted mode in the subinterpreter (see
 * PyEval_GetRestricted()) that prevents linecache to open the source
 * files and prevents attribute access. */
saved_globals = mainstate->frame->f_globals;
saved_locals = mainstate->frame->f_locals;
saved_tstate_getframe = _PyThreadState_GetFrame;
mainstate->frame->f_globals = globals;
mainstate->frame->f_locals = locals;
_PyThreadState_GetFrame = threadstate_getframe;
pdbhandler_tstate = mainstate;

So _PyThreadState_GetFrame was used to "disable the Python 2 restricted mode", 
but this mode has been removed from Python 3.

--

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

2020-03-20 Thread STINNER Victor


STINNER Victor  added the comment:

I changed my mind. I managed to implement bpo-39984 without needing my PR 
19063, so I closed it.

--

___
Python tracker 

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



[issue40026] Create render_*_diff variants to the *_diff functions in difflib

2020-03-20 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
nosy: +rhettinger

___
Python tracker 

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



[issue40026] Create render_*_diff variants to the *_diff functions in difflib

2020-03-20 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy: +tim.peters

___
Python tracker 

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



[issue39946] Is it time to remove _PyThreadState_GetFrame() hook?

2020-03-20 Thread STINNER Victor


STINNER Victor  added the comment:

I added PyThreadState_GetFrame() function in bpo-39947: commit 
fd1e1a18fa3befe5b6eeac32e0561e15c7e5164b.

--

___
Python tracker 

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



[issue39947] Make the PyThreadState structure opaque (move it to the internal C API)

2020-03-20 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset fd1e1a18fa3befe5b6eeac32e0561e15c7e5164b by Victor Stinner in 
branch 'master':
bpo-39947: Add PyThreadState_GetFrame() function (GH-19092)
https://github.com/python/cpython/commit/fd1e1a18fa3befe5b6eeac32e0561e15c7e5164b


--

___
Python tracker 

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



[issue27807] Prevent site-packages .pth files from causing test_site failure: test_site.test_startup_imports() failure

2020-03-20 Thread STINNER Victor


STINNER Victor  added the comment:

The issue is now fixed in 3.7, 3.8 and master branches.

Thanks Chris Angelico for the bug report.

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

___
Python tracker 

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



[issue27807] Prevent site-packages .pth files from causing test_site failure: test_site.test_startup_imports() failure

2020-03-20 Thread miss-islington


miss-islington  added the comment:


New changeset 6056b7b84f2f77e2c3b49a18cfebe061fc23a08a by Miss Islington (bot) 
in branch '3.7':
[3.8] bpo-27807: Skip test_site.test_startup_imports() if pth file (GH-19060) 
(GH-19090)
https://github.com/python/cpython/commit/6056b7b84f2f77e2c3b49a18cfebe061fc23a08a


--

___
Python tracker 

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



[issue39939] Add str methods to remove prefixes or suffixes

2020-03-20 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

https://github.com/python/peps/pull/1332

--

___
Python tracker 

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



[issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed.

2020-03-20 Thread STINNER Victor


STINNER Victor  added the comment:

I partially reimplemented commit ef4ac967e2f3a9a18330cc6abe14adb4bc3d0465 in 
the following issues:

* bpo-39984: Move some ceval fields from _PyRuntime.ceval to 
PyInterpreterState.ceval
* bpo-40010: Inefficient signal handling in multithreaded applications
* bpo-39877: Daemon thread is crashing in PyEval_RestoreThread() while the main 
thread is exiting the process
* bpo-37127: Handling pending calls during runtime finalization may cause 
problems.

I cannot give a list of commits, I made too many of them :-D


The most important change is:

commit 50e6e991781db761c496561a995541ca8d83ff87
Author: Victor Stinner 
Date:   Thu Mar 19 02:41:21 2020 +0100

bpo-39984: Move pending calls to PyInterpreterState (GH-19066)

If Py_AddPendingCall() is called in a subinterpreter, the function is
now scheduled to be called from the subinterpreter, rather than being
called from the main interpreter.

Each subinterpreter now has its own list of scheduled calls.

* Move pending and eval_breaker fields from _PyRuntimeState.ceval
  to PyInterpreterState.ceval.
* new_interpreter() now calls _PyEval_InitThreads() to create
  pending calls lock.
* Fix Py_AddPendingCall() for subinterpreters. It now calls
  _PyThreadState_GET() which works in a subinterpreter if the
  caller holds the GIL, and only falls back on
  PyGILState_GetThisThreadState() if _PyThreadState_GET()
  returns NULL.


My plan is now to fix pending calls in subinterpreters. Currently, they are 
only executed in the "main thread"... _PyRuntimeState.main_thread must be moved 
to PyInterpreterState, as it was done in commit 
ef4ac967e2f3a9a18330cc6abe14adb4bc3d0465. 

This issue shows that it's dangerous to change too many things at once. Python 
internals were still very fragile: bpo-39877 and and bpo-37127 are good 
examples of that. I'm trying to move *very slowly*. Move pieces one by one.

I added _Py_ThreadCanHandlePendingCalls() function in commit 
d83168854e19d0381fa57db25fca6c622917624f (bpo-40010): it should ease moving 
_PyRuntimeState.main_thread to PyInterpreterState. I also added 
_Py_ThreadCanHandleSignals() in a previous commit, so it's easier to change 
which thread is allowed or not to handle signals and pending calls.

I also plan to revisit (removal) pending_calls.finalizing added by commit 
842a2f07f2f08a935ef470bfdaeef40f87490cfc (bpo-33608). I plan to work on that in 
bpo-37127.

--
nosy: +vstinner

___
Python tracker 

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



[issue40026] Create render_*_diff variants to the *_diff functions in difflib

2020-03-20 Thread Daniel


New submission from Daniel :

Currently difflib offers no way to synthesize a diff output without having to 
assemble the original and modified strings and then asking difflib to calculate 
the diff.

It would be nice if I could just call a `render_unified_diff(a, b, 
grouped_opcodes)` and get a diff output. This is useful when I'm synthesizing a 
patch dynamically and I don't necessarily want to load the entire original file 
and apply the changes.

One example usage would be something like:

```
def make_patch(self):
# simplified input for synthesizing the diff
a = []
b = []
include_lines = []
for header, _ in self.missing.items():
include_lines.append(f"#include <{header}>\n")
while len(b) < self.line:
b.append(None)
b.extend(include_lines)
opcodes = [
[('insert',
  self.line, self.line,
  self.line, self.line + len(include_lines))]
]
diff = render_unified_diff(
a, b, opcodes,
fromfile=os.path.join('a', self.filename),
tofile=os.path.join('b', self.filename),
)
return ''.join(diff)
```

--
components: Library (Lib)
messages: 364669
nosy: pablogsal, ruoso
priority: normal
severity: normal
status: open
title: Create render_*_diff variants to the *_diff functions in difflib

___
Python tracker 

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



[issue40010] Inefficient signal handling in multithreaded applications

2020-03-20 Thread STINNER Victor


Change by STINNER Victor :


--
title: Inefficient sigal handling in multithreaded applications -> Inefficient 
signal handling in multithreaded applications

___
Python tracker 

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



[issue27807] Prevent site-packages .pth files from causing test_site failure: test_site.test_startup_imports() failure

2020-03-20 Thread miss-islington


Change by miss-islington :


--
pull_requests: +18453
pull_request: https://github.com/python/cpython/pull/19093

___
Python tracker 

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



[issue27807] Prevent site-packages .pth files from causing test_site failure: test_site.test_startup_imports() failure

2020-03-20 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset ba26bf30940f4347fedcf8ebc374c6e2dc375afa by Victor Stinner in 
branch '3.8':
[3.8] bpo-27807: Skip test_site.test_startup_imports() if pth file (GH-19060) 
(GH-19090)
https://github.com/python/cpython/commit/ba26bf30940f4347fedcf8ebc374c6e2dc375afa


--

___
Python tracker 

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



[issue40010] Inefficient sigal handling in multithreaded applications

2020-03-20 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset d83168854e19d0381fa57db25fca6c622917624f by Victor Stinner in 
branch 'master':
bpo-40010: Optimize pending calls in multithreaded applications (GH-19091)
https://github.com/python/cpython/commit/d83168854e19d0381fa57db25fca6c622917624f


--

___
Python tracker 

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



[issue40025] enum: _generate_next_value_ is not called if its definition occurs after calls to auto()

2020-03-20 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +barry, eli.bendersky, ethan.furman

___
Python tracker 

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



[issue39947] Make the PyThreadState structure opaque (move it to the internal C API)

2020-03-20 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18452
pull_request: https://github.com/python/cpython/pull/19092

___
Python tracker 

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



[issue40010] Inefficient sigal handling in multithreaded applications

2020-03-20 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18451
pull_request: https://github.com/python/cpython/pull/19091

___
Python tracker 

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



[issue27807] Prevent site-packages .pth files from causing test_site failure: test_site.test_startup_imports() failure

2020-03-20 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18450
pull_request: https://github.com/python/cpython/pull/19090

___
Python tracker 

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



[issue27807] Prevent site-packages .pth files from causing test_site failure: test_site.test_startup_imports() failure

2020-03-20 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 5.0 -> 6.0
pull_requests: +18449
pull_request: https://github.com/python/cpython/pull/19089

___
Python tracker 

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



[issue40010] Inefficient sigal handling in multithreaded applications

2020-03-20 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset d2a8e5b42c5e9c4e745a0589043a8aebb49f8ca2 by Victor Stinner in 
branch 'master':
bpo-40010: COMPUTE_EVAL_BREAKER() checks for subinterpreter (GH-19087)
https://github.com/python/cpython/commit/d2a8e5b42c5e9c4e745a0589043a8aebb49f8ca2


--

___
Python tracker 

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



[issue40025] enum: _generate_next_value_ is not called if its definition occurs after calls to auto()

2020-03-20 Thread Luis E.


Change by Luis E. :


--
components:  -Documentation

___
Python tracker 

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



[issue40025] enum: _generate_next_value_ is not called if its definition occurs after calls to auto()

2020-03-20 Thread Luis E.


New submission from Luis E. :

I ran into this issue when attempting to add a custom _generate_next_value_ 
method to an existing Enum. Adding the method definition to the bottom of the 
class causes it to not be called at all:

from enum import Enum, auto

class E(Enum):
A = auto()
B = auto()
def _generate_next_value_(name, *args):
return name


E.B.value  # Returns 2, E._generate_next_value_ is not called

class F(Enum):
def _generate_next_value_(name, *args):
return name
A = auto()
B = auto()


F.B.value  # Returns 'B', as intended


I do not believe that the order of method/attribute definition should affect 
the behavior of the class, or at least it should be mentioned in the 
documentation.

--
assignee: docs@python
components: Documentation, Library (Lib)
messages: 364665
nosy: docs@python, edd07
priority: normal
severity: normal
status: open
title: enum: _generate_next_value_ is not called if its definition occurs after 
calls to auto()
type: behavior
versions: Python 3.7

___
Python tracker 

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



[issue40020] growable_comment_array_add leaks, causes crash

2020-03-20 Thread Dong-hee Na


Change by Dong-hee Na :


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



[issue39939] Add str methods to remove prefixes or suffixes

2020-03-20 Thread Walter Dörwald

Walter Dörwald  added the comment:

IMHO the names don't fit Pythons current naming scheme, so what about naming 
them "lchop" and "rchop"?

--
nosy: +doerwalter

___
Python tracker 

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



[issue39966] mock 3.9 bug: Wrapped objects without __bool__ raise exception

2020-03-20 Thread Amir Mohamadi


Amir Mohamadi  added the comment:

I'd like to work on it.
Should I add tests to 'Lib/unittest/test/testmock/testmock.py'??

--
nosy: +Amir

___
Python tracker 

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



[issue22699] Module source files not found when cross-compiling

2020-03-20 Thread Steve Dower


Steve Dower  added the comment:

Is that epic line automatically generated? It didn't work for me for some 
reason (was trying to launch the built Python, not the host).

Even so, I got to the point of filling in all those values manually while 
testing sysconfig, and while I'm 100% sure sysconfig still gave some wrong 
values, I'm 99% sure they weren't being fixed up by setup.py. Need to get back 
on my work machine to check.

--

___
Python tracker 

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



[issue40024] Add _PyModule_AddType private helper function

2020-03-20 Thread Dong-hee Na


Change by Dong-hee Na :


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

___
Python tracker 

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



[issue40024] Add _PyModule_AddType private helper function

2020-03-20 Thread Dong-hee Na


New submission from Dong-hee Na :

See: https://github.com/python/cpython/pull/19084#discussion_r395486583

--
assignee: corona10
components: C API
messages: 364661
nosy: corona10, vstinner
priority: normal
severity: normal
status: open
title: Add _PyModule_AddType private helper function
type: enhancement
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



[issue40010] Inefficient sigal handling in multithreaded applications

2020-03-20 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18447
pull_request: https://github.com/python/cpython/pull/19087

___
Python tracker 

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



[issue40019] test_gdb should better detect when Python is optimized

2020-03-20 Thread STINNER Victor


STINNER Victor  added the comment:

The fix works as expected: test_gdb passed on PR 19077. Well, likely because a 
few tests have been skipped. I don't think that in test_gdb can do better than 
skipping the test if gdb fails to read debug information.

--

___
Python tracker 

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



[issue40010] Inefficient sigal handling in multithreaded applications

2020-03-20 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset da2914db4b6f786a1e9f0b424efeeb6ca9418912 by Victor Stinner in 
branch 'master':
bpo-40010: Pass tstate to ceval GIL functions (GH-19077)
https://github.com/python/cpython/commit/da2914db4b6f786a1e9f0b424efeeb6ca9418912


--

___
Python tracker 

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



[issue22699] Module source files not found when cross-compiling

2020-03-20 Thread Xavier de Gaye


Xavier de Gaye  added the comment:

Steve wrote:
> In my build, I've set PYTHON_FOR_BUILD=python3.8

This will not work, PYTHON_FOR_BUILD when cross-compiling is set by configure 
as:

PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) 
_PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f 
pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib 
_PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH) 
'$interp

FWIW there is no problem cross-compiling Python and the standard library 
extension modules on Android, see for example the 'termux' Android application 
and its Python build.

On the other hand there are problems when cross-compiling third party extension 
modules due to:
* PYTHON_FOR_BUILD must be set correctly.
* distutils is still refering to sysconfig values of the build system instead 
of the target system.
But setup.py handles this correctly and does not need to be modified.

--
nosy: +xdegaye

___
Python tracker 

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



[issue39939] Add str methods to remove prefixes or suffixes

2020-03-20 Thread STINNER Victor


STINNER Victor  added the comment:

The PEP is a good start. Can you try to convert it to a PR on 
https://github.com/python/peps/ ? It seems like the next available PEP number 
is 616. I would prefer to leave comments on a PR.

--

___
Python tracker 

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



[issue40011] Tkinter widget events are of type Tuple

2020-03-20 Thread Ned Deily


Change by Ned Deily :


--
nosy: +gpolo, serhiy.storchaka
type: crash -> behavior

___
Python tracker 

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



[issue40011] Tkinter widget events are of type Tuple

2020-03-20 Thread Ned Deily


Change by Ned Deily :


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

___
Python tracker 

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



[issue40011] Tkinter widget events are of type Tuple

2020-03-20 Thread Ned Deily


Change by Ned Deily :


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

___
Python tracker 

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



[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-03-20 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 8334f30a74abcf7e469b901afc307887aa85a888 by Hai Shi in branch 
'master':
bpo-1635741: Port _weakref extension module to multiphase initialization (PEP 
489) (GH-19084)
https://github.com/python/cpython/commit/8334f30a74abcf7e469b901afc307887aa85a888


--

___
Python tracker 

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



[issue39797] shutdown() in socketserver.BaseServer should be in a different thread from serve_forever()

2020-03-20 Thread Ned Deily


Ned Deily  added the comment:

Thank you for your PR!

--
nosy: +ned.deily
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
type: enhancement -> 
versions:  -Python 3.5, Python 3.6

___
Python tracker 

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



[issue39797] shutdown() in socketserver.BaseServer should be in a different thread from serve_forever()

2020-03-20 Thread miss-islington


miss-islington  added the comment:


New changeset 64937d308c71a5c95627b0a0d0574d164c0cf30a by Miss Islington (bot) 
in branch '3.7':
bpo-39797 Changes to socketserver.BaseServer's shutdown() method. (GH-18929)
https://github.com/python/cpython/commit/64937d308c71a5c95627b0a0d0574d164c0cf30a


--

___
Python tracker 

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



  1   2   >