[issue32989] IDLE: Fix pyparse.find_good_parse_start

2020-01-20 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

After updating the patch, I noticed that deletion of self.context_use_ps1 from 
the editor call to y.find_good_parse_start was no longer part of the diff.  
This is because 3.8 changeset 6bdc4dee01788599808c7858e2fe9fdd72cf6792 for 
#35610 (backported only to 3.7) already did so. The remaining substantive 
change other than new tests is the removal of the unused default value None in 
the signature of the function and unused code triggered by 'if not arg'. 

I don't remember how well I tested that never exiting find...start early left 
indentations unchanged.  This would require comparing behavior to 3.6.  It 
would make more sense to check that the behavior and new tests conform to PEP8.

--
title: IDLE: Fix pyparse.find_good_parse_start and its bad editor call -> IDLE: 
Fix pyparse.find_good_parse_start

___
Python tracker 

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



[issue39405] Using relative path as a --prefix during configure.

2020-01-20 Thread Sankar


Change by Sankar :


--
type:  -> behavior

___
Python tracker 

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



[issue39405] Using relative path as a --prefix during configure.

2020-01-20 Thread Sankar


New submission from Sankar :

Is it possible to provide the relative path as a --prefix during configure?

I want to compile a python as a distributive package, so using an absolute path 
won't help. It should have a relative path like "../../Python".

The compiled python needs to have a relative everywhere, is it possible to 
achieve this?

--
components: Build
messages: 360360
nosy: Sankark
priority: normal
severity: normal
status: open
title: Using relative path as a --prefix during configure.
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



[issue39397] Mac : fail to launch Python 3.8

2020-01-20 Thread STINNER Victor


STINNER Victor  added the comment:

Can you try to dump your environment variables? Try maybe the "env" command.

At least, I would need: LC_ALL, LC_CTYPE and LANG.

--

___
Python tracker 

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



[issue39404] Pexpect : setwinsize() not working in SLES 12.4 kernel 4.12.14-94.41-default

2020-01-20 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

The tracker is for issues related to CPython. Can you please add a reproducer 
without pexpect or other dependencies explaining the issue with Python? 
https://github.com/pexpect/pexpect/issues is the issue tracker for pexpect.

--
nosy: +xtreak

___
Python tracker 

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



[issue39402] Consistent use of terms

2020-01-20 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I don't think we would ever consider replacing "parentheses" with "round 
brackets".  Also, we have long talked about "curly braces" though the 
braces/brackets choice is a little loose.  Also note that greater-than or 
less-than have established usage (see the html entities or unicode code point 
name for example).

> I'm well aware of the difficulty in garnering support for 
> this kind of an 'improvement', but I felt it needed said.

I appreciate that.  Thanks for the suggestion, but we'll decline a wholesale 
search and replace mission.  If an individual case of known confusion arises, 
we can take a look at it, but for now we have no evidence that the current docs 
are causing confusion for end users.

--
nosy: +rhettinger
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue39404] Pexpect : setwinsize() not working in SLES 12.4 kernel 4.12.14-94.41-default

2020-01-20 Thread Archana Pandey


New submission from Archana Pandey :

use of setwinsize function returns empty if the values of rows and cols 
differes from(24,80).
Issue occurs only on SLES 12.4.

sample code:
#!/usr/bin/env python
from pexpect import pxssh
try:
s = pxssh.pxssh()
hostname = 'someIp'
username = 'username'
password = 'password'
s.login(hostname, username, password)
s.setwinsize(1000,1000)  # setting default winsize works
s.sendline('uname -r')   # run a command
s.prompt() # match the prompt
print(s.before)# print everything before the prompt.
s.logout()
except pxssh.ExceptionPxssh as e:
print("pxssh failed on login.")
print(e)

--
components: Library (Lib)
messages: 360356
nosy: archi-pandey
priority: normal
severity: normal
status: open
title: Pexpect : setwinsize() not working in SLES 12.4 kernel 
4.12.14-94.41-default
type: behavior
versions: Python 3.6

___
Python tracker 

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



[issue39393] Misleading error message upon dependent DLL resolution failure

2020-01-20 Thread Zackery Spytz


Change by Zackery Spytz :


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

___
Python tracker 

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



[issue32308] Replace empty matches adjacent to a previous non-empty match in re.sub()

2020-01-20 Thread Anders Hovmöller

Anders Hovmöller  added the comment:

We were also bitten by this. In fact we still run a compatibility shim in 
production where we log if the new and old behavior are different. We also 
didn't think this "bug fix" made sense or was treated with the appropriate 
gravity in the release notes. 

I understand the logic in the bug tracker and they it matches other languages 
is good. But the bahvior also makes no sense for the .* case unfortunately. 

> On 21 Jan 2020, at 05:56, David Barnett  wrote:
> 
> 
> David Barnett  added the comment:
> 
> We were also bitten by this behavior change in 
> https://github.com/google/vroom/issues/110. I'm kinda baffled by the new 
> behavior and assumed it had to be an accidental regression, but I guess not. 
> If you have any other context on the BDFL conversation and reasoning for 
> calling this behavior correct, I'd love to see additional info.
> 
> --
> nosy: +mu_mind
> 
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue39397] Mac : fail to launch Python 3.8

2020-01-20 Thread Inada Naoki


Inada Naoki  added the comment:

Try `locale` command.  What is shown?

--
nosy: +inada.naoki

___
Python tracker 

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



[issue39403] Objects equal (assertEqual return True) but behave differently

2020-01-20 Thread Zachary Ware


Zachary Ware  added the comment:

For `list1`, you are creating three separate lists containing `0` contained by 
a fourth list.  For `list2`, you're creating a single list containing `0` 
contained by a second list, and then replicating the contents of that second 
list three times; thus `list2` actually contains the same list object three 
times.  You can compare the result of `[id(l) for l in list1]` with the same 
for `list2` to see this.

See point 2 here [1] and in this [2] FAQ for more information on this.

[1] https://docs.python.org/3/library/stdtypes.html#common-sequence-operations
[2] https://docs.python.org/3/faq/programming.html#faq-multidimensional-list

--
nosy: +zach.ware
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



[issue32308] Replace empty matches adjacent to a previous non-empty match in re.sub()

2020-01-20 Thread David Barnett


David Barnett  added the comment:

We were also bitten by this behavior change in 
https://github.com/google/vroom/issues/110. I'm kinda baffled by the new 
behavior and assumed it had to be an accidental regression, but I guess not. If 
you have any other context on the BDFL conversation and reasoning for calling 
this behavior correct, I'd love to see additional info.

--
nosy: +mu_mind

___
Python tracker 

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



[issue39403] Objects equal (assertEqual return True) but behave differently

2020-01-20 Thread wh1te r4bb1t


Change by wh1te r4bb1t :


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



[issue39403] Objects equal (assertEqual return True) but behave differently

2020-01-20 Thread wh1te r4bb1t


Change by wh1te r4bb1t :


--
versions: +Python 3.9 -Python 3.8

___
Python tracker 

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



[issue39403] Objects equal (assertEqual return True) but behave differently

2020-01-20 Thread wh1te r4bb1t


New submission from wh1te r4bb1t :

Here is a code highlighting a very strange behavior. This has been noticed in  
python 3.7, 3.8 and 3.9.0a2


def function(input_list, a='x'):
[input_list[i].append(a) for i in range(len(input_list))]
return input_list

list1 = [[0], [0], [0]]
list2 = [[0]] * 3

list1 == list2   # return True

function(list1)  # return [[0, 'x'], [0, 'x'], [0, 'x']]
function(list2)  # return [[0, 'x', 'x', 'x'], [0, 'x', 'x', 'x'], [0, 'x', 
'x', 'x']]

list1 == list2   # return false

--
messages: 360351
nosy: wh1te r4bb1t
priority: normal
severity: normal
status: open
title: Objects equal (assertEqual return True) but behave differently
type: behavior
versions: Python 3.8

___
Python tracker 

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



[issue39401] Unsafe dll loading in getpathp.c on Win7

2020-01-20 Thread Eryk Sun


Eryk Sun  added the comment:

> On Win7, running Python in the terminal will attempt to load the 
> "api-ms-win-core-path-l1-1-0.dll" from various paths outside of the 
> Python directory and the C:\Windows\System32 directories.

"api-ms-win-core-path-l1-1-0.dll" is not assigned in the API set schema (in 
ApiSetSchema.dll) in Windows 7. Since the name is neither in the list of known 
DLLs nor the list of assigned API sets, the loader searches for it in the 
normal way. (FYI, the number of API sets increased from 35 in Windows 7 up to 
502 in Windows 8.1.)

> I'm working on a fix to pass the LOAD_LIBRARY_SEARCH_DEFAULT_DIRS

I think this could use just LOAD_LIBRARY_SEARCH_SYSTEM32. I see no reason to 
try to load "api-ms-win-core-path-l1-1-0.dll" from the application directory or 
user directories.

I'm adding 3.6-3.9 to the list of affected versions. In 3.9 it can use a static 
import instead (i.e. remove LoadLibraryaExW / GetProcAddress), since only 
Windows 8.1+ is supported.

--
components: +Windows
nosy: +eryksun, paul.moore, steve.dower, tim.golden, zach.ware
stage:  -> needs patch
type:  -> security
versions: +Python 3.6, Python 3.7, 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



[issue39402] Consistent use of terms

2020-01-20 Thread Raymond Leiter


New submission from Raymond Leiter :

This is my idea of an improvement to the documentation, but I doubt anyone 
would agree with me.
Nevertheless, here it is:
There are at least 4 commonly used characters used to group other constructs to 
clearly call attention to their meaning.
1. [] Brackets
2. {} Braces
3. () Parentheses
4. <> Less than/Greater than 

The problem I have with the way these symbols are spoken of (in writing as well 
as oral discourse) is the lack of consistent names for them.
Brackets are often referred to as square Brackets, even though there is 
apparently no alternative such as rectangular Brackets, etc.
Braces are often referred to as curly Braces or some times curly Brackets.
Parentheses are usually called, correctly, Parentheses, but also referred to as 
round Brackets. I've never encountered 'round Braces', but I'm hopeful.
Less then and Greater then symbols are referred to correctly when they are used 
in mathematics speak.
However, when they are used as a 'grouping' mechanism, they are usually called 
Angle Brackets -- not Angle Braces.
My proposal is this:
The most consistent way I can think of for referring to these 4 symbols when 
used as a 'grouping' mechanism is:
1. [] SQUARE BRACKETS
2. {} CURLY BRACKETS
3. () ROUND BRACKETS
4. <> ANGLE BRACKETS
There will be no more Braces, since that term is apparently quite unpopular 
with most programmers today.
The 'shape' modifiers (SQUARE, CURLY, ROUND, ANGLE), applied to the 
common term BRACKETS, would appear to be much more consistent than current 
usage.
I'm well aware of the difficulty in garnering support for this kind of an 
'improvement', but I felt it needed said.

--
assignee: docs@python
components: Documentation
messages: 360349
nosy: Raymond Leiter, docs@python
priority: normal
severity: normal
status: open
title: Consistent use of terms
type: enhancement
versions: Python 3.8

___
Python tracker 

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



[issue39401] Unsafe dll loading in getpathp.c on Win7

2020-01-20 Thread Anthony Wee


New submission from Anthony Wee :

On Win7, running Python in the terminal will attempt to load the 
"api-ms-win-core-path-l1-1-0.dll" from various paths outside of the Python 
directory and the C:\Windows\System32 directories. This behavior can be 
verified using Process Monitor (see attachment).

This is happening due to direct calls to LoadLibraryW() in getpathp.c without 
any "LOAD_LIBRARY_SEARCH*" flags.

In join():

https://github.com/python/cpython/blob/c02b41b1fb115c87693530ea6a480b2e15460424/PC/getpathp.c#L255

and canonicalize():

https://github.com/python/cpython/blob/c02b41b1fb115c87693530ea6a480b2e15460424/PC/getpathp.c#L291

For both cases, the methods they are trying to load from 
api-ms-win-core-path-l1-1-0.dll (PathCchCanonicalizeEx and PathCchCombineEx) 
were introduced in Win8. 

I tested on Win7 and Win10 and they differ in how they load these api-ms-win-* 
dll's and whether they appear in process monitor. In Win7, a CreateFile event 
appears in procmon, while in Win10 it seems like the OS is automatically 
loading the module from kernelbase.dll. Also in Win7 the loading of 
api-ms-win-core-path-l1-1-0.dll will fail while in Win10 it succeeds. However, 
in Win7 when it fails it results in the standard dll search strategy, which 
will eventually search outside of the secure directories such as the 
directories in the PATH env var: 
https://docs.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-search-order

Each of the problematic methods in cpython have a pattern of attempting to load 
the dll, then falling back to an older version of the method. Thus in Win7, the 
dll fails to load and it falls back to the older version of the method. In 
Win10, the dll load succeeds and we use the new versions of the methods.

I'm working on a fix to pass the LOAD_LIBRARY_SEARCH_DEFAULT_DIRS flag to limit 
to the dll search path scope.

--
files: python unsafe dll loading.png
messages: 360348
nosy: anthonywee
priority: normal
severity: normal
status: open
title: Unsafe dll loading in getpathp.c on Win7
Added file: https://bugs.python.org/file48855/python unsafe dll loading.png

___
Python tracker 

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



[issue39386] Prevent double awaiting of async iterator

2020-01-20 Thread Andrew Svetlov


Change by Andrew Svetlov :


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



[issue29435] Allow to pass fileobj to is_tarfile

2020-01-20 Thread William Woodruff


Change by William Woodruff :


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

___
Python tracker 

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



[issue39383] Mention Darwin as a potential value for platform.system()

2020-01-20 Thread Ned Deily


Ned Deily  added the comment:

Thanks for the PR!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
type: enhancement -> 
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



[issue39383] Mention Darwin as a potential value for platform.system()

2020-01-20 Thread miss-islington


miss-islington  added the comment:


New changeset c1964e09421e7ab61179eb4e2691e858a50d70e5 by Miss Islington (bot) 
in branch '3.8':
bpo-39383: Mention Darwin as a potential value for platform.system() (GH-18054)
https://github.com/python/cpython/commit/c1964e09421e7ab61179eb4e2691e858a50d70e5


--

___
Python tracker 

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



[issue39383] Mention Darwin as a potential value for platform.system()

2020-01-20 Thread miss-islington


miss-islington  added the comment:


New changeset 3da839046359644f286195f5126035e162440af1 by Miss Islington (bot) 
in branch '3.7':
bpo-39383: Mention Darwin as a potential value for platform.system() (GH-18054)
https://github.com/python/cpython/commit/3da839046359644f286195f5126035e162440af1


--
nosy: +miss-islington

___
Python tracker 

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



[issue39383] Mention Darwin as a potential value for platform.system()

2020-01-20 Thread miss-islington


Change by miss-islington :


--
pull_requests: +17481
pull_request: https://github.com/python/cpython/pull/18089

___
Python tracker 

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



[issue39383] Mention Darwin as a potential value for platform.system()

2020-01-20 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue39383] Mention Darwin as a potential value for platform.system()

2020-01-20 Thread Ned Deily


Ned Deily  added the comment:


New changeset 8d57a4182f0aa68e16d66dea31ba59e732612b4f by Ned Deily (Peter 
Bittner) in branch 'master':
bpo-39383: Mention Darwin as a potential value for platform.system() (GH-18054)
https://github.com/python/cpython/commit/8d57a4182f0aa68e16d66dea31ba59e732612b4f


--
nosy: +ned.deily

___
Python tracker 

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



[issue39399] Cross compilation using different libc is broken

2020-01-20 Thread Ned Deily


Ned Deily  added the comment:

Thanks for the report. This appears to be a duplicate of languishing 
Issue22724.  Suggest you join the discussion there.

--
nosy: +ned.deily
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> byte-compile fails for cross-builds

___
Python tracker 

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



[issue39386] Prevent double awaiting of async iterator

2020-01-20 Thread miss-islington


miss-islington  added the comment:


New changeset b76d5e9ee64b8ac861e856d8e41289c0977c75e1 by Miss Islington (bot) 
in branch '3.7':
bpo-39386: Prevent double awaiting of async iterator (GH-18081)
https://github.com/python/cpython/commit/b76d5e9ee64b8ac861e856d8e41289c0977c75e1


--

___
Python tracker 

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



[issue39386] Prevent double awaiting of async iterator

2020-01-20 Thread miss-islington


miss-islington  added the comment:


New changeset 5cadd3fe3aead1b5bee1438dc03383d6739d4209 by Miss Islington (bot) 
in branch '3.8':
bpo-39386: Prevent double awaiting of async iterator (GH-18081)
https://github.com/python/cpython/commit/5cadd3fe3aead1b5bee1438dc03383d6739d4209


--
nosy: +miss-islington

___
Python tracker 

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



[issue18819] tarfile fills devmajor and devminor fields even for non-devices

2020-01-20 Thread Ned Deily


Change by Ned Deily :


--
nosy: +ethan.furman
versions:  -Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 
3.7, Python 3.8

___
Python tracker 

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



[issue39381] Fix get_event_loop documentation

2020-01-20 Thread Andrew Svetlov


Change by Andrew Svetlov :


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



[issue39386] Prevent double awaiting of async iterator

2020-01-20 Thread miss-islington


Change by miss-islington :


--
pull_requests: +17479
pull_request: https://github.com/python/cpython/pull/18087

___
Python tracker 

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



[issue39386] Prevent double awaiting of async iterator

2020-01-20 Thread miss-islington


Change by miss-islington :


--
pull_requests: +17478
pull_request: https://github.com/python/cpython/pull/18086

___
Python tracker 

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



[issue39386] Prevent double awaiting of async iterator

2020-01-20 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset a96e06db77dcbd3433d39761ddb4615d7d96284a by Andrew Svetlov in 
branch 'master':
bpo-39386: Prevent double awaiting of async iterator (GH-18081)
https://github.com/python/cpython/commit/a96e06db77dcbd3433d39761ddb4615d7d96284a


--

___
Python tracker 

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



[issue39381] Fix get_event_loop documentation

2020-01-20 Thread miss-islington


Change by miss-islington :


--
pull_requests: +17477
pull_request: https://github.com/python/cpython/pull/18085

___
Python tracker 

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



[issue39381] Fix get_event_loop documentation

2020-01-20 Thread miss-islington


Change by miss-islington :


--
pull_requests: +17476
pull_request: https://github.com/python/cpython/pull/18084

___
Python tracker 

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



[issue39390] shutil.copytree - 3.8 changed argument types of the ignore callback

2020-01-20 Thread Ned Deily


Change by Ned Deily :


--
keywords: +patch

___
Python tracker 

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



[issue39390] shutil.copytree - 3.8 changed argument types of the ignore callback

2020-01-20 Thread Ned Deily


Change by Ned Deily :


--
keywords: +3.8regression -patch

___
Python tracker 

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



[issue39392] Python Turtle is not filling alternate overlapping areas of a shape with same color

2020-01-20 Thread Ned Deily


Change by Ned Deily :


--
nosy: +gregorlingl, willingc

___
Python tracker 

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



[issue3770] test_multiprocessing fails on systems with HAVE_SEM_OPEN=0

2020-01-20 Thread Ned Deily


Ned Deily  added the comment:

Matthew, this tracker issue has been closed for over 10 years; posting new 
questions or comments to such is unlikely to get a response (I just happened to 
see your comment in passing).  If you believe you have identified a new issue 
with current versions of Python, you should search for newer issues and, if 
appropriate, open a new one with a reference to this one.  However, before 
doing that, I would do a web search on "cannot import name 'SemLock'"; you 
should find a number of references to situations that seem similar to yours 
with the cause being the lack of a working sem_open implementation as noted in 
the ImportError message, a condition that might just be a system configuration 
issue on the build system.  Good luck!

--
nosy: +ned.deily

___
Python tracker 

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



[issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details

2020-01-20 Thread Nick Coghlan


Nick Coghlan  added the comment:


New changeset 1e420f849d0c094098543d2c27d35eaec69b2784 by Nick Coghlan in 
branch 'master':
bpo-35134: Migrate frameobject.h contents to cpython/frameobject.h (GH-18052)
https://github.com/python/cpython/commit/1e420f849d0c094098543d2c27d35eaec69b2784


--

___
Python tracker 

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



[issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details

2020-01-20 Thread Nick Coghlan


Change by Nick Coghlan :


--
pull_requests: +17475
pull_request: https://github.com/python/cpython/pull/18052

___
Python tracker 

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



[issue35003] Provide an option to venv to put files in a bin/ directory on Windows

2020-01-20 Thread Erik Aronesty


Erik Aronesty  added the comment:

See https://github.com/python/cpython/pull/18083 for an example of a 'simple 
copy' for shell script compatibility ... rather than trying to make Scripts 
move around (which it can't trivially).

--

___
Python tracker 

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



[issue35003] Provide an option to venv to put files in a bin/ directory on Windows

2020-01-20 Thread Erik Aronesty


Change by Erik Aronesty :


--
pull_requests: +17474
pull_request: https://github.com/python/cpython/pull/18083

___
Python tracker 

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



[issue39383] Mention Darwin as a potential value for platform.system()

2020-01-20 Thread Brett Cannon


Change by Brett Cannon :


--
priority: normal -> low

___
Python tracker 

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



[issue39400] pydoc: Use of MANPAGER variable is incorrect

2020-01-20 Thread Ronan Pigott


Ronan Pigott  added the comment:

Actually my previous comment is incorrect, the value of the PAGER is split with 
the shell as a result of shell=True. There _is_ still an incompatibility with 
man.

I have a value for MANPAGER set like 'env LESS_TERMCAP_mb=^[[01;31m ... less' 
which becomes split on ';' by the shell as a result of 'shell=True'. The 
MANPAGER value is not interpreted by a shell with man, so it works as expected 
when using man.

Becuase man explicitly allows the use of quotes, it is possible to set a value 
of MANPAGER that has the desired effect for both programs by quoting the 
terminal control sequences like so: 'env LESS="^[[01;31m ... less"'.

Still, it might be reasonable to change pydocs interpretation of MANPAGER to 
better align with man's.

--

___
Python tracker 

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



[issue35003] Provide an option to venv to put files in a bin/ directory on Windows

2020-01-20 Thread Erik Aronesty


Erik Aronesty  added the comment:

the single Scripts/activate tool should be simply copied to bin/activate ... 
this is what you have to do to write a bash script for python now:

source bin/activate || source Scripts/activate

we should not assume that all windows users use things like CMD and PowerShell, 
and instead just make support for "shell activation" be cross-platform

--
nosy: +earonesty

___
Python tracker 

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



[issue39379] sys.path[0] is already absolute path

2020-01-20 Thread Brett Cannon


Brett Cannon  added the comment:

Is sys.path[0] always absolute, or is it just a side-effect of the site module 
(i.e. is it absolute even with -S)?

--
nosy: +brett.cannon

___
Python tracker 

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



[issue39400] pydoc: Use of MANPAGER variable is incorrect

2020-01-20 Thread Ronan Pigott


New submission from Ronan Pigott :

pydoc references the value of both MANPAGER and PAGER variables when selecting 
a command to present the user with documentation. Those values are passed 
directly to subprocess.Popen. However, MANPAGER may contain arguments that need 
splitting, and is explicitly documented as such in the `man 1 man` manpage:

> If $MANPAGER or $PAGER is set ($MANPAGER is used in preference), its value is 
> used as the name of the program used to display the manual page. [...] The 
> value may be a simple command name or a command with arguments, and may  use  
> shell quoting (backslashes,  single quotes, or double quotes). It may not use 
> pipes to connect multiple commands; if you need that, use a wrapper script 
> [...]

pydoc should perform word splitting a la shlex.split on the values of MANPAGER 
and PAGER to retain compatibility with man.

--
components: Library (Lib)
messages: 360332
nosy: Brocellous
priority: normal
severity: normal
status: open
title: pydoc: Use of MANPAGER variable is incorrect
type: enhancement
versions: Python 3.8

___
Python tracker 

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



[issue39082] AsyncMock is unable to correctly patch static or class methods

2020-01-20 Thread Matt Kokotovich


Change by Matt Kokotovich :


--
nosy: +mkokotovich

___
Python tracker 

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



[issue39384] Email parser creates a message object that can't be flattened as bytes.

2020-01-20 Thread Mark Sapiro


Mark Sapiro  added the comment:

This came about because of an actual situation in a Mailman 3 installation. I 
can't say for sure what the actual original message looked like, but it was 
received by Mailman's LMTP server and parsed with email.message_from_bytes(), 
so it clearly wasn't exactly like the message excerpt I posted in the report 
above. However, All I had to go by was the message object from the shunted 
pickle file created as a result of the exception.

The message was processed by Mailman, but when Mailman's handler pipeline 
attempted to save it for the digest, it calls an instance of mailbox.MMDF to 
add the message to the mailbox accumulating messages for the digest, and that 
in turn calls the flatten method of an email.generator.BytesGenerator instance. 
and that's where the exception was thrown.

Perhaps the suggested patch in https://github.com/python/cpython/pull/18056 
doesn't address every possible case, and it can result in a slightly garbled 
message due to replacing 'invalid' characters, but in my case at least, it is 
much preferable to the alternative.

--

___
Python tracker 

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



[issue39399] Cross compilation using different libc is broken

2020-01-20 Thread Andrew Aladjev


New submission from Andrew Aladjev :

Hello. I am implementing python cross compilation using "x86_64-pc-linux-musl" 
toolchain: "x86_64-pc-linux-musl-emerge -v1 python:3.6". Please see the 
following build log 
https://gist.github.com/andrew-aladev/e10fa5a8151ffb3c5782edd64ae08b28.

We can see the following part:

Traceback (most recent call last):
  File 
"/usr/x86_64-pc-linux-musl/tmp/portage/dev-lang/python-3.6.9/image//usr/lib/python3.6/compileall.py",
 line 17, in 
import struct
  File 
"/usr/x86_64-pc-linux-musl/tmp/portage/dev-lang/python-3.6.9/image/usr/lib/python3.6/struct.py",
 line 13, in 
from _struct import *
ImportError: libc.so: cannot open shared object file: No such file or directory

It means that cross compilation of python is not reliable today by design. 
Python is trying to use PYTHON_FOR_BUILD for loading cross compiled modules. It 
is not possible in general case. PYTHON_FOR_BUILD should not try to load cross 
compiled modules.

Please see the following gentoo issue https://bugs.gentoo.org/705970. I've 
attached a gentoo specific workaround there.

--
components: Build
messages: 360330
nosy: puchenyaka
priority: normal
severity: normal
status: open
title: Cross compilation using different libc is broken
type: behavior
versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7, 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



[issue39386] Prevent double awaiting of async iterator

2020-01-20 Thread Andrew Svetlov


Change by Andrew Svetlov :


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

___
Python tracker 

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



[issue39396] AIX: self.assertEqualSign(math.nextafter(-0.0, +0.0), +0.0) test fails on AIX

2020-01-20 Thread Mark Dickinson


Mark Dickinson  added the comment:

BTW, stupid question: why is `test_nextafter` in `test.test_math.IsCloseTests` 
and `test.test_cmath.IsCloseTests`? The first seems inappropriate; the second 
even more so.

--

___
Python tracker 

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



[issue39396] AIX: self.assertEqualSign(math.nextafter(-0.0, +0.0), +0.0) test fails on AIX

2020-01-20 Thread Mark Dickinson


Mark Dickinson  added the comment:

> Mark: what's your call on that one?

I don't know. It's a hard problem in general: where do we draw the line between 
simply wrapping the platform libm, bugs and all, on one hand and trying to 
abstract away platform differences and make guarantees about corner-case 
behaviour on the other.

For this particular case, I'd be fine with adding a special case for `x == y` 
in the code (suitably commented to explain why the special case is there, and 
under what conditions it can be removed). But I fear it's the thin end of the 
wedge: as Michael's last message shows, to get the test suite to pass on his 
particular flavour of AIX, we'd need to add a special case for cmath.exp, too, 
and there may be more failures once that's fixed.

Actually, the cmath.exp failure looks a little odd to my eyes: it would be a 
bit surprising to have cmath.exp fail if all of test_math passed. I suspect a 
dodgy compiler optimisation. But that's another issue.

--

___
Python tracker 

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



[issue18819] tarfile fills devmajor and devminor fields even for non-devices

2020-01-20 Thread William Chargin


William Chargin  added the comment:

I've just independently run into this and sent a patch as a pull
request. Happily, once this is fixed, the output of `tarfile` is
bit-for-bit compatible with the output of GNU `tar(1)`.

PR: 

--
nosy: +wchargin

___
Python tracker 

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



[issue18819] tarfile fills devmajor and devminor fields even for non-devices

2020-01-20 Thread William Chargin


Change by William Chargin :


--
versions: +Python 3.5, Python 3.6, Python 3.7, 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



[issue18819] tarfile fills devmajor and devminor fields even for non-devices

2020-01-20 Thread William Chargin


Change by William Chargin :


--
pull_requests: +17472
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/18080

___
Python tracker 

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



[issue30951] Documentation error in inspect module

2020-01-20 Thread Cheryl Sabella


Change by Cheryl Sabella :


--
versions: +Python 3.8, Python 3.9 -Python 2.7, Python 3.3, Python 3.4, Python 
3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue39386] Prevent double awaiting of async iterator

2020-01-20 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
title: getting invalid data from async iterator -> Prevent double awaiting of 
async iterator
versions: +Python 3.7, 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



[issue39386] getting invalid data from async iterator

2020-01-20 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Thanks for the report.

Your example could be boiled down to the following:

coro = asynciter()
await coro
await coro

The second call incorrectly returns None but should raise an exception, double 
awaiting is a programming error.

For regular async functions it raises "RuntimeError: cannot reuse already 
awaited coroutine"

--
stage:  -> needs patch

___
Python tracker 

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



[issue39293] Windows 10 64-bit needs reboot after install

2020-01-20 Thread Zachary Ware


Change by Zachary Ware :


Removed file: https://bugs.python.org/file48854/windows-ssh-tools.snapshot.json

___
Python tracker 

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



[issue37096] Add large-file tests for modules using sendfile(2)

2020-01-20 Thread STINNER Victor


STINNER Victor  added the comment:

Right now, "AMD64 Fedora Rawhide Clang 3.x" worker is broken: "C compiler 
cannot create executables"
https://bugs.python.org/issue39398

--

___
Python tracker 

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



[issue39398] AMD64 Fedora Rawhide Clang 3.x: C compiler cannot create executables

2020-01-20 Thread STINNER Victor


New submission from STINNER Victor :

"AMD64 Fedora Rawhide Clang 3.x" buildbot worker is currently broken:
https://buildbot.python.org/all/#/builders/169/builds/168

clang cannot build (statically linked) binary using UBSan:

$ ./configure --prefix '$(PWD)/target' CC=clang LD=clang 
CFLAGS=-fsanitize=undefined LDFLAGS=-fsanitize=undefined
...
checking for gcc... clang
checking whether the C compiler works... no
configure: error: in 
`/home/buildbot/buildarea/3.x.cstratak-fedora-rawhide-x86_64.clang-ubsan/build':
configure: error: C compiler cannot create executables
See `config.log' for more details

I reproduced the issue on the worker. The issue comes from a version conflict 
between clang and compiler-rt packages:

compiler-rt-9.0.0-1.fc32.x86_64 uses /usr/lib64/clang/9.0.0/...

vs

clang-9.0.1-2.fc32.x86_64 uses /usr/lib64/clang/9.0.1/...

Charalampos created 
https://src.fedoraproject.org/rpms/compiler-rt/pull-request/10 to propose to 
update compiler-rt.

--
components: Tests
keywords: buildbot
messages: 360324
nosy: vstinner
priority: normal
severity: normal
status: open
title: AMD64 Fedora Rawhide Clang 3.x: C compiler cannot create executables
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



[issue39393] Misleading error message upon dependent DLL resolution failure

2020-01-20 Thread Eryk Sun


Eryk Sun  added the comment:

That clarification seems okay to me. The error message is in load_library in 
Modules/_ctypes/callproc.c. 

The underlying problem is that the directory of the DLL is only added to the 
search path (in CDLL.__init__ in Lib/ctypes/__init__.py) if the caller uses a 
qualified path. This is an OS limit that we can't avoid.

Also note that the suggestion to use a qualified path won't necessarily resolve 
the problem, in which case scripts will have to use os.add_dll_directory, and 
find a reliable way to identify the required directories.

--
components: +Extension Modules
keywords: +easy (C)
nosy: +eryksun
stage:  -> needs patch

___
Python tracker 

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



[issue39397] Mac : fail to launch Python 3.8

2020-01-20 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +vstinner

___
Python tracker 

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



[issue39397] Mac : fail to launch Python 3.8

2020-01-20 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


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

___
Python tracker 

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



[issue39397] Mac : fail to launch Python 3.8

2020-01-20 Thread Sebastien Foo


New submission from Sebastien Foo :

Hello,
I am facing an issue with python on mac and there is not much information that 
I can find to fix it.
When I installed the latest cli for Azure (brew upgrade azure-cli) it installed 
python 3.8
And then the az cli failed and running the python 3.8 failed too with the 
following error.
 
/usr/local/Cellar/python@3.8/3.8.1/Frameworks/Python.framework/Versions/3.8/bin/python3.8
Fatal Python error: config_get_locale_encoding: failed to get the locale 
encoding: nl_langinfo(CODESET) failed
Python runtime state: preinitialized
 
I have tried to reinstall python and the azure cli without success.

Any help would be much appreciated.

--
components: Installation
messages: 360322
nosy: Sebastien Foo
priority: normal
severity: normal
status: open
title: Mac : fail to launch Python 3.8
versions: Python 3.8

___
Python tracker 

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



[issue39309] Please delete my account

2020-01-20 Thread R. David Murray


R. David Murray  added the comment:

AFAIR it can only be done using the roundup command line on the server.

--
nosy: +ezio.melotti

___
Python tracker 

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



[issue39384] Email parser creates a message object that can't be flattened as bytes.

2020-01-20 Thread R. David Murray

R. David Murray  added the comment:

Since you parsed it as a string it is not really legitimate to serialize it as 
bytes.  (That will work if the input message only contains ascii, but not if it 
contains unicode).  You'll get the same error if you replace the garbage with 
the "’".  Using errors=replace is not crazy, but it hides the actual problem.  
Let's see what other people think :)

In theory you could "fix" this by encoding the unicode using the charset 
specified by the container.  I have no idea how complicated it will be do that, 
and it would be a new feature: parsing strings is specified to only work with 
ASCII input, currently.

I put "fix" in quotes, because even if you make text parts like this example 
work, you still can't handle non-text 8bit mime parts.  Is it worth doing 
anyway?

Really, message_as_string and friends should just be avoided entirely, maybe 
even deprecated.

--

___
Python tracker 

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



[issue39396] AIX: self.assertEqualSign(math.nextafter(-0.0, +0.0), +0.0) test fails on AIX

2020-01-20 Thread Michael Felt


Michael Felt  added the comment:

FYI: On AIX 5.3, after your proposal I get:

==
FAIL: test_specific_values (test.test_cmath.CMathTests)
--
Traceback (most recent call last):
  File "/data/prj/python/git/python3-3.9/Lib/test/test_cmath.py", line 418, in 
test_specific_values
self.rAssertAlmostEqual(expected.imag, actual.imag,
  File "/data/prj/python/git/python3-3.9/Lib/test/test_cmath.py", line 130, in 
rAssertAlmostEqual
self.fail(msg or 'zero has wrong sign: expected {!r}, '
AssertionError: exp0001: exp(complex(0.0, -0.0))
Expected: complex(1.0, -0.0)
Received: complex(1.0, 0.0)
Received value insufficiently close to expected value.

--

So, test_nextafter works with the patch, but test_specific_values remains 
'active'

--

___
Python tracker 

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



[issue39396] AIX: self.assertEqualSign(math.nextafter(-0.0, +0.0), +0.0) test fails on AIX

2020-01-20 Thread STINNER Victor


STINNER Victor  added the comment:

Checking how Python is linked or checking the libm version sounds overkill to 
me. "if (x == y)" test is really cheap: I don't expect nextafter() to be used 
in performance critical code path anyway. That's why I even consider to add 
this code path on all platforms, not only AIX.

Mark: what's your call on that one? Make the code conditional on AIX? In 
practice, it seems like only (old libm) AIX nextafter() requires to be 
"patched".

--

___
Python tracker 

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



[issue39396] AIX: self.assertEqualSign(math.nextafter(-0.0, +0.0), +0.0) test fails on AIX

2020-01-20 Thread Michael Felt


Michael Felt  added the comment:

A hard call to make, imho.

Thinking aloud...

Currently, for AIX 6.1 and AIX 7.1 your proposal for the code change would be 
great, but less so for AIX 7.2.

However! Since libm (on AIX) is a static library - the behavior depends on the 
support libm has on the build system.

I'll have to puzzle a bit with the configure process and figure out how to best 
determine the behavior of the build system. On a properly patched AIX 7.2 
system the standard code would apply, on others the "adjusted behavior".

So, would you go for modified based on what version of libm is installed, 
better how this function is behaving?

--

___
Python tracker 

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



[issue39394] re: DeprecationWarning for `flag not at the start of expression` is cutoff too early

2020-01-20 Thread Jürgen Gmach

Jürgen Gmach  added the comment:

> Why do you want to output the full regular expression?

The current output gives no clue about which flag is problematic, nor does it 
show the complete output (which at least would include the problematic flag), 
nor does it show the exact line, as it refers only to the line where compile 
gets called.

The warning points to following line ( 
https://github.com/jedie/python-creole/blob/4e74f29daaf5026a3d4d6dae9f2e74f5f3655439/creole/parser/creol2html_parser.py#L49-L50
 ):

cell_re = re.compile(SpecialRules.cell, re.VERBOSE | re.UNICODE)


And SpecialRules.cell is a quite a big class ( 
https://github.com/jedie/python-creole/blob/4e74f29daaf5026a3d4d6dae9f2e74f5f3655439/creole/parser/creol2html_rules.py#L16-L97
 ) defining lots of partial expressions.

Even if spotting this line ( 
https://github.com/jedie/python-creole/blob/4e74f29daaf5026a3d4d6dae9f2e74f5f3655439/creole/parser/creol2html_rules.py#L54
 ) at the first glance it looks like it starts with the flag and should be 
correct (but is not as it turned out later).


> Is not source file path, line number, and starting 20 characters not enough 
> to identify the affected regular expression?

It definitely was not enough for me (new to this code base as I only tried to 
report deprecation warnings in my application), and when you have a look at the 
comment ( 
https://github.com/jedie/python-creole/issues/31#issuecomment-575983117 ) it 
even was not enough for the author/maintainer of this package.

Do you expect any downside of printing the complete warning?

--

___
Python tracker 

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



[issue39396] AIX: self.assertEqualSign(math.nextafter(-0.0, +0.0), +0.0) test fails on AIX

2020-01-20 Thread STINNER Victor


STINNER Victor  added the comment:

Ah, I saw an error on POWER6 AIX 3.x ("POWER6 (aka ppc64-be) using (GCC) 
4.7.4"):
https://buildbot.python.org/all/#/builders/119/builds/175

The following test fails:

self.assertEqualSign(math.nextafter(-0.0, +0.0), +0.0)

Well, C code specific to AIX can be added to nextafter() to handle this corner 
case:

diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c
index 81d871786f..82ffb4c3d1 100644
--- a/Modules/mathmodule.c
+++ b/Modules/mathmodule.c
@@ -3287,7 +3287,16 @@ static PyObject *
 math_nextafter_impl(PyObject *module, double x, double y)
 /*[clinic end generated code: output=750c8266c1c540ce input=02b2d50cd1d9f9b6]*/
 {
-double f = nextafter(x, y);
+double f;
+#if defined(_AIX)
+if (x == y) {
+f = y;
+}
+else
+#endif
+{
+f = nextafter(x, y);
+}
 return PyFloat_FromDouble(f);
 }
 

Another option is to not make the assumption on the libc nextafter() and handle 
x==y the same way on all platforms.

Error:

==
FAIL: test_nextafter (test.test_math.IsCloseTests)
--
Traceback (most recent call last):
  File 
"/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/test/test_math.py", 
line 2040, in test_nextafter
self.assertEqualSign(math.nextafter(-0.0, +0.0), +0.0)
  File 
"/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/test/test_math.py", 
line 2018, in assertEqualSign
self.assertEqual(math.copysign(1.0, x), math.copysign(1.0, y))
AssertionError: -1.0 != 1.0

Same error in test_cmath:

==
FAIL: test_nextafter (test.test_cmath.IsCloseTests)
--
Traceback (most recent call last):
  File 
"/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/test/test_math.py", 
line 2040, in test_nextafter
self.assertEqualSign(math.nextafter(-0.0, +0.0), +0.0)
  File 
"/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/test/test_math.py", 
line 2018, in assertEqualSign
self.assertEqual(math.copysign(1.0, x), math.copysign(1.0, y))
AssertionError: -1.0 != 1.0

--
components: +Tests
nosy: +mark.dickinson
title: AIX: math.nextafter(a, b) breaks AIX bot -> AIX: 
self.assertEqualSign(math.nextafter(-0.0, +0.0), +0.0) test fails on AIX

___
Python tracker 

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



[issue39396] AIX: math.nextafter(a, b) breaks AIX bot

2020-01-20 Thread Michael Felt


Michael Felt  added the comment:

As I said, was investigating.

a) is a bug in most AIX system libraries.
b) there is a fix, but not one I can install - as my bots and build systems run 
on AIX 6.1 and AIX 7.1

c) the fix is APAR IV95512 which includes fixes in the following filesets:

IV95512 shipped  nextafter(+0.0, -0.0) returns +0.0 instead of -0.0.
  bos.rte.shell 7.2.2.0
  bos.adt.prof 7.2.2.0
  bos.adt.libm 7.2.2.0

So, nothing for me "to fix" -- see 
https://www-01.ibm.com/support/docview.wss?uid=isg1IV95512

FYI: The document URL (above) was last modified on 30 October 2017

--

___
Python tracker 

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



[issue39396] AIX: math.nextafter(a, b) breaks AIX bot

2020-01-20 Thread STINNER Victor


STINNER Victor  added the comment:

> AIX: math.nextafter(a, b) breaks AIX bot

Please elaborate. What is the error?

--
nosy: +vstinner

___
Python tracker 

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



[issue39396] AIX: math.nextafter(a, b) breaks AIX bot

2020-01-20 Thread Michael Felt


New submission from Michael Felt :

As issue39288 (that introduces this breakage) is closed, opening a new issue.

Back from away - and only starting my investigation - and that will probably be 
slow. Have not done anything with IEEE754 in over 30 years.

--
messages: 360312
nosy: Michael.Felt
priority: normal
severity: normal
status: open
title: AIX: math.nextafter(a, b) breaks AIX bot
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



[issue35381] posixmodule: convert statically allocated types (DirEntryType & ScandirIteratorType) to heap-allocated types

2020-01-20 Thread STINNER Victor


STINNER Victor  added the comment:

This issue introduced a regression: bpo-39395 "The os module should unset() 
environment variable at exit".

--

___
Python tracker 

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



[issue39395] The os module should unset() environment variable at exit

2020-01-20 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue29258] __init__.py required for pkgutil.walk_packages in python3

2020-01-20 Thread Inada Naoki


Inada Naoki  added the comment:

I am totally agree with Wolfgang:

> they make it impossible to know whether a directory found on the filesystem 
> is *intended* as a Python package or not.

I think we shouldn't treat normal directory as namespace package until some 
portion in the directory is imported, or it is specified explicitly.

So walk_packages() should be used like:

  walk_packages("/path/to/namespace", "namespace")

I already rejected similar issue: #29642.

If you can not agree with me, please make an thread in python-dev ML or 
discuss.python.org.

--

___
Python tracker 

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



[issue39394] re: DeprecationWarning for `flag not at the start of expression` is cutoff too early

2020-01-20 Thread STINNER Victor


Change by STINNER Victor :


--
title: DeprecationWarning for `flag not at the start of expression` is cutoff 
too early -> re: DeprecationWarning for `flag not at the start of expression` 
is cutoff too early

___
Python tracker 

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



[issue29258] __init__.py required for pkgutil.walk_packages in python3

2020-01-20 Thread Inada Naoki


Change by Inada Naoki :


--
assignee:  -> docs@python
components: +Documentation -Library (Lib)
nosy: +docs@python
resolution: rejected -> 
stage: resolved -> needs patch
status: closed -> open
versions: +Python 3.8, Python 3.9 -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



[issue39395] The os module should unset() environment variable at exit

2020-01-20 Thread STINNER Victor


New submission from STINNER Victor :

os.environ[key] = value has to keep internally the string "key=value\0" after 
putenv("key=value\0") has been called, since the glibc doesn't copy the string. 
Python has to manage the string memory.

Internally, the posix module uses a "posix_putenv_garbage" dictionary mapping 
key (bytes) to value (bytes). Values are "key=value\0" strings.

The bpo-35381 issue converted the os ("posix" in practice) module PEP 384: 
"Remove all static state from posixmodule": commit 
b3966639d28313809774ca3859a347b9007be8d2. The _posix_clear() function is now 
called by _PyImport_Cleanup().

Problem: the glibc is not aware that Python is exiting and that the memory of 
the environment variable has been released. Next access to environment 
variables ("environ" C variable, putenv, setenv, unsetenv, ...) can crash. 
Sometimes, it doesn't crash even if the memory has been released, because 
free() does not always dig immediately holes in the heap memory (the complex 
problelm of memory fragmentation).

The posix module should notify the glibc that the memory will be released 
before releasing the memory, to avoid keeping dangling pointers in the 
"environ" C variable.

The following crash in the Elements module is an example of crash introduced by 
commit b3966639d28313809774ca3859a347b9007be8d2 which introduced this issue:
https://bugzilla.redhat.com/show_bug.cgi?id=1791761

--
components: Interpreter Core
messages: 360309
nosy: vstinner
priority: normal
severity: normal
status: open
title: The os module should unset() environment variable at exit
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



[issue39394] DeprecationWarning for `flag not at the start of expression` is cutoff too early

2020-01-20 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Why do you want to output the full regular expression? Is not source file path, 
line number, and starting 20 characters not enough to identify the affected 
regular expression?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue29258] __init__.py required for pkgutil.walk_packages in python3

2020-01-20 Thread Eric Wieser


Eric Wieser  added the comment:

If the resolution here is that this is behaving as intended (which personally I 
disagree with), I think this issue should remain open as a documentation task - 
the docs should clearly state that this does not apply to PEP420 namespace 
packages.

--

___
Python tracker 

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



[issue39394] DeprecationWarning for `flag not at the start of expression` is cutoff too early

2020-01-20 Thread Jürgen Gmach

New submission from Jürgen Gmach :

The usage of flags not at the start of an expression is deprecated.

Also see "Deprecate the use of flags not at the start of regular expression" / 
https://bugs.python.org/issue22493 

A deprecation warning is issued, but is cutoff at 20 characters.

For complex expressions this is way too small.

Example ( https://github.com/jedie/python-creole/issues/31 ):

current output

/home/jugmac00/Projects/bliss_deployment/work/_/home/jugmac00/.batou-shared-eggs/python_creole-1.3.2-py3.7.egg/creole/parser/creol2html_parser.py:48
  
/home/jugmac00/Projects/bliss_deployment/work/_/home/jugmac00/.batou-shared-eggs/python_creole-1.3.2-py3.7.egg/creole/parser/creol2html_parser.py:48:
 DeprecationWarning: Flags not at the start of the expression '(?P\n 
' (truncated)
re.VERBOSE | re.UNICODE


output with patched sre_parse.py

creole/parser/creol2html_parser.py:51
  /home/jugmac00/Projects/python-creole/creole/parser/creol2html_parser.py:51: 
DeprecationWarning: Flags not at the start of the expression '\n\\| 
\\s*\n(\n(?P [=][^|]+ ) |\n
(?P (  (?P\n\\[\\[\n(?P.+?) 
\\s*\n([|] \\s* (?P.+?) \\s*)?\n]]\n
)|\n(?P\n<< \\s* (?P\\w+) 
\\s* (?P.*?) \\s* >>\n
(?P(.|\\n)*?)\n<>\n)\n|(?P\n<<(?P \\w+) 
(?P.*?) \\s* /*>>\n)|(?i)(?P\n{{\n   
 (?P.+?) \\s*\n(\\| \\s* (?P.+?) 
\\s*)?\n}}\n)|(?P {{{ (?P.*?) 
}}} ) | [^|])+ )\n) \\s*\n'
cell_re = re.compile(x, re.VERBOSE | re.UNICODE)


(Line number differs because there was a change in the source between these two 
test runs).

I would like to create a pr and remove the limitation to 20 characters 
completely, but wanted to get feedback before I do so.

The deprecation warning was created by Tim Graham - maybe he could elaborate 
why it was cut at 20 chars at first?
https://github.com/python/cpython/commit/abf275af5804c5f76fbe10c5cb1dd3d2e4b04c5b

--
components: Regular Expressions
messages: 360306
nosy: ezio.melotti, jugmac00, mrabarnett
priority: normal
severity: normal
status: open
title: DeprecationWarning for `flag not at the start of expression` is cutoff 
too early
type: enhancement
versions: Python 3.7, 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



[issue39393] Misleading error message upon dependent DLL resolution failure

2020-01-20 Thread plimkilde


New submission from plimkilde :

Under Windows with Python 3.8+, trying to load a DLL whose dependencies cannot 
be resolved may produce a misleading error message.

For example, if we are trying to load a library foo.dll that depends on 
bar.dll, and bar.dll cannot be resolved while foo.dll itself can, Python gives 
this error message:
"FileNotFoundError: Could not find module 'foo.dll'. Try using the full path 
with constructor syntax."
(behavior introduced with PR #12302)

Personally, I'd be happy to see a fix that simply adds " (or one of its 
dependencies)" to the error message.

--
components: Windows, ctypes
messages: 360305
nosy: paul.moore, plimkilde, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Misleading error message upon dependent DLL resolution failure
type: behavior
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



[issue36892] "Modules" section in Tutorial contains incorrect description about __init__.py

2020-01-20 Thread Inada Naoki


Inada Naoki  added the comment:

I think it is just a noise for the tutorial readers.

I created a post about misunderstanding of PEP 420.
https://dev.to/methane/don-t-omit-init-py-3hga

How about adding note in top of the PEP 420 instead?

.. note::
   Namespace packages are not regular packages.  It
   is a feature for very special use case.
   Don't omit ``__init__.py`` in regular packages.

--
nosy: +inada.naoki

___
Python tracker 

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



[issue39390] shutil.copytree - 3.8 changed argument types of the ignore callback

2020-01-20 Thread Manuel Barkhau


Manuel Barkhau  added the comment:

> This looks like a backward incompatible change in 3.8.

Indeed. 

> Should not copytree convert arguments of the ignore callback to str and list 
> correspondingly?

Well, since any existing code probably expects that behavior (or at least 
probably works if that is the case), I would be for such a change. I'm not sure 
what your policy is though. If there is recently written code that assumes the 
new types, are you OK with that breaking if it is changed back?

I guess since it's an undocumented breaking change, it shouldn't be too much of 
an issue.

--

___
Python tracker 

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



[issue39389] gzip metadata fails to reflect compresslevel

2020-01-20 Thread William Chargin


William Chargin  added the comment:

PR URL, for reference:


--

___
Python tracker 

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



[issue39389] gzip metadata fails to reflect compresslevel

2020-01-20 Thread William Chargin


William Chargin  added the comment:

Sure, PR sent (pull_request17470).

--

___
Python tracker 

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



[issue39389] gzip metadata fails to reflect compresslevel

2020-01-20 Thread William Chargin


Change by William Chargin :


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

___
Python tracker 

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



[issue39293] Windows 10 64-bit needs reboot after install

2020-01-20 Thread Alberto N Leilani Campos


Change by Alberto N Leilani Campos :


Added file: https://bugs.python.org/file48854/windows-ssh-tools.snapshot.json

___
Python tracker 

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



[issue39390] shutil.copytree - 3.8 changed argument types of the ignore callback

2020-01-20 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

This looks like a backward incompatible change in 3.8. Should not copytree 
convert arguments of the ignore callback to str and list correspondingly?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue39389] gzip metadata fails to reflect compresslevel

2020-01-20 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Looks reasonable. gzip should write b'\002' for compresslevel == 
_COMPRESS_LEVEL_BEST, b'\004' for compresslevel == _COMPRESS_LEVEL_FAST, and 
b'\000' otherwise. Do you mind to create a PR William.

--
keywords: +easy
nosy: +serhiy.storchaka
stage:  -> needs patch
versions:  -Python 2.7, 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



[issue29258] __init__.py required for pkgutil.walk_packages in python3

2020-01-20 Thread Inada Naoki


Inada Naoki  added the comment:

> PEP420 makes __init__.py files optional

This is almost wrong.  PEP 420 added a new way for "namespace pacakge."
PEP 420 doesn't make empty __init__.py file in regular package.

(See https://dev.to/methane/don-t-omit-init-py-3hga)

Then, should pkgutil.walk_packages walk into all directories (e.g.  
node_modules) ?  I don't think so.

--
nosy: +inada.naoki
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue39365] Support (SEEK_END/SEEK_CUR) relative seeking in StringIO

2020-01-20 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

This is a duplicate of issue25190.

--
components: +Library (Lib)
nosy: +serhiy.storchaka
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Define StringIO seek offset as code point offset
type: behavior -> 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



[issue39377] json.loads encoding parameter deprecation removal in Python 3.9

2020-01-20 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Please update the documentation which still mentions the encoding parameter.

--

___
Python tracker 

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