[issue44608] Memory use increase in function _tkinter._flatten

2021-07-13 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



[issue44608] Memory use increase in function _tkinter._flatten

2021-07-13 Thread miss-islington


miss-islington  added the comment:


New changeset 94adfe6e2cdc9ba715b6d7068d8bd521ba6bf30b by Miss Islington (bot) 
in branch '3.9':
bpo-44608: Fix memory leak in _tkinter._flatten() (GH-27107)
https://github.com/python/cpython/commit/94adfe6e2cdc9ba715b6d7068d8bd521ba6bf30b


--

___
Python tracker 

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



[issue44633] Indexing the union type can return NotImplemented

2021-07-13 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

>>> import typing
>>> (int | typing.T)[1]
NotImplemented

It is related to issue44632.

--
components: Interpreter Core
messages: 397468
nosy: gvanrossum, kj, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Indexing the union type can return NotImplemented
type: behavior
versions: Python 3.10, Python 3.11

___
Python tracker 

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



[issue44608] Memory use increase in function _tkinter._flatten

2021-07-13 Thread miss-islington


miss-islington  added the comment:


New changeset 7e1d6308a3fc536719adcf1df0aa4e9953c12f8b by Miss Islington (bot) 
in branch '3.10':
bpo-44608: Fix memory leak in _tkinter._flatten() (GH-27107)
https://github.com/python/cpython/commit/7e1d6308a3fc536719adcf1df0aa4e9953c12f8b


--

___
Python tracker 

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



[issue44632] Union with TypeVar does not work as intended

2021-07-13 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

>>> import typing
>>> int | typing.T
int | ~T
>>> typing.T | int
typing.Union[~T, int]
>>> T2 = TypeVar('T2')
>>> int | T2
typing.Union[int, ~T2]
>>> T2 | int
typing.Union[~T2, int]

There is a support of TypeVar in type.__or__, but it does not work with user 
defined TypeVars, only with internal TypeVars defined in the typing module.

--
components: Interpreter Core
messages: 397466
nosy: gvanrossum, kj, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Union with TypeVar does not work as intended
type: behavior
versions: Python 3.10, Python 3.11

___
Python tracker 

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



[issue44606] Discrepancy between isinstance() and issubclass() for union types

2021-07-13 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



[issue44608] Memory use increase in function _tkinter._flatten

2021-07-13 Thread miss-islington


Change by miss-islington :


--
pull_requests: +25677
pull_request: https://github.com/python/cpython/pull/27134

___
Python tracker 

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



[issue44608] Memory use increase in function _tkinter._flatten

2021-07-13 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset f572cbf1faab33d9afbbe3e95738ed6fbe6e48e6 by Serhiy Storchaka in 
branch 'main':
bpo-44608: Fix memory leak in _tkinter._flatten() (GH-27107)
https://github.com/python/cpython/commit/f572cbf1faab33d9afbbe3e95738ed6fbe6e48e6


--

___
Python tracker 

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



[issue44608] Memory use increase in function _tkinter._flatten

2021-07-13 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 2.0 -> 3.0
pull_requests: +25676
pull_request: https://github.com/python/cpython/pull/27133

___
Python tracker 

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



[issue44606] Discrepancy between isinstance() and issubclass() for union types

2021-07-13 Thread miss-islington


miss-islington  added the comment:


New changeset b42eee78e7651693aa38c390f577e5d499dcf55d by Miss Islington (bot) 
in branch '3.10':
bpo-44606: Fix __instancecheck__ and __subclasscheck__ for the union type. 
(GH-27120)
https://github.com/python/cpython/commit/b42eee78e7651693aa38c390f577e5d499dcf55d


--

___
Python tracker 

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



[issue44606] Discrepancy between isinstance() and issubclass() for union types

2021-07-13 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 81989058de381108dfd0a4255b93d4fb34417002 by Serhiy Storchaka in 
branch 'main':
bpo-44606: Fix __instancecheck__ and __subclasscheck__ for the union type. 
(GH-27120)
https://github.com/python/cpython/commit/81989058de381108dfd0a4255b93d4fb34417002


--

___
Python tracker 

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



[issue44606] Discrepancy between isinstance() and issubclass() for union types

2021-07-13 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit()

2021-07-13 Thread Jack DeVries


Jack DeVries  added the comment:

I wonder if the middle ground here is to let it be a teachable moment, and to 
inform the user by having the string returned by __repr__ be a bit more 
descriptive. Currently, it is:

> Use exit() or Ctrl-Z plus Return to exit

I propose:

> exit is the function that closes Python when called. To call a Python 
> function, add parenthesis! For example, "exit()".

To share a personal anecdote, Python was my first programming language. I can 
remember this specific case of REPL-stubbornness being instrumental in teaching 
me about referencing versus calling a function. Special cases cause confusion, 
and a shortcut that removes two characters at the expense of skirting past an 
essential understanding is not the right choice. The place we should be *most* 
careful about breaking language idioms are in the spots that are exposed to 
beginners and newcomers to the language.

--
nosy: +jack__d

___
Python tracker 

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



[issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit()

2021-07-13 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

On Tue, Jul 13, 2021 at 01:58:30AM +, Taylor Alexander wrote:

> I would push back against the idea that this is about laziness. It 
> sounds like this is about reducing user confusion.

Users aren't *confused* by the instructions, which are clear and simple: 
call the object using parentheses. Nobody says that they don't 
understand what it means to "use exit() to exit".

They are *annoyed* that they have to type the parentheses. This is not 
confusion, and it is disengenious to claim that people are "confused".

Especially when people have said that they understand the technical 
reasons for why exit behaves as it does, and that makes them "more 
frustrated". So they understand the reasoning why having repr(exit) kill 
the interpreter is a bad idea, and rather than satisfying them, they get 
even more annoyed.

--

___
Python tracker 

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



[issue44589] Pattern Matching - duplicate keys in mapping patterns

2021-07-13 Thread Jack DeVries


Jack DeVries  added the comment:

@brandtbucher, I think that my PR implements the solution you've described 
here. What do you think?

--

___
Python tracker 

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



[issue44589] Pattern Matching - duplicate keys in mapping patterns

2021-07-13 Thread Jack DeVries


Change by Jack DeVries :


--
keywords: +patch
nosy: +jack__d
nosy_count: 3.0 -> 4.0
pull_requests: +25674
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/27131

___
Python tracker 

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



[issue44617] Undesired Behavior on `match` using Singleton object

2021-07-13 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

>From https://www.python.org/dev/peps/pep-0635/#value-patterns :

"""We therefore only adopted the rule that any dotted name (i.e., attribute 
access) is to be interpreted as a value pattern, for example HttpStatus.OK 
above. This precludes, in particular, local variables and global variables 
defined in the current module from acting as constants."""

So your `case Nothing` example is an irrefutable capture pattern that binds the 
subject to the name "Nothing", while `case Maybe.empty` is a value pattern.

This is probably a little confusing the first time a person sees it, but it is 
in fact working in compliance with PEP 634, PEP 635, and PEP 636.

--

___
Python tracker 

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



[issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit()

2021-07-13 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
stage:  -> patch review
type: behavior -> enhancement

___
Python tracker 

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



[issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit()

2021-07-13 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

Agreed with Paul, this is a good idea UX wise for interactive interpreters.  
IPython proved that well over a decade ago.  Thanks for the historical links!

--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue44617] Undesired Behavior on `match` using Singleton object

2021-07-13 Thread Pablo Aguilar


Pablo Aguilar  added the comment:

In fact, I'm worried about how to explain some behaviors.

Look here:
```python
# `Maybe` here is the same class described in the first message
Nothing = Maybe()
Maybe.empty = Nothing


if __name__ == '__main__':
my_maybe = Maybe()
match my_maybe:
case Nothing:
print('FIRST CASE')
case _:
print('DEFAULT CASE')
```

I can't use `Nothing` to match the values even though it's a variable but using 
`Maybe.empty` it works.

--

___
Python tracker 

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



[issue38278] Need a more efficient way to perform dict.get(key, default)

2021-07-13 Thread Inada Naoki


Change by Inada Naoki :


--
nosy: +methane

___
Python tracker 

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



[issue44617] Undesired Behavior on `match` using Singleton object

2021-07-13 Thread Pablo Aguilar


Pablo Aguilar  added the comment:

But, `Maybe.empty` works like a `Literal Pattern` or `Constant Pattern`?

--

___
Python tracker 

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



[issue44604] [Enhancement] Asyncio task decorator to provide interface to define async DAGs (similar to dask's delayed interface)

2021-07-13 Thread Art


Art  added the comment:

Hi Yury, could you by any chance point me to some material on the inclusion of 
task groups in 3.11? I've found these "task group" docs from a library called 
AnyIO: https://anyio.readthedocs.io/en/stable/tasks.html.

If the asyncio task group feature is similar to this, then while I think it is 
a nice inclusion, I believe it does not cover the use case that this proposal 
would cover.

* If your opinion on the matter is still not final, then would you be open to a 
further demonstration of this proposal? I could gather several use cases from 
SO and other sites and demo how they could be elegantly solved with this 
interface.

--

___
Python tracker 

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



[issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit()

2021-07-13 Thread Éric Araujo

Change by Éric Araujo :


--
components: +Library (Lib) -Demos and Tools
nosy: +eric.araujo

___
Python tracker 

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



[issue44630] Assertion failure in csv module

2021-07-13 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

Thanks!

Things like this both internal to CPython and in CPython API misuse in all 
sorts of third party extension modules are why i think we as a project really 
should to encourage more CI systems to have -UNDEBUG builds of CPython 
available and in use by default when people request Python...

To answer anyone's "why no news entry?" questions... This only shows up in 
-UNDEBUG (and thus pydebug) builds of CPython.  Which basically nobody uses.

We, Google, keep C assertions enabled by undefining NDEBUG in our default 
non-release builds that everything by default runs tests against as a way to 
help improve code quality.

--
resolution:  -> fixed
stage: patch review -> commit review
status: open -> closed

___
Python tracker 

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



[issue44630] Assertion failure in csv module

2021-07-13 Thread miss-islington


miss-islington  added the comment:


New changeset fe73509c5ba3844b45a2253967522531ab80c849 by Miss Islington (bot) 
in branch '3.9':
bpo-44630: Fix assertion errors in csv module (GH-27127)
https://github.com/python/cpython/commit/fe73509c5ba3844b45a2253967522531ab80c849


--

___
Python tracker 

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



[issue44630] Assertion failure in csv module

2021-07-13 Thread miss-islington


miss-islington  added the comment:


New changeset bb260c2a212aee2a7d7a32bf5208fd554bf72713 by Miss Islington (bot) 
in branch '3.10':
[3.10] bpo-44630: Fix assertion errors in csv module (GH-27127) (GH-27129)
https://github.com/python/cpython/commit/bb260c2a212aee2a7d7a32bf5208fd554bf72713


--

___
Python tracker 

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



[issue44630] Assertion failure in csv module

2021-07-13 Thread miss-islington


Change by miss-islington :


--
pull_requests: +25673
pull_request: https://github.com/python/cpython/pull/27130

___
Python tracker 

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



[issue44630] Assertion failure in csv module

2021-07-13 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 2.0 -> 3.0
pull_requests: +25672
pull_request: https://github.com/python/cpython/pull/27129

___
Python tracker 

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



[issue38278] Need a more efficient way to perform dict.get(key, default)

2021-07-13 Thread Irit Katriel


Irit Katriel  added the comment:

> Was LOAD_METHOD optimized for builtin methods?


Maybe this can be done with specialization.

--
nosy: +Mark.Shannon, gvanrossum, iritkatriel

___
Python tracker 

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



[issue44630] Assertion failure in csv module

2021-07-13 Thread Gregory P. Smith


Gregory P. Smith  added the comment:


New changeset 0093876328afa330224c9d887c18dee0b3117852 by T. Wouters in branch 
'main':
bpo-44630: Fix assertion errors in csv module (GH-27127)
https://github.com/python/cpython/commit/0093876328afa330224c9d887c18dee0b3117852


--

___
Python tracker 

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



[issue44604] [Enhancement] Asyncio task decorator to provide interface to define async DAGs (similar to dask's delayed interface)

2021-07-13 Thread Yury Selivanov


Yury Selivanov  added the comment:

Yeah, I'm also not convinced this has to be part of asyncio, especially since 
we'll likely have task groups in 3.11.

--

___
Python tracker 

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



[issue44631] Refactoring the repr() of the _Environ class (os module)

2021-07-13 Thread Leonardo Freua


Change by Leonardo Freua :


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

___
Python tracker 

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



[issue44631] Refactoring the repr() of the _Environ class (os module)

2021-07-13 Thread Leonardo Freua


New submission from Leonardo Freua :

Currently, the repr() code of the _Environ class does many things in a bunched 
way, making it difficult to read and difficult to determine the result returned 
by the method.

Therefore, I propose an adjustment in the code to make it more readable, as 
well as your test.

--
components: Library (Lib)
messages: 397448
nosy: Leonardofreua
priority: normal
severity: normal
status: open
title: Refactoring the repr() of the _Environ class (os module)
type: enhancement
versions: Python 3.10, Python 3.11, 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



[issue44630] Assertion failure in csv module

2021-07-13 Thread Thomas Wouters


Change by Thomas Wouters :


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

___
Python tracker 

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



[issue44627] Python terminal cmd line recall

2021-07-13 Thread Eryk Sun


Eryk Sun  added the comment:

By default, reading input from the console uses the console's built-in 
command-line editor. You can clear the console input history with Alt+F7; 
display the history list with F7; navigate in the history list with the up and 
down arrow keys, even when the list isn't displayed; recall the first and last 
entries of the list with page up and page down; and cycle through matching 
command completions with F8.

Having said that, the new implementation of the console in Windows 10 has a bug 
in the "Discard Old Duplicates" history option [1]. Try disabling this option 
in the console's "Properties" dialog, which can be accessed from the Alt+Space 
control menu.

---
[1] https://github.com/microsoft/terminal/issues/4186

--
nosy: +eryksun

___
Python tracker 

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



pythran 0.9.12 - heskenn

2021-07-13 Thread Serge Guelton
Hi folks,

I just shipped a new release of Pythran—a compiler for scientific kernels 
written
in python.

It means it is available on PyPI and github, but not yet on conda, fedora, 
gentoo etc.

This one fixes a bunch of issues for Scipy (again), restores compatibility with
Cython, but the biggest change is definitively the new dependency tree.

Indeed, Pythran no longer depends on networkx, six nor decorator. The dependency
on gast and beniget received a version bump for compatibility with python 3.10
changes.

Big thanks to the contributors, every commit counts!

$ git shortlog -s 0.9.11..0.9.12
 1  Ashwin Vishnu
 1  Christian Clauss
 1  Jochen Schröder
 1  Miro Hrončok
 2  Ralf Gommers
35  serge-sans-paille
 1  刘星雨

A summarized changelog

$ git diff 0.9.11..0.9.12 -- Changelog | cut -c 2-
(...)
2021-07-06 Serge Guelton 
* Remove six, networkx and decorator dependency

* Bump gast and Beniget requirements to support python 3.10

* Bump xsimd to 7.5.0

* Minimal default support for non-linux, non-osx, now-windows platform

* Numpy improvements for np.bincount, np.transpose, np.searchsorted

* Restore (and test) cython compatibility

* Expose pythran.get_include for toolchain integration

* Improve error message on invalid spec

* Handle static dispatching based on keyword signature

* Raise Memory Error upon (too) large numpy alloc

* Support scalar case of scipy.special.binom

* Trim the number of warnings in pythonic codebase
(...)
___
Python-announce-list mailing list -- python-announce-list@python.org
To unsubscribe send an email to python-announce-list-le...@python.org
https://mail.python.org/mailman3/lists/python-announce-list.python.org/
Member address: arch...@mail-archive.com


[issue44630] Assertion failure in csv module

2021-07-13 Thread Thomas Wouters


New submission from Thomas Wouters :

The csv module has some incorrect exception handling when dealing with dialect 
objects that are not csv.Dialect subclasses (or that otherwise raise errors 
when accessing the dialect attributes):

>>> csv.reader([], dialect=None)
python: ../../cpython/Objects/typeobject.c:3820: _PyType_Lookup: Assertion 
`!PyErr_Occurred()' failed.
Aborted

The problem is Modules/_csv.c tries to cater to dialects that lack the 
attributes it wants to access, but does so by leaving exceptions set between 
calls to PyObject_SetAttrString(). Since 3.7, that causes assertion failures. 
(I have a PR with a fix.)

--
assignee: twouters
components: Extension Modules
messages: 397446
nosy: gregory.p.smith, twouters
priority: normal
severity: normal
status: open
title: Assertion failure in csv module
type: crash
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



[issue33346] Syntax error with async generator inside dictionary comprehension

2021-07-13 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 054e9c84ac7c394941bba3ea1829d14dce1243fc by Serhiy Storchaka in 
branch 'main':
bpo-33346: Allow async comprehensions inside implicit async comprehensions 
(GH-6766)
https://github.com/python/cpython/commit/054e9c84ac7c394941bba3ea1829d14dce1243fc


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



[issue43950] Include column offsets for bytecode instructions

2021-07-13 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
pull_requests: +25669
pull_request: https://github.com/python/cpython/pull/27126

___
Python tracker 

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



Tkinter widgets for desktop database application

2021-07-13 Thread Rich Shepard

I'm writing a couple of database applications that use tkinter, and not a
web browser, for the UI and I'm still trying to determine the optimal way to
do this.

Individual tk and ttk widgets (LineEntry, Combobox, etc.) work for adding
and modifying individual database table rows but not for displaying multiple
rows returned by a SELECT statement. To view all rows returned by the SQL
statement would a pythonReport be used?

I'm working on learning to use tksheet as the sole widget because it can
display multiple rows from a database table as well as add new rows and
modify existing ones (one or more columns in each row).

What have other developers used for the UI on a stand-alone database
application not using a web browser? I've struggled with finding the most
efficient and optimal non-brower UI for months and would like to have a
solid path toward a working solution. I know too little to make this
decision and want advice, suggestions, and recommendations from experienced
developers.

TIA,

Rich

--
https://mail.python.org/mailman/listinfo/python-list


[issue34388] collect_gdb fails for test.pythoninfo in several AMD64 FreeBSD buildbots

2021-07-13 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue38842] test_multiprocessing_spawn altered the execution environment in AMD64 FreeBSD Non-Debug 3.x

2021-07-13 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue37271] Make multiple passes of the peephole optimizer until bytecode cannot be optimized further

2021-07-13 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
resolution:  -> out of date
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



[issue34292] test_compile hangs in AMD Ubuntu buildbots

2021-07-13 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue44572] Calls to platform._syscmd_ver() dependent functions consume STDIN

2021-07-13 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 425756abdc03263ab3a52b068befd1ddb16c2dd2 by Miss Islington (bot) 
in branch '3.10':
bpo-44572: On Windows, disconnect STDIN in platform._syscmd_ver() to prevent 
erroneous STDIN consumption (GH-27092) (GH-27124)
https://github.com/python/cpython/commit/425756abdc03263ab3a52b068befd1ddb16c2dd2


--
nosy: +pablogsal

___
Python tracker 

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



[issue33125] Windows 10 ARM64 platform support

2021-07-13 Thread Jay Swanson


Jay Swanson  added the comment:

I know this is closed, but is it possible that the ARM64EC support coming in 
Windows 11 that allows mixed native/emulated code is something that would help 
this along? That along with the sunsetting of 32-bit systems.

--
nosy: +jay.swanson

___
Python tracker 

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



[issue43948] sysconfig's osx_framework_user puts headers in different locations from distutils

2021-07-13 Thread Tzu-ping Chung


Tzu-ping Chung  added the comment:

Personally I am not very surprised. The scenario (installing a package to the 
user scheme of a macOS Framework build) is quite obscure on its own, and AFAIK 
no third-party package installers is currently using sysconfig. Both pip and 
setuptools use distutils, and everything else uses one of them to perform the 
installation indirectly.

--

___
Python tracker 

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



[issue44629] Some files from distutils module are importing all exceptions unnecessarily

2021-07-13 Thread Leonardo Freua


New submission from Leonardo Freua :

Some files from the distutils module are importing all the exceptions from the 
errors.py file unnecessarily, when in fact only a few of the Exception classes 
are used.

Could I open a PR by fixing the files that are making these unnecessary 
imports? Or is this problem in the same category as f-String refactorings?

--
components: Library (Lib)
messages: 397441
nosy: Leonardofreua
priority: normal
severity: normal
status: open
title: Some files from distutils module are importing all exceptions 
unnecessarily
type: enhancement
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



[issue44572] Calls to platform._syscmd_ver() dependent functions consume STDIN

2021-07-13 Thread miss-islington


Change by miss-islington :


--
pull_requests: +25668
pull_request: https://github.com/python/cpython/pull/27125

___
Python tracker 

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



[issue44572] Calls to platform._syscmd_ver() dependent functions consume STDIN

2021-07-13 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 5.0 -> 6.0
pull_requests: +25667
pull_request: https://github.com/python/cpython/pull/27124

___
Python tracker 

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



[issue12178] csv writer doesn't escape escapechar

2021-07-13 Thread Sebastian Bank


Sebastian Bank  added the comment:

Thanks Tal.

AFAICT there was an undocumented change in behaviour related to this fix.

Python 3.9 quotes values with escapechar:

```
import csv
import io

kwargs = {'escapechar': '\\'}

value = 'spam\\eggs'

print(value)

with io.StringIO() as buf:
writer = csv.writer(buf, **kwargs)
writer.writerow([value])
line = buf.getvalue()

print(line.strip())

with io.StringIO(line) as buf:
reader = csv.reader(buf, **kwargs)
(new_value,), = reader

print(new_value)
spam\eggs
"spam\eggs"
spameggs
```

- quotes escapechar
- fails to double the escapechar (this bug)

Btw, from
https://docs.python.org/3/library/csv.html#csv.QUOTE_MINIMAL

> only quote those fields which contain special characters
> such as delimiter, quotechar or any of the characters in lineterminator.

this seems incorrect because escapechar is not mentioned (but at the same time 
it says 'such as') and maybe better matching the name 'minimal' (or one might 
expect 'more' quoting as a better default).

Python 3.10:

https://github.com/python/cpython/blob/5c0eed7375fdd791cc5e19ceabfab4170ad44062/Lib/test/test_csv.py#L207-L208

See also https://github.com/xflr6/csv23/actions/runs/1027687524

--

___
Python tracker 

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



[issue44572] Calls to platform._syscmd_ver() dependent functions consume STDIN

2021-07-13 Thread Steve Dower


Steve Dower  added the comment:


New changeset 0ee0a740e12ec8568aafa033aa6bb08b265afe26 by Konstantin-Glukhov in 
branch 'main':
bpo-44572: On Windows, disconnect STDIN in platform._syscmd_ver() to prevent 
erroneous STDIN consumption (GH-27092)
https://github.com/python/cpython/commit/0ee0a740e12ec8568aafa033aa6bb08b265afe26


--

___
Python tracker 

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



[issue44626] Incorrect tracing of nested if/if/for/yield

2021-07-13 Thread Sergey B Kirpichev


Change by Sergey B Kirpichev :


--
nosy: +Sergey.Kirpichev

___
Python tracker 

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



[issue44604] [Enhancement] Asyncio task decorator to provide interface to define async DAGs (similar to dask's delayed interface)

2021-07-13 Thread Art


Art  added the comment:

Note: regarding my inclusion of "airflow" in point #4 above. I in no way 
believe that airflow is a viable alternative to this proposal. I included it 
because one of those posts I linked explicitly mentioned that they looked into 
it as an alternative.

--

___
Python tracker 

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



[issue44628] Remove the broken link for issue #445902 in unixcompiler.py (distutils)

2021-07-13 Thread Leonardo Freua


Change by Leonardo Freua :


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

___
Python tracker 

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



[issue44604] [Enhancement] Asyncio task decorator to provide interface to define async DAGs (similar to dask's delayed interface)

2021-07-13 Thread Art


Art  added the comment:

I understand the hesitation to add this to the library, however I'd like to 
make a case for why I believe that it fits. To start this is my understanding 
of the scope of asyncio (or at least part of the scope, taken from the asyncio 
docs):

asyncio provides a set of high-level APIs to:
- run Python coroutines concurrently and have full control over their execution;
- perform network IO and IPC;
- control subprocesses;
- distribute tasks via queues;
- synchronize concurrent code;

I believe this decorator would be another high-level api that would be 
considered a valid, useful, simple, and if it was more well-known, popular, 
method of exerting "full control over their execution".

Here's an example of a few places from around the internet where people are 
asking how to do something that would directly benefit from this API, and where 
I believe frankly that this API would provide a much cleaner/better solution 
than those proposed.

https://old.reddit.com/r/learnpython/comments/oi3ueo/how_do_you_use_asyncio_to_do_this/
(inspiration for demo solution provided above)
https://stackoverflow.com/questions/58581270/what-is-the-cleanest-way-to-write-and-run-a-dag-of-tasks
(user specifies their tasks are IO bound and that they tried to use 
asyncio, but to no avail, or it was too complicated)

In both these cases above, it is explicitly implied that the user tried to use 
asyncio to solve their problem, but could not find a satisfactory way to do so.

Here's a few more examples of asyncio code, that aren't as directly related to 
the issue at hand, but would greatly benefit from this isolated "task" 
structure.

https://stackoverflow.com/questions/58905515/how-to-ensure-python-s-asyncio-library-executes-tasks-in-depth-first-search-orde
(user trying to build/execute a DAG of async tasks)
https://stackoverflow.com/questions/67481509/how-should-i-design-a-concurrency-pipeline-with-asyncio
(user could/should consider their task pipeline as a DAG which would 
conceptually simplify what they are trying to achieve)

To directly address the concern of "why add this to asyncio, and not a 
third-party library".
1) I believe this falls into the scope of the library as demonstrated in the 
first paragraph of this comment
2) Users look to and trust asyncio to provide good high level apis to build 
better code/systems (As you can see from some of the examples I posted above)
3) This is a very simple high-level api, that will not interfere with anything 
else in the library. Will introduce no compatibility issues
4) This point is conjecture, but I believe that this api will keep users from 
unnecessarily moving their workflows to other libraries like dask (which I love 
and contribute too) or airflow as you can see from some of the examples where 
users claim to try other libraries for something that asyncio could easily 
handle.
5) Inclusion in asyncio (over a third-party library) would provide faster, more 
reputable exposure to users of a great method of thinking about/solving their 
problems.

I hope you'll re-consider your position, but completely understand if not, in 
which case I'll close this issue.

--

___
Python tracker 

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



[issue44628] Remove the broken link for issue #445902 in unixcompiler.py (distutils)

2021-07-13 Thread Leonardo Freua


New submission from Leonardo Freua :

There is a broken link in the docstring of the runtime_library_dir_option() 
method of the UnixCCompiler class.

See the broken link below:
http://sourceforge.net/tracker/index.php?func=detail=445902_id=5470=105470

And the link that is working for this same issue:
https://bugs.python.org/issue445902

I will send a PR removing the link, leaving without it, as there is already 
exists the issue ID in the docstring.

--
components: Library (Lib)
messages: 397436
nosy: Leonardofreua
priority: normal
severity: normal
status: open
title: Remove the broken link for issue #445902 in unixcompiler.py (distutils)
versions: Python 3.11

___
Python tracker 

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



[issue44627] Python terminal cmd line recall

2021-07-13 Thread jg


New submission from jg :

Command line recall in python terminal treats strings case insensitively.

Example:
Define a 'dummy' function that takes a string as input. If you run dummy twice 
with the same input string, but different cases, it only saves one.
>>> dummy("This is a test") # run this
>>> dummy("THIS IS A TEST") # run again w/ different string
Now if you try cmd recall, it only recalls the first.
I believe it should recall both.
Maybe it's treating one as a duplicate - erroneously?

--
components: Windows
messages: 397435
nosy: jggammon, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Python terminal cmd line recall
type: behavior
versions: Python 3.9

___
Python tracker 

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



[issue44626] Incorrect tracing of nested if/if/for/yield

2021-07-13 Thread Ned Batchelder


New submission from Ned Batchelder :

In Python 3.10, this code is traced incorrectly. I don't know if there's a 
simpler format that would show the problem. This code is already simplified 
from https://github.com/nedbat/coveragepy/issues/1188.

--
import linecache, sys

def trace(frame, event, arg):
# The weird globals here is to avoid a NameError on shutdown...
if frame.f_code.co_filename == globals().get("__file__"):
lineno = frame.f_lineno
print("{} {}: {}".format(event[:4], lineno, linecache.getline(__file__, 
lineno).rstrip()))
return trace

print(sys.version)
sys.settrace(trace)

def f(a, p, z):
if p:
print(f"{a=}")
if a:
if z:
for x in [1,2]:
yield x
else:
for x in [1,2]:
yield x
else:
print("nope")

import itertools

for a, p, z in itertools.product([0, 1], repeat=3):
list(f(a, p, z))


Running this with 3.10.0b4 produces this output. The starred lines show a is 
false, but tracing then indicates a line which is not executed:

  3.10.0b4 (default, Jul 11 2021, 13:51:53) [Clang 12.0.0 (clang-1200.0.32.29)]
  call 13: def f(a, p, z):
  line 14: if p:
  line 24: print("nope")
  nope
  retu 24: print("nope")
  call 13: def f(a, p, z):
  line 14: if p:
  line 24: print("nope")
  nope
  retu 24: print("nope")
  call 13: def f(a, p, z):
  line 14: if p:
  line 15: print(f"{a=}")
  a=0
* line 16: if a:
  line 22: yield x
  retu 22: yield x
  call 13: def f(a, p, z):
  line 14: if p:
  line 15: print(f"{a=}")
  a=0
* line 16: if a:
  line 22: yield x
  retu 22: yield x
  call 13: def f(a, p, z):
  line 14: if p:
  line 24: print("nope")
  nope
  retu 24: print("nope")
  call 13: def f(a, p, z):
  line 14: if p:
  line 24: print("nope")
  nope
  retu 24: print("nope")
  call 13: def f(a, p, z):
  line 14: if p:
  line 15: print(f"{a=}")
  a=1
  line 16: if a:
  line 17: if z:
  line 21: for x in [1,2]:
  line 22: yield x
  retu 22: yield x
  call 22: yield x
  line 21: for x in [1,2]:
  line 22: yield x
  retu 22: yield x
  call 22: yield x
  line 21: for x in [1,2]:
  line 22: yield x
  retu 22: yield x
  call 13: def f(a, p, z):
  line 14: if p:
  line 15: print(f"{a=}")
  a=1
  line 16: if a:
  line 17: if z:
  line 18: for x in [1,2]:
  line 19: yield x
  retu 19: yield x
  call 19: yield x
  line 18: for x in [1,2]:
  line 19: yield x
  retu 19: yield x
  call 19: yield x
  line 18: for x in [1,2]:
  retu 18: for x in [1,2]:

--
components: Interpreter Core
keywords: 3.10regression
messages: 397434
nosy: Mark.Shannon, nedbat
priority: normal
severity: normal
status: open
title: Incorrect tracing of nested if/if/for/yield
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



[issue43124] [security] smtplib multiple CRLF injection

2021-07-13 Thread Martin Ortner


Martin Ortner  added the comment:

> This bug report starts with "a malicious user with direct access to 
> `smtplib.SMTP(..., local_hostname, ..)", which is a senseless supposition.  
> Anyone with "access to" the SMTP object could just as well be talking 
> directly to the SMTP server and do anything they want that SMTP itself allows.

Let's not argue about the phrasing and settle on the fact that I am not a 
native English speaker which might be the root cause of the confusion. The core 
of the issue is that this *unexpected side-effect* may be security-relevant. 
Fixing it probably takes less time than arguing about phrasing, severity, or 
spending time describing exploitation scenarios for a general-purpose library 
that should protect the underlying protocol from injections. 


Be kind, I come in peace.

--

___
Python tracker 

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



[issue44606] Discrepancy between isinstance() and issubclass() for union types

2021-07-13 Thread Ken Jin


Ken Jin  added the comment:

> 3. There is also a crash in isinstance():

That's unfortunate :(.

Serhiy, thanks for catching all these bugs in union. I recently realized you 
probably made 50% of all bug reports for union and they're very much 
appreciated :).

> Converting None to type(None) will be done in other PR.

Alright. Do tell me if you're too busy and want me to take it up instead. I'll 
be glad to help.

--

___
Python tracker 

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



[issue44606] Discrepancy between isinstance() and issubclass() for union types

2021-07-13 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

PR 27120 fixes __instancecheck__ and __subclasscheck__. Converting None to 
type(None) will be done in other PR.

--

___
Python tracker 

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



[issue44606] Discrepancy between isinstance() and issubclass() for union types

2021-07-13 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
type: behavior -> crash

___
Python tracker 

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



[issue44606] Discrepancy between isinstance() and issubclass() for union types

2021-07-13 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue44606] Discrepancy between isinstance() and issubclass() for union types

2021-07-13 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

3. There is also a crash in isinstance():

>>> class BadMeta(type):
... def __instancecheck__(cls, inst):
... 1/0
... 
>>> x = int | BadMeta('A', (), {})
>>> isinstance([], x)
Fatal Python error: _Py_CheckFunctionResult: a function returned a result with 
an exception set
Python runtime state: initialized
Traceback (most recent call last):
  File "", line 3, in __instancecheck__
ZeroDivisionError: division by zero

The above exception was the direct cause of the following exception:

SystemError:  returned a result with an exception set

Current thread 0x7f024beb1280 (most recent call first):
  File "", line 1 in 
Aborted (core dumped)

--

___
Python tracker 

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



Re: argparse support of/by argparse

2021-07-13 Thread lucas

Mmmh, that may work just fine !
Thanks for that idea, ChrisA, i'm looking forward to implement that.

Best wishes,
--lucas



On 12/07/2021 21:33, Chris Angelico wrote:

On Tue, Jul 13, 2021 at 5:22 AM lucas  wrote:


Hello everyone,

Let us consider this patch of code:

  import argparse

  def parse_cli() -> argparse.Namespace:
  parser = argparse.ArgumentParser()
  parser.add_argument('n', type=int)
  return parser.parse_args()

  args = parse_cli()
  print(args.n + ' ')  # type error

Running CPython on it will raise a TypeError, and running Mypy on it
will indicate that no issues were found.

I was wondering if there is any way for me to have mypy detecting the
args.n type, based on the type keyword of the parser.add_argument function ?

It appears that some type annotations were added to tierce party
modules, provided by mypy itself. Is there a technical issue preventing
such work to be made for argparse (or other CLI ; i didn't find anything
for others either)



Seems complicated, since it depends on a lot of run-time information.
What if you flip the problem on its head? Instead of creating the
argparser and letting that govern the types, maybe create a dataclass,
and then programmatically build the parser.

from dataclasses import dataclass
import argparse

@dataclass
class Args:
 n: int

def parse_cli() -> Args:
 parser = argparse.ArgumentParser()
 for field, typ in Args.__dataclass_fields__.items():
 if hasattr(typ, "type"): typ = typ.type # Python 3.10 changed
things a bit
 parser.add_argument(field, type=typ)
 return Args(**vars(parser.parse_args()))

args = parse_cli()
print(args.n + ' ')


Only barely tested it and didn't try MyPy, but that's the basic idea.
You'd have to figure out the tidiest way to define all the other
attributes of your arguments (help text, etc), but ideally, all the
info should be able to be coded in the dataclass.

Incidentally, you could choose to make parse_cli into a classmethod of
Args. Might be cleaner.

ChrisA


--
https://mail.python.org/mailman/listinfo/python-list


[issue44625] Python C API version of `fractions` module

2021-07-13 Thread Mark Dickinson


Mark Dickinson  added the comment:

No, no plans. There are tradeoffs here - the extra speed comes at the expense 
of increased maintenance burden. (It's certainly much harder to make minor 
changes and fixes to the decimal module now that it's written in C.)

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue43950] Include column offsets for bytecode instructions

2021-07-13 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
pull_requests: +25664
pull_request: https://github.com/python/cpython/pull/27117

___
Python tracker 

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



Re: Python does not work

2021-07-13 Thread Mats Wichmann

On 7/13/21 3:05 AM, rubiks solver wrote:

When I run python 3.9.6 on visual studio code it opens multiple python
setup windows.

I rebooted my computer. Same result.


Is this a bug?


No, it's a setup problem.

Sounds like when you pointed Code at Python, you pointed it at the 
installer. You should be able to adjust it to point to the real Python 
executable.


Unfortunately, since there are so many choices how things could have 
been installed from the various different sources, but a guess at the 
path you want would be something like:


...\AppData\Local\Programs\Python\Python39\python.exe


--
https://mail.python.org/mailman/listinfo/python-list


Re: Simple SSL client hangs

2021-07-13 Thread MRAB

On 2021-07-13 08:50, Loris Bennett wrote:

Hi,

In Perl I have the following

   use IO::Socket::SSL;

   my $my_socket = new IO::Socket::SSL(PeerAddr => 'some.server.somewhere,
  PeerPort => 12345,
 );

   my $line = <$my_socket>;
   print("$line\n");
   say $my_socket 'ECHO 1';
   $line = <$my_socket>;
   print("$line\n");

This runs as expected and I get

   200 Some Server Somewhere - Hello [123.456.789.123]

   310 Hello Echo

If I try the same with the following Python code:

   import socket
   import ssl

   HOST = "some.server.somewhere"
   PORT = 12345

   context = ssl.create_default_context()

   with socket.create_connection((HOST, PORT)) as sock:
   with context.wrap_socket(sock, server_hostname=HOST) as ssock:
   data = ssock.recv(1024)
   print(data.decode())
   ssock.write(b'ECHO 1')
   data = ssock.read(1024)
   print(data.decode())

I get a timeout for the 'ECHO' command:

   200 Some Server Somewhere - Hello [123.456.789.123]

   501 Timeout

Does anyone have an idea what I might be doing wrong?


The docs for Perl says that 'say' appends a newline.

On the other hand, 'ssock.write' doesn't append a newline.

Could that be the problem?
--
https://mail.python.org/mailman/listinfo/python-list


Re: Simple SSL client hangs

2021-07-13 Thread Douglas Wells
In article <871r821wlg@hornfels.zedat.fu-berlin.de>,
Loris Bennett  wrote:
>In Perl I have the following
>
>  use IO::Socket::SSL;
>  my $my_socket = new IO::Socket::SSL(PeerAddr => 'some.server.somewhere,
> PeerPort => 12345,
>);
>  my $line = <$my_socket>;
>  print("$line\n");
>  say $my_socket 'ECHO 1';
>  $line = <$my_socket>;
>  print("$line\n");
>
>This runs as expected and I get
>
>  200 Some Server Somewhere - Hello [123.456.789.123]
>  310 Hello Echo
>
>If I try the same with the following Python code:
>
>  import socket
>  import ssl
>  HOST = "some.server.somewhere"
>  PORT = 12345
>  context = ssl.create_default_context()
>  with socket.create_connection((HOST, PORT)) as sock:
>  with context.wrap_socket(sock, server_hostname=HOST) as ssock:
>  data = ssock.recv(1024)
>  print(data.decode())
>  ssock.write(b'ECHO 1')
>  data = ssock.read(1024)
>  print(data.decode())
>
>I get a timeout for the 'ECHO' command:
>
>  200 Some Server Somewhere - Hello [123.456.789.123]
>  501 Timeout
>
>Does anyone have an idea what I might be doing wrong?

Loris,

You don't specify the type of your server, but it looks like a
"normal" SMTP or NNTP or whatever server.  This type of server is line
oriented.

The Perl "say" operation adds a trailing line terminator.  The Python
"ssl:write" does not.  Try adding an appropriate line terminator to
your Python code.  Most likely it needs to be CR-LF.  Perhaps use
"ssock.write(b'ECHO 1\r\n')

 - dmw
-- 
https://mail.python.org/mailman/listinfo/python-list


Simple SSL client hangs

2021-07-13 Thread Loris Bennett
Hi,

In Perl I have the following

  use IO::Socket::SSL;

  my $my_socket = new IO::Socket::SSL(PeerAddr => 'some.server.somewhere,
  PeerPort => 12345,
 );

  my $line = <$my_socket>;
  print("$line\n");
  say $my_socket 'ECHO 1';
  $line = <$my_socket>;
  print("$line\n");

This runs as expected and I get

  200 Some Server Somewhere - Hello [123.456.789.123]

  310 Hello Echo

If I try the same with the following Python code:

  import socket
  import ssl

  HOST = "some.server.somewhere"
  PORT = 12345

  context = ssl.create_default_context()

  with socket.create_connection((HOST, PORT)) as sock:
  with context.wrap_socket(sock, server_hostname=HOST) as ssock:
  data = ssock.recv(1024)
  print(data.decode())
  ssock.write(b'ECHO 1')
  data = ssock.read(1024)
  print(data.decode())

I get a timeout for the 'ECHO' command:

  200 Some Server Somewhere - Hello [123.456.789.123]

  501 Timeout

Does anyone have an idea what I might be doing wrong?

Cheers,

Loris

-- 
This signature is currently under construction.
-- 
https://mail.python.org/mailman/listinfo/python-list


Python does not work

2021-07-13 Thread rubiks solver
   When I run python 3.9.6 on visual studio code it opens multiple python
   setup windows.

   I rebooted my computer. Same result.







   Is this a bug?
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue44604] [Enhancement] Asyncio task decorator to provide interface to define async DAGs (similar to dask's delayed interface)

2021-07-13 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

I'm not convinced why @task decorator should be a part of asyncio.

You can provide the implementation as a part of some third-party library on 
pypy.org. Looks like it doesn't require any change of asyncio itself.

--

___
Python tracker 

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



[issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit()

2021-07-13 Thread Paul Ganssle


Change by Paul Ganssle :


--
stage: resolved -> 

___
Python tracker 

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



[issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit()

2021-07-13 Thread Paul Ganssle


Paul Ganssle  added the comment:

Re-opening this because I think the discussion is not done and I don't see any 
reason why this was rejected.

> Related 2005 python-dev discussion: 
> https://mail.python.org/archives/list/python-...@python.org/thread/VNGY2DLML4QJUXE73JLVBIH5WFBZNIKG/

@Mark Thanks for digging these up! From what I can tell, that discussion ended 
up with a combination of there not being quite enough enthusiasm for the idea 
to drive it forward and no one coming up with a good way to localize the effect 
to just the case where we know the person was trying to type "exit" in a REPL.

I think Pablo's patch shows that a very limited addition to the "REPL layer" is 
actually plausible, and we *could* implement this without taking on an enormous 
amount of additional complexity or affecting non-interactive use cases.

Fernando's point about it being dangerous to generalize this additional layer 
of "interactive-use only" keywords is a good one (see: 
https://mail.python.org/archives/list/python-...@python.org/message/L37RD7SG26IOBETPI7TETKFGHPAPC75Q/),
 though it seems that it was this thread that prompted him to add exit/quit as 
auto-call magic keywords to IPython, and I think that has worked out in the 
intervening 16 years. I don't think there's much danger of us wanting to 
generalize this concept, since the only really compelling argument for doing it 
this way for exit/quit is that almost everyone seems to think it *should* work 
this way (despite it never having worked this way, and there not being any 
equivalents), and gets tripped up when it doesn't.

> and the related issue: https://bugs.python.org/issue1446372

Looks to me like that is an issue for adding the message when you type "exit". 
There's no additional discussion disqualifying the use of "exit" as an 
interactive-only keyword.

--
resolution: rejected -> 
status: closed -> open

___
Python tracker 

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



[issue44623] help(open('/dev/zero').writelines) gives no help

2021-07-13 Thread Zachary Ware


Change by Zachary Ware :


--
versions: +Python 3.6 -Python 3.11

___
Python tracker 

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



[issue44623] help(open('/dev/zero').writelines) gives no help

2021-07-13 Thread Zachary Ware


Zachary Ware  added the comment:

Even with 3.6 I get a different result:

```
Python 3.6.13 (tags/v3.6.13:aa73e1722e, Mar 23 2021, 15:45:49) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> help(open('/dev/zero').writelines)
Help on built-in function writelines:

writelines(lines, /) method of _io.TextIOWrapper instance

```

This appears to be because TextIOWrapper.writelines just didn't have a 
docstring in 3.6.  I can't explain why `help` just gave you the repr of the 
method, though.

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



[issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit()

2021-07-13 Thread Mark Dickinson


Mark Dickinson  added the comment:

and the related issue: https://bugs.python.org/issue1446372

--

___
Python tracker 

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



[issue44625] Python C API version of `fractions` module

2021-07-13 Thread Azat Ibrakov


New submission from Azat Ibrakov :

Are there any plans for implementing `fractions` module in C (like  for 
`decimal` there is a 
https://github.com/python/cpython/blob/main/Modules/_decimal/_decimal.c module)?
I've implemented one myself (https://github.com/lycantropos/cfractions) and 
from benchmarks (available at https://stackoverflow.com/a/67821911/5997596) we 
can see that it can be faster that current pure Python implementation.

--
messages: 397424
nosy: lycantropos
priority: normal
severity: normal
status: open
title: Python C API version of `fractions` module

___
Python tracker 

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



[issue44624] Script name for venv PowerShell activate

2021-07-13 Thread Ammar Askar


Change by Ammar Askar :


--
nosy: +paul.moore, steve.dower, tim.golden, zach.ware

___
Python tracker 

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



[issue43124] [security] smtplib multiple CRLF injection

2021-07-13 Thread R. David Murray


R. David Murray  added the comment:

s/header injection/command injection/

--

___
Python tracker 

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



[issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit()

2021-07-13 Thread Mark Dickinson


Mark Dickinson  added the comment:

Related 2005 python-dev discussion: 
https://mail.python.org/archives/list/python-...@python.org/thread/VNGY2DLML4QJUXE73JLVBIH5WFBZNIKG/

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue43124] [security] smtplib multiple CRLF injection

2021-07-13 Thread R. David Murray


R. David Murray  added the comment:

This bug report starts with "a malicious user with direct access to 
`smtplib.SMTP(..., local_hostname, ..)", which is a senseless supposition.  
Anyone with "access to" the SMTP object could just as well be talking directly 
to the SMTP server and do anything they want that SMTP itself allows.

The concern here is that data a program might obtain *from unsanitized user 
input* could be used to do header injection.  The "proof of concept" does not 
address this at all.  We'd need to see a scenario under which data that could 
reasonably be derived from user input ends up being passed as arguments to an 
smtplib method that calls putcmd with arguments.

So, I would rate this as *very* low impact issue, unless someone has an *actual 
example* of code using smtplib that passes user input through to smtplib 
commands in an exploitable way.

That said, it is perfectly reasonable to be proactive here and prevent 
scenarios we haven't yet thought of, by doing as recommended (and a bit more) 
by raising a ValueError if 'args' in the putcmd call contain either \n or \r 
characters.  I don't think we need to check 'cmd', because I can't see any 
scenario in which the SMTP command would be derived from user input.  If you 
want to be *really* paranoid you could check cmd too, and since it will always 
be a short string the additional performance impact will be minor.

--
type: performance -> security
versions: +Python 3.10, Python 3.11, 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



[issue44623] help(open('/dev/zero').writelines) gives no help

2021-07-13 Thread Jonathan Fine


Jonathan Fine  added the comment:

I used my default Python, which is Python 3.6. However, with 3.7 and 3.8 I get 
the same as Paul.

So I'm closing this as 'not a bug' (as there's not an already-fixed option for 
closing).

--
resolution: works for me -> not a bug
status: pending -> open

___
Python tracker 

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



[issue44623] help(open('/dev/zero').writelines) gives no help

2021-07-13 Thread Zachary Ware


Zachary Ware  added the comment:

I also can't reproduce this with a fresh build of 3b5b99da4b on Linux.

--
nosy: +zach.ware
resolution:  -> works for me
status: open -> pending

___
Python tracker 

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



[issue19072] classmethod doesn't honour descriptor protocol of wrapped callable

2021-07-13 Thread Łukasz Langa

Change by Łukasz Langa :


--
nosy: +lukasz.langa
nosy_count: 11.0 -> 12.0
pull_requests: +25663
pull_request: https://github.com/python/cpython/pull/27115

___
Python tracker 

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



[issue42073] classmethod does not pass "type/owner" when invoking wrapped __get__

2021-07-13 Thread Łukasz Langa

Change by Łukasz Langa :


--
nosy: +lukasz.langa
nosy_count: 4.0 -> 5.0
pull_requests: +25662
pull_request: https://github.com/python/cpython/pull/27115

___
Python tracker 

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



[issue44355] Allow spaces in format strings

2021-07-13 Thread Jean Abou Samra


Jean Abou Samra  added the comment:

Maybe leave the current state, keeping backwards compatibility, but improve the 
error message by adding "perhaps you wanted no spaces in the format field?" 
when the_field.replace(" ", "") would be valid?

--
nosy: +Jean_Abou_Samra

___
Python tracker 

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



[issue44606] Discrepancy between isinstance() and issubclass() for union types

2021-07-13 Thread Ken Jin


Ken Jin  added the comment:

@Serhiy, can I work on converting None to type(None) please?

--

___
Python tracker 

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



[issue44624] Script name for venv PowerShell activate

2021-07-13 Thread Paul Watson


New submission from Paul Watson :

In the venv .\Scripts directory. the name 'Activate.ps1' does not conform to 
the PowerShell prescribed Verb-Noun format.

How about using 'Initialize-Python.ps1' as the script name? Or, something else 
that does conform to PowerShell standard naming.

--
components: Installation
messages: 397416
nosy: Paul Watson
priority: normal
severity: normal
status: open
title: Script name for venv PowerShell activate
type: enhancement

___
Python tracker 

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



[issue44623] help(open('/dev/zero').writelines) gives no help

2021-07-13 Thread Paul Moore


Paul Moore  added the comment:

It does for me:

>>> help(open("nul").writelines)
Help on built-in function writelines:

writelines(lines, /) method of _io.TextIOWrapper instance
Write a list of lines to stream.

Line separators are not added, so it is usual for each of the
lines provided to have a line separator at the end.

This is Windows, Python 3.9. What version did you get the problem with? If it's 
older, I'd say the problem has likely since been fixed.

--
nosy: +paul.moore

___
Python tracker 

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



[issue44623] help(open('/dev/zero').writelines) gives no help

2021-07-13 Thread Jonathan Fine


New submission from Jonathan Fine :

On Linux
>>> help(open('/dev/zero').writelines)
gives


However
https://docs.python.org/3/library/io.html#io.IOBase.writelines
gives

Write a list of lines to the stream. Line separators are not added, so it is 
usual for each of the lines provided to have a line separator at the end.

See also request that writelines support a line separator.
https://mail.python.org/archives/list/python-id...@python.org/thread/A5FT7SVZBYAJJTIWQFTFUGNSKMVQNPVF/#A5FT7SVZBYAJJTIWQFTFUGNSKMVQNPVF

--
assignee: docs@python
components: Documentation
messages: 397414
nosy: docs@python, jfine2358
priority: normal
severity: normal
status: open
title: help(open('/dev/zero').writelines) gives no help
type: enhancement
versions: Python 3.11

___
Python tracker 

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



[issue43126] IOBase.readlines(0) behaviour is inconsistent with documentation

2021-07-13 Thread Łukasz Langa

Łukasz Langa  added the comment:

Thanks, Andrei! ✨  ✨

--

___
Python tracker 

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



[issue43126] IOBase.readlines(0) behaviour is inconsistent with documentation

2021-07-13 Thread Łukasz Langa

Change by Łukasz Langa :


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

___
Python tracker 

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



[issue43126] IOBase.readlines(0) behaviour is inconsistent with documentation

2021-07-13 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset a3d20bfee38c71df88d69064d47fe98a1d59e624 by Miss Islington (bot) 
in branch '3.9':
bpo-43126: Expand docs on io.IOBase.readlines() method (GH-27061) (#27114)
https://github.com/python/cpython/commit/a3d20bfee38c71df88d69064d47fe98a1d59e624


--

___
Python tracker 

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



[issue43126] IOBase.readlines(0) behaviour is inconsistent with documentation

2021-07-13 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 9b369c952cbefb064dda6cb781e66cc1b793fffa by Miss Islington (bot) 
in branch '3.10':
bpo-43126: Expand docs on io.IOBase.readlines() method (GH-27061) (GH-27113)
https://github.com/python/cpython/commit/9b369c952cbefb064dda6cb781e66cc1b793fffa


--

___
Python tracker 

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



[issue38741] Definition of multiple ']' in header configparser

2021-07-13 Thread Łukasz Langa

Łukasz Langa  added the comment:

Since I got to this only now, we can include the fix in main (3.11) and 3.10. 
It's too late in the cycle for 3.9.

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

___
Python tracker 

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



[issue44514] configparser.rst & bz2.rst leave temp files after 'make doctest'

2021-07-13 Thread Łukasz Langa

Łukasz Langa  added the comment:

Thanks, Kevin! ✨  ✨

--

___
Python tracker 

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



  1   2   >