[issue41774] While removing element from list using for and remove(), which has same items output is not right

2020-10-04 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
assignee:  -> terry.reedy

___
Python tracker 

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



[issue41931] Make dict(object) return its attribute __dict__

2020-10-04 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Sorry, but I think there is a near zero chance that the language will be 
revised as you suggest. 

Marking this as closed. If you want to have more discussion, please take it to 
the python-ideas maillist.

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



[issue41428] PEP 604 -- Allow writing union types as X | Y

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



[issue41428] PEP 604 -- Allow writing union types as X | Y

2020-10-04 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 8e1dd55e63d18d40e78d941fc9233d2c77bcd3de by Fidget-Spinner in 
branch 'master':
bpo-41428: Documentation for PEP 604  (gh-22517)
https://github.com/python/cpython/commit/8e1dd55e63d18d40e78d941fc9233d2c77bcd3de


--
nosy: +gvanrossum

___
Python tracker 

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



[issue41892] use both "for in" and "ElementTree.remove" has a index bug

2020-10-04 Thread Stefan Behnel


Stefan Behnel  added the comment:

Closing since this works as designed.

Users are responsible for avoiding concurrent tree modifications during 
iteration.

--
resolution:  -> not a bug
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



[issue41938] concurrent.futures.wait calls len() on an possible iterable

2020-10-04 Thread Kaushal Rohit


Change by Kaushal Rohit :


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

___
Python tracker 

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



[issue41938] concurrent.futures.wait calls len() on an possible iterable

2020-10-04 Thread Kaushal Rohit


New submission from Kaushal Rohit :

`fs` argument could be an iterable, and calling len on it would raise an 
Exception.

We are converting `fs` into a set anyways for set difference, and that too 
twice. we can just put an `fs = set(fs)`.

Let me know if we choose to go with that and I will make a PR ASAP.

Thanks.

--
components: Library (Lib)
messages: 377991
nosy: rohitkg98
priority: normal
severity: normal
status: open
title: concurrent.futures.wait calls len() on an possible iterable
type: behavior
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



[issue41912] Long generator chain causes segmentation fault

2020-10-04 Thread Tim Peters


Tim Peters  added the comment:

"Stackless" is a large topic with a convoluted history. Do the web search. In 
short, no, it will never go in the core - too disruptive to too many things. 
Parts have lived on in other ways, watered down versions. The PyPy project 
captured most of what remains, as optional features. CPython's generators 
captured the easiest part: after a yield, the C stack space the generator 
consumed is released, while the Python VM stack space lives on in the heap 
awaiting possible resumption (but, if/when it's resumed, C stack space is 
required again).

--

___
Python tracker 

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



[issue41892] use both "for in" and "ElementTree.remove" has a index bug

2020-10-04 Thread Ned Deily


Ned Deily  added the comment:


New changeset d5719247ba32b3ac700454bad9a9e2cc7edeac6a by Miss Skeleton (bot) 
in branch '3.9':
bpo-41892: Clarify that an example in the ElementTree docs explicitly avoids 
modifying an XML tree while iterating over it. (GH-22464) (GH-22554)
https://github.com/python/cpython/commit/d5719247ba32b3ac700454bad9a9e2cc7edeac6a


--

___
Python tracker 

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



[issue41937] how to use cpython O

2020-10-04 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Please don't post screen shots of text when you can post a direct link to the 
page.

Are you talking about this?

https://docs.python.org/3/c-api/arg.html?highlight=py_cleanup#other-objects

This is a bug tracker, for reporting bugs in the Python interpreter and 
standard library, not a help desk for asking for help with your code. There are 
many other places where you can ask for help, such as:

- Stackoverflow

- Reddit's /r/learnpython

- https://python-forum.io/

- the Python-List mailing list 
https://mail.python.org/mailman/listinfo/python-list

- IRC https://www.python.org/community/irc/

and probably many more.

For help getting your code to work, see the above forums.

I'm going to close this as "Not A Bug", if you have an actual bug to report, 
you can re-open this with a demonstration of the bug.

--
nosy: +steven.daprano
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



[issue41925] Lowercase path to python.exe in pip.exe from venv is throwing error

2020-10-04 Thread Eryk Sun


Eryk Sun  added the comment:

> I wouldn't think that changing locales would have an effect on Windows
> paths being case sensitive or not, otherwise folks from other countries
> would be experiencing this error. Perhaps the mixing of locale and system
> language? I had locale set to Japan but system language set to English

It shouldn't make a difference. Filenames are Unicode, the NTFS case table is 
set on disk when the filesystem is formatted, and the launcher uses 
wide-character strings and calls CreateProcessW. I wish I could offer up a 
reasonable explanation, but I think this one stays in the category of strange 
problems fixed by turning it off and on again.

--

___
Python tracker 

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



[issue41935] Add binary operator!

2020-10-04 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

You can already do:

my_counter = 0

for i in rage(1000):
my_counter += (1 if (i % 2) == 0 else 0)

--
nosy: +pablogsal

___
Python tracker 

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



[issue41935] Add binary operator!

2020-10-04 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

In any case, for modifications about the Python syntax, please, open first some 
debate in the python-ideas mailing list.

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



[issue41892] use both "for in" and "ElementTree.remove" has a index bug

2020-10-04 Thread miss-islington


miss-islington  added the comment:


New changeset 6bd058e0ff5d4a63fb35f6d45161cdf51cb68c58 by Miss Skeleton (bot) 
in branch '3.8':
bpo-41892: Clarify that an example in the ElementTree docs explicitly avoids 
modifying an XML tree while iterating over it. (GH-22464)
https://github.com/python/cpython/commit/6bd058e0ff5d4a63fb35f6d45161cdf51cb68c58


--

___
Python tracker 

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



[issue41892] use both "for in" and "ElementTree.remove" has a index bug

2020-10-04 Thread miss-islington


Change by miss-islington :


--
pull_requests: +21552
pull_request: https://github.com/python/cpython/pull/22554

___
Python tracker 

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



[issue41892] use both "for in" and "ElementTree.remove" has a index bug

2020-10-04 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 7.0 -> 8.0
pull_requests: +21551
pull_request: https://github.com/python/cpython/pull/22553

___
Python tracker 

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



[issue41937] how to use cpython O

2020-10-04 Thread twoone3


New submission from twoone3 <3197653...@qq.com>:

When I use'O&' to parse the parameters, I have never succeeded, I hope I can 
give a demo

--
files: Screenshot_2020_1005_070639.png
messages: 377983
nosy: twoone3
priority: normal
severity: normal
status: open
title: how to use cpython O&
type: behavior
versions: Python 3.8
Added file: https://bugs.python.org/file49494/Screenshot_2020_1005_070639.png

___
Python tracker 

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



[issue41892] use both "for in" and "ElementTree.remove" has a index bug

2020-10-04 Thread Ned Deily


Ned Deily  added the comment:


New changeset 40db798692ca783fc2163656f196ac77e8b9e792 by scoder in branch 
'master':
bpo-41892: Clarify that an example in the ElementTree docs explicitly avoids 
modifying an XML tree while iterating over it. (GH-22464)
https://github.com/python/cpython/commit/40db798692ca783fc2163656f196ac77e8b9e792


--
nosy: +ned.deily

___
Python tracker 

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



[issue41909] Segfault on __getattr__ infinite recursion on certain attribute accesses

2020-10-04 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue40640] Tutorial for Continue missing ... line

2020-10-04 Thread Irit Katriel


Change by Irit Katriel :


--
nosy: +orsenthil

___
Python tracker 

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



[issue40640] Tutorial for Continue missing ... line

2020-10-04 Thread Irit Katriel


Irit Katriel  added the comment:

ping

--
nosy: +iritkatriel
versions:  -Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue41936] Remove macros Py_ALLOW_RECURSION/Py_END_ALLOW_RECURSION

2020-10-04 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue41909] Segfault on __getattr__ infinite recursion on certain attribute accesses

2020-10-04 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 7aa22ba923509af1dbf115c090964f503c84ca8d by Serhiy Storchaka in 
branch '3.9':
[3.9] bpo-41909: Enable previously disabled recursion checks. (GH-22536) 
(GH-22550)
https://github.com/python/cpython/commit/7aa22ba923509af1dbf115c090964f503c84ca8d


--

___
Python tracker 

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



[issue41909] Segfault on __getattr__ infinite recursion on certain attribute accesses

2020-10-04 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 09a7b3b618cd02694a0bc8abfa24c75f0e659407 by Serhiy Storchaka in 
branch '3.8':
[3.8] bpo-41909: Enable previously disabled recursion checks. (GH-22536) 
(GH-22551)
https://github.com/python/cpython/commit/09a7b3b618cd02694a0bc8abfa24c75f0e659407


--

___
Python tracker 

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



[issue41936] Remove macros Py_ALLOW_RECURSION/Py_END_ALLOW_RECURSION

2020-10-04 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

Macros Py_ALLOW_RECURSION and Py_END_ALLOW_RECURSION together with field 
recursion_critical of the PyInterpreterState structure were added in 
5b222135f8d2492713994f2cb003980e87ce6a72 but were never documented. It seems 
that the reason of adding them was to work around the fact that 
PyDict_GetItem() can silence any exception including recursion error. But 
PyDict_GetItem() no longer used in that code and the macros are also no longer 
used (see issue41909).

GvR proposed to remove these macros. I think that recursion_critical can be 
removed too.

--
components: C API
messages: 377978
nosy: gvanrossum, serhiy.storchaka, vstinner
priority: normal
severity: normal
status: open
title: Remove macros Py_ALLOW_RECURSION/Py_END_ALLOW_RECURSION
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



[issue41909] Segfault on __getattr__ infinite recursion on certain attribute accesses

2020-10-04 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +21549
pull_request: https://github.com/python/cpython/pull/22551

___
Python tracker 

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



[issue41909] Segfault on __getattr__ infinite recursion on certain attribute accesses

2020-10-04 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +21548
pull_request: https://github.com/python/cpython/pull/22550

___
Python tracker 

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



[issue41909] Segfault on __getattr__ infinite recursion on certain attribute accesses

2020-10-04 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 9ece9cd65cdeb0a1f6e60475bbd0219161c348ac by Serhiy Storchaka in 
branch 'master':
bpo-41909: Enable previously disabled recursion checks. (GH-22536)
https://github.com/python/cpython/commit/9ece9cd65cdeb0a1f6e60475bbd0219161c348ac


--

___
Python tracker 

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



[issue41935] Add binary operator!

2020-10-04 Thread Hadi Alqattan


New submission from Hadi Alqattan :

What are your opinions about adding a binary operator to Python in order to 
make this code possible?
```
my_counter = 0

for i in rage(1000):
my_counter += 1 if (i % 2) == 0
```

--
components: Interpreter Core
messages: 377976
nosy: hadialqattan
priority: normal
severity: normal
status: open
title: Add binary operator!
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



[issue41934] Add `has` method to `pathlib.Path` class.

2020-10-04 Thread Hadi Alqattan


Hadi Alqattan  added the comment:

You're right, I'm sorry.

--

___
Python tracker 

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



[issue41934] Add `has` method to `pathlib.Path` class.

2020-10-04 Thread Hadi Alqattan


Change by Hadi Alqattan :


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



[issue41934] Add `has` method to `pathlib.Path` class.

2020-10-04 Thread Eric V. Smith


Eric V. Smith  added the comment:

Isn't this just:
(project_path / "main.py").exists()
?

I don't think .has would be any more efficient.

--
nosy: +eric.smith

___
Python tracker 

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



[issue41934] Add `has` method to `pathlib.Path` class.

2020-10-04 Thread Hadi Alqattan


New submission from Hadi Alqattan :

Adding a new method to `pathlib.Path` class, `has` method is a method that can 
determine if the `Path` object has a specific file/dir or not.

Assume that we have a `Path` object for this `project/` directory:
```
project/
  main.py
  __init__.py
  utils/
```
and we want to know if the project directory has `main.py` or not, after adding 
this method we will be able to do this:
```
from pathlib import Path

project_path = Path("./project")

if project_path.has("main.py"):
pass  # do something.
```

--
components: Library (Lib)
messages: 377973
nosy: hadialqattan
priority: normal
severity: normal
status: open
title: Add `has` method to `pathlib.Path` class.
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



[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2020-10-04 Thread Guido van Rossum


Guido van Rossum  added the comment:

Possibly at some point in the future we can switch to using typing.Protocol, 
which requires neither registration nor explicit subclassing (it's like 
Hashable). This makes it easy for user code to define custom protocols as 
needed. So if you need something that has .keys() and .items() but you don't 
care about .values() you can just write

class KeysAndItems(typing.Protocol):
def keys(self): ...
def items(self): ...

def my_func(x: KeysAndItems):
...

This can be statically checked using e.g. mypy.

--

___
Python tracker 

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



[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2020-10-04 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> How so?

When a concrete class registers with an ABC, it is making a promise that it 
implements everything in the ABC so that client code can count on all the 
methods being present.  That is the raison d'etre for abstract base classes.

In general, we restrict ABCs to a minimal useful subset of the capabilities of 
concrete classes.  That makes the ABC more broadly applicable and it makes life 
easier for implementers of concrete classes.  That's why collections.abc.Set 
doesn't include most of the named methods present in the concrete set/frozenset 
types.

Likewise, we don't want to add methods to already published ABCs because 
existing user classes registered to the ABC stop being compliant.  If an 
additional method is deemed essential, the technically correct way to do is to 
make a new ABC that subclasses from the old.  For example, that's why Python 2 
had to have both UserDict and IterableUserDict when we needed to add a 
__iter__() method.

--

___
Python tracker 

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



[issue41931] Make dict(object) return its attribute __dict__

2020-10-04 Thread மனோஜ்குமார் பழனிச்சாமி

மனோஜ்குமார் பழனிச்சாமி  added the comment:

Changing '__dict__' to __vars__ will be much better.

Like len() calling __len__()

Can we change the title?

Why Github Issue Tracker is not issued?

--

___
Python tracker 

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



[issue41905] add update_abstractmethods function to update an ABC's abstract methods

2020-10-04 Thread Ben Avrahami


Ben Avrahami  added the comment:

> Adding a function to recalculate will require everyone to use it

I'd argue that this is akin to `functools.update_wrapper`. It too is a function 
that must be called in virtually every function decorator (the only function 
decorators that don't/needn't call it are the built-in method decorators and, 
appropriately enough, @abstractmethod), and if not called, certain 
functionality won't work.

> and worse, know that it even exists

I think that knowing about such a function is a fair requirement. Mixin tools 
already has nuances and edge cases, such that it should only be done (and 
especially distributed) by advanced users.

Furthermore, not all class mixin tools have/need to be ABC-aware. Just as 
`total_ordering` is ABC-agnostic (indeed, it is also subclass-agnostic), any 
other mixin tool can decide that implementing abstract classes is simply not a 
use case for them. The upshot of the `update_abstractmethods` implementation is 
that, as long as their implementation isn't afraid to override methods that are 
already defined (like attrs does), the function can be slotted above 
ABC-agnostic wrappers and it suddenly becomes ABC-aware.

--

___
Python tracker 

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



[issue41931] Make dict(object) return its attribute __dict__

2020-10-04 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

The vars() function already does this.

--
nosy: +rhettinger

___
Python tracker 

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



[issue41931] Make dict(object) return its attribute __dict__

2020-10-04 Thread மனோஜ்குமார் பழனிச்சாமி

மனோஜ்குமார் பழனிச்சாமி  added the comment:

Your point makes sense as it takes space to allocate for the new instance to 
just return another dict object. 
Then the attribute name at least should be meaningful.

Instead of __dict__ , __attr__ is more appropriate.

--

___
Python tracker 

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



[issue41925] Lowercase path to python.exe in pip.exe from venv is throwing error

2020-10-04 Thread Chris Tse


Chris Tse  added the comment:

Another update:

After a full shutdown from yesterday and trying again today, everything seems 
to be working now, including activating the venv via:

  1. python -m venv myenv
  2. .\myenv\Scripts\activate (not Activate.ps1, though that work too, is this 
intended?)

The only thing I can think of that changed since I opened the report was that I 
changed my system locale back to English (United States) from Japan (Japan). I 
did a system restart to make the changes take effect, but it didn't seem to fix 
the issue at the time. It could possibly be a difference between a shutdown vs 
a restart. Odd, either way.

I wouldn't think that changing locales would have an effect on Windows paths 
being case sensitive or not, otherwise folks from other countries would be 
experiencing this error. Perhaps the mixing of locale and system language? I 
had locale set to Japan but system language set to English

Thank you for taking the time to reply.

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



[issue41931] Make dict(object) return its attribute __dict__

2020-10-04 Thread Irit Katriel


Irit Katriel  added the comment:

You ignored the other point I made: dict is not a function, it is a class. 
dict() calls the function dict.__init__() which should create a new instance of 
dict (not return some field of its parameter). 


You also didn't justify your suggestion in any way. Why should this change be 
made?

--

___
Python tracker 

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



[issue41892] use both "for in" and "ElementTree.remove" has a index bug

2020-10-04 Thread Stefan Behnel


Change by Stefan Behnel :


--
pull_requests: +21547
pull_request: https://github.com/python/cpython/pull/22546

___
Python tracker 

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



[issue41490] Update bundled pip to 20.2.1 and setuptools to 49.2.1

2020-10-04 Thread Łukasz Langa

Łukasz Langa  added the comment:

This change goes into 3.9.0 with Pablo's fix.

--

___
Python tracker 

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



[issue41490] Update bundled pip to 20.2.1 and setuptools to 49.2.1

2020-10-04 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 4b4d60f9287e0e52c2569876456f40efc11529b4 by Pablo Galindo in 
branch '3.9':
[3.9] bpo-41490: Bump vendored pip to version 20.2.3 (GH-22527). (GH-22544)
https://github.com/python/cpython/commit/4b4d60f9287e0e52c2569876456f40efc11529b4


--

___
Python tracker 

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



[issue41490] Update bundled pip to 20.2.1 and setuptools to 49.2.1

2020-10-04 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 28cd96f2e5cfb16566a75dca8473b71889746f10 by Pablo Galindo in 
branch '3.8':
[3.8] bpo-41490: Bump vendored pip to version 20.2.3 (GH-22527). (GH-22545)
https://github.com/python/cpython/commit/28cd96f2e5cfb16566a75dca8473b71889746f10


--

___
Python tracker 

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



[issue41490] Update bundled pip to 20.2.1 and setuptools to 49.2.1

2020-10-04 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +21546
pull_request: https://github.com/python/cpython/pull/22545

___
Python tracker 

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



[issue41490] Update bundled pip to 20.2.1 and setuptools to 49.2.1

2020-10-04 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +21545
pull_request: https://github.com/python/cpython/pull/22544

___
Python tracker 

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



[issue41490] Update bundled pip to 20.2.1 and setuptools to 49.2.1

2020-10-04 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 2cc6dc9896771ef3615abbb5ba80939a2f644a08 by Pablo Galindo in 
branch 'master':
bpo-41490: Bump vendored pip to version 20.2.3 (#22527)
https://github.com/python/cpython/commit/2cc6dc9896771ef3615abbb5ba80939a2f644a08


--

___
Python tracker 

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



[issue32922] dbm.open() encodes filename with default encoding rather than the filesystem encoding

2020-10-04 Thread Josh Friend


Josh Friend  added the comment:

yes it should be closed, can i do that? (ill try...)

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



[issue38302] [3.10] __pow__ and __rpow__ are not reached when __ipow__ returns NotImplemented for **=

2020-10-04 Thread Łukasz Langa

Change by Łukasz Langa :


--
title: __pow__ and __rpow__ are not reached when __ipow__ returns 
NotImplemented for **= -> [3.10] __pow__ and __rpow__ are not reached when 
__ipow__ returns NotImplemented for **=

___
Python tracker 

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



[issue41875] __builtin_unreachable error in gcc 4.4.5

2020-10-04 Thread Łukasz Langa

Łukasz Langa  added the comment:

Done.

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



[issue41933] Wording of s * n in Common Sequence Operations is not optimal

2020-10-04 Thread Julien Palard


New submission from Julien Palard :

As reported by Graham Ewart on docs@,

in https://docs.python.org/3/library/stdtypes.html#common-sequence-operations:

s * n or n * s | equivalent to adding s to itself n times

is badly worded. In fact it's more like n-1 times, but yet it's not adding s to 
itself.

I'd go for "n times the s sequence" or "n copies of the s sequence" instead, 
which both avoid the "n-1" and the "to itself" parts.

--
assignee: docs@python
components: Documentation
keywords: easy
messages: 377958
nosy: docs@python, mdk
priority: normal
severity: normal
status: open
title: Wording of s * n in Common Sequence Operations is not optimal

___
Python tracker 

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



[issue41898] Any logging causes assertLogs to pass

2020-10-04 Thread Irit Katriel


Irit Katriel  added the comment:

Troy, 

I'm also confused about how you would have liked assertLogs to behave you say:

1. I don't want to specify the logger because I don't care which logger the 
message comes from.

2. I don't want it to catch messages from other loggers (whatever other means 
here).  But -- see 1 -- you didn't specify the logger because you don't care 
which logger.

What do you expect assertLogs to do when you don't specify a logger?

--

___
Python tracker 

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



[issue41905] add update_abstractmethods function to update an ABC's abstract methods

2020-10-04 Thread Bar Harel


Bar Harel  added the comment:

> When instantiation fails, recheck to see the missing abstract methods had 
> been defined?

I've written about it in the python-ideas discussion as well, and completely 
agree.

There is no other approach that would guarantee correctness across all APIs, 
both internal and 3rd party. Adding a function to recalculate will require 
everyone to use it, and worse, know that it even exists.

The overhead should be quite low as this case is probably rare and the 
recalculation can happen only on failure.

I'm not sure however, what are the implications of changing 
Py_TPFLAGS_IS_ABSTRACT during type creation.

--
nosy: +bar.harel

___
Python tracker 

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



[issue41483] Do not acquire lock in MemoryHandler.flush() if no target defined

2020-10-04 Thread Irit Katriel


Irit Katriel  added the comment:

The missing target error was fixed under issue41503

--

___
Python tracker 

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



[issue41932] Incorrect struct definition with bitfields

2020-10-04 Thread berthin


New submission from berthin :

Hi all,

I found one issue related to bitfields and ctypes, and although there is a 
similar issue already opened (https://bugs.python.org/issue29753), that only 
covers the case with pragmas. 

Please, consider the following scenario:

>>> from ctypes import *
>>> class X(Structure):
... _fields_ = [("a", c_uint8, 8), ("b", c_uint8, 8), ("c", c_uint32, 16)]
...
>>> sizeof(X)
5


Which seems to be incorrect, because what natively C does is to generate a 
4bytes struct.

root@0bc6a647abaa:/target/cpython-fix# cat sample.c

#include 
#include 
struct X { 
uint8_t a; 
uint8_t b; 
uint32_t c:16;
} X;

int main() { 
printf("%u\n", sizeof(X)); 
}

root@0bc6a647abaa:/target/cpython-fix# gcc sample.c -o a && ./a
4

Also, if I use different databtypes I get what I expect (a struct of 4 bytes).

>>> X = type('X', (Structure,), {'_fields_': [('a', c_uint32, 8), ('b', 
>>> c_uint32, 8), ('c', c_uint32, 16)]})
>>> sizeof(X)
4
>>> X = type('X', (Structure,), {'_fields_': [('a', c_uint16, 8), ('b', 
>>> c_uint16, 8), ('c', c_uint16, 16)]})
>>> sizeof(X)
4
>>> X = type('X', (Structure,), {'_fields_': [('a', c_uint8, 8), ('b', c_uint8, 
>>> 8), ('c', c_uint16, 16)]})
>>> sizeof(X)
4

I tried to debug a little bit, adding some prints before and after calling 
*PyCField_FromDesc* in *Modules/_ctypes/stgdict.c:L603*.=, if someone wants to 
look at it, the logs are attached / one log file per each test, using the 
following gdb init:

# before
break stgdict.c:601
commands
p field_size
p bitofs
p size
p align
p *dict
continue
end


# after
break stgdict.c:617
commands
p field_size
p bitofs
p size
p align
p *(CFieldObject*) prop
continue
end

Hope someone could spot the issue, I will also try to investigate it by my own.

Best,

P.S. For the tests, I worked on top of bpo-29753 
(https://github.com/python/cpython/pull/19850)

--
components: ctypes
files: bitfields.zip
messages: 377953
nosy: FFY00, berthin
priority: normal
severity: normal
status: open
title: Incorrect struct definition with bitfields
type: behavior
versions: Python 3.10, Python 3.8, Python 3.9
Added file: https://bugs.python.org/file49493/bitfields.zip

___
Python tracker 

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



[issue41483] Do not acquire lock in MemoryHandler.flush() if no target defined

2020-10-04 Thread Kostis Anagnostopoulos


Kostis Anagnostopoulos  added the comment:

Have nothing else to say on top of what iritkatriel discovered, a double-check 
would be needed, but may be a pointless speed up, if MemoryHandler is 
impossible to work without a `target`.  

Fixing the no-target error is more important.  Actually that's how i came to 
notice this optimization.

--
status: pending -> open

___
Python tracker 

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



[issue25292] ssl socket gets into broken state when client exits during handshake

2020-10-04 Thread Carl Bordum Hansen


Carl Bordum Hansen  added the comment:

I have submitted a proposed solution

Just found this similar issue https://bugs.python.org/issue35840

--

___
Python tracker 

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



[issue41898] Any logging causes assertLogs to pass

2020-10-04 Thread Irit Katriel


Irit Katriel  added the comment:

I'm not sure my patch completely resolved this issue. I'm adding Antoine re the 
OP's question about the assertLogs API. 

> Doing so would make the test over-specific and fragile.  The requirement is > 
> that a warning be logged, not that a specific logger issue the warning.

My view is that your test is fragile because it just asks "was anything logged" 
without checking the log message. The docs show how to verify that the log 
message is what you expect it to be.

--
nosy: +pitrou

___
Python tracker 

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



[issue21756] IDLE - ParenMatch fails to find closing paren of multi-line statements

2020-10-04 Thread Tal Einat


Tal Einat  added the comment:

As noted on the PR GH-20753, an incremental change to the current logic doesn't 
seem like a promising approach.

It seems to me that this will require refactoring the code parsing logic to 
allow it to incrementally parse lines backwards and forwards in order to find 
the beginning and end of a code block.

--

___
Python tracker 

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



[issue41929] Detect OEM code page for zip archives in ZipFile based on system locale

2020-10-04 Thread Eryk Sun


Eryk Sun  added the comment:

This is already addressed in bpo-28080, which adds an `encoding` parameter -- 
e.g. `encoding="oem"` ("oem" is only available in Windows). Unfortunately 
bpo-28080 has languished without resolution for four years.

--
nosy: +eryksun

___
Python tracker 

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



[issue32112] Should uuid.UUID() accept another UUID() instance?

2020-10-04 Thread Irit Katriel


Irit Katriel  added the comment:

I agree with Serhiy that there needs to be a reason for adding this to a class 
constructor.

In the case of int, this is to implement conversion - it's not accepting int, 
it's accepting any number (it would be weird of int(3.4) worked and int(3) 
didn't).  Similarly, complex constructor accepts numbers.

In the case of tuple, bytes, bytearray - the constructor accepts any iterable, 
again in order to implement type conversion.


So it's not random - these constructors accept objects of the same type because 
they accept params of a more generic type, in order to provide type conversion 
functionality.

What functionality would we gain from increasing the API surface of the UUID 
constructor as you suggest?

--
nosy: +iritkatriel

___
Python tracker 

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



[issue41483] Do not acquire lock in MemoryHandler.flush() if no target defined

2020-10-04 Thread Vinay Sajip


Vinay Sajip  added the comment:

OK, I'll mark as pending and close in a few days if nothing more is heard from 
Kostis.

--
status: open -> pending

___
Python tracker 

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



[issue41898] Any logging causes assertLogs to pass

2020-10-04 Thread Vinay Sajip


Change by Vinay Sajip :


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

___
Python tracker 

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



[issue41898] Any logging causes assertLogs to pass

2020-10-04 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset faa8c6a8f1fe9c3bac31061e8a59a686b983ebb8 by Miss Skeleton (bot) 
in branch '3.9':
bpo-41898: add caveat on root logger seeing all messages in assertLogs doc 
(GH-22526) (GH-22540)
https://github.com/python/cpython/commit/faa8c6a8f1fe9c3bac31061e8a59a686b983ebb8


--

___
Python tracker 

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



[issue41928] ZipFile does not supports Unicode Path Extra Field (0x7075) zip header field

2020-10-04 Thread Ivan Sorokin

Ivan Sorokin  added the comment:

Grand unified algorithm to read filenames from zip files correctly:

1. Do zip entry have «Unicode Path Extra Field» (0x7075)? Use it for file name.
2. Is Unicode flag (0x800) set in «Flags» Field of zip entry? Assume «Filename» 
Field is in UTF-8.
3. Do «HostOS» Field of zip entry have values of 0 (FAT) or 11 (NTFS)? Assume 
«Filename» Field is in OEM charset corresponding to system locale.
4. Assume «Filename» Field is in UTF-8.

p7zip with oemcp patch (https://github.com/unxed/oemcp/) uses exactly this 
method, and is able to process all zip files in my test set correctly (my test 
set contains several zips generated by different packers on windows, macos, 
linux, and by online services). The same algorithm should be used in any zip 
unpacker wishing to process non-latin filenames as gently as possible.

--

___
Python tracker 

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



[issue41483] Do not acquire lock in MemoryHandler.flush() if no target defined

2020-10-04 Thread Irit Katriel


Irit Katriel  added the comment:

I think this issue should be closed - Kostis doesn't seem keen to discuss the 
merits of this change, and as I've said I don't think it's worth pursuing.

--

___
Python tracker 

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



[issue25292] ssl socket gets into broken state when client exits during handshake

2020-10-04 Thread Carl Bordum Hansen


Change by Carl Bordum Hansen :


--
keywords: +patch
nosy: +carlbordum
nosy_count: 5.0 -> 6.0
pull_requests: +21544
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/22541

___
Python tracker 

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



[issue32222] pygettext doesn't extract docstrings for functions with type annotated params

2020-10-04 Thread Irit Katriel


Irit Katriel  added the comment:

I think this is resolved and can be closed.

--
nosy: +iritkatriel

___
Python tracker 

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



[issue32922] dbm.open() encodes filename with default encoding rather than the filesystem encoding

2020-10-04 Thread Irit Katriel


Irit Katriel  added the comment:

This seems resolved, can it be closed?

--
nosy: +iritkatriel

___
Python tracker 

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



[issue41931] Make dict(object) return its attribute __dict__

2020-10-04 Thread மனோஜ்குமார் பழனிச்சாமி

மனோஜ்குமார் பழனிச்சாமி  added the comment:

Will return only if it is not an iterator

--

___
Python tracker 

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



[issue41931] Make dict(object) return its attribute __dict__

2020-10-04 Thread Irit Katriel


New submission from Irit Katriel :

dict is not a function, it's a class and the purpose of a dict() call is to 
create a new instance of that class.

The change you are proposing is also breaking for iterators:

>>> class Pairs(list): pass
... 
>>> pairs = Pairs([('a', 1), ('b', 2)])
>>> pairs.__dict__
{}
>>> dict(pairs)
{'a': 1, 'b': 2}

A change of this magnitude will need to be discussed on python-ideas and will 
require a PEP explaining why the benefits of the change outweigh its costs. I 
very much doubt that they do.

--
nosy: +iritkatriel

___
Python tracker 

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



[issue41183] [3.5] Workaround or fix for SSL ".._KEY_TOO_SMALL" test failures

2020-10-04 Thread Łukasz Langa

Change by Łukasz Langa :


--
resolution:  -> fixed
stage: needs patch -> resolved
status: open -> closed

___
Python tracker 

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



[issue41931] Make dict(object) return its attribute __dict__

2020-10-04 Thread மனோஜ்குமார் பழனிச்சாமி

Change by மனோஜ்குமார் பழனிச்சாமி :


--
nosy: SmartManoj
priority: normal
severity: normal
status: open
title: Make dict(object) return its attribute __dict__
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



[issue41898] Any logging causes assertLogs to pass

2020-10-04 Thread miss-islington


Change by miss-islington :


--
pull_requests: +21543
pull_request: https://github.com/python/cpython/pull/22540

___
Python tracker 

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



[issue41898] Any logging causes assertLogs to pass

2020-10-04 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset b2611fac05ed391d68f09781903aae7394fab832 by Miss Skeleton (bot) 
in branch '3.8':
bpo-41898: add caveat on root logger seeing all messages in assertLogs doc 
(GH-22526) (GH-22537)
https://github.com/python/cpython/commit/b2611fac05ed391d68f09781903aae7394fab832


--

___
Python tracker 

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



[issue29394] Cannot tunnel TLS connection through TLS connection

2020-10-04 Thread Carl Bordum Hansen


Change by Carl Bordum Hansen :


--
keywords: +patch
nosy: +carlbordum
nosy_count: 4.0 -> 5.0
pull_requests: +21542
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/22539

___
Python tracker 

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



[issue41898] Any logging causes assertLogs to pass

2020-10-04 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset 1ed54435268b285964141fb74d47ceaa33ea79ab by Irit Katriel in 
branch 'master':
bpo-41898: add caveat on root logger seeing all messages in assertLogs doc 
(GH-22526)
https://github.com/python/cpython/commit/1ed54435268b285964141fb74d47ceaa33ea79ab


--
nosy: +vinay.sajip

___
Python tracker 

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



[issue41898] Any logging causes assertLogs to pass

2020-10-04 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +21540
pull_request: https://github.com/python/cpython/pull/22537

___
Python tracker 

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



[issue41898] Any logging causes assertLogs to pass

2020-10-04 Thread miss-islington


Change by miss-islington :


--
pull_requests: +21541
pull_request: https://github.com/python/cpython/pull/22538

___
Python tracker 

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



[issue30578] Misleading example in sys.set_coroutine_wrapper docs

2020-10-04 Thread Carl Bordum Hansen


Carl Bordum Hansen  added the comment:

I think this can be closed as `sys.set_coroutine_wrapper` was removed in 
https://bugs.python.org/issue36933

--
nosy: +carlbordum

___
Python tracker 

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



[issue41927] Why is there no documentation in Russian?

2020-10-04 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Closed as an obvious trolling.

--
nosy: +serhiy.storchaka
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



[issue41930] Wrap sqlite3_serialize API in sqlite3 module

2020-10-04 Thread Kerrick Staley


New submission from Kerrick Staley :

It would be useful to provide a wrapper (in the Python sqlite3 stdlib module) 
for the sqlite3_serialize API. This API allows you to get a database's content 
as a byte string, as if you had called open('foo.sqlite3', 'rb').read(). 
sqlite3_serialize can even be used for :memory: databases, which I think is the 
most interesting use-case.

Concretely, I'd propose adding a .serialize() method on sqlite3.Connection 
objects that returns a bytes object representing the serialized database. It 
would be similar to the .iterdump() method except that it would use the binary 
format instead of the text format, and it would return all the data at once 
instead of an iterator (because that's how the underlying sqlite API works).

--
components: Library (Lib)
messages: 377935
nosy: Kerrick Staley
priority: normal
severity: normal
status: open
title: Wrap sqlite3_serialize API in sqlite3 module
type: enhancement

___
Python tracker 

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



[issue41927] Why is there no documentation in Russian?

2020-10-04 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Python is a volunteer-driven project.
The documentation translation is provided by champions who does this hard work 
for free. 
You can join the team and maintain the Python Russian Translation :)

Sorry, to keep the discussion productive I should remind our community rules:
* Please keep calm and provide a polite attitude in conversations on this bug 
tracker.
* Otherwise, you must understand that the rude mood can be considered as the 
reason for the ban.

--
nosy: +asvetlov

___
Python tracker 

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



[issue41927] Why is there no documentation in Russian?

2020-10-04 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Oh no, you have discovered our dirty secret! Python is racist against Russia! 
/sarcasm

Python is created by volunteers, including the documentation. If you want a 
Russian translation, feel free to start working on one.

You could start here: https://wiki.python.org/moin/Languages

--
nosy: +steven.daprano

___
Python tracker 

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



[issue41929] Detect OEM code page for zip archives in ZipFile based on system locale

2020-10-04 Thread Ivan Sorokin

New submission from Ivan Sorokin :

ZipFile has problems with filename charset in .zip archives having filenames 
charset encoded in OEM code page.

ZipFile assumes that OEM code page always means "cp437". Actually many popular 
.zip packers (for example, Windows internal "zip folders" tool) use OEM code 
page corresponding to system locale to write file names in .zip files.

To read such files correctly we should detect correct OEM code page from system 
locale instead of sticking to cp437.

Here is locale-to-oem-code-page conversion table, generated from Wine source 
code:
https://github.com/unxed/oemcp/blob/master/oemcp.txt

Sample archive is attached. The file inside should be extracted as "Новый 
текстовый документ.txt" when ru_RU system locale is set.

--
components: Library (Lib)
files: windows_cyrillic.zip
messages: 377932
nosy: ivan.sorokin.tech
priority: normal
severity: normal
status: open
title: Detect OEM code page for zip archives in ZipFile based on system locale
versions: Python 3.10
Added file: https://bugs.python.org/file49492/windows_cyrillic.zip

___
Python tracker 

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



[issue41928] ZipFile does not supports Unicode Path Extra Field (0x7075) zip header field

2020-10-04 Thread Ivan Sorokin

New submission from Ivan Sorokin :

See attached sample. Well-known unzip command line tool lists its contents 
correctly:

$ unzip -l 23.zip
Archive:  23.zip
  Length  DateTimeName
-  -- -   
81408  2012-10-23 19:03   Β' ΦΑΣΗ ΠΕ06 ΣΧΟΛΕΙΑ ΕΑΕΠ (ΙΝΤ).xls
- ---
81408 1 file

But ZipFile lists the same file inside this archive as
ü' öÇæå Åä06 æòÄèäêÇ äÇäÅ (êîÆ).xls

It's because ZipFile completely ignores Unicode Path Extra Field (0x7075) zip 
header field.

See .ZIP specification for details on this field meaning and usage:
https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT

--
components: Library (Lib)
files: 23.zip
messages: 377931
nosy: ivan.sorokin.tech
priority: normal
severity: normal
status: open
title: ZipFile does not supports Unicode Path Extra Field (0x7075) zip header 
field
type: enhancement
versions: Python 3.10
Added file: https://bugs.python.org/file49491/23.zip

___
Python tracker 

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



[issue41927] Why is there no documentation in Russian?

2020-10-04 Thread Борис Лакеев

New submission from Борис Лакеев :

Is this a racist policy of the site management? For so much time, not even for 
2.7. I'm sure there were a lot of suggestions to add. Aren't you ashamed?

--
assignee: docs@python
components: Documentation
messages: 377930
nosy: docs@python, lakeevboris
priority: normal
severity: normal
status: open
title: Why is there no documentation in Russian?
type: resource usage
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



[issue41926] Unpredictable behavior when parsing xml. (xml.etree.ElementTree.iterparse)

2020-10-04 Thread Джон Смит

Джон Смит  added the comment:

The file example5.xml could not be loaded, so to generate it, run the 
generator.py.

--

___
Python tracker 

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



[issue41926] Unpredictable behavior when parsing xml. (xml.etree.ElementTree.iterparse)

2020-10-04 Thread Джон Смит

Change by Джон Смит :


Added file: https://bugs.python.org/file49490/app.rar

___
Python tracker 

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



[issue41926] Unpredictable behavior when parsing xml. (xml.etree.ElementTree.iterparse)

2020-10-04 Thread Джон Смит

New submission from Джон Смит :

Data is lost when parsing large files.
I have prepared 5 test files for different cases.
With their help, I learned that losses are not accidental.
In example.xml, when going to iteration 717 (i = 717), the data is lost.

In the rest of the files, I learned that data loss occurs when the number of 
characters changes. It looks like some kind of buffer overflow.
In example5.xml I am using randomly generated data using a generator.py.

Several xml files have been prepared to show that this is not an error in the 
input data, but a problem in the library itself.

I tried to trace the cause of the occurrence, and came to the conclusion that 
the bug lies in the compiled file.

In the ElementTree.py library file, the line
"events = self._events_queue" 
returns an empty list. This can be seen at iteration 717 in example.xml.

--
components: XML
messages: 377928
nosy: kibertitan
priority: normal
severity: normal
status: open
title: Unpredictable behavior when parsing xml. 
(xml.etree.ElementTree.iterparse)
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



[issue33533] Provide an async iterator version of as_completed

2020-10-04 Thread Hrvoje Nikšić

Hrvoje Nikšić  added the comment:

Justin, thanks for updating the PR! I'll take another look at the code.

--

___
Python tracker 

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



[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2020-10-04 Thread Mark Dickinson


Mark Dickinson  added the comment:

> That still amounts to making it a requirement for all numeric classes

How so? I don't follow the reasoning here.

--

___
Python tracker 

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



[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2020-10-04 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

>  it was added as a concrete method,

That still amounts to making it a requirement for all numeric classes, even 
ones that predate this patch.  So existing classes that are registered will no 
longer comply with the ABC.  

In general, it's hard to add methods to ABCs because an ABC makes a promise 
about what methods are available in any class registered to that ABC.

--

___
Python tracker 

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



[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2020-10-04 Thread Mark Dickinson


Mark Dickinson  added the comment:

I interpreted "in the numeric tower" as meaning declared as an abstract method 
that all those registering with the class would have to implement. As you point 
out in msg350173, that would be problematic - adding new methods to published 
interfaces is pretty much a no-no for backwards compatibility reasons.

But that's not what happened here. Robert's original patch *did* add is_integer 
as an abstract method. The PR that was merged did not - it was added as a 
concrete method, as a convenience for those using the ABCs via direct 
subclassing rather than registering.

--

___
Python tracker 

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



[issue41909] Segfault on __getattr__ infinite recursion on certain attribute accesses

2020-10-04 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue41905] add update_abstractmethods function to update an ABC's abstract methods

2020-10-04 Thread Ben Avrahami


Ben Avrahami  added the comment:

Implementing this behavior automatically would be more complicated since you 
would also have to take subclasses into account. Current implementation 
enforces that the class is unused (as much as can be reasonably done) when its 
abstraction status is re-calculated, such checks cannot be done in an automatic 
implementation.

The question becomes whether or not we think its reasonable that an abstract 
class would change its abstraction status throughout its lifetime. I'd argue 
"not implicitly".

--

___
Python tracker 

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



[issue41909] Segfault on __getattr__ infinite recursion on certain attribute accesses

2020-10-04 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Antoine give me a hint. The problem seems related to using PyDict_GetItem() 
when look up an attribute in the instance dict. It silences all exceptions 
(including RecursionError) and this results in silent "no such key in a dict".

But since 3.8 it was replaced with PyDict_GetItemWithError() which preserves 
RecursionError (see issue35459). I think we can remove 
Py_ALLOW_RECURSION/Py_END_ALLOW_RECURSION now.

As for other case in interning string, 
Py_ALLOW_RECURSION/Py_END_ALLOW_RECURSION was used to guard PyDict_GetItem(). 
But the current code uses PyDict_SetDefault() (added in 3.4) which does not 
silence errors. So Py_ALLOW_RECURSION/Py_END_ALLOW_RECURSION can be removed in 
that place too.

--

___
Python tracker 

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