[issue42260] [C API] Add PyInterpreterState_SetConfig(): reconfigure an interpreter

2020-11-23 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Please don't use PyDict_GetItemString(), it will be deprecated. You can use 
_PyDict_GetItemStringWithError().

Also always check the raised exception type before overwriting the exception, 
so you will not swallow MemoryError or other unexpected error.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue42006] Stop using PyDict_GetItem, PyDict_GetItemString and _PyDict_GetItemId

2020-11-23 Thread hongweipeng


Change by hongweipeng :


--
nosy: +hongweipeng
nosy_count: 2.0 -> 3.0
pull_requests: +22374
pull_request: https://github.com/python/cpython/pull/23487

___
Python tracker 

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



[issue42299] Add test_formatter (or remove deprecated formatter module?)

2020-11-23 Thread Christian Heimes


Christian Heimes  added the comment:

The formatter has been deprecated for a long time. It's been issuing a 
DeprecationWarning on import since 3.5. Let's remove it.

--
nosy: +christian.heimes

___
Python tracker 

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



[issue41100] Support macOS 11 and Apple Silicon Macs

2020-11-23 Thread Ned Deily


Ned Deily  added the comment:


New changeset 96d906b144e6e6aa96c5ffebecbcc5d38034bbda by Miss Islington (bot) 
in branch '3.9':
bpo-41100: in test_platform, ignore 10.16 (GH-23485) (GH-23486)
https://github.com/python/cpython/commit/96d906b144e6e6aa96c5ffebecbcc5d38034bbda


--

___
Python tracker 

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



[issue41100] Support macOS 11 and Apple Silicon Macs

2020-11-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +22373
pull_request: https://github.com/python/cpython/pull/23486

___
Python tracker 

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



[issue41100] Support macOS 11 and Apple Silicon Macs

2020-11-23 Thread Ned Deily


Ned Deily  added the comment:


New changeset c0c23ea72b76b06b7db0d09415fa90bab8ded63a by Ned Deily in branch 
'master':
bpo-41100: in test_platform, ignore 10.16 (GH-23485)
https://github.com/python/cpython/commit/c0c23ea72b76b06b7db0d09415fa90bab8ded63a


--

___
Python tracker 

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



[issue41100] Support macOS 11 and Apple Silicon Macs

2020-11-23 Thread Ned Deily


Change by Ned Deily :


--
pull_requests: +22372
pull_request: https://github.com/python/cpython/pull/23485

___
Python tracker 

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



[issue42410] Raise a pickleError when convert _functools module to use PyType_FromModuleAndSpec

2020-11-23 Thread hai shi


hai shi  added the comment:

> It looks like you imported the functools module twice and have two different 
> classes functools.partial. When you try to import one of them, you found the 
> other one.

You are right. Serhiy:)

The key point is `import_helper.import_fresh_module()`.
```
import functools
from test.support import import_helper

partial = functools.partial
new_functools = import_helper.import_fresh_module('functools',
  fresh=['_functools'])
new_partial = new_functools.partial
assert(partial == new_partial)
```
Succeed in master, failed in PR23405.

--

___
Python tracker 

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



[issue42450] Docstrings in itertools recipes should have triple-quotes

2020-11-23 Thread Raymond Hettinger


Change by Raymond Hettinger :


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



[issue42450] Docstrings in itertools recipes should have triple-quotes

2020-11-23 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I concur with Eric.

--

___
Python tracker 

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



[issue42450] Docstrings in itertools recipes should have triple-quotes

2020-11-23 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +rhettinger

___
Python tracker 

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



[issue42450] Docstrings in itertools recipes should have triple-quotes

2020-11-23 Thread Eric V. Smith


Eric V. Smith  added the comment:

I don't think the readability of the examples would be improved by triple 
quotes. In fact, I think it would be reduced.

--
nosy: +eric.smith

___
Python tracker 

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



[issue42450] Docstrings in itertools recipes should have triple-quotes

2020-11-23 Thread Peter Norvig


New submission from Peter Norvig :

In the itertools recipes (  
https://docs.python.org/3/library/itertools.html#itertools-recipes ) there are 
21 functions that have single-quote docstrings. These should be changed to 
triple-quotes, as mandated in PEP 257.

--
messages: 381704
nosy: peter.norvig2
priority: normal
severity: normal
status: open
title: Docstrings in itertools recipes should have triple-quotes
versions: Python 3.10, 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



[issue34394] Descriptors HowTo doesn't mention __set_name__

2020-11-23 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

For the record, __set_name__ isn't specific to descriptors.  It can be used 
with any class:

>>> class A:
def __set_name__(*args):
print(args)
 
>>> class B:
x = A()
y = A()
 
(<__main__.A object at 0x7febfe01ac40>, , 'x')
(<__main__.A object at 0x7febfe01a5e0>, , 'y')

--

___
Python tracker 

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



[issue41100] Support macOS 11 and Apple Silicon Macs

2020-11-23 Thread miss-islington


miss-islington  added the comment:


New changeset 3266991e721286e942125350ca41e1403d8384d6 by Miss Islington (bot) 
in branch '3.9':
bpo-41100: minor build installer fixes (GH-23480)
https://github.com/python/cpython/commit/3266991e721286e942125350ca41e1403d8384d6


--

___
Python tracker 

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



[issue41100] Support macOS 11 and Apple Silicon Macs

2020-11-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +22371
pull_request: https://github.com/python/cpython/pull/23484

___
Python tracker 

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



[issue41100] Support macOS 11 and Apple Silicon Macs

2020-11-23 Thread Ned Deily


Ned Deily  added the comment:


New changeset 936533ca0415c40dc64ccb5f8857720f32b3fcb4 by Ned Deily in branch 
'master':
bpo-41100: minor build installer fixes (GH-23480)
https://github.com/python/cpython/commit/936533ca0415c40dc64ccb5f8857720f32b3fcb4


--

___
Python tracker 

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



[issue42448] re.findall have different match result against re.search or re.sub

2020-11-23 Thread 赵豪杰

赵豪杰 <1292756...@qq.com> added the comment:

AhAh, got it, I misunderstood the usage, the findall returns tuple of groups 
the expression set. Thanks @serhiy.storchaka @rhettinger

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



[issue41100] Support macOS 11 and Apple Silicon Macs

2020-11-23 Thread Ned Deily


Change by Ned Deily :


--
pull_requests: +22370
pull_request: https://github.com/python/cpython/pull/23480

___
Python tracker 

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



[issue42449] Adding number to a declared 2 dimension list

2020-11-23 Thread Eric V. Smith


Eric V. Smith  added the comment:

This isn't a bug. All of your nested lists are the same. See for example: 
https://stackoverflow.com/questions/44195396/initializing-an-m-x-n-array-of-0s-in-python

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



[issue42449] Adding number to a declared 2 dimension list

2020-11-23 Thread void abuser


New submission from void abuser :

So basically the bug that I found was about adding a number to a sub-list.
If you declare li1 as li1=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]] in the code 
below then the code is working as it should do.
Although if you create the list called li1 with the same way how I did in the 
code below (which has the same outcome in terms of looking at that 2 dimension 
list) then the output is different and in fact false.
The code:
li1=[[0]*4]*4 for x in range(4): li1[0][1]+=1 print(li1)
Expected behavior
Expected output:
[[0, 1, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]
[[0, 2, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]
[[0, 3, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]
[[0, 4, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]
The output that I got:
[[0, 1, 0, 0], [0, 1, 0, 0], [0, 1, 0, 0], [0, 1, 0, 0]]
[[0, 2, 0, 0], [0, 2, 0, 0], [0, 2, 0, 0], [0, 2, 0, 0]]
[[0, 3, 0, 0], [0, 3, 0, 0], [0, 3, 0, 0], [0, 3, 0, 0]]
[[0, 4, 0, 0], [0, 4, 0, 0], [0, 4, 0, 0], [0, 4, 0, 0]]

--
components: Regular Expressions
files: bug.png
messages: 381698
nosy: ezio.melotti, mrabarnett, void4buser
priority: normal
severity: normal
status: open
title: Adding number to a declared 2 dimension list
type: behavior
versions: Python 3.9
Added file: https://bugs.python.org/file49615/bug.png

___
Python tracker 

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



[issue42422] Py_Decref on value crash the interpreter in Python/ceval.c:1104

2020-11-23 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

> do you think this is too similar to bogus_code_obj.py? That's the only 
> crasher I can see it being similar to.

As far as I assume, yes, that is the generic VM crasher via custom code object 
execution. I feel its existence is good enough to answer to issue openings like 
this.

--

___
Python tracker 

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



[issue42445] Assertion in run_coroutine_threadsafe

2020-11-23 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Transferring the loop instance between threads is not safe. You should create a 
loop and after that call run_forever() in the same thread.
Or, even better, call asynxio.run() in a thread.

--

___
Python tracker 

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



[issue35498] Parents objects in pathlib.Path don't support slices as __getitem__ arguments

2020-11-23 Thread Paul Ganssle


Paul Ganssle  added the comment:


New changeset 79d2e62c008446fbbc6f264bb8a30e2d38b6ff58 by Yaroslav Pankovych in 
branch 'master':
Added support for negative indexes to PurePath.parents (GH-21799)
https://github.com/python/cpython/commit/79d2e62c008446fbbc6f264bb8a30e2d38b6ff58


--

___
Python tracker 

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



[issue21041] pathlib.PurePath.parents rejects negative indexes

2020-11-23 Thread Paul Ganssle


Paul Ganssle  added the comment:


New changeset 79d2e62c008446fbbc6f264bb8a30e2d38b6ff58 by Yaroslav Pankovych in 
branch 'master':
Added support for negative indexes to PurePath.parents (GH-21799)
https://github.com/python/cpython/commit/79d2e62c008446fbbc6f264bb8a30e2d38b6ff58


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



[issue42410] Raise a pickleError when convert _functools module to use PyType_FromModuleAndSpec

2020-11-23 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It looks like you imported the functools module twice and have two different 
classes functools.partial. When you try to import one of them, you found the 
other one.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue18212] No way to check whether Future is finished?

2020-11-23 Thread Irit Katriel


Change by Irit Katriel :


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



[issue42448] re.findall have different match result against re.search or re.sub

2020-11-23 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

When groups are present in the regex, findall() returns the subgroups rather 
than the entire match:

>>> mo = re.search('(12)+', '121212 and 121212')
>>> mo[0]  # Entire match
'121212'
>>> mo[1]  # Group match
'12'

To get the result you were looking for use a non-capturing expression:

>>> re.findall('(?:12)+', '121212 and 121212')
['121212', '121212']

Also consider using finditer() which gives more fine grained control:

>>> for mo in re.finditer('(12)+', '121212 and 121212'):
print(mo.span())
print(mo[0])
print(mo[1])
print()

(0, 6)
121212
12

(11, 17)
121212
12

--
nosy: +rhettinger

___
Python tracker 

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



[issue42446] Assertion error os.path.exists(pyc_path) while building Python 3.8.6 with-ensurepip

2020-11-23 Thread Thoradia Quack


Thoradia Quack  added the comment:

I build Python with the LibreELEC toolchain.
I removed the --disable-pyc-build and a patch to generate legacy bytecode.
That fixed the issue.
Thank you for the fast answer and for pointing me to the solution.
Closing.

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



[issue42436] Google use wrong "hightlight" argument

2020-11-23 Thread Eric V. Smith


Change by Eric V. Smith :


--
status: open -> pending

___
Python tracker 

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



[issue42448] re.findall have different match result against re.search or re.sub

2020-11-23 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It looks correct to me. Of course, the result is different, because they are 
different functions. re.match() and re.search() return a match object (or 
None), and re.findall returns a list. What result did you expect?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue42448] re.findall have different match result against re.search or re.sub

2020-11-23 Thread 赵豪杰

New submission from 赵豪杰 <1292756...@qq.com>:

```
>>> import re
>>> text = '121212 and 121212'
>>> pattern = '(12)+'
>>> print(re.findall(pattern, text))
['12', '12']
>>> 
>>> 
>>> print(re.search(pattern, text))

>>> 
>>> 
>>> print(re.sub(pattern, '', text))
 and 
# The re.findall have different search result against re.search or re.sub
# re.findall 和 re.search 、 re.sub 的匹配结果不相同
```

With same pattern and string, the re.findall is supposed to have same match 
with re.search, but it didn't. 

This result is from python3.8.5

--
components: Regular Expressions
messages: 381689
nosy: HaujetZhao, ezio.melotti, mrabarnett
priority: normal
severity: normal
status: open
title: re.findall have different match result against re.search or re.sub
type: behavior
versions: Python 3.8

___
Python tracker 

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



[issue42443] Provide Thread creation hook support

2020-11-23 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
components: +Library (Lib)

___
Python tracker 

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



[issue42443] Provide Thread creation hook support

2020-11-23 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
assignee:  -> gregory.p.smith

___
Python tracker 

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



[issue42422] Py_Decref on value crash the interpreter in Python/ceval.c:1104

2020-11-23 Thread Eric V. Smith


Eric V. Smith  added the comment:

@BTaskaya: do you think this is too similar to bogus_code_obj.py? That's the 
only crasher I can see it being similar to.

--
versions: +Python 3.10 -Python 3.6, Python 3.7

___
Python tracker 

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



[issue42446] Assertion error os.path.exists(pyc_path) while building Python 3.8.6 with-ensurepip

2020-11-23 Thread Thoradia Quack


Thoradia Quack  added the comment:

I get the same error when I build without -disable-pyc-build.

I could create the missing directory if only I knew what directory ensurepip is 
expecting.

--

___
Python tracker 

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



[issue42429] Behavior of general (%g, :g) formatting inconsistent for decimal.Decimal

2020-11-23 Thread Mark Dickinson


Mark Dickinson  added the comment:

Here's a first draft of proposed re-wording for the 'e', 'f' and 'g' sections 
of the table in the general format-specification mini-language docs. (I started 
making a PR, but got too annoyed with the mechanics of editing reStructuredText 
tables.)


'e': Scientific "E" notation. For a given precision ``p >= 0``, formats the
number in scientific notation with the letter 'e' separating the coefficient
from the exponent. The coefficient has one digit before and ``p`` digits after
the decimal point, for a total of ``p + 1`` significant digits. With no
precision, uses a precision of ``6`` digits after the decimal point for
:class:`float`, and shows all coefficient digits (including any trailing zeros)
for :class:`~decimal.Decimal`.

'f': Fixed-point notation. For a given precision ``p >= 0``, formats the number
as a decimal number with exactly ``p`` digits following the decimal point. With
no precision, uses a precision of ``6`` digits after the decimal point for
:class:`float`, and shows all coefficient digits (including any trailing zeros)
for :class:`~decimal.Decimal`. Note that in the case of a
:class:`~decimal.Decimal` instance with a positive exponent, the formatted
output will consist of the digits of the coefficient sequence extended by
additional zeros: for example, ``format(Decimal('1.23e4'), 'f')`` gives
``'12300'``.

'g': 

A precision of ``0`` is treated as equivalent to a precision of ``1``.
With no precision, uses a precision of ``6`` significant digits for
:class:`float`, and shows all coefficient digits (including any trailing zeros)
for :class:`~decimal.Decimal`.

--

___
Python tracker 

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



[issue42447] robotsparser deny all with some rules

2020-11-23 Thread Net Offensive


Net Offensive  added the comment:

Sorry if my message is not clear enough. I will ask my developer to come and 
complete the information if needed.

--

___
Python tracker 

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



[issue42429] Behavior of general (%g, :g) formatting inconsistent for decimal.Decimal

2020-11-23 Thread Mark Dickinson


Mark Dickinson  added the comment:

There's also #39096.

--

___
Python tracker 

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



[issue42447] robotsparser deny all with some rules

2020-11-23 Thread Net Offensive

New submission from Net Offensive :

Bonjour, 

Notre développeur a un soucis avec l'utilisation de cette librairie. Dans le 
cadre d'un projet SEO, nous souhaiterions scrapper les pages de notre réseau de 
site.

Nous avons essayé de tester avec l'un de nos site dont les pages se présentent 
comme ce guide sur le référencement : 
https://www.netoffensive.blog/referencement-naturel/

Elle ne sont pas détectées comme des pages à cause de leur forme en repertoire. 
A ton besoin forcément de créer des pages du type : page.ext ?

C'est pourtant un format utilisé sur Wordpress et d'autres CMS.

Merci

---

Hello, 

Our developer has a problem with the use of this library. As part of an SEO 
project, we would like to scramble the pages of our site network.

We tried to test with one of our site whose pages look like this SEO guide: 
https://www.netoffensive.blog/referencement-naturel/.

They are not detected as pages because of their directory shape. Do you 
necessarily need to create pages of the type: page.ext?

It is however a format used on Wordpress and other CMS.

Thanks

Translated with www.DeepL.com/Translator (free version)

--
components: Library (Lib)
messages: 381683
nosy: contact
priority: normal
severity: normal
status: open
title: robotsparser deny all with some rules
type: behavior
versions: Python 3.6

___
Python tracker 

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



[issue42429] Behavior of general (%g, :g) formatting inconsistent for decimal.Decimal

2020-11-23 Thread Mark Dickinson


Mark Dickinson  added the comment:

Some references after a bit of tracker digging:

- #7098 is the original issue where the behaviour was considered.
- #23460 is related, and _did_ result in a documentation change, but that 
documentation change didn't say anything about preserving trailing zeros
- #13433 is relevant, and still open

So I think we're still missing a documentation update.

--
assignee:  -> docs@python
components: +Documentation -Library (Lib)
nosy: +docs@python
versions: +Python 3.10, Python 3.8

___
Python tracker 

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



[issue42446] Assertion error os.path.exists(pyc_path) while building Python 3.8.6 with-ensurepip

2020-11-23 Thread Christian Heimes


Christian Heimes  added the comment:

Your problem could be related to --disable-pyc-build. It sounds like it 
disables pyc compilation, which may explain the exception.

--disable-pyc-build is not supported by official releases of Python. Are you 
building Python with additional distribution-specific patches?

--
nosy: +christian.heimes

___
Python tracker 

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



[issue42446] Assertion error os.path.exists(pyc_path) while building Python 3.8.6 with-ensurepip

2020-11-23 Thread Thoradia Quack


New submission from Thoradia Quack :

I try building Python 3.8.6 with-ensurepip (see configuration below) but this 
fails with an assertion error (see error below).

I do not understand the error and I do not know how to fix it.

For what it is worth, I used to successfully build Python 3.8.5 with the same 
configuration.

Thank you for any help with this.

Configuration:
home/thoradia/9.80.8/build.LibreELEC-RPi4.arm-9.80-devel/build/Python3-3.8.6/configure
 --host=x86_64-linux-gnu --build=x86_64-linux-gnu 
--prefix=/home/thoradia/9.80.8/build.LibreELEC-RPi4.arm-9.80-devel/toolchain 
--bindir=/home/thoradia/9.80.8/build.LibreELEC-RPi4.arm-9.80-devel/toolchain/bin
 
--sbindir=/home/thoradia/9.80.8/build.LibreELEC-RPi4.arm-9.80-devel/toolchain/sbin
 
--sysconfdir=/home/thoradia/9.80.8/build.LibreELEC-RPi4.arm-9.80-devel/toolchain/etc
 
--libexecdir=/home/thoradia/9.80.8/build.LibreELEC-RPi4.arm-9.80-devel/toolchain/lib
 
--localstatedir=/home/thoradia/9.80.8/build.LibreELEC-RPi4.arm-9.80-devel/toolchain/var
 --disable-static --enable-shared ac_cv_prog_HAS_HG=/bin/false
 ac_cv_prog_SVNVERSION=/bin/false
 --disable-pyc-build
 --disable-ossaudiodev
 --disable-sqlite3
 --disable-codecs-cjk
 --disable-nis
 --enable-unicodedata
 --enable-openssl
 --disable-readline
 --enable-bzip2
 --enable-zlib
 --enable-xz
 --disable-tk
 --disable-curses
 --disable-pydoc
 --disable-test-modules
 --enable-lib2to3
 --disable-idle3
 --without-cxx-main
 --with-expat=builtin
 --with-libmpdec=none
 --with-doc-strings
 --with-system-ffi
 --without-pymalloc
 --with-ensurepip


Error:
if test "xupgrade" != "xno"  ; then \
case upgrade in \
upgrade) ensurepip="--upgrade" ;; \
install|*) ensurepip="" ;; \
esac; \

LD_LIBRARY_PATH=/home/thoradia/9.80.8/build.LibreELEC-RPi4.arm-9.80-devel/build/Python3-3.8.6/.x86_64-linux-gnu
 ./python -E -m ensurepip \
$ensurepip --root=/ ; \
fi
Looking in links: /tmp/tmpm7whdxa4
Requirement already up-to-date: setuptools in 
/home/thoradia/9.80.8/build.LibreELEC-RPi4.arm-9.80-devel/toolchain/lib/python3.8/site-packages
 (49.2.1)
Processing /tmp/tmpm7whdxa4/pip-20.2.1-py2.py3-none-any.whl
Installing collected packages: pip
ERROR: Exception:
Traceback (most recent call last):
  File 
"/tmp/tmpm7whdxa4/pip-20.2.1-py2.py3-none-any.whl/pip/_internal/cli/base_command.py",
 line 216, in _main
status = self.run(options, args)
  File 
"/tmp/tmpm7whdxa4/pip-20.2.1-py2.py3-none-any.whl/pip/_internal/cli/req_command.py",
 line 182, in wrapper
return func(self, options, args)
  File 
"/tmp/tmpm7whdxa4/pip-20.2.1-py2.py3-none-any.whl/pip/_internal/commands/install.py",
 line 412, in run
installed = install_given_reqs(
  File 
"/tmp/tmpm7whdxa4/pip-20.2.1-py2.py3-none-any.whl/pip/_internal/req/__init__.py",
 line 82, in install_given_reqs
requirement.install(
  File 
"/tmp/tmpm7whdxa4/pip-20.2.1-py2.py3-none-any.whl/pip/_internal/req/req_install.py",
 line 813, in install
install_wheel(
  File 
"/tmp/tmpm7whdxa4/pip-20.2.1-py2.py3-none-any.whl/pip/_internal/operations/install/wheel.py",
 line 852, in install_wheel
_install_wheel(
  File 
"/tmp/tmpm7whdxa4/pip-20.2.1-py2.py3-none-any.whl/pip/_internal/operations/install/wheel.py",
 line 734, in _install_wheel
assert os.path.exists(pyc_path)
AssertionError

--
components: Build
messages: 381680
nosy: thoradia
priority: normal
severity: normal
status: open
title: Assertion error os.path.exists(pyc_path) while building Python 3.8.6 
with-ensurepip
type: behavior
versions: Python 3.8

___
Python tracker 

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



[issue42373] PEP 626 does not specify behavior of tracing for keywords.

2020-11-23 Thread Mark Shannon


Mark Shannon  added the comment:

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

--

___
Python tracker 

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



[issue42349] Compiler front-end produces a broken CFG

2020-11-23 Thread Mark Shannon


Change by Mark Shannon :


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



[issue21041] pathlib.PurePath.parents rejects negative indexes

2020-11-23 Thread Yaroslav Pankovych


Yaroslav Pankovych  added the comment:

Agree with that, it currently supports this behavior.

--

___
Python tracker 

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



[issue15450] Allow dircmp.subdirs to behave well under subclassing

2020-11-23 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.10 -Python 3.4

___
Python tracker 

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



[issue15450] Allow dircmp.subdirs to behave well under subclassing

2020-11-23 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset 2f2f9d0b5c96e68ed91cddd6673860ee752eb49c by Nick Crews in branch 
'master':
bpo-15450: Allow subclassing of dircmp (GH-23424) (#23424)
https://github.com/python/cpython/commit/2f2f9d0b5c96e68ed91cddd6673860ee752eb49c


--
nosy: +asvetlov

___
Python tracker 

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



[issue42443] Provide Thread creation hook support

2020-11-23 Thread Thomas Wouters


Change by Thomas Wouters :


--
nosy: +gregory.p.smith, twouters

___
Python tracker 

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



[issue31842] pathlib: "Incorrect function" during resolve()

2020-11-23 Thread christopher.pickering


christopher.pickering  added the comment:

Hi, is there a status update on this issue? Thanks!

--
nosy: +christopherpickering

___
Python tracker 

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



[issue42410] Raise a pickleError when convert _functools module to use PyType_FromModuleAndSpec

2020-11-23 Thread hai shi


hai shi  added the comment:

> You should analyze why "cls != obj" conditon is true: why cls is not obj?

You are right. I am in the wrong way definitely. It's weird to me.I try to 
figure it out in this week~

--

___
Python tracker 

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



[issue42445] Assertion in run_coroutine_threadsafe

2020-11-23 Thread Jochen Kienzle


New submission from Jochen Kienzle :

Hello,

in my implementation I want to call mqtt_client.publish_json from a sync method:

-
def __on_event(self, ev):
...

asyncio.run_coroutine_threadsafe(self.mqtt_client.publish_json(INGESTION_TOPIC, 
msg), loop=self.publish_loop)
-

where self.broker.publish_json is an async function and publish_loop is a loop 
which has been started (run_forever) in a separate thread:

---
self.publish_loop = asyncio.new_event_loop()
t = threading.Thread(target=self.publish_loop.run_forever)
t.start()
---

Sometimes (about 1 in 400 calls) I get the following Assertion Error:

-
?[94;1m== APP == Exception in callback 
_ProactorBaseWritePipeTransport._loop_writing(<_OverlappedF...ed result=366>)
?[0m
?[94;1m== APP == handle: )>
[0m
[94;1m== APP == Traceback (most recent call last):
[0m
[94;1m== APP ==   File 
"C:\Users\sio7fe\AppData\Local\Programs\Python\Python38-32\lib\asyncio\events.py",
 line 81, in _run
[0m
[94;1m== APP == self._context.run(self._callback, *self._args)
[0m
[94;1m== APP ==   File 
"C:\Users\sio7fe\AppData\Local\Programs\Python\Python38-32\lib\asyncio\proactor_events.py",
 line 375, in _loop_writing
[0m
[94;1m== APP == assert f is self._write_fut
[0m
[94;1m== APP == AssertionError
-

Run time behavior:
 - publish_loop will be re-used on each event
 - run_coroutine_threadsafe will be called multiple times without any sleep 
(its in a for-loop with 1-3 elements)


Since this is a thread safe method and its working multiple times, it seems to 
be some run-time related issue and I can't figure out the root cause.

--
components: asyncio
messages: 381674
nosy: JoKi, asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: Assertion in run_coroutine_threadsafe
type: behavior
versions: Python 3.8

___
Python tracker 

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



[issue42444] pathlib.PurePath properties annotated with .. data directive

2020-11-23 Thread Paul Ganssle

New submission from Paul Ganssle :

Currently, it seems that the pathlib module uses `.. data::` to annotate the 
properties of the PurePath type (e.g. .parts, .drive, .root, etc). See: 
https://github.com/python/cpython/blob/ff420f0e08a2443339da0df7ace95e14177bac53/Doc/library/pathlib.rst

According to the documentation 
(https://devguide.python.org/documenting/#information-units), `data` is for 
module-level constants, specifically:

> Describes global data in a module, including both variables and values used
> as “defined constants.” Class and object attributes are not documented using
> this directive.

I believe that we should switch these over to use the `.. attribute:` directive 
instead.

>From what I can tell, you can still link to these attributes using the 
>`:attr:` role. I haven't checked if you can link to `:attribute:`s using the 
>`:data:` role, though. If not, it might break some links to change these to 
>`:attribute:`.

--
assignee: docs@python
components: Documentation
messages: 381673
nosy: docs@python, eric.araujo, ezio.melotti, mdk, p-ganssle, willingc
priority: low
severity: normal
status: open
title: pathlib.PurePath properties annotated with .. data directive
versions: Python 3.10

___
Python tracker 

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



[issue42443] Provide Thread creation hook support

2020-11-23 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
nosy: +python-dev
nosy_count: 1.0 -> 2.0
pull_requests: +22369
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/23477

___
Python tracker 

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



[issue42443] Provide Thread creation hook support

2020-11-23 Thread Piotr Stanczyk


New submission from Piotr Stanczyk :

For monitoring purposes we would like to have a way of registering newly 
created Python threads with a runtime. For that reason we ask to add a thread 
creation hook inside threading.py. There are 2 similar hooks already 
(_profile_hook and _trace_hook).

--
messages: 381672
nosy: stanczyk
priority: normal
severity: normal
status: open
title: Provide Thread creation hook support
type: enhancement
versions: Python 3.10

___
Python tracker 

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



[issue42102] Make builtins.callable "generic"

2020-11-23 Thread Guido van Rossum


Guido van Rossum  added the comment:

No, they both have a different meaning. Object has (almost) no attributes. Any 
has all attributes.

--

___
Python tracker 

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



[issue21041] pathlib.PurePath.parents rejects negative indexes

2020-11-23 Thread Paul Ganssle


Paul Ganssle  added the comment:

I think you may have confused my thoughts as to why this might be considered 
ambiguous with an actual suggestion for what the semantics should be.

I think that we should stick with `p.parents[x] == tuple(p.parents)[x]` for any 
valid value of `x`, which means that `p.parents[-1]` will always be `Path('.')` 
for any non-empty `p`.

--

___
Python tracker 

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



[issue42299] Add test_formatter (or remove deprecated formatter module?)

2020-11-23 Thread Dong-hee Na


Change by Dong-hee Na :


--
pull_requests: +22368
pull_request: https://github.com/python/cpython/pull/23476

___
Python tracker 

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



[issue42299] Add test_formatter (or remove deprecated formatter module?)

2020-11-23 Thread Dong-hee Na


Dong-hee Na  added the comment:

> If so, the patch, aDo we still want to remove formatted

IMHO, 3.10 is a good time to remove formatter

--
nosy: +corona10

___
Python tracker 

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



[issue28850] Regression in Python 3: Subclassing PrettyPrinter.format doesn't work anymore

2020-11-23 Thread Tal Einat


Tal Einat  added the comment:

Thanks for the report, Michael!

Thanks for the fix, Irit!

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



[issue28850] Regression in Python 3: Subclassing PrettyPrinter.format doesn't work anymore

2020-11-23 Thread Tal Einat


Tal Einat  added the comment:


New changeset ff420f0e08a2443339da0df7ace95e14177bac53 by Irit Katriel in 
branch 'master':
bpo-28850: Fix PrettyPrinter.format overrides ignored for contents of small 
containers (GH-22120)
https://github.com/python/cpython/commit/ff420f0e08a2443339da0df7ace95e14177bac53


--
nosy: +taleinat

___
Python tracker 

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



[issue42429] Behavior of general (%g, :g) formatting inconsistent for decimal.Decimal

2020-11-23 Thread Mark Dickinson


Mark Dickinson  added the comment:

Hmm. I'm not sure that it ever got documented properly. There may still be an 
open documentation issue somewhere.

There's not really much wiggle-room for changing the implementation: the 
behaviour of the "g" formatting for Decimal objects is following the 
specification of "to-scientific-string" from the Decimal Arithmetic spec that 
the decimal module is based on: 
http://speleotrove.com/decimal/daconvs.html#reftostr

One of the principles articulated there is that to-scientific-string should be 
faithful, so that conversion to string and back doesn't lose any information. 
That precludes chopping significant trailing zeros.

--

___
Python tracker 

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



[issue42442] Tarfile to stdout documentation example

2020-11-23 Thread Ian Laughlin


New submission from Ian Laughlin :

Recommend adding example to tarfile documentation to provide example of writing 
a tarfile to stdout.


example:

files = [(file_1, filename_1), (file_2, filename_2)]


with tarfile.open(fileobj=sys.stdout.buffer, mode = 'w|gz') as tar:
for file, filename in files:
file_obj = io.BytesIO() #starts a BytesIO object
file_obj.write(file.encode('utf-8')) #writes the file to the BytesIO 
object
info = tarfile.TarInfo(filename) #creates the TarInfo
file_obj.seek(0) #goes to the beginning of the BytesIO object else it 
won't write
info.size = len(file) #sets the length of the file
tar.addfile(info, fileobj=file_obj) #writes the tar to stdout.

--
assignee: docs@python
components: Documentation
messages: 381665
nosy: docs@python, ilaughlin
priority: normal
severity: normal
status: open
title: Tarfile to stdout documentation example
versions: Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue42376] Add helpers to populate modules in C

2020-11-23 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue42142] test_ttk timeout: FAIL tkinter ttk LabeledScale test_resize, and more

2020-11-23 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +22367
pull_request: https://github.com/python/cpython/pull/23474

___
Python tracker 

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



[issue40077] Convert static types to heap types: use PyType_FromSpec()

2020-11-23 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +serhiy.storchaka
nosy_count: 10.0 -> 11.0
pull_requests: +22364
pull_request: https://github.com/python/cpython/pull/23443

___
Python tracker 

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



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

2020-11-23 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +serhiy.storchaka, serhiy.storchaka
nosy_count: 20.0 -> 21.0
pull_requests: +22365, 22366
pull_request: https://github.com/python/cpython/pull/23443

___
Python tracker 

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



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

2020-11-23 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +serhiy.storchaka
nosy_count: 20.0 -> 21.0
pull_requests: +22365
pull_request: https://github.com/python/cpython/pull/23443

___
Python tracker 

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



[issue42413] Replace custom exception socket.timeout with TimeoutError

2020-11-23 Thread STINNER Victor


STINNER Victor  added the comment:

I see this issue as a follow-up of PEP 3151 which started to uniformize 
IOError, OSError and many variants that we had in Python 2.

socket.timeout was introduced as a subclass of TimeoutError according to:
https://www.python.org/dev/peps/pep-3151/#new-exception-classes

In Python 3.9, socket.timeout and TimeoutError are subclasses of OSError but 
are different. I agree that it was confusion.

--

___
Python tracker 

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



[issue42413] Replace custom exception socket.timeout with TimeoutError

2020-11-23 Thread STINNER Victor


STINNER Victor  added the comment:

IMHO it's ok that exc.errno is None. It doesn't prevent to write code like:

except OSError as exc:
if exc.errno == ...:
...
else:
...

In the early days (first 5 years? :-D) of the asyncio documentation, 
TimeoutError was documented just as "TimeoutError", instead of 
"asyncio.TimeoutError". So if you followed carefully the asyncio documentation 
and wrote "except TimeoutError:", the except would never be reached beause 
asyncio.TimeoutError is *not* a subclass of the builtin Timeout...

>>> issubclass(asyncio.TimeoutError, TimeoutError)
False

It would be great to have a single TimeoutError class. I'm fine with having 
weird attributes depending who raise the exception. Honestly, in most cases 
"except TimeoutError:" is enough: there is no need to check for exception 
attributes.

--

___
Python tracker 

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



[issue42440] MACBOOK Python launcher

2020-11-23 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

Your message has not enough information to determine what's going on.

- How was Python installed?
- What version of macOS?
- Are you using an M1 system?
- Is the problem reproducible with a script that you can share?
- ...

--

___
Python tracker 

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



[issue42431] Fix outdated bytes comments

2020-11-23 Thread STINNER Victor


STINNER Victor  added the comment:

(Sorry, I need more coffee. New attempt.)

A C extension must define Py_BUILD_CORE macro or variant to include such header 
file. There is no intent to technically prevent to include a header file, only 
an intent to warn users that they should not do that unless they understand 
what they do.

--

___
Python tracker 

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



[issue42431] Fix outdated bytes comments

2020-11-23 Thread STINNER Victor


STINNER Victor  added the comment:

> Is it true that headers in Include/internal are more private than headers in 
> Include/cpython? It is not clear from names.

You cannot include an header file from Include/internal by default. All 
internal header files are guarded with:

#ifndef Py_BUILD_CORE
#  error "this header requires Py_BUILD_CORE define"
#endif

A C extension must define Py_BUILD_CORE macro or variant to include such header 
file. There is no intent to tehcnically prevent to include a header file, only 
an header to warn users that you should not do that unless they understand what 
they do.

--

___
Python tracker 

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



[issue42432] Http client, Bad Status Line triggered for no reason

2020-11-23 Thread sicarius noidea


sicarius noidea  added the comment:

Alright, that was a bad idea.

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



[issue42432] Http client, Bad Status Line triggered for no reason

2020-11-23 Thread Christian Heimes


Christian Heimes  added the comment:

urllib is a high level API on top of http.client. It wraps and uses http.client 
internally. urllib does not accept invalid protocol identifiers either:

>>> urllib.request.urlopen('http://localhost:8080')
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib64/python3.8/urllib/request.py", line 222, in urlopen
return opener.open(url, data, timeout)
  File "/usr/lib64/python3.8/urllib/request.py", line 525, in open
response = self._open(req, data)
  File "/usr/lib64/python3.8/urllib/request.py", line 542, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
  File "/usr/lib64/python3.8/urllib/request.py", line 502, in _call_chain
result = func(*args)
  File "/usr/lib64/python3.8/urllib/request.py", line 1379, in http_open
return self.do_open(http.client.HTTPConnection, req)
  File "/usr/lib64/python3.8/urllib/request.py", line 1354, in do_open
r = h.getresponse()
  File "/usr/lib64/python3.8/http/client.py", line 1347, in getresponse
response.begin()
  File "/usr/lib64/python3.8/http/client.py", line 307, in begin
version, status, reason = self._read_status()
  File "/usr/lib64/python3.8/http/client.py", line 289, in _read_status
raise BadStatusLine(line)
http.client.BadStatusLine: Http/1.1 200 OK


curl is more forgiving but does not recognize "Http/1.1" as a valid HTTP/1.1 
header either. Instead it assumes that any non-valid header means HTTP/1.0.

$ curl -v http://localhost:8080
*   Trying ::1:8080...
* connect to ::1 port 8080 failed: Connection refused
*   Trying 127.0.0.1:8080...
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET / HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.69.1
> Accept: */*
> 
* HTTP 1.0, assume close after body
< Http/1.1 200 OK
< Server: BaseHTTP/0.6 Python/3.8.6
< Date: Mon, 23 Nov 2020 09:10:38 GMT
< Content-Type: text/plain
< 
* Closing connection 0


I'm against changing the behavior of http.client.

--

___
Python tracker 

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



[issue42102] Make builtins.callable "generic"

2020-11-23 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Could not object replace Any?

--

___
Python tracker 

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



[issue42441] UnicodeEncodeError

2020-11-23 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

You can learn more about unicode and encodings:

https://www.joelonsoftware.com/2003/10/08/the-absolute-minimum-every-software-developer-absolutely-positively-must-know-about-unicode-and-character-sets-no-excuses/


https://pyvideo.org/pycon-us-2012/pragmatic-unicode-or-how-do-i-stop-the-pain.html


https://nedbatchelder.com/text/unipain/unipain.html#1

(For the last link, use the arrow keys to navigate.)

--
nosy: +steven.daprano

___
Python tracker 

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



[issue42441] UnicodeEncodeError

2020-11-23 Thread Eryk Sun


Eryk Sun  added the comment:

The default encoding for files in Windows is the process active code page, 
which defaults to the system code page, e.g. code page 1252 if the system 
locale is "en-IN". You need to explicitly use a Unicode encoding such as UTF-8 
when opening the file, e.g. open('some.csv', newline='', encoding='utf-8').

--
nosy: +eryksun
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type: crash -> behavior

___
Python tracker 

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



[issue21041] pathlib.PurePath.parents rejects negative indexes

2020-11-23 Thread Yaroslav Pankovych


Yaroslav Pankovych  added the comment:

And it looks like a special case, so "Special cases aren't special enough to 
break the rules."

--

___
Python tracker 

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



[issue42328] ttk style.map function incorrectly handles the default state for element options.

2020-11-23 Thread miss-islington


miss-islington  added the comment:


New changeset 3e5330130810e485f1abbf192590b7109880a4da by Miss Islington (bot) 
in branch '3.9':
bpo-42328: Fix tkinter.ttk.Style.map(). (GH-23300)
https://github.com/python/cpython/commit/3e5330130810e485f1abbf192590b7109880a4da


--

___
Python tracker 

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



[issue42328] ttk style.map function incorrectly handles the default state for element options.

2020-11-23 Thread miss-islington


miss-islington  added the comment:


New changeset ad49526c80fedf7469bd65b44d8021bab5fb998b by Miss Islington (bot) 
in branch '3.8':
bpo-42328: Fix tkinter.ttk.Style.map(). (GH-23300)
https://github.com/python/cpython/commit/ad49526c80fedf7469bd65b44d8021bab5fb998b


--

___
Python tracker 

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



[issue42432] Http client, Bad Status Line triggered for no reason

2020-11-23 Thread sicarius noidea


sicarius noidea  added the comment:

Hi @christian.heimes,
Thank you for your research too. We've also discovered that this check is 
correct, but this check is very strict and blocking (error raised, stopping the 
connection), we should maybe be more "laxist" and allow the  lowercase version 
? As they do in the others libs ? I've nerver encountered this error with 
urllib for instance. 

The server that answered this HTTP response line is a clone of the "spip" 
framework used in many websites. This is clearly a human behavior, but this 
http.client error could be a bit more "intelligent" I guess.

--

___
Python tracker 

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



[issue42441] UnicodeEncodeError

2020-11-23 Thread Md Tausif Iqbal


New submission from Md Tausif Iqbal :

my application crashes

 File "c:\users\tausif\appdata\local\programs\python\python38-32\lib\csv.py", 
line 154, in writerow
return self.writer.writerow(self._dict_to_list(rowdict))
  File 
"c:\users\tausif\appdata\local\programs\python\python38-32\lib\encodings\cp1252.py",
 line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position 22-29: 
character maps to 

I know this error is occurring due to a Hindi Language character.

--
components: Library (Lib)
messages: 381650
nosy: mdtausifiqbal
priority: normal
severity: normal
status: open
title: UnicodeEncodeError
type: crash
versions: Python 3.8

___
Python tracker 

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