[issue36260] [security] CVE-2019-9674: Zip Bomb vulnerability

2020-02-10 Thread STINNER Victor


STINNER Victor  added the comment:

I marked bpo-39341 as a duplicate of this issue: "[security] zipfile: ZIP Bomb 
vulnerability, don't check announced uncompressed size".

--

___
Python tracker 

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



[issue39596] reverse parameter for enumerate()

2020-02-10 Thread Ammar Askar


Ammar Askar  added the comment:

What is the use case for this? You seem to want `enumerate` to return (item, 
index) instead of (index, item) when `reverse=True`? You can achieve this 
yourself easily a custom generator:

>>> def swapped_enumerate(l):
...   for idx, item in enumerate(l):
... yield item, idx
...
>>> list(swapped_enumerate(lis))
[('a', 0), ('b', 1), ('c', 2), ('d', 3)]

--
nosy: +ammar2

___
Python tracker 

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



[issue39597] sorting the String

2020-02-10 Thread Shani M


New submission from Shani M :

It showing the wrong string order. 'sss' is to be appear at 3rd place but it 
comes at last place. 'qwe' is to appear at last place but it comes at 3rd place.

--
files: Screenshot from 2020-02-10 14-08-52.png
messages: 361675
nosy: Shani M
priority: normal
severity: normal
status: open
title: sorting the String
versions: Python 2.7
Added file: https://bugs.python.org/file48886/Screenshot from 2020-02-10 
14-08-52.png

___
Python tracker 

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



[issue39596] reverse parameter for enumerate()

2020-02-10 Thread Eric V. Smith


Eric V. Smith  added the comment:

You can already do this using existing composable tools, including:

>>> list((item, idx) for idx, item in enumerate(lis))
[('a', 0), ('b', 1), ('c', 2), ('d', 3)]
>>>

We won't be adding a parameter to enumerate in order add another way of doing 
this.

If you really want to pursue this, you should discuss it on the python-ideas 
mailing list and try to get the idea accepted there. But it really doesn't have 
any chance of being accepted.

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



[issue39128] Document happy eyeball parameters in loop.create_connection signature docs

2020-02-10 Thread Julien Palard


Julien Palard  added the comment:


New changeset 5305cc9dbfe8a5a0ab666511f3ba7f026c8983f8 by idomic in branch 
'master':
bpo-39128: Added happy_eyeballs_delay, interleave to function signature 
(GH-18315)
https://github.com/python/cpython/commit/5305cc9dbfe8a5a0ab666511f3ba7f026c8983f8


--
nosy: +mdk

___
Python tracker 

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



[issue39128] Document happy eyeball parameters in loop.create_connection signature docs

2020-02-10 Thread miss-islington


Change by miss-islington :


--
pull_requests: +17804
pull_request: https://github.com/python/cpython/pull/18428

___
Python tracker 

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



[issue39128] Document happy eyeball parameters in loop.create_connection signature docs

2020-02-10 Thread Julien Palard


Julien Palard  added the comment:

I merged the first PR about adding parameter, but I'm not closing this issue 
yet, as Andrew said, a small chapter with a description of Happy Eyeballs 
algorithm would be nice, if anyone want to write a PR, go for it.

--

___
Python tracker 

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



[issue39128] Document happy eyeball parameters in loop.create_connection signature docs

2020-02-10 Thread miss-islington


miss-islington  added the comment:


New changeset af95d790a86fc46739badfa9edbaeb264ee96600 by Miss Islington (bot) 
in branch '3.8':
bpo-39128: Added happy_eyeballs_delay, interleave to function signature 
(GH-18315)
https://github.com/python/cpython/commit/af95d790a86fc46739badfa9edbaeb264ee96600


--
nosy: +miss-islington

___
Python tracker 

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



[issue39534] Clarify tutorial on return statement in finally clause.

2020-02-10 Thread Julien Palard


Change by Julien Palard :


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



[issue39584] MacOS crashes by running attached Python code

2020-02-10 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



[issue39584] multiprocessing.shared_memory: MacOS crashes by running attached Python code

2020-02-10 Thread STINNER Victor


Change by STINNER Victor :


--
title: MacOS crashes by running attached Python code -> 
multiprocessing.shared_memory: MacOS crashes by running attached Python code

___
Python tracker 

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



[issue39597] sorting the String

2020-02-10 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

>From the screenshot:

>>> b = ['sss', 'ase', 'klm', 'qwe']
>>> print sorted(b)
['ase', 'klm', 'qwe', 'sss']

This is the correct result, the output list is alphabetically sorted.

--
nosy: +ronaldoussoren
resolution:  -> not a bug
status: open -> pending

___
Python tracker 

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



[issue39011] ElementTree attributes replace "\r" with "\n"

2020-02-10 Thread Stefan Behnel


Stefan Behnel  added the comment:

Your patch looks good to me. Could you please add (or adapt) the tests and then 
create a PR from it? You also need to write a NEWS entry for this change, and 
it also seems worth an entry in the "What's new" document.

https://devguide.python.org/committing/

--

___
Python tracker 

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



[issue39011] ElementTree attributes replace "\r" with "\n"

2020-02-10 Thread Reece Johnson


Reece Johnson  added the comment:

Hope it is fixed now.

--
nosy: +nows

___
Python tracker 

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



[issue39598] ERR_CACHE_MISS

2020-02-10 Thread Thomas Reed


New submission from Thomas Reed :

Hi, I have problem with cache.

If there is someone in the detail of product longer that 5 minutes and than 
click to button "back",it makes error "ERR_CACHE_MISS". Do you know, how can i 
solve it?

Thank you :)

--
components: Windows
messages: 361683
nosy: judiction, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: ERR_CACHE_MISS

___
Python tracker 

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



[issue39598] ERR_CACHE_MISS

2020-02-10 Thread Reece Johnson


Reece Johnson  added the comment:

Is the user logged out from your site when receiving this message?

--
nosy: +nows

___
Python tracker 

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



[issue39598] ERR_CACHE_MISS

2020-02-10 Thread Thomas Reed


Thomas Reed  added the comment:

No, normally browsing the web and products (without login in), after looking at 
the product details and then clicking the back button, the error will occur.

--

___
Python tracker 

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



[issue39598] ERR_CACHE_MISS

2020-02-10 Thread Reece Johnson


Reece Johnson  added the comment:

It's a google chrome issue: https://winerrorfixer.com/err-cache-miss

--

___
Python tracker 

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



[issue39598] ERR_CACHE_MISS

2020-02-10 Thread Thomas Reed


Thomas Reed  added the comment:

Alright, thanks.

--

___
Python tracker 

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



[issue39598] ERR_CACHE_MISS

2020-02-10 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

The tracker is for issues related to CPython. This doesn't seem like a Python 
issue to me. Please use other forums for discussion. Closing it as not a bug.

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



[issue39599] ABI breakage between 3.7.4 and 3.7.5

2020-02-10 Thread Julien Danjou


New submission from Julien Danjou :

As I've reported originally on the python-dev list, there seems to be an ABI 
breakage between 3.7.4 and 3.7.5.

https://mail.python.org/archives/list/python-...@python.org/message/J2FGZPS5PS7473TONJTPAVSNXRGV3TFL/

The culprit commit is 
https://github.com/python/cpython/commit/8766cb74e186d3820db0a855ccd780d6d84461f7

This happens on a custom C module (built via Cython) when using including 
 with -DPy_BUILD_CORE. I'm not sure it'd happen otherwise.

I've tried to provide a minimal use case, but since it seems to be a memory 
overflow, the backtrace does not make any sense and it's hard to reproduce 
without the orignal code.

--
components: C API
messages: 361689
nosy: jd
priority: normal
severity: normal
status: open
title: ABI breakage between 3.7.4 and 3.7.5
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



[issue39593] Adding a unit test of ctypes

2020-02-10 Thread STINNER Victor


STINNER Victor  added the comment:

Using strlen() seems to be as old as ctypes itself.

--

I don't know which behavior is correct. It's a little bit strange that ctypes 
truncate the string at "\0". A "char" buffer can be an arbitrary array of 
bytes. It may be a binary format which doesn't use null byte as string 
terminator, but just to encode a 16-bit integer as two bytes.

My attempt to understand the current behavior:

https://github.com/python/cpython/pull/18419#pullrequestreview-355606890

"size = strlen(data);" instruction was added when the ctypes was added by this 
commit:

commit d4c9320412177895f598a93d73a0e654db27c351
Author: Thomas Heller 
Date:   Wed Mar 8 19:35:11 2006 +

Copy ctypes-0.9.9.4 sources from external into the trunk.

Sadly, Thomas Heller no longer contributes to Python since 2011:
https://blog.python.org/2011/04/thomas-heller-steps-down-as-ctypes.html

The original project is hosted at:
https://sourceforge.net/p/ctypes/code/

It seems like s_set() function was added between these source/cfield.c two 
versions:

revision 1.116
date: 2006/03/15 20:35:55;  author: theller;  state: Exp;  lines: +14 -4
PyString_FromFormat()b understands the C99 "z" qualifier on all
platforms, in Python 2.5.  Patch from Tim Peters, adapted to work with
older Python versions.

revision 1.115
date: 2006/03/03 20:17:15;  author: theller;  state: Exp;  lines: +636 -279
Moving files from branch_1_0 to HEAD.

Sadly, the commit message doesn't say much about the rationale.

--
nosy: +vstinner

___
Python tracker 

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



[issue39593] ctypes s_set() uses strlen() and so truncates string at null character

2020-02-10 Thread STINNER Victor


Change by STINNER Victor :


--
title: Adding a unit test of ctypes -> ctypes s_set() uses strlen() and so 
truncates string at null character

___
Python tracker 

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



[issue38323] asyncio: MultiLoopWatcher has a race condition (test_asyncio: test_close_kill_running() hangs on AMD64 RHEL7 Refleaks 3.x)

2020-02-10 Thread STINNER Victor


STINNER Victor  added the comment:

This issue is still failing frequently on buildbots. What can be done to stop 
getting test failures on buildbots?

--

___
Python tracker 

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



[issue39128] Document happy eyeball parameters in loop.create_connection signature docs

2020-02-10 Thread Ido Michael


Ido Michael  added the comment:

Thanks Julien, I forgot about this part, will create a new PR.

I thought referencing the abstract of the algorithm + a link to the IETF RFC:

  Happy Eyeballs: Success with Dual-Stack Hosts
   When a server's IPv4 path and protocol are working, but the server's
   IPv6 path and protocol are not working, a dual-stack client
   application experiences significant connection delay compared to an
   IPv4-only client.  This is undesirable because it causes the dual-
   stack client to have a worse user experience.  This document
   specifies requirements for algorithms that reduce this user-visible
   delay and provides an algorithm.

https://tools.ietf.org/html/rfc6555

--

___
Python tracker 

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



[issue39586] Deprecate bdist_msi: use bdist_wheel instead

2020-02-10 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 29b3fc0a18f105de666fdd586b537f34e349766d by Hugo van Kemenade in 
branch 'master':
bpo-39586: Deprecate distutils bdist_msi command (GH-18415)
https://github.com/python/cpython/commit/29b3fc0a18f105de666fdd586b537f34e349766d


--
nosy: +vstinner

___
Python tracker 

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



[issue39586] Deprecate bdist_msi: use bdist_wheel instead

2020-02-10 Thread STINNER Victor


STINNER Victor  added the comment:

Steve Dower who knows well Windows installer discourage users to use MSI:
https://discuss.python.org/t/remove-distutils-bdist-wininst-command/3115/14

Other pip developers want to get ride of everything but sdist and bdist_wheel 
formats:
https://discuss.python.org/t/remove-distutils-bdist-wininst-command/3115/14

So let's deprecated bdist_msi. If someone comes with a use case which justify 
to keep the feature, it would be trivial to revert the deprecation.

Thanks Hugo van Kemenade ;-)

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



[issue39599] ABI breakage between 3.7.4 and 3.7.5

2020-02-10 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +inada.naoki

___
Python tracker 

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



[issue39599] ABI breakage between 3.7.4 and 3.7.5

2020-02-10 Thread STINNER Victor


STINNER Victor  added the comment:

The latest 3.7 release is Python 3.7.6: Dec. 18, 2019. So at least two 3.7 
release are impacted. Moreover, Python 3.8.0 and 3.8.1 have also been released 
with the change.

--
nosy: +vstinner

___
Python tracker 

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



[issue39599] ABI breakage between Python 3.7.4 and 3.7.5: change in PyGC_Head structure

2020-02-10 Thread STINNER Victor


Change by STINNER Victor :


--
title: ABI breakage between 3.7.4 and 3.7.5 -> ABI breakage between Python 
3.7.4 and 3.7.5: change in PyGC_Head structure

___
Python tracker 

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



[issue39599] ABI breakage between 3.7.4 and 3.7.5

2020-02-10 Thread STINNER Victor


STINNER Victor  added the comment:

You can find the rationale for this change in two issues:

* bpo-27987
* bpo-36618

First, it was a warning in clang ubsan (Undefined Behavior Sanitizer).
Then ctypes started to crash when Python was compiled with clang. It
means that compiling Python 3.7 with clang also had the issue.

The quick fix was to compile Python with -fmax-type-align=8 when clang
was detected.

But it was a signal that something was wrong in Python on x86-64:
Python didn't respect the x86-64 ABI.

--

___
Python tracker 

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



[issue39498] Signpost security considerations in library

2020-02-10 Thread Julien Palard


Julien Palard  added the comment:

Asked on gh:

> this is a "security guidance for standard library modules" index?

(I'm not sure to understand the question exactly)

I think it could be usefull from a reviewer point of view to have such index so 
he can iterate over it and check point by point if the code is OK.

In this case, linking to all notes like "beware, wrong usage of this could lead 
to security issues" looks what's needed in this index.

Anthony: did you opened the issue with this in mind or any other usages?

--
nosy: +mdk

___
Python tracker 

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



[issue39090] Document various options for getting the absolute path from pathlib.Path objects

2020-02-10 Thread Paul Moore


Paul Moore  added the comment:

> In short -- I understand that this is a complex issue, but making an absolute 
> path is a pretty common use case, and we've had os.path.abspath() for 
> decades, so there should be one obvious way to do it, and it should be easily 
> discoverable.

+1 on this.

Given that (as far as I can tell from the various discussions) `resolve` works 
fine as long as the file exists, maybe the key distinction to make is whether 
you have an existing file or not.

(More subtle questions like UNC path vs drive letter, mentioned on the 
Discourse thread, are probably things that we can defer to a "more advanced 
cases" discussion in the docs).

--
nosy: +paul.moore

___
Python tracker 

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



[issue39597] sorting the String

2020-02-10 Thread Zachary Ware


Change by Zachary Ware :


--
stage:  -> resolved
status: pending -> closed

___
Python tracker 

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



[issue39591] Functions in Python/traceback.c can take const pointer arguments

2020-02-10 Thread Andy Lester


Andy Lester  added the comment:

> Yes, Py_INCREF and Py_DECREF change the type, and therefore constness.

Understood. The changes that I have proposed are not to objects that get sent 
through Py_INCREF/Py_DECREF.  If they did, -Wcast-qual would have caught it.  
-Wcast-qual catches if you cast, say, a const char * to a char *.

Let's let this stay closed and I'll resubmit with a clearer ticket & PR.

--

___
Python tracker 

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



[issue39600] idle_test: test_fontlist_key() fails if two fonts have the same name

2020-02-10 Thread STINNER Victor


New submission from STINNER Victor :

==
FAIL: test_fontlist_key (idlelib.idle_test.test_configdialog.FontPageTest)
--
Traceback (most recent call last):
  File "/usr/lib64/python3.7/idlelib/idle_test/test_configdialog.py", line 104, 
in test_fontlist_key
self.assertNotEqual(down_font, font)
AssertionError: 'Cantarell' == 'Cantarell'

Example:
---
import tkinter.ttk
import tkinter.font
frame = tkinter.ttk.Frame()
families=sorted(tkinter.font.families(frame))
for family in families:
print(family)
---

Truncated output on my Fedora 31:
---
Abyssinica SIL
Android Emoji
AnjaliOldLipi
Bitstream Vera Sans
C059
Caladea
Cantarell
Cantarell
Cantarell
Cantarell
(...)
Comfortaa
Comfortaa
(...))
DejaVu Sans
DejaVu Sans
DejaVu Sans
(...)
Source Han Serif CN
Source Han Serif CN
Source Han Serif CN
Source Han Serif CN
Source Han Serif CN
Source Han Serif CN
Source Han Serif TW
Source Han Serif TW
Source Han Serif TW
Source Han Serif TW
Source Han Serif TW
Source Han Serif TW
(...)
---

I'm not sure if it's an issue in the unit test or an issue with the widget 
itself. Does it make sense to display the same font family name twice?

--
assignee: terry.reedy
components: IDLE, Tests
messages: 361700
nosy: cheryl.sabella, taleinat, terry.reedy, vstinner
priority: normal
severity: normal
status: open
title: idle_test: test_fontlist_key() fails if two fonts have the same name
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



[issue39600] idle_test: test_fontlist_key() fails if two font families have the same name

2020-02-10 Thread STINNER Victor


Change by STINNER Victor :


--
title: idle_test: test_fontlist_key() fails if two fonts have the same name -> 
idle_test: test_fontlist_key() fails if two font families have the same name

___
Python tracker 

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



[issue39600] idle_test: test_fontlist_key() fails if two font families have the same name

2020-02-10 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue39600] idle_test: test_fontlist_key() fails if two font families have the same name

2020-02-10 Thread STINNER Victor


STINNER Victor  added the comment:

I proposed PR 18430 to remove duplicated font family names.

--

___
Python tracker 

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



[issue39600] idle_test: test_fontlist_key() fails if two font families have the same name

2020-02-10 Thread STINNER Victor


Change by STINNER Victor :


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



[issue39601] brace escapes are not working in formatted string literal format specifications

2020-02-10 Thread JitterMan


New submission from JitterMan :

It appears as if escaping the braces by doubling them up is not working 
properly if the braces are in a format specification within a f-string.

>>> print(f'Email:\n{C:{{v.name}} {{v.email}}|\n}') 
>>> 
Traceback (most recent call last):
  File "bugreport.py", line 95, in 
print(f'Email:\n{C:{{v.name}} {{v.email}}|\n}')
NameError: name 'v' is not defined

The escaping works as expected when the string's format method is used.

--
components: 2to3 (2.x to 3.x conversion tool)
files: bugreport.py
messages: 361702
nosy: jitterman
priority: normal
severity: normal
status: open
title: brace escapes are not working in formatted string literal format 
specifications
type: behavior
versions: Python 3.8
Added file: https://bugs.python.org/file48887/bugreport.py

___
Python tracker 

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



[issue39601] brace escapes are not working in formatted string literal format specifications

2020-02-10 Thread JitterMan


JitterMan  added the comment:

It appears as if escaping the braces by doubling them up is not working 
properly if the braces are in a format specification within a f-string.

>>> print(f'Email:\n{C:{{v.name}} {{v.email}}|\n}') 
>>> 
Traceback (most recent call last):
  File "bugreport.py", line 95, in 
print(f'Email:\n{C:{{v.name}} {{v.email}}|\n}')
NameError: name 'v' is not defined

The escaping works as expected when the string's format method is used.

--
Added file: https://bugs.python.org/file4/bugreport.py

___
Python tracker 

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



[issue39601] brace escapes are not working in formatted string literal format specifications

2020-02-10 Thread Zachary Ware


Zachary Ware  added the comment:

What result are you expecting here?

--
nosy: +zach.ware

___
Python tracker 

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



[issue39602] importlib: lazy loading can result in reimporting a submodule

2020-02-10 Thread Pox TheGreat


New submission from Pox TheGreat :

Using the LazyLoader class one can modify the sys.meta_path finders so that 
every import mechanism becomes lazy. This method has been used in Mercurial and 
by Facebook.

My problem is that if I have a package (pa) which imports a submodule (a) in 
the __init__.py and accesses its attributes (or uses a from list) then that 
submodule is imported (executed) twice without any warning.

I traced back the problem to importlib._bootstrap.py / _find_and_load_unlocked. 
There is a check there if the submodule has already been imported by the parent 
package, but the submodule will be imported just after that check because of 
the _LazyModule and the __path__ attribute access of the submodule.

# Crazy side-effects!
if name in sys.modules:
return sys.modules[name]
parent_module = sys.modules[parent]
try:
path = parent_module.__path__


Maybe we could check if name in sys.modules after the __path__ attribute access?

--
components: Library (Lib)
files: LazyImport.zip
messages: 361705
nosy: Pox TheGreat
priority: normal
severity: normal
status: open
title: importlib: lazy loading can result in reimporting a submodule
type: behavior
versions: Python 3.7, Python 3.8
Added file: https://bugs.python.org/file48889/LazyImport.zip

___
Python tracker 

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



[issue39545] await is not supported in f-string in 3.6

2020-02-10 Thread Elena Oat


Elena Oat  added the comment:

There was no update on this since 02/04, so I will work on this as I am at the 
PyCascades sprints right now.

--
nosy: +Elena.Oat

___
Python tracker 

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



[issue39601] brace escapes are not working in formatted string literal format specifications

2020-02-10 Thread Chris Wilcox


Chris Wilcox  added the comment:

The attached code implements `__format__` on the `Collections` class. In case 
1, the template passed to `__format__` is "{v.name}: {v.email}|". In case 2, a 
name error will occur while processing the f string and v will not be found as 
no object 'v' exists in locals or globals.

In reviewing PEP 0498, https://www.python.org/dev/peps/pep-0498/, I think the 
difference is in what object is being formatted.

In case 1 of the attached code, the collection is being formatted. In case 2 
where f-strings are used, 'v' is being formatted. Because v doesn't exist in 
this context, it fails. I found this in the PEP and I think it is what is going 
on here.

```
Note that __format__() is not called directly on each value. The actual code 
uses the equivalent of type(value).__format__(value, format_spec), or 
format(value, format_spec). See the documentation of the builtin format() 
function for more details.

```

--
nosy: +crwilcox

___
Python tracker 

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



[issue16776] Document PyCFunction_New and PyCFunction_NewEx functions

2020-02-10 Thread Roger Hurwitz


Roger Hurwitz  added the comment:

I am at PyCascades at the CPython sprint, and I will work on this issue to the 
best of my ability.

--
nosy: +rogerhurwitz

___
Python tracker 

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



[issue39551] mock patch should match behavior of import from when module isn't present in sys.modules

2020-02-10 Thread Dino Viehland


Dino Viehland  added the comment:

I like that idea, let me see if I can find a way to do that.  This is a little 
bit different in that it's implicitly trying to find a module, and supports 
dotting through non-packages as well, but maybe there's a way to leverage 
importlib and still keep the existing behavior.

--

___
Python tracker 

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



[issue39603] Injection in http.client

2020-02-10 Thread Max


New submission from Max :

I recently came across a bug during a pentest that's allowed me to perform some 
really interesting attacks on a target. While originally discovered in 
requests, I had been forwarded to one of the urllib3 developers after agreeing 
that fixing it at it's lowest level would be preferable. I was informed that 
the vulnerability is also present in http.client and that I should report it 
here as well.

The 'method' parameter is not filtered to prevent the injection from altering 
the entire request.

For example:
>>> conn = http.client.HTTPConnection("localhost", 80)
>>> conn.request(method="GET / HTTP/1.1\r\nHost: abc\r\nRemainder:", 
>>> url="/index.html")

This will result in the following request being generated:
GET / HTTP/1.1
Host: abc
Remainder: /index.html HTTP/1.1
Host: localhost
Accept-Encoding: identity

This was originally found in an HTTP proxy that was utilising Requests. It 
allowed me to manipulate the original path to access different files from an 
internal server since the developers had assumed that the method would filter 
out non-standard HTTP methods.

The recommended solution is to only allow the standard HTTP methods of GET, 
HEAD, POST, PUT, DELETE, CONNECT, OPTIONS, TRACE, and PATCH.

An alternate solution that would allow programmers to use non-standard methods 
would be to only support characters [a-z] and stop reading at any special 
characters (especially newlines and spaces).

--
components: Library (Lib)
messages: 361710
nosy: maxpl0it
priority: normal
severity: normal
status: open
title: Injection in http.client
type: security
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



[issue14678] Update zipimport to support importlib.invalidate_caches()

2020-02-10 Thread Chris Wilcox


Chris Wilcox  added the comment:

What work remains to be done for this issue?

--
nosy: +crwilcox

___
Python tracker 

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



[issue39600] idle_test: test_fontlist_key() fails if two font families have the same name

2020-02-10 Thread Carol Willing


Carol Willing  added the comment:


New changeset ed335cf53b5d4bca9a08c9b83ba684ba17be0f10 by Victor Stinner in 
branch 'master':
bpo-39600, IDLE: Remove duplicated font names (GH-18430)
https://github.com/python/cpython/commit/ed335cf53b5d4bca9a08c9b83ba684ba17be0f10


--
nosy: +willingc

___
Python tracker 

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



[issue39417] Link to "Python Packaging User Guide: Creating and using virtual environments" is broken

2020-02-10 Thread Ognyan Moore


Ognyan Moore  added the comment:

Hi, I'm at pycascades cpython sprint, I can tackle this issue.

--
nosy: +Ognyan Moore

___
Python tracker 

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



[issue39417] Link to "Python Packaging User Guide: Creating and using virtual environments" is broken

2020-02-10 Thread Roundup Robot


Change by Roundup Robot :


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

___
Python tracker 

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



[issue39545] await is not supported in f-string in 3.6

2020-02-10 Thread Elena Oat


Change by Elena Oat :


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

___
Python tracker 

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



[issue39417] Link to "Python Packaging User Guide: Creating and using virtual environments" is broken

2020-02-10 Thread Ognyan Moore


Ognyan Moore  added the comment:

Submitted PR 18432 to reflect this fix

--

___
Python tracker 

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



[issue9305] Don't use east/west of UTC in date/time documentation

2020-02-10 Thread Chris Wilcox


Chris Wilcox  added the comment:

Are you still working on this Ajay Mahato?

--
nosy: +crwilcox

___
Python tracker 

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



[issue39545] await is not supported in f-string in 3.6

2020-02-10 Thread Elena Oat


Change by Elena Oat :


--
pull_requests: +17808
pull_request: https://github.com/python/cpython/pull/18434

___
Python tracker 

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



[issue20265] Bring Windows docs up to date

2020-02-10 Thread Mariatta


Mariatta  added the comment:

I think this is done, so I'm going to close it.
Thanks all who participated. If there are more updates needed to the Windows 
documentation, I would suggest creating specific tickets with specific 
problems, instead of one big catchall ticket.

--
nosy: +Mariatta
resolution:  -> fixed
stage: needs patch -> 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



[issue39369] Doc: Update mmap readline method documentation

2020-02-10 Thread Carol Willing


Carol Willing  added the comment:


New changeset 6c9974e12c50150149b989aaef68be1fe46ea670 by Wellington Pardim in 
branch 'master':
bpo-39369 Doc: Update mmap readline method documentation (GH-17957)
https://github.com/python/cpython/commit/6c9974e12c50150149b989aaef68be1fe46ea670


--
nosy: +willingc

___
Python tracker 

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



[issue39417] Link to "Python Packaging User Guide: Creating and using virtual environments" is broken

2020-02-10 Thread Ammar Askar


Change by Ammar Askar :


--
keywords: +newcomer friendly

___
Python tracker 

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



[issue3950] turtle.py: bug in TurtleScreenBase._drawimage

2020-02-10 Thread Carl Tyndall


Change by Carl Tyndall :


--
pull_requests: +17809
pull_request: https://github.com/python/cpython/pull/18435

___
Python tracker 

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



[issue39545] await is not supported in f-string in 3.6

2020-02-10 Thread Ned Deily


Ned Deily  added the comment:


New changeset a2963f09629a0a8c63e9acef79c1dcc0a040ddb6 by Elena Oat in branch 
'3.6':
bpo-39545: docs: do not use await in f-strings (GH-18434)
https://github.com/python/cpython/commit/a2963f09629a0a8c63e9acef79c1dcc0a040ddb6


--
nosy: +ned.deily

___
Python tracker 

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



[issue39545] await is not supported in f-string in 3.6

2020-02-10 Thread Ned Deily


Ned Deily  added the comment:

Thanks for the PR!  We don't normally accept doc changes for branches in 
security-fix mode but this seems like a worthwhile exception.

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



[issue16776] Document PyCFunction_New and PyCFunction_NewEx functions

2020-02-10 Thread Guido van Rossum


Guido van Rossum  added the comment:

I'm sprinting with Roger. Based on Petr's comment I am closing this issue -- if 
we should not draw attention to this function let's not document it.

@svetlov if you still think it should be documented, can you suggest where the 
documentation should go? The best place we could come up with is in the file 
where Andrew put it.

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



[issue39600] idle_test: test_fontlist_key() fails if two font families have the same name

2020-02-10 Thread miss-islington


Change by miss-islington :


--
pull_requests: +17810
pull_request: https://github.com/python/cpython/pull/18436

___
Python tracker 

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



[issue39600] idle_test: test_fontlist_key() fails if two font families have the same name

2020-02-10 Thread miss-islington


Change by miss-islington :


--
pull_requests: +17811
pull_request: https://github.com/python/cpython/pull/18437

___
Python tracker 

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



[issue13826] Having a shlex example in the subprocess.Popen docs is confusing

2020-02-10 Thread Tim Smith


Change by Tim Smith :


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

___
Python tracker 

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



[issue39600] idle_test: test_fontlist_key() fails if two font families have the same name

2020-02-10 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Serhiy, do you know anything about the tkinter.font.families() tuple having 
duplicate names?  It strikes me as an OS or tk error.

On Windows, the tuple has groups of related names with a base name, such as 
'Segoe UI' both alone and with suffixes, such as 'light', 'black', and 
'symbol'.  I wonder if on Fedora 31 the duplicates are related names with the 
suffixes somehow left off.  Cheryl, do you see any of the above duplicated 
names de-duplicated on Ubuntu with suffixes?

Whether the duplicates are true duplicates, (same family repeated) or mistakes 
(related families missing suffixes), they should be useless to the user.  
Clicking or scrolling through the duplicates should not change the font sample 
as 'Font(family=dupname)' will not change.

Victor, your example does not create a Listbox, so that cannot be the issue.  
The only change to ConfigDialog when testing is that it is not made modal.  
What puzzles me is that test_fontlist_key starts by explicitly activating the 
first font on the list, so that the first test on the Fedora machine should be 
'Android Emoji' != 'Abyssinica SIL'.  Perhaps there is a bug in the tk on that 
machine.

Carol Willing merged the PR before I could review and edit.  I will add a 
follow-up after getting backport to work.

--
nosy: +serhiy.storchaka -willingc

___
Python tracker 

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



[issue3950] turtle.py: bug in TurtleScreenBase._drawimage

2020-02-10 Thread miss-islington


Change by miss-islington :


--
pull_requests: +17814
pull_request: https://github.com/python/cpython/pull/18439

___
Python tracker 

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



[issue3950] turtle.py: bug in TurtleScreenBase._drawimage

2020-02-10 Thread miss-islington


Change by miss-islington :


--
pull_requests: +17813
pull_request: https://github.com/python/cpython/pull/18440

___
Python tracker 

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



[issue39600] idle_test: test_fontlist_key() fails if two font families have the same name

2020-02-10 Thread miss-islington


Change by miss-islington :


--
pull_requests: +17815
pull_request: https://github.com/python/cpython/pull/18441

___
Python tracker 

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



[issue39600] idle_test: test_fontlist_key() fails if two font families have the same name

2020-02-10 Thread miss-islington


Change by miss-islington :


--
pull_requests: +17816
pull_request: https://github.com/python/cpython/pull/18442

___
Python tracker 

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



[issue30155] Add ability to get/set tzinfo on datetime instances in C API

2020-02-10 Thread Anthony Tuininga


Anthony Tuininga  added the comment:

Any progress on this?

--

___
Python tracker 

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



[issue39578] MagicMock specialisation instance can no longer be passed to new MagicMock instance

2020-02-10 Thread Elena Oat


Elena Oat  added the comment:

I am looking at reproducing this and creating a short example of where this 
fails. Will look further into more details of why this doesn't work.

--
nosy: +Elena.Oat

___
Python tracker 

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



[issue3950] turtle.py: bug in TurtleScreenBase._drawimage

2020-02-10 Thread miss-islington


miss-islington  added the comment:


New changeset 3b888ad70aaed39df1985b38b4987feb5bee7981 by Miss Islington (bot) 
in branch '3.7':
[3.7] bpo-3950: Fix docs for default locale used by gettext to match 
implementation (GH-18435) (GH-18439)
https://github.com/python/cpython/commit/3b888ad70aaed39df1985b38b4987feb5bee7981


--
nosy: +miss-islington

___
Python tracker 

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



[issue39501] gettext's default localedir does not match documentation

2020-02-10 Thread Guido van Rossum


Guido van Rossum  added the comment:

Fixed by Carl-y in PR 18435, PR 18440, PR 18439. (Sorry, those commits were 
attributed to issue3950 by mistake.)

--
nosy: +gvanrossum
resolution:  -> fixed
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



[issue3950] turtle.py: bug in TurtleScreenBase._drawimage

2020-02-10 Thread Guido van Rossum


Guido van Rossum  added the comment:

Sorry, those PRs were for issue39501.

--
nosy: +gvanrossum

___
Python tracker 

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



[issue39600] idle_test: test_fontlist_key() fails if two font families have the same name

2020-02-10 Thread miss-islington


miss-islington  added the comment:


New changeset 021a5694ede9d7be119f9ceb3ee7e8e518ec5002 by Miss Islington (bot) 
in branch '3.8':
bpo-39600, IDLE: Remove duplicated font names (GH-18430)
https://github.com/python/cpython/commit/021a5694ede9d7be119f9ceb3ee7e8e518ec5002


--
nosy: +miss-islington

___
Python tracker 

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



[issue39600] idle_test: test_fontlist_key() fails if two font families have the same name

2020-02-10 Thread miss-islington


miss-islington  added the comment:


New changeset 2e8097d1c7c04dd96061ec1498cfa088bce9085b by Miss Islington (bot) 
in branch '3.7':
bpo-39600, IDLE: Remove duplicated font names (GH-18430)
https://github.com/python/cpython/commit/2e8097d1c7c04dd96061ec1498cfa088bce9085b


--

___
Python tracker 

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



[issue39600] idle_test: test_fontlist_key() fails if two font families have the same name

2020-02-10 Thread STINNER Victor


STINNER Victor  added the comment:

In LibreOffice, I see 4 flavors of "Cantarell" with different *weight* :

Cantarell
Cantarell Extra Bold
Cantarell Light
Cantarell Thin

whereas tkinter.font.families(frame) returns 4 times the same string: 
"Cantarell". The C function of Tk is TkpGetFontFamilies().

The X11 implementation uses XListFonts() which returns a string like 
"-foundry-family-weight-slant-(...)" but the function only returns the "family" 
substring: it ignores the foundy and the weight for example. So it's not 
surprising to get duplicates. Example: 
"-adobe-helvetica-bold-o-normal--11-80-100-100-p-60-iso8859-1" becomes 
"helvetica".

There is also a Xft implementation which uses XftListFonts(). Then it uses 
XftPatternGetString() to get a font family.

I see no logic in Tcl to exclude duplicated family names of different weights.

--

>>> tkinter.font.names(frame)
('TkCaptionFont', 'TkSmallCaptionFont', 'TkTooltipFont', 'TkFixedFont', 
'TkHeadingFont', 'TkMenuFont', 'TkIconFont', 'TkTextFont', 'TkDefaultFont')

That's something different that I would call unrelated ;-)

--

___
Python tracker 

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



[issue39600] idle_test: test_fontlist_key() fails if two font families have the same name

2020-02-10 Thread STINNER Victor


STINNER Victor  added the comment:

> Victor, your example does not create a Listbox, so that cannot be the issue.  
> The only change to ConfigDialog when testing is that it is not made modal.  
> What puzzles me is that test_fontlist_key starts by explicitly activating the 
> first font on the list, so that the first test on the Fedora machine should 
> be 'Android Emoji' != 'Abyssinica SIL'.  Perhaps there is a bug in the tk on 
> that machine.

The test failure comes from our build system where very few fonts are limited. 
For example, you can imagine that only a few variants of Cantarell are 
installed.

Sorry, I forgot to mention that the test failure and the list of strings come 
from two different machines.

The list comes from my laptop where I have many fonts installed.

--

___
Python tracker 

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



[issue39594] Typo in documentation for os.times

2020-02-10 Thread Roger Hurwitz


Roger Hurwitz  added the comment:

Reviewing this as part of the CPython sprint at PyCascades.

--
nosy: +rogerhurwitz

___
Python tracker 

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



[issue39278] add docstrings to functions in pdb module

2020-02-10 Thread Ognyan Moore


Ognyan Moore  added the comment:

Stumbled across this issue, is there a list of methods/functions that need 
docstrings or should we aim to add docstrings to all methods in pdb.py?

--
nosy: +Ognyan Moore

___
Python tracker 

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



[issue39594] Typo in documentation for os.times

2020-02-10 Thread Roger Hurwitz


Change by Roger Hurwitz :


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

___
Python tracker 

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



[issue39604] Document PyDateTimeAPI / PyDateTime_CAPI struct

2020-02-10 Thread Paul Ganssle


New submission from Paul Ganssle :

The entire public interface documented for the datetime C API is various C 
macros (see: https://docs.python.org/3/c-api/datetime.html) which are wrappers 
around function calls to the PyDateTimeAPI / PyDatetime_CAPI struct, but the 
struct itself is undocumented. 

Unfortunately (or fortunately, depending on how you think the C API should 
look), pretty much everyone has to know the implementation details of the C API 
struct anyway. Bindings in other languages usually can't use the C preprocessor 
macros and have to directly use the C API struct so projects like PyPy, PyO3 
and Cython are using it. The struct also can do things that the macros can't 
do: consider bug #30155 which is looking for a way to create a datetime object 
with a tzinfo (which is possible using the C struct).

I think we can should go ahead and make the `PyDateTimeAPI` struct "public" and 
document the functions on it. This may be a bit tougher than one would hope 
because the overlap between the macros and the struct functions isn't 100%, but 
it's pretty close, so I would think we'd want to document the two ways to do 
things rather close to one another.

nosy-ing Victor on here in case he has any strong opinions about whether these 
kinds of struct should be exposed as part of the official public interface.

--
assignee: docs@python
components: C API, Documentation
messages: 361733
nosy: belopolsky, docs@python, lemburg, p-ganssle, vstinner
priority: normal
severity: normal
status: open
title: Document PyDateTimeAPI / PyDateTime_CAPI struct
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



[issue34592] cdll.LoadLibrary allows None as an argument

2020-02-10 Thread Malcolm Smith


Malcolm Smith  added the comment:

This isn't documented, but CDLL(None) is translated to dlopen(NULL), which 
"causes a search for a symbol in the main program, followed by all shared 
libraries loaded at program startup, and then all shared libraries loaded by 
dlopen() with the flag RTLD_GLOBAL" (https://linux.die.net/man/3/dlopen).

This is sometimes useful because it lets you look up a symbol in an 
already-loaded library without needing to give the library's name. For example:

>>> import ctypes
>>> dll = ctypes.CDLL(None)
>>> dll.printf
<_FuncPtr object at 0x7f3427d547c0>
>>> dll.PyObject_Str
<_FuncPtr object at 0x7f3427d54880>

--
nosy: +Malcolm Smith

___
Python tracker 

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



[issue34592] cdll.LoadLibrary allows None as an argument

2020-02-10 Thread STINNER Victor


STINNER Victor  added the comment:

I'm using LoadLibrary(None) commonly to load symbols in Python itself ;-)

--
nosy: +vstinner

___
Python tracker 

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



[issue11664] Add patch method to unittest.TestCase

2020-02-10 Thread Guido van Rossum


Guido van Rossum  added the comment:

Given the two recent -1 responses let's close this.

--
nosy: +gvanrossum
resolution:  -> wont fix
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



[issue30155] Add ability to get tzinfo from a datetime instance in C API

2020-02-10 Thread Paul Ganssle


Paul Ganssle  added the comment:

So this bug is asking for two things:

1. An official accessor for the `tzinfo` component of an existing datetime, 
which I think is very reasonable in light of the fact that there are official 
accessors for all the other components of a datetime.

2. An official constructor for a timezone-aware datetime, which I think 
basically exists in the form of 
PyDatetime_CAPI->PyDateTimeAPI->DateTime_FromDateAndTime / 
->DateTime_FromDateAndTimeAndFold, and we just need to document it. I think 
this is basically a separate issue, and I have opened #39604 to track it.

I'm going to rename this bug to focus only on issue #1. I think we can accept a 
PR adding two new macros. I would suggest calling them:

- PyDateTime_DATE_GET_TZINFO
- PyDateTime_TIME_GET_TZINFO

Please make sure to add tests to any PR you make. See the CapiTest case 
(https://github.com/python/cpython/blob/d68e0a8a165761604e820c8cb4f20abc735e717f/Lib/test/datetimetester.py#L5914)
 for examples. You may want to look at the git blame for a few of those tests 
to see the PRs that they were added in, since part of the tests are defined in 
a C file.

(As an aside: I don't love that the accessor methods are not available on the 
struct, since all the "macro-only" code needs to be re-implemented in all 
other-language bindings. Since the accessors are already all macro-only, 
though, might as well keep with the tradition for now :P)

--
stage:  -> needs patch
title: Add ability to get/set tzinfo on datetime instances in C API -> Add 
ability to get tzinfo from a datetime instance in C API
versions: +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



[issue38324] [Windows] test_locale and test__locale failures on Windows

2020-02-10 Thread STINNER Victor


STINNER Victor  added the comment:

Details on this error:

ERROR: test_getsetlocale_issue1813 (test.test_locale.TestMiscellaneous)
--
Traceback (most recent call last):
  File "C:\vstinner\python\3.8\lib\test\test_locale.py", line 567, in 
test_getsetlocale_issue1813
locale.setlocale(locale.LC_CTYPE, loc)
  File "C:\vstinner\python\3.8\lib\locale.py", line 608, in setlocale
return _setlocale(category, locale)
locale.Error: unsupported locale setting

On Windows 10 (version 1903), ANSI code page 1252, OEM code page 437, LC_CTYPE 
locale "French_France.1252":

vstinner@WIN C:\vstinner\python\master>python
Running Debug|x64 interpreter...
Python 3.9.0a3+ (heads/master:d68e0a8a16, Feb 10 2020, 22:59:58) [MSC v.1916 64 
bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import locale
>>> locale.setlocale(locale.LC_CTYPE, "tr_TR")
'tr_TR'
>>> loc=locale.getlocale(locale.LC_CTYPE) 
>>> loc
('tr_TR', 'ISO8859-9')
>>> locale.setlocale(locale.LC_CTYPE, loc)
Traceback (most recent call last):
  File "", line 1, in 
  File "C:\vstinner\python\master\lib\locale.py", line 610, in setlocale
return _setlocale(category, locale)
locale.Error: unsupported locale setting
>>> name=locale._build_localename(loc)
>>> name
'tr_TR.ISO8859-9'
>>> name2 = locale.normalize(name)
>>> name2 == name
True
>>> name2
'tr_TR.ISO8859-9'
>>> locale.setlocale(locale.LC_CTYPE, 'tr_TR.ISO8859-9') 
Traceback (most recent call last):
  File "", line 1, in 
  File "C:\vstinner\python\master\lib\locale.py", line 610, in setlocale
return _setlocale(category, locale)
locale.Error: unsupported locale setting

Note: I changed the OEM code page, usually OEM cp is 850, but the OEM code page 
should have no effect on setlocale().

--

___
Python tracker 

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



[issue39594] Typo in documentation for os.times

2020-02-10 Thread miss-islington


Change by miss-islington :


--
pull_requests: +17818
pull_request: https://github.com/python/cpython/pull/18444

___
Python tracker 

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



[issue39594] Typo in documentation for os.times

2020-02-10 Thread miss-islington


miss-islington  added the comment:


New changeset 37c55b2b49a3acb7c56c9f6a5062bc6e4e35bc1c by Roger Hurwitz in 
branch 'master':
bpo-39594: Fix typo in os.times documentation (GH-18443)
https://github.com/python/cpython/commit/37c55b2b49a3acb7c56c9f6a5062bc6e4e35bc1c


--
nosy: +miss-islington

___
Python tracker 

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



[issue13826] Having a shlex example in the subprocess.Popen docs is confusing

2020-02-10 Thread miss-islington


Change by miss-islington :


--
pull_requests: +17819
pull_request: https://github.com/python/cpython/pull/18445

___
Python tracker 

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



[issue13826] Having a shlex example in the subprocess.Popen docs is confusing

2020-02-10 Thread miss-islington


miss-islington  added the comment:


New changeset 95d024d585bd3ed627437a2f0cbc783c8a014c8a by Tim D. Smith in 
branch 'master':
bpo-13826: Clarify Popen constructor example (GH-18438)
https://github.com/python/cpython/commit/95d024d585bd3ed627437a2f0cbc783c8a014c8a


--
nosy: +miss-islington

___
Python tracker 

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



[issue39594] Typo in documentation for os.times

2020-02-10 Thread Mariatta


Mariatta  added the comment:

Thanks!

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



[issue13826] Having a shlex example in the subprocess.Popen docs is confusing

2020-02-10 Thread miss-islington


Change by miss-islington :


--
pull_requests: +17820
pull_request: https://github.com/python/cpython/pull/18446

___
Python tracker 

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



[issue39594] Typo in documentation for os.times

2020-02-10 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue39594] Typo in documentation for os.times

2020-02-10 Thread miss-islington


miss-islington  added the comment:


New changeset a12effde34e7cf7ced767ca232cc2ed95e62cd46 by Miss Islington (bot) 
in branch '3.7':
bpo-39594: Fix typo in os.times documentation (GH-18443)
https://github.com/python/cpython/commit/a12effde34e7cf7ced767ca232cc2ed95e62cd46


--

___
Python tracker 

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



[issue13826] Having a shlex example in the subprocess.Popen docs is confusing

2020-02-10 Thread miss-islington


miss-islington  added the comment:


New changeset 78982f94faaa05e363d15b49ec230d11a4d8bebd by Miss Islington (bot) 
in branch '3.7':
bpo-13826: Clarify Popen constructor example (GH-18438)
https://github.com/python/cpython/commit/78982f94faaa05e363d15b49ec230d11a4d8bebd


--

___
Python tracker 

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



[issue13826] Having a shlex example in the subprocess.Popen docs is confusing

2020-02-10 Thread miss-islington


miss-islington  added the comment:


New changeset e6690f6cd1b0c2bd5804bad30239a4070f79102c by Miss Islington (bot) 
in branch '3.8':
bpo-13826: Clarify Popen constructor example (GH-18438)
https://github.com/python/cpython/commit/e6690f6cd1b0c2bd5804bad30239a4070f79102c


--

___
Python tracker 

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



  1   2   >