[issue39530] Documentation about comparisons between numeric types is misleading

2020-02-10 Thread Mark Dickinson


Mark Dickinson  added the comment:

Hi Katherine,

My report was really just about the last sentence, but I agree that the 
"narrower" language is confusing here. If someone says that a type "A" is 
narrower than type "B", that suggests to my ears that "A" represents a subset 
of the values of "B" (but conversely, that "B" can represent everything "A" 
can). That applies to the float/complex pair, or to Python 2's int/long, or to 
NumPy's float32/float64 or int32/int64, but not really to int/float, since int 
has many values that can't be represented as a float (and even has larger range 
than float).

I suspect that the wording may have made a bit (but only a bit) more sense in 
Python 2, where `long` was still in the mix, and `int` was the fixed-width 
type, which really would have been a subset of `float` on a typical 32-bit 
machine.

So yes, if we can find a way to ditch the "narrower" language altogether but 
still convey that idea of implicit conversions from int to float, and from 
float to complex, that would be good.

And then the last sentence still needs fixing somehow.

--

___
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 Eric V. Smith


Eric V. Smith  added the comment:

I always use datetime for testing such things. Its __format__() returns its 
argument, as long as you don't have '%' in it.

I do agree that it's odd that the doubled braces cause the expression to be 
evaluated, but are still kept as single braces in the resulting string. I'll 
have to investigate, although I'm not sure if we can change it at this point. 
Surely someone, somewhere is relying on this behavior.

I'll assume that what the OP wants in my example below is a format specifier of 
"x{x}x":

>>> x = 42
>>> import datetime
>>> now = datetime.datetime.now()

>>> f'{now:x{{x}}x}'
'x{42}x'

Given the current behavior, I'm not sure it's possible to get 'x{x}x'. 
Sometimes nested f-strings will help, but I don't think that will work here. 
The OP might need to use a separate expression to calculate the format 
specifier, which I realize isn't a very satisfying solution.

>>> spec = 'x{x}x'
>>> f'{now:{spec}}'
'x{x}x'

--

___
Python tracker 

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



[issue38374] Remove weakref.ReferenceError entry from documentation

2020-02-10 Thread miss-islington


miss-islington  added the comment:


New changeset 3f8d181446aa9d87e3773896c2695161ea8f6e42 by Miss Islington (bot) 
in branch '3.8':
bpo-38374: Remove weakref.ReferenceError from docs (GH-18452)
https://github.com/python/cpython/commit/3f8d181446aa9d87e3773896c2695161ea8f6e42


--

___
Python tracker 

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



[issue38374] Remove weakref.ReferenceError entry from documentation

2020-02-10 Thread miss-islington


miss-islington  added the comment:


New changeset fcfc3c8fbe3942e8deef15acc25bfa371db7766a by Miss Islington (bot) 
in branch '3.7':
bpo-38374: Remove weakref.ReferenceError from docs (GH-18452)
https://github.com/python/cpython/commit/fcfc3c8fbe3942e8deef15acc25bfa371db7766a


--

___
Python tracker 

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



[issue38374] Remove weakref.ReferenceError entry from documentation

2020-02-10 Thread Guido van Rossum


Change by Guido van Rossum :


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



[issue38374] Remove weakref.ReferenceError entry from documentation

2020-02-10 Thread miss-islington


miss-islington  added the comment:


New changeset 4eb9f4313cfaea6a9611221024a1c54f5662cc37 by Roger Hurwitz in 
branch 'master':
bpo-38374: Remove weakref.ReferenceError from docs (GH-18452)
https://github.com/python/cpython/commit/4eb9f4313cfaea6a9611221024a1c54f5662cc37


--
nosy: +miss-islington

___
Python tracker 

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



[issue38374] Remove weakref.ReferenceError entry from documentation

2020-02-10 Thread miss-islington


Change by miss-islington :


--
pull_requests: +17829
pull_request: https://github.com/python/cpython/pull/18455

___
Python tracker 

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



[issue38374] Remove weakref.ReferenceError entry from documentation

2020-02-10 Thread miss-islington


Change by miss-islington :


--
pull_requests: +17828
pull_request: https://github.com/python/cpython/pull/18454

___
Python tracker 

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



[issue39606] Regression: it should be possible to close async iterators multiple times

2020-02-10 Thread Nathaniel Smith


New submission from Nathaniel Smith :

In bpo-39386, the 'aclose' method for async generators was fixed so that the 
following broken code would correctly raise an error:

# -- bad code --
async def agen_fn():
yield

async def do_bad_thing():
agen = agen_fn()
aclose_coro = agen.aclose()
await aclose_coro
# Should raise RuntimeError:
await aclose_coro

asyncio.run(do_bad_thing())

# -

However, the merged fix also broke the following correct code, which should 
*not* raise an error:

# -- good code --
async def agen_fn():
yield

async def do_good_thing():
agen = agen_fn()
await agen.aclose()
# Should *not* raise an error, but currently does in Python dev branches:
await agen.aclose()

asyncio.run(do_good_thing())

# 

It's not supported to iterate the same coroutine object twice. However, making 
two *independent* calls to aclose should return two independent coroutine 
objects, and it should be legal to iterate over each object once.

This can also occur even if there's only a single call to 'aclose'. For 
example, this is the recommended idiom for making sure that an async generator 
correctly closes all its resources:

# -- good code --
async def agen_fn():
yield

async def careful_loop():
agen = agen_fn()
try:
async for _ in agen:
pass
finally:
await agen.aclose()

asyncio.run(careful_loop())

# ---

On released Python, the code above runs correctly. On the latest Python dev 
branches, it raises a RuntimeError.

So basically the problem is that the fix for bpo-39386 is storing the "was 
aclose iterated?" state on the async generator object, but in fact it needs to 
be stored on the aclose coroutine object.

--
keywords: 3.7regression, 3.8regression, 3.9regression
messages: 361783
nosy: asvetlov, lukasz.langa, ned.deily, njs, yselivanov
priority: release blocker
severity: normal
status: open
title: Regression: it should be possible to close async iterators multiple times
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



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

2020-02-10 Thread hai shi


hai shi  added the comment:

releated bpo: issue12769

s_get() in cfield.c function have similar behavior. So far, this is a planned 
action(lack evidence).

--

___
Python tracker 

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



[issue39577] venv --prompt argument is ignored

2020-02-10 Thread Vinay Sajip


Vinay Sajip  added the comment:

> Am I misunderstanding the behaviour of the prompt argument?

You can see from Karthikeyan's post how it's supposed to work, and how it does 
work in his example. It may be that something else is overwriting the prompt in 
your environment - we can't tell without knowing what's in your .bashrc, 
.profile etc.

--

___
Python tracker 

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



[issue39605] Fix some casts to not cast away const

2020-02-10 Thread Andy Lester


Change by Andy Lester :


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

___
Python tracker 

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



[issue39605] Fix some casts to not cast away const

2020-02-10 Thread Andy Lester


New submission from Andy Lester :

gcc -Wcast-qual turns up a number of instances of casting away constness of 
pointers.  Some of these can be safely modified, by either:

* Adding the const to the type cast, as in:

-return _PyUnicode_FromUCS1((unsigned char*)s, size);
+return _PyUnicode_FromUCS1((const unsigned char*)s, size);

* Removing the cast entirely, because it's not necessary (but probably was at 
one time), as in:

-PyDTrace_FUNCTION_ENTRY((char *)filename, (char *)funcname, lineno);
+PyDTrace_FUNCTION_ENTRY(filename, funcname, lineno);

These changes will not change code, but they will make it much easier to check 
for errors in consts.

--
components: Interpreter Core
messages: 361780
nosy: petdance
priority: normal
severity: normal
status: open
title: Fix some casts to not cast away const
type: enhancement

___
Python tracker 

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



[issue38374] Remove weakref.ReferenceError entry from documentation

2020-02-10 Thread Roger Hurwitz


Change by Roger Hurwitz :


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

___
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


Change by Zachary Ware :


--
nosy: +eric.smith

___
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


Change by Zachary Ware :


--
components:  -2to3 (2.x to 3.x conversion tool)

___
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


Change by Terry J. Reedy :


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



[issue37970] urllib.parse docstrings incomplete

2020-02-10 Thread Ido Michael


Ido Michael  added the comment:

Hey Senthil,
Yes the PEP guides was fixed a while ago, also the new comment of adding the 
same change for the second function were taken care of.

--

___
Python tracker 

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



[issue39585] Delete a pending item in _warning.c

2020-02-10 Thread ppperry


ppperry  added the comment:

What if a warning has a metaclass with a custom __getattribute__ method?

--
nosy: +ppperry

___
Python tracker 

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



[issue37970] urllib.parse docstrings incomplete

2020-02-10 Thread Senthil Kumaran


Senthil Kumaran  added the comment:

Hi Ido, there was a change requested by a core-dev, Zachary , on your PR.

>  Please have a look at PEP 257 for docstring formatting guidelines.

https://github.com/python/cpython/pull/16458/files#r353422155

Please let us know if that is addressed.

--

___
Python tracker 

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



[issue37970] urllib.parse docstrings incomplete

2020-02-10 Thread Ido Michael


Ido Michael  added the comment:

Any update on this? Adding @Tal Einat on the PR

--

___
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 Eryk Sun

Eryk Sun  added the comment:

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

The CRT default locale (i.e. the empty locale "") uses the user locale, which 
is the "Format" value on the Region->Formats tab. It does not use the system 
locale from the Region->Administrative tab. 

The default locale normally uses the user locale's ANSI codepage, as returned 
by GetLocaleInfoEx(LOCALE_NAME_USER_DEFAULT, LOCALE_IDEFAULTANSICODEPAGE, ...). 
But if the active codepage of the process is UTF-8, then GetACP(), GetOEMCP(), 
and setlocale(LC_CTYPE, "") all use UTF-8 (i.e. CP_UTF8, i.e. 65001). The 
active codepage can be set to UTF-8 either at the system-locale level or in the 
application-manifest. For example, with the active codepage setting in the 
manifest:

C:\>python.utf8.exe -q

>>> from locale import setlocale, LC_CTYPE
>>> setlocale(LC_CTYPE, "")
'English_Canada.utf8'

>>> kernel32 = ctypes.WinDLL('kernel32', use_last_error=True)
>>> kernel32.GetACP()
65001
>>> kernel32.GetOEMCP()
65001

A default locale name can also specify the codepage to use. It could be UTF-8, 
a particular codepage, ".ACP" (ANSI), or ".OCP" (OEM). "ACP" and "OCP" have to 
be in upper case. For example:

>>> setlocale(LC_CTYPE, '.utf8')
'English_Canada.utf8'
>>> setlocale(LC_CTYPE, '.437')
'English_Canada.437'

>>> setlocale(LC_CTYPE, ".ACP")
'English_Canada.1252'
>>> setlocale(LC_CTYPE, ".OCP")
'English_Canada.850'

Otherwise, if you provide a known locale -- using full names, or three-letter 
abbreviations, or from the small set of locale aliases, then setlocale queries 
any missing values from the NLS database. 

One snag in the road is the set of Unicode-only locales, such as "Hindi_India". 
Querying the ANSI and OEM codepages for a Unicode-only locale respectively 
returns CP_ACP (0) and CP_OEMCP (1). It used to be that the CRT would end up 
using the system locale for these cases. But recently ucrt has switched to 
using UTF-8 for these cases. For example:

>>> setlocale(LC_CTYPE, "Hindi_India")
'Hindi_India.utf8'

That brings us to the case of modern Windows BCP-47 locale names, which usually 
lack an implicit encoding. For example:

>>> setlocale(LC_CTYPE, "hi_IN")
'hi_IN'

The current CRT codepage can be queried via __lc_codepage_func:

>>> import ctypes; ucrt = ctypes.CDLL('ucrtbase', use_errno=True)
>>> ucrt.___lc_codepage_func()
65001

With the exception of Unicode-only locales, using a modern name without an 
encoding defaults to the named locale's ANSI codepage. For example:

>>> setlocale(LC_CTYPE, "en_CA")
'en_CA'
>>> ucrt.___lc_codepage_func()
1252

The only encoding allowed in BCP-47 locale names is ".utf8" or ".utf-8" (case 
insensitive):

>>> setlocale(LC_CTYPE, "fr_FR.utf8")
'fr_FR.utf8'
>>> setlocale(LC_CTYPE, "fr_FR.UTF-8")
'fr_FR.UTF-8'

No other encoding is allowed with this form. For example:

>>> try: setlocale(LC_CTYPE, "fr_FR.ACP")
... except Exception as e: print(e)
...
unsupported locale setting
>>> try: setlocale(LC_CTYPE, "fr_FR.1252")
... except Exception as e: print(e)
...
unsupported locale setting

As to the "tr_TR" locale bug, the Windows implementation is broken due to 
assumptions that POSIX locale names are directly supported. A significant 
redesign is required to connect the dots.

>>> from locale import getlocale
>>> setlocale(LC_CTYPE, 'tr_TR')
'tr_TR'
>>> ucrt.___lc_codepage_func()
1254

>>> getlocale(LC_CTYPE)
('tr_TR', 'ISO8859-9')

Codepage 1254 is similar to ISO8859-9, except, in typical fashion, Microsoft 
assigned most of the upper control range 0x80-0x9F to an assortment of 
characters it deemed useful, such as the Euro symbol "€". The exact codepage 
needs to be queried via __lc_codepage_func() and returned as ('tr_TR', 
'cp1254'). 

Conversely, setlocale() needs to know that this BCP-47 name does not support an 
explicit encoding, unless it's "utf8". If the given codepage, or an associated 
alias, doesn't match the locale's ANSI codepage, then the locale name has to be 
expanded to the full name "Turkish_Turkey". The long name allows specifying an 
arbitrary codepage. 

For example, say we have ('tr_TR', 'ISO8859-7'), i.e. Greek with Turkish locale 
rules. This transforms to the closest approximation ('tr_TR', '1253'). When 
setlocale queries the OS, it will find that the ANSI codepage is actually 1254, 
so it cannot use "tr_TR" or "tr-TR". It needs to expand to the long form:

>>> setlocale(LC_CTYPE, 'Turkish_Turkey.1253')
'Turkish_Turkey.1253'

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/pytho

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

2020-02-10 Thread Chris Wilcox


Chris Wilcox  added the comment:

Double curly braces do not indicate to not process the inner content. They 
indicate to include a literal curly brace. That said, I think there may be 
something not quite correct.

I came up with an example based on the example in the format specifiers section 
of the PEP.

>From the PEP.
```
>>> width = 10
>>> precision = 4
>>> value = decimal.Decimal('12.34567')
>>> f'result: {value:{width}.{precision}}'
'result:  12.35'
```
The template in this instance is "10.4"

If we leave the sample the same, but don't wrap width or precision in single 
curly braces,
```
>>> f'result: {value:width.precision}'
```
I would expect the template "width.precision".

Further, I would expect
```
>>> f'result: {value:{{width}}.{{precision}}}'
```
to have a template of "{width}.{precision}". This is not the case.


Here is some code that should demonstrate this.
```
class Decimal:
def __init__(self, value):
pass
def __format__(self, template):
return template
width = 10
precision = 4
value = Decimal('12.34567')
print("Expect Template to be '10.4' (TRUE)")
print(f'result0: {value:{width}.{precision}}')
print("Expect Template to be 'width.precision' (TRUE)")
print(f'result1: {value:width.precision}')
print("Expect Template to be '{width}.{precision}' (FALSE)")
print(f'result2: {value:{{width}}.{{precision}}}') # ACTUAL: {10}.{4}
```

--

___
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 32c88407d24a700946e1a6429cd5ca616cb3a810 by Miss Islington (bot) 
in branch '3.7':
bpo-39600: Adjust code, add idlelib/NEWS item (GH-18449)
https://github.com/python/cpython/commit/32c88407d24a700946e1a6429cd5ca616cb3a810


--

___
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 c372f9b9e758a22608b8df33423b7413d224fdad by Miss Islington (bot) 
in branch '3.8':
bpo-39600: Adjust code, add idlelib/NEWS item (GH-18449)
https://github.com/python/cpython/commit/c372f9b9e758a22608b8df33423b7413d224fdad


--

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

Cheryl, it appears that only 'weight' words are deleted.  For a given family, 
Tk only has a (user) settable 'bold', so other weight options must be 'baked 
in' to the family.  Perhaps X11 allows more weight settings within a family, 
even if not exposed in Tk.

--

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

font.names() lists 'symbolic' family names guaranteed to exist.  
'TkDefaultFont' is the default Text widget font on a particular OS.  IDLE 
replaces that with 'TkFixedFont', which is translated to the actual family name 
on each OS: Courier on Windows (ugh) and something like Monaco on macOS.

Thank you for the additional information.  For *nix users, removing the useless 
duplicates should be an improvement.  (This is aside from the test issue, which 
could have been fixed otherwise: perhaps by inserting 'TestFont' at the top of 
the list and making other adjustments.)

--

___
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: +17825
pull_request: https://github.com/python/cpython/pull/18451

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


New changeset 96ce22706735779cf8cc46eaaa5ac61359364b5a by Terry Jan Reedy in 
branch 'master':
bpo-39600: Adjust code, add idlelib/NEWS item (GH-18449)
https://github.com/python/cpython/commit/96ce22706735779cf8cc46eaaa5ac61359364b5a


--

___
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: +17824
pull_request: https://github.com/python/cpython/pull/18450

___
Python tracker 

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



[issue38374] Remove weakref.ReferenceError entry from documentation

2020-02-10 Thread Roger Hurwitz


Roger Hurwitz  added the comment:

At PyCascades CPython sprint and reviewing this issue.

--
nosy: +rogerhurwitz

___
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 Cheryl Sabella


Cheryl Sabella  added the comment:

I don't see the same duplicates that Victor listed, however I do see some 
duplicates.

(...)
DejaVu Sans
DejaVu Sans Mono
DejaVu Serif
(...)
Manjari
Manjari
Manjari
(...)
Mukti Narrow
Mukti Narrow
(...)
Ubuntu
Ubuntu
Ubuntu Condensed
Ubuntu Mono
(...)

--

___
Python tracker 

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



[issue39577] venv --prompt argument is ignored

2020-02-10 Thread Andrea


Andrea  added the comment:

Operative system is OS X 10.15.3 (19D76) Catalina
Python 3.7.4 installed via HomeBrew

If I do this python -m venv ciao --prompt NewOne by the time I activate the 
environment, the prompt looks like (ciao) andreamoro@MacBookAir:~/Python

Am I misunderstanding the behaviour of the prompt argument?

Thanks
Andrea

--

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



[issue38063] Modify test_socket.py to use unittest test discovery

2020-02-10 Thread STINNER Victor


STINNER Victor  added the comment:

I mark this issue as a duplicate of bpo-14408.

--
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> Support ./python -m unittest in test_socket

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

Here's the example I ran, that indeed fails in Python 3.8 and Python 3.9 (with 
different errors) and works in Python 3.7. 

from unittest.mock import MagicMock


class CustomMock(MagicMock):
def __init__(self):
super().__init__(__something__='something')


mock = CustomMock()
MagicMock(mock)


In Python 3.8 the error is TypeError: __init__() got an unexpected keyword 
argument '_new_parent'. 

In Python 3.9 the error is TypeError: __init__() got an unexpected keyword 
argument 'name'.

--

___
Python tracker 

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



[issue14408] Support ./python -m unittest in test_socket

2020-02-10 Thread STINNER Victor


STINNER Victor  added the comment:

I marked bpo-38063 as a duplicate of this issue.

--
nosy: +vstinner

___
Python tracker 

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



[issue36273] test_thread leaks a core dump on PPC64 AIX 3.x

2020-02-10 Thread STINNER Victor


STINNER Victor  added the comment:

I didn't see this failure on PPC64 AIX 3.x recently, I close the issue.

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

___
Python tracker 

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



[issue36194] Add "make regen-configure"

2020-02-10 Thread STINNER Victor


STINNER Victor  added the comment:

Most developers seem to be used to "autoconf && autoheader", so it's not 
obvious that "make regen-configure" would benefit to anyone. I just close the 
issue.

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



[issue35361] Update libffi dependency to 3.2.1?

2020-02-10 Thread STINNER Victor


STINNER Victor  added the comment:

Python 2.7 and 3.6 don't accept bugfixes anymore. I close the issue.

--
resolution:  -> out of date
stage:  -> resolved
status: open -> closed
versions: +Python 2.7, Python 3.6 -Python 3.8

___
Python tracker 

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



[issue38325] [Windows] test_winconsoleio failures

2020-02-10 Thread STINNER Victor


STINNER Victor  added the comment:

I "fixed" the issue by skipping broken tests. If anyone wants to fix the 
underlying issue: go ahead and open an issue, it would be way better with a PR 
to fix these tests!

In the meanwhile, skipping broken tests help to detect regressions (new issues).

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



[issue35501] "make coverage" should not leak coverage compiler flags to third party C extensions

2020-02-10 Thread STINNER Victor


STINNER Victor  added the comment:

It's unclear to me if it's a real issue or not. Moreover, I'm not comfortable 
to change the Makefile. So I just close the issue.

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

___
Python tracker 

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



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

2020-02-10 Thread Guido van Rossum


Change by Guido van Rossum :


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



[issue38325] [Windows] test_winconsoleio failures

2020-02-10 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 038770edc4680e9a3dc39bacb35a8358034fb901 by Victor Stinner in 
branch 'master':
bpo-38325: Skip non-BMP tests of test_winconsoleio (GH-18448)
https://github.com/python/cpython/commit/038770edc4680e9a3dc39bacb35a8358034fb901


--

___
Python tracker 

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



[issue31963] AMD64 Debian PGO 3.x buildbot: compilation failed with an internal compiler error in create_edge

2020-02-10 Thread STINNER Victor


STINNER Victor  added the comment:

I didn't see this failure recently, I close the issue.

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

___
Python tracker 

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



[issue21998] asyncio: support fork

2020-02-10 Thread STINNER Victor


STINNER Victor  added the comment:

There is no activity for 2 years. Asyncio is mature now. It seems like users 
learnt how to work around this issue, or don't use fork() with asyncio.

I close the issue.

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

___
Python tracker 

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



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

2020-02-10 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +17823
pull_request: https://github.com/python/cpython/pull/18449

___
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 Carol Willing


Carol Willing  added the comment:


New changeset c4a65ed7fe342bd18b5a5b0eea3470dc4fc31160 by Ogi Moore in branch 
'master':
bpo-39417: Fix broken link to guide to building venvs (GH-18432)
https://github.com/python/cpython/commit/c4a65ed7fe342bd18b5a5b0eea3470dc4fc31160


--
nosy: +willingc

___
Python tracker 

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



[issue11871] test_default_timeout() of test_threading.BarrierTests failure: BrokenBarrierError

2020-02-10 Thread STINNER Victor


STINNER Victor  added the comment:

I didn't see this failure recently, I close the issue.

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

___
Python tracker 

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



[issue39530] Documentation about comparisons between numeric types is misleading

2020-02-10 Thread Katherine Michel

Katherine Michel  added the comment:

I'm at the sprints at PyCascades and was looking for an issue to work on and 
came across this and wanted to know more about it. As I was doing some 
research, I found the terms "narrower" and "wider" to seem ambiguous. I'm 
assuming "narrower" to mean that an integer has a more precise value and 
"wider" to mean that a float has a less precise/wider range of possible values, 
but unless I'm missing something, it isn't clear. I think the first paragraph 
should be revised to make the meaning more explicit. Happy to assist (with some 
input), if applicable.

--
nosy: +Katherine Michel

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

My expectation is that doubling up the braces acts to escape them, meaning that 
characters between the braces is treated as simple text and passed to the 
__format__ method as is. The only processing that should occur on the format 
specification is to convert the double braces to single braces. The fact that 
an error occurs saying that 'v' is not defined before the __format__ method is 
ever called indicates that the contents of the braces are being evaluated as an 
expression, which fails because v is not defined in the outer scope.  Thus the 
f-string seems to be ignoring the escaping of the braces, but it only does so 
in the format specifier.

--

___
Python tracker 

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



[issue38061] FreeBSD: Optimize subprocess.Popen(close_fds=True) using closefrom()

2020-02-10 Thread STINNER Victor


STINNER Victor  added the comment:

FreeBSD change has been merged:
"lang/python{27,35,36,37,38}: Add closefrom(2) support"
https://svnweb.freebsd.org/ports?view=revision&revision=518640

--

___
Python tracker 

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



[issue38325] [Windows] test_winconsoleio failures

2020-02-10 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue38515] regrtest main process timed out after 5 min on AMD64 FreeBSD CURRENT Shared 3.8

2020-02-10 Thread STINNER Victor


STINNER Victor  added the comment:

I didn't see the failure recently, I close the issue.

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

___
Python tracker 

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



[issue38887] test_asyncio: test_pipe_handle() failed on AMD64 Windows7 SP1 3.x

2020-02-10 Thread STINNER Victor


STINNER Victor  added the comment:

I didn't see the failure recently, I close the issue.

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

___
Python tracker 

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



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

2020-02-10 Thread STINNER Victor


STINNER Victor  added the comment:

>>> loc=locale.getlocale(locale.LC_CTYPE) 
>>> loc
('tr_TR', 'ISO8859-9')

getlocale() has issues on Unix, but worse issues on Windows. See:

* bpo-12726
* bpo-20087
* bpo-20088
* bpo-23425
* bpo-33934
* bpo-38805

I never use getlocale() and I never understood the purpose of this function. I 
use locale.setlocale(loc) (same than locale.setlocale(loc, None)) to *get* a 
locale: the result can be passed to locale.setlocale(loc, result) with no 
problem.

--

___
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 Carol Willing


Carol Willing  added the comment:

I agree that a helpful entry in the index would be a nice addition. Christian 
would be the person to start with since he probably has ideas what would be 
useful too.

--
nosy: +willingc

___
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 4d4301782cbc789eedc5b76741d1028df579cfa5 by Miss Islington (bot) 
in branch '3.8':
bpo-39594: Fix typo in os.times documentation (GH-18443)
https://github.com/python/cpython/commit/4d4301782cbc789eedc5b76741d1028df579cfa5


--

___
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



[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



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



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



[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



[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



[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



[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



[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



[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



[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



[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


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



[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



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



[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



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



[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



[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



[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



[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



[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



[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



[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



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



[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



[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



[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



[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



[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



  1   2   >