[issue46223] asyncio cause infinite loop during debug

2022-01-08 Thread Kumar Aditya


Change by Kumar Aditya :


--
nosy: +kumaraditya303

___
Python tracker 

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



[issue46309] Task created by StreamReaderProtocol gets garbage collected.

2022-01-08 Thread Kumar Aditya


Change by Kumar Aditya :


--
nosy: +kumaraditya303

___
Python tracker 

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



[issue23819] test_asyncio fails when run under -O

2022-01-08 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Is anything left to do?

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



[issue46309] Task created by StreamReaderProtocol gets garbage collected.

2022-01-08 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Thanks for the bug report.

Seems like your analysis is correct.

Could you make a pull request which adds a task reference?

--

___
Python tracker 

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



[issue46223] asyncio cause infinite loop during debug

2022-01-08 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

I guess applying '@reprlib.recursive_repr' decorator to 
'events.Handle.__repr__()' function can help.

Could you check, please?

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



[issue40280] Consider supporting emscripten/webassembly as a build target

2022-01-08 Thread Ethan Smith


Change by Ethan Smith :


--
pull_requests: +28700
pull_request: https://github.com/python/cpython/pull/30494

___
Python tracker 

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



[issue46205] test.libregrtest: Race condition in runtest_mp leads to hangs (never exits)

2022-01-08 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10

___
Python tracker 

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



[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2022-01-08 Thread Guido van Rossum


Guido van Rossum  added the comment:

Yup. All better: 
https://speed.python.org/timeline/#/?exe=12=python_startup=1=50=off=on=on

--

___
Python tracker 

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



[issue46148] Optimize pathlib

2022-01-08 Thread Guido van Rossum


Change by Guido van Rossum :


--
nosy:  -gvanrossum

___
Python tracker 

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



[issue46307] string.Template should allow inspection of identifiers

2022-01-08 Thread Ben Kehoe


Ben Kehoe  added the comment:

I opened a PR. By default, it raises an exception if there's an invalid 
identifier; there's a keyword argument raise_on_invalid to control that.

The implementation I have adds them to a set first, which means the order is 
not guaranteed. I'm of two minds about this: if there's a big template, you 
want to gather the identifiers in a set so uniqueness is checked immediately 
and O(1) and without duplication. On the other hand, if templates are never 
very big, you could build a list (in order) and check it, O(N) style, or build 
a duplicate list and set in parallel. Or build a big list and check it at the 
end.

I kind of think ordering doesn't matter? What would someone do with that 
information?

--

___
Python tracker 

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



[issue46307] string.Template should allow inspection of identifiers

2022-01-08 Thread Ben Kehoe


Change by Ben Kehoe :


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

___
Python tracker 

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



[issue46307] string.Template should allow inspection of identifiers

2022-01-08 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

I think you’re right that the iterator API isn’t very helpful.  I also agree 
that you probably really want to answer the “why identifiers are in this 
template?” question.  As for repeats, there’s two ways to think about it.  You 
could return all the identifiers in the order in which they’re found in the 
template (and you can unique-ify them if you want by passing that list to 
set()).  But maybe you don’t really need that either.

get_identifiers() works for me!

On Jan 8, 2022, at 18:51, Ben Kehoe  wrote:
> 
> Ben Kehoe  added the comment:
> 
> Happy to make a PR! In my mind I had been thinking it would be the 
> get_identifiers() method with the implementation above, returning a list.
> 
> As for __iter__, I'm less clear on what that would look like:
> 
> t = string.Template(...)
> for identifier in t:
>  # what would I do here?
>  # would it include repeats if they appear more than once in the template?
> 
> I guess there are two ways to think about it: one is "what identifiers are in 
> this template?" which I think should return a list with no repeats, which I 
> can then iterate over or check if a value is in it. The other is, "what are 
> the contents of the template?" in the style of string.Formatter.parse().
> 
> Given that string.Template is supposed to be the "simple, no-frills" thing in 
> comparison to string.Formatter, I see less use for the latter option.

--

___
Python tracker 

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



[issue46307] string.Template should allow inspection of identifiers

2022-01-08 Thread Ben Kehoe


Ben Kehoe  added the comment:

Happy to make a PR! In my mind I had been thinking it would be the 
get_identifiers() method with the implementation above, returning a list.

As for __iter__, I'm less clear on what that would look like:

t = string.Template(...)
for identifier in t:
  # what would I do here?
  # would it include repeats if they appear more than once in the template?

I guess there are two ways to think about it: one is "what identifiers are in 
this template?" which I think should return a list with no repeats, which I can 
then iterate over or check if a value is in it. The other is, "what are the 
contents of the template?" in the style of string.Formatter.parse().

Given that string.Template is supposed to be the "simple, no-frills" thing in 
comparison to string.Formatter, I see less use for the latter option.

--

___
Python tracker 

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



[issue46148] Optimize pathlib

2022-01-08 Thread Barney Gale


Change by Barney Gale :


--
nosy: +barneygale
nosy_count: 8.0 -> 9.0
pull_requests: +28697
pull_request: https://github.com/python/cpython/pull/30492

___
Python tracker 

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



[issue46307] string.Template should allow inspection of identifiers

2022-01-08 Thread Barry A. Warsaw


Barry A. Warsaw  added the comment:

I've never personally needed this, but I could see where it could come in handy.

I wonder if __iter__() would be the right API for that?  I wonder then if we 
should also implement __contains__()?

Would you be interested in creating a PR for the feature?

--

___
Python tracker 

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



[issue34602] python3 resource.setrlimit strange behaviour under macOS

2022-01-08 Thread Ned Deily


Ned Deily  added the comment:


New changeset b962544594c6a7c695330dd20fedffb3a1916ba6 by Miss Islington (bot) 
in branch '3.10':
bpo-34602: Fix unportable test(1) operator in configure script (GH-30490) 
(GH-30491)
https://github.com/python/cpython/commit/b962544594c6a7c695330dd20fedffb3a1916ba6


--

___
Python tracker 

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



[issue34602] python3 resource.setrlimit strange behaviour under macOS

2022-01-08 Thread miss-islington


Change by miss-islington :


--
pull_requests: +28696
pull_request: https://github.com/python/cpython/pull/30491

___
Python tracker 

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



[issue46308] Unportable test(1) operator in configure script

2022-01-08 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue46308] Unportable test(1) operator in configure script

2022-01-08 Thread Ned Deily


Ned Deily  added the comment:


New changeset 3d11c1b8b49800c5c4c295953cc3abf577f6065a by Thomas Klausner in 
branch 'main':
bpo-46308: Fix unportable test(1) operator in configure script (GH-30490)
https://github.com/python/cpython/commit/3d11c1b8b49800c5c4c295953cc3abf577f6065a


--
nosy: +ned.deily

___
Python tracker 

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



[issue34602] python3 resource.setrlimit strange behaviour under macOS

2022-01-08 Thread Thomas Klausner


Change by Thomas Klausner :


--
nosy: +wiz
nosy_count: 8.0 -> 9.0
pull_requests: +28694
pull_request: https://github.com/python/cpython/pull/30490

___
Python tracker 

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



[issue46307] string.Template should allow inspection of identifiers

2022-01-08 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
nosy: +barry

___
Python tracker 

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



[issue46309] Task created by StreamReaderProtocol gets garbage collected.

2022-01-08 Thread Simon Wrede


Change by Simon Wrede :


--
type:  -> behavior

___
Python tracker 

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



[issue46309] Task created by StreamReaderProtocol gets garbage collected.

2022-01-08 Thread Simon Wrede


New submission from Simon Wrede :

Documentation states that a reference must be kept when creating a task, 
https://docs.python.org/3/library/asyncio-task.html#asyncio.create_task.

This is not done in StreamReaderProtocol, 
https://github.com/python/cpython/blob/main/Lib/asyncio/streams.py#L244.

I've provided a simple example to force garbage collection of this task which 
results in `Task was destroyed but it is pending!`. Uncommenting the commented 
code of the example shows that the task is not destroyed when a reference is 
kept.

Am I missing something or using the library incorrectly? I've followed the 
examples at 
https://docs.python.org/3/library/asyncio-stream.html#tcp-echo-server-using-streams.

--
components: asyncio
files: example.py
messages: 410124
nosy: asvetlov, simwr872, yselivanov
priority: normal
severity: normal
status: open
title: Task created by StreamReaderProtocol gets garbage collected.
versions: Python 3.10
Added file: https://bugs.python.org/file50552/example.py

___
Python tracker 

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



[issue46291] [doc] First argument to raise can also be BaseException

2022-01-08 Thread Vedran Čačić

Vedran Čačić  added the comment:

Let me just say that I use `raise SystemExit` all the time. Beats `from sys 
import exit`, weird error messages about having to type parentheses, and surely 
beats "oh, am I on Windows so Ctrl+Z, or on Linux so Ctrl+D". :-]

I also use `raise KeyboardInterrupt` sometimes in games, to test whether Ctrl+C 
handling works as expected at precise moments in the game (beats having to 
guess the millisecond in which to press Ctrl+C:).

--
nosy: +veky

___
Python tracker 

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



[issue46304] Unable to iterate over lines in a file without a block of code

2022-01-08 Thread Eric V. Smith


Eric V. Smith  added the comment:

I can't believe I missed that, Jason. I even read it twice!

I think this could go in pathlib, along with read_text. Maybe read_lines, or 
iter_lines, or something. Of course PEP 533 is needed, too.

--

___
Python tracker 

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



[issue46308] Unportable test(1) operator in configure script

2022-01-08 Thread Thomas Klausner


Change by Thomas Klausner :


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

___
Python tracker 

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



[issue46279] [docs] Minor information-ordering issue in __main__ doc

2022-01-08 Thread Jackson Brummell


Jackson Brummell  added the comment:

Have updated the PR to be in line with the issues leading ideas, specifically 
Tal's suggestion.

Thanks

--

___
Python tracker 

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



[issue46308] Unportable test(1) operator in configure script

2022-01-08 Thread Thomas Klausner


New submission from Thomas Klausner :

The configure script uses the test(1) '==' operator, which is only supported by 
bash. The standard comparison operator is '='.

--
components: Installation
messages: 410120
nosy: wiz
priority: normal
severity: normal
status: open
title: Unportable test(1) operator in configure script
type: compile error
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



[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2022-01-08 Thread Guido van Rossum


Guido van Rossum  added the comment:

To close the loop, setuptools 60.4.0 should fix this, see 
https://github.com/pypa/setuptools/pull/3009.

--

___
Python tracker 

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



[issue46249] [sqlite3] lastrowid improvements

2022-01-08 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
title: [sqlite3] move set lastrowid out of the query loop and enable it for 
executemany() -> [sqlite3] lastrowid improvements

___
Python tracker 

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



[issue46304] Unable to iterate over lines in a file without a block of code

2022-01-08 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

Nice reference. Indeed, the 
[rationale](https://www.python.org/dev/peps/pep-0533/#id15) of that pep gives a 
similar example and the 
[background](https://www.python.org/dev/peps/pep-0533/#id3) describes the 
problem with the solution I've drafted above (it still depends on garbage 
collection to close the file).

I guess that means that in general, it's not possible to accomplish what I'd 
like.

As author of the PEP, I'm looping in njs.

--
nosy: +njs

___
Python tracker 

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



[issue46249] [sqlite3] move set lastrowid out of the query loop and enable it for executemany()

2022-01-08 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
pull_requests: +28692
pull_request: https://github.com/python/cpython/pull/30489

___
Python tracker 

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



[issue46249] [sqlite3] move set lastrowid out of the query loop and enable it for executemany()

2022-01-08 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

I see now that GH-30380 has grown a little bit out of scope, as it changes too 
many things at once:

1. Simplify the `execute()`/`executemany()` query loop
2. Create the lastrowid PyObject on demand, simplifying cursor GC
3. `lastrowid` is now available for all `execute*()` methods
4. The default value of `lastrowid` is now `0`

It will be easier to reason about and review each change separately.

--

___
Python tracker 

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



[issue46249] [sqlite3] move set lastrowid out of the query loop and enable it for executemany()

2022-01-08 Thread Erlend E. Aasland

Erlend E. Aasland  added the comment:

Marc-André: since Python 3.6, the sqlite3.Cursor.lastrowid attribute does no 
longer comply with the recommendations of PEP 249:

Previously, lastrowid was set to None for operations other than INSERT or 
REPLACE. This changed with ab994ed8b97e1b0dac151ec827c857f5e7277565 (in Python 
3.6), so that lastrowid is _unchanged_ for operations other than INSERT or 
REPLACE, and it is set to 0 after the first valid SQL (that is not 
INSERT/REPLACE) is executed on the cursor.

Now, PEP 249 only _recommends_ that lastrowid is set to None for operations 
that do not modify a row, so it's probably not a big deal. No-one has ever 
mentioned this change in behaviour; there have been no bug reports.

FTR, here is the relevant quote from PEP 249:

If the operation does not set a rowid or if the database does not support
rowids, this attribute should be set to None.

(I interpret "should" as understood by RFC 2119.)

So, my follow-up question becomes:
I see no point in reverting to pre Python 3.6 behaviour. I would rather change 
the default value to be 0 (to get rid of the dirty flag in GH-30380), and to 
make the behaviour more consistent with how the actual SQLite API behaves.


Do you have an opinion about such a change (in behaviour)?

--

___
Python tracker 

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



[issue46304] Unable to iterate over lines in a file without a block of code

2022-01-08 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

I think this might require something like PEP 533 in order to be safe.

--
nosy: +Dennis Sweeney

___
Python tracker 

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



[issue46304] Unable to iterate over lines in a file without a block of code

2022-01-08 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

Hi Eric. I did mention that option in my report, but that option requires 
loading the whole file into memory. I'd like something equivalent to the 
iterator that `open()` provides, which yields lines lazily.

Serihy, thanks for the feedback. I do indeed not want to rely on the implicit 
closing of the file handle. I'd instead like a helper function/method that will 
close the file after the iterator is consumed.

Something like:

def read_lines(path):
with path.open() as strm:
yield from strm

What I'm seeking is for that block to be placed somewhere in the stdlib so that 
I don't have to copy it into every project that needs/wants this behavior.

--
type:  -> enhancement

___
Python tracker 

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



[issue46306] Suspicious operation in `doctest.py`: `None - 1`

2022-01-08 Thread Eric V. Smith


Change by Eric V. Smith :


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



[issue46306] Suspicious operation in `doctest.py`: `None - 1`

2022-01-08 Thread Eric V. Smith


Eric V. Smith  added the comment:


New changeset 0fc58c1e051026baff4919d8519ce2aabe3b2ba1 by Nikita Sobolev in 
branch 'main':
bpo-46306: simplify `CodeType` attribute access in `doctest.py` (GH-30481)
https://github.com/python/cpython/commit/0fc58c1e051026baff4919d8519ce2aabe3b2ba1


--
nosy: +eric.smith

___
Python tracker 

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



[issue46307] string.Template should allow inspection of identifiers

2022-01-08 Thread Ben Kehoe


New submission from Ben Kehoe :

Currently, the only thing that can be done with a string.Template instance and 
a mapping is either attempt to substitute with substitute() and catch a 
KeyError if some identifier has not been provided in the mapping, or substitute 
with safe_substitute() and not know whether all identifiers were provided.

I propose adding a method that returns the identifiers in the template. Because 
the template string and pattern are exposed, this is already possible as a 
separate function:

def get_identifiers(template):
return list(
set(
filter(
lambda v: v is not None,
(mo.group('named') or mo.group('braced') 
 for mo in template.pattern.finditer(template.template))
)
)
)

However, this function is not easy for a user of string.Template to construct 
without learning how the template pattern works (which is documented but 
intended to be learned only when subclassing or modifying id patterns).

As a method on string.Template, this would enable use cases like more 
comprehensive error handling (e.g., finding all missing mapping keys at once) 
or interactive prompting.

--
components: Library (Lib)
messages: 410112
nosy: ben11kehoe
priority: normal
severity: normal
status: open
title: string.Template should allow inspection of identifiers
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



[issue46261] [doc] fix inaccuracies in sqlite3.Cursor.lastrowid docs

2022-01-08 Thread Tal Einat


Change by Tal Einat :


--
stage: patch review -> resolved

___
Python tracker 

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



[issue46261] [doc] fix inaccuracies in sqlite3.Cursor.lastrowid docs

2022-01-08 Thread Tal Einat


Tal Einat  added the comment:

Thanks for this, Erlend!

--
stage: resolved -> patch review

___
Python tracker 

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



[issue46261] [doc] fix inaccuracies in sqlite3.Cursor.lastrowid docs

2022-01-08 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


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



[issue46261] [doc] fix inaccuracies in sqlite3.Cursor.lastrowid docs

2022-01-08 Thread Tal Einat


Tal Einat  added the comment:


New changeset b29aa71090e4dd34900660ecca8bb62667440f41 by Miss Islington (bot) 
in branch '3.9':
[3.9] bpo-46261: Update `sqlite3.Cursor.lastrowid` docs (GH-30407)
https://github.com/python/cpython/commit/b29aa71090e4dd34900660ecca8bb62667440f41


--

___
Python tracker 

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



[issue46261] [doc] fix inaccuracies in sqlite3.Cursor.lastrowid docs

2022-01-08 Thread Tal Einat


Tal Einat  added the comment:


New changeset 987fba102e909229dd2aa1a6115aa28d514c1818 by Miss Islington (bot) 
in branch '3.10':
bpo-46261: Update `sqlite3.Cursor.lastrowid` docs (GH-30407)
https://github.com/python/cpython/commit/987fba102e909229dd2aa1a6115aa28d514c1818


--

___
Python tracker 

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



[issue46141] Fix ipaddress.ip_network TypeErrors

2022-01-08 Thread Tal Einat


Change by Tal Einat :


--
nosy: +pmoody, taleinat
stage:  -> patch review
status: pending -> open
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



[issue46301] Enum tests: One branch is not covered in `Enum._convert_`

2022-01-08 Thread Ethan Furman


Change by Ethan Furman :


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



[issue46301] Enum tests: One branch is not covered in `Enum._convert_`

2022-01-08 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset 8d59d2563b914b7208779834895c080c70cd94dd by Nikita Sobolev in 
branch 'main':
bpo-46301: [Enum] test uncomparable values in `_convert_` (GH-30472)
https://github.com/python/cpython/commit/8d59d2563b914b7208779834895c080c70cd94dd


--

___
Python tracker 

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



[issue46285] http/server.py wont respect its protocol_version

2022-01-08 Thread Hugo Almeida


Hugo Almeida  added the comment:

The short story is, everything is okay,
its my bad to taken the test function out of context,
sorry about that of issue report.

# just for details review (related file attached):
#
# check line 1277 to line 1278 (main branch of Python currently):
# https://github.com/python/cpython/blob/17b16e1/Lib/http/server.py#L1277-L1278
#
# thus, `functools.partial` (closure/wrapper) will
# make the parameter `protocol` of the function `test` useless.
# So, specify a handler class directly.

--
resolution: remind -> not a bug
stage:  -> resolved
status: open -> closed
Added file: https://bugs.python.org/file50551/my_http.py

___
Python tracker 

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



[issue46261] [doc] fix inaccuracies in sqlite3.Cursor.lastrowid docs

2022-01-08 Thread Tal Einat


Tal Einat  added the comment:


New changeset b6aa38f1ca79600f2ab46ac114ff36461a19c4a3 by Erlend Egeberg 
Aasland in branch 'main':
bpo-46261: Update `sqlite3.Cursor.lastrowid` docs (GH-30407)
https://github.com/python/cpython/commit/b6aa38f1ca79600f2ab46ac114ff36461a19c4a3


--
nosy: +taleinat

___
Python tracker 

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



[issue46261] [doc] fix inaccuracies in sqlite3.Cursor.lastrowid docs

2022-01-08 Thread miss-islington


Change by miss-islington :


--
pull_requests: +28691
pull_request: https://github.com/python/cpython/pull/30488

___
Python tracker 

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



[issue46261] [doc] fix inaccuracies in sqlite3.Cursor.lastrowid docs

2022-01-08 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue46305] SyntaxError when using dict key in fstring

2022-01-08 Thread Eric V. Smith


Eric V. Smith  added the comment:

Yes, the behavior is intentional. It might be relaxed in the future.

--
nosy: +eric.smith

___
Python tracker 

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



[issue46086] Add ratio_min() function to the difflib library

2022-01-08 Thread Tal Einat


Tal Einat  added the comment:

Thanks for the suggestion and the PR, Giacomo!

However, in my opinion, this is better suited to be something like a cookbook 
recipe.  The number of use cases for this will be low, and there would be 
little advantage to having this in the stdlib rather than elsewhere.

--
nosy: +taleinat

___
Python tracker 

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



[issue46290] Parameter names are inaccurate in dataclasses docs

2022-01-08 Thread Tal Einat


Tal Einat  added the comment:

Good to know Eric, will do!

--

___
Python tracker 

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



[issue46290] Parameter names are inaccurate in dataclasses docs

2022-01-08 Thread Eric V. Smith


Eric V. Smith  added the comment:

Thanks for committing this, @taleinat. But next time, if it's assigned to me, 
I'd like to review it first. Thanks!

--

___
Python tracker 

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



[issue46290] Parameter names are inaccurate in dataclasses docs

2022-01-08 Thread Tal Einat


Tal Einat  added the comment:

Thanks for the report and the PR, Zsolt!

--
nosy:  -miss-islington
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



[issue46290] Parameter names are inaccurate in dataclasses docs

2022-01-08 Thread miss-islington


miss-islington  added the comment:


New changeset cd95033d9c27d6c541dfd774b4c5eab4a70a23ab by Miss Islington (bot) 
in branch '3.9':
bpo-46290: Fix parameter names in dataclasses docs (GH-30450)
https://github.com/python/cpython/commit/cd95033d9c27d6c541dfd774b4c5eab4a70a23ab


--

___
Python tracker 

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



[issue46290] Parameter names are inaccurate in dataclasses docs

2022-01-08 Thread miss-islington


miss-islington  added the comment:


New changeset 8bef658668bac923166ae160c79720aed5f3b712 by Miss Islington (bot) 
in branch '3.10':
bpo-46290: Fix parameter names in dataclasses docs (GH-30450)
https://github.com/python/cpython/commit/8bef658668bac923166ae160c79720aed5f3b712


--

___
Python tracker 

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



[issue46227] add pathlib.Path.walk method

2022-01-08 Thread Stanislav Zmiev


Stanislav Zmiev  added the comment:

Thanks for the tip! Hopefully, I created it correctly:
https://discuss.python.org/t/add-pathlib-path-walk-method/

It is currently on review.

--

___
Python tracker 

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



[issue45925] Upgrade macOS and Windows installers to use SQLite 3.37.2

2022-01-08 Thread Kumar Aditya


Change by Kumar Aditya :


--
keywords: +patch
nosy: +kumaraditya303
nosy_count: 7.0 -> 8.0
pull_requests: +28689
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30485

___
Python tracker 

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



[issue40479] Port _hashlib to OpenSSL 3.0.0

2022-01-08 Thread Christian Heimes


Christian Heimes  added the comment:

Simple benchmark with openssl-3.0.0-5.el9.x86_64

With custom EVP_MD cache:
$ ./python -m timeit -s "from hashlib import md5" "md5(b'12345678', 
usedforsecurity=False).digest()"50 loops, best of 5: 520 nsec per loop
$ ./python -m timeit -s "from hashlib import sha512" "sha512(b'12345678', 
usedforsecurity=False).digest()"
50 loops, best of 5: 730 nsec per loop

Without EVP_MD cache:
$ ./python -m timeit -s "from hashlib import md5" "md5(b'', 
usedforsecurity=False).digest()"
50 loops, best of 5: 807 nsec per loop
$ ./python -m timeit -s "from hashlib import sha512" "sha512(b'12345678', 
usedforsecurity=False).digest()"
20 loops, best of 5: 1.03 usec per loop

--

___
Python tracker 

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



[issue46302] IndexError inside list comprehension + workaround

2022-01-08 Thread Pierre Fortin


Pierre Fortin  added the comment:

[Thanks for the replies! I was trying to post this before seeing them.]

Major egg on face...
The more complex the code becomes, the more likely you will be burned by a 
rookie mistake...
var = ''
var[0]  WILL give IndexError  -- Duh!
It was buried in the each.split('=') returning an empty string -- that's what 
you get for making things easier for the user. 
The easier code is to use, the more complex it must be...

Sorry for the noise.

--

___
Python tracker 

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



[issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with subinterpreters

2022-01-08 Thread STINNER Victor


Change by STINNER Victor :


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



[issue46303] _Py_stat and _Py_wstat using incorrect type for status argument

2022-01-08 Thread STINNER Victor


STINNER Victor  added the comment:

It's not the first time that private functions included by the public Python.h 
are causing build errors event if these functions are not used. The previous 
issue were functions for atomic operations. I solved this build error by moving 
the whole private C API into the internal C API: 
Include/internal/pycore_atomic.h. Since that time, we no longer got build error 
related to this header file.

I propose a similar fix: move all private fileutils.h functions from 
Include/cpython/fileutils.h to the internal Include/internal/pycore_fileutils.h.

I wrote PR 30484 to implement this change.

To keep the implementation simple, I kept _Py_fopen_obj() in 
Include/cpython/fileutils.h, for _testcapi which must not use the internal C 
API.

If this PR is merged, for Python 3.9 and 3.10, I will write a simpler change: 
modify Include/cpython/fileutils.h to only define functions using "struct stat" 
in the internal C API (if Py_BUILD_CORE is defined).

--

___
Python tracker 

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



[issue46303] _Py_stat and _Py_wstat using incorrect type for status argument

2022-01-08 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +28688
pull_request: https://github.com/python/cpython/pull/30484

___
Python tracker 

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



[issue46306] Suspicious operation in `doctest.py`: `None - 1`

2022-01-08 Thread Alex Waygood


Change by Alex Waygood :


--
title: Suspicios operation in `doctest.py`: `None - 1` -> Suspicious operation 
in `doctest.py`: `None - 1`

___
Python tracker 

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



[issue46290] Parameter names are inaccurate in dataclasses docs

2022-01-08 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 4.0 -> 5.0
pull_requests: +28686
pull_request: https://github.com/python/cpython/pull/30482

___
Python tracker 

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



[issue46290] Parameter names are inaccurate in dataclasses docs

2022-01-08 Thread miss-islington


Change by miss-islington :


--
pull_requests: +28687
pull_request: https://github.com/python/cpython/pull/30483

___
Python tracker 

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



[issue46290] Parameter names are inaccurate in dataclasses docs

2022-01-08 Thread Tal Einat


Tal Einat  added the comment:


New changeset ef5376e69e72fa922d7f1b3df47b99d3576f9df1 by Zsolt Dollenstein in 
branch 'main':
bpo-46290: Fix parameter names in dataclasses docs (GH-30450)
https://github.com/python/cpython/commit/ef5376e69e72fa922d7f1b3df47b99d3576f9df1


--

___
Python tracker 

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



[issue46306] Suspicios operation in `doctest.py`: `None - 1`

2022-01-08 Thread Nikita Sobolev


Change by Nikita Sobolev :


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

___
Python tracker 

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



[issue46279] [docs] Minor information-ordering issue in __main__ doc

2022-01-08 Thread FeRD (Frank Dana)

FeRD (Frank Dana)  added the comment:

Maybe,

"""
This won’t work for __main__.py files in the root directory of a .zip file 
though. Thus, for consistency, it is usually preferred to place code in other 
modules. That code can then be invoked from a minimal ``__main__.py``.
"""

(And then the see-also opens, "See venv for an example of a package with a 
minimal __main__.py in the standard library." which is a natural extension of 
the discussion.)

@taleinat's suggestion works as well (crossed streams).

--
nosy:  -taleinat

___
Python tracker 

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



[issue46306] Suspicios operation in `doctest.py`: `None - 1`

2022-01-08 Thread Nikita Sobolev

New submission from Nikita Sobolev :

This line `lineno = getattr(obj, 'co_firstlineno', None)-1` does not look good. 
Link: 
https://github.com/python/cpython/blame/45d44b950f1dab0ef90d0a8f4fa75ffaae71500b/Lib/doctest.py#L1116

Why? 
1. `CodeType` is guaranteed to have `co_firstlineno`. Docs: 
https://github.com/python/cpython/blob/45d44b950f1dab0ef90d0a8f4fa75ffaae71500b/Lib/inspect.py#L487
2. Even if it does not have it for some reason, this `getattr` does not help. 
It raises unhandled `TypeError`. We can simulate it by replacing `lineno = 
getattr(obj, 'co_firstlineno', None)-1` with `lineno = None-1`

Here's what happens in this case:

```
» ./python.exe -m test -v test_doctest
== CPython 3.11.0a3+ (heads/issue-26767:45d44b950f, Jan 8 2022, 12:23:45) 
[Clang 11.0.0 (clang-1100.0.33.16)]
== Darwin-18.7.0-x86_64-i386-64bit little-endian
== cwd: /Users/sobolev/Desktop/cpython/build/test_python_78065æ
== CPU count: 4
== encodings: locale=UTF-8, FS=utf-8
0:00:00 load avg: 3.51 Run tests sequentially
0:00:00 load avg: 3.51 [1/1] test_doctest
Failed to call load_tests:
Traceback (most recent call last):
  File "/Users/sobolev/Desktop/cpython/Lib/unittest/loader.py", line 108, in 
loadTestsFromModule
return load_tests(self, tests, pattern)
   
  File "/Users/sobolev/Desktop/cpython/Lib/test/test_doctest.py", line 3134, in 
load_tests
tests.addTest(doctest.DocTestSuite(doctest))
  ^
  File "/Users/sobolev/Desktop/cpython/Lib/doctest.py", line 2391, in 
DocTestSuite
tests = test_finder.find(module, globs=globs, extraglobs=extraglobs)

  File "/Users/sobolev/Desktop/cpython/Lib/doctest.py", line 940, in find
self._find(tests, obj, name, module, source_lines, globs, {})
^
  File "/Users/sobolev/Desktop/cpython/Lib/doctest.py", line 1013, in _find
self._find(tests, val, valname, module, source_lines,
^
  File "/Users/sobolev/Desktop/cpython/Lib/doctest.py", line 1001, in _find
test = self._get_test(obj, name, module, globs, source_lines)
   ^^
  File "/Users/sobolev/Desktop/cpython/Lib/doctest.py", line 1069, in _get_test
lineno = self._find_lineno(obj, source_lines)
 
  File "/Users/sobolev/Desktop/cpython/Lib/doctest.py", line 1117, in 
_find_lineno
None - 1
~^~~
TypeError: unsupported operand type(s) for -: 'NoneType' and 'int'

test test_doctest crashed -- Traceback (most recent call last):
  File "/Users/sobolev/Desktop/cpython/Lib/test/libregrtest/runtest.py", line 
352, in _runtest_inner
refleak = _runtest_inner2(ns, test_name)
  ^^
  File "/Users/sobolev/Desktop/cpython/Lib/test/libregrtest/runtest.py", line 
309, in _runtest_inner2
test_runner()
^
  File "/Users/sobolev/Desktop/cpython/Lib/test/libregrtest/runtest.py", line 
272, in _test_module
raise Exception("errors while loading tests")
^
Exception: errors while loading tests

test_doctest failed (uncaught exception)

== Tests result: FAILURE ==

1 test failed:
test_doctest

Total duration: 1.0 sec
Tests result: FAILURE
```

So, we have two options:
1. Think of a case when `CodeType` does not have `co_firstlineno` and handle it 
properly, like using `0` or `None` as `lineno`
2. Simplify this line to remove potential `TypeError`

I think that this line should be rewritten as `lineno = obj.co_firstlineno - 1`

I will send a PR for others to judge.

--
components: Library (Lib)
messages: 410092
nosy: sobolevn
priority: normal
severity: normal
status: open
title: Suspicios operation in `doctest.py`: `None - 1`
type: behavior
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



[issue46279] [docs] Minor information-ordering issue in __main__ doc

2022-01-08 Thread Tal Einat

Tal Einat  added the comment:

I agree that it seems better to avoid menntioning venv in that sentence. 
Specifically I suggest:

This won’t work for __main__.py files in the root directory of a .zip file 
though. Hence, for consistency, minimal __main__.py without a __name__ check 
are preferred.

--
nosy: +taleinat

___
Python tracker 

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



[issue46242] Improve error message when attempting to extend an enum with `__call__`

2022-01-08 Thread Alex Waygood


Change by Alex Waygood :


--
assignee:  -> ethan.furman

___
Python tracker 

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



[issue46303] _Py_stat and _Py_wstat using incorrect type for status argument

2022-01-08 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +vstinner

___
Python tracker 

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



[issue46304] Unable to iterate over lines in a file without a block of code

2022-01-08 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

A warning is an indication of possible bugs in your code. If you do not close 
file explicitly, and it is closed by the garbage collector, the time of closing 
is undeterminated. This can lead to exhausting of file descriptors if you have 
a lot of opened files waiting for closing in reference loops.

If you want to get rid of warnings, use a corresponding warning filter for 
ignoring specific warnings. Or better rewrite your code in a way that file 
closing is deterministic.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue46290] Parameter names are inaccurate in dataclasses docs

2022-01-08 Thread Tal Einat


Tal Einat  added the comment:

Indeed, the argument name in the code is "obj", and in 3 of those 4 functions 
it is a normal (positional or keyword) argument, so the name is important.

--
assignee: eric.smith -> taleinat
nosy: +taleinat

___
Python tracker 

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



[issue46279] [docs] Minor information-ordering issue in __main__ doc

2022-01-08 Thread FeRD (Frank Dana)

FeRD (Frank Dana)  added the comment:

TBH, personally I don't think I'd just reword it with "below". That seems like 
the path of least resistance, but then the sentence becomes this:

"""
This won’t work for __main__.py files in the root directory of a .zip file 
though. Hence, for consistency, minimal __main__.py like the venv one mentioned 
below are preferred.
"""

Doesn't really track. How can you draw conclusions ("Hence...") from something 
that hasn't even been discussed yet?

It might actually be better to just drop the mention of venv from that 
particular sentence. The see-also text introduces *itself* as an example of 
what was just discussed. There's no real reason to bring it up ahead of time, 
because the see-also already flows naturally from the previous discussion 
without any setup.

--

___
Python tracker 

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



[issue46279] [docs] Minor information-ordering issue in __main__ doc

2022-01-08 Thread Jackson Brummell


Jackson Brummell  added the comment:

Updating issue, Have submitted fix

--

___
Python tracker 

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



[issue46279] [docs] Minor information-ordering issue in __main__ doc

2022-01-08 Thread Jackson Brummell


Change by Jackson Brummell :


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

___
Python tracker 

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



[issue46279] [docs] Minor information-ordering issue in __main__ doc

2022-01-08 Thread Jackson Brummell


Jackson Brummell  added the comment:

It seems this is a simple miswording, where the word 'above' is used when the 
see below example clarifies BELOW the text.

I will create a pull request within the hour

--
nosy: +jacksonbrummell1

___
Python tracker 

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



[issue46305] SyntaxError when using dict key in fstring

2022-01-08 Thread Samisafool


Samisafool  added the comment:

Huh, it does seem to be intentional.

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



[issue46223] asyncio cause infinite loop during debug

2022-01-08 Thread Nikita Sobolev


Nikita Sobolev  added the comment:

Just to clarify.

What do you mean by "When running code in debug mode"?
Do you use some debugger like `pdb` or pycharm?

--
nosy: +sobolevn

___
Python tracker 

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



[issue46305] SyntaxError when using dict key in fstring

2022-01-08 Thread Samisafool


Samisafool  added the comment:

Is that intended behaviour? It works though.

--

___
Python tracker 

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



[issue46305] SyntaxError when using dict key in fstring

2022-01-08 Thread Nikita Sobolev


Nikita Sobolev  added the comment:

Can you please try this:

```
dict1 = {
"key1": "test"
}

print(dict1["key1"])

print(f"key1 is {dict1['key1']}!")
```

The problem with your code is that `dict1["key1"]` used the same quotes as 
`f""`.

--
nosy: +sobolevn

___
Python tracker 

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



[issue46299] Improve several exception handling practices in `test_descr.py`

2022-01-08 Thread Dong-hee Na


Change by Dong-hee Na :


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



[issue46299] Improve several exception handling practices in `test_descr.py`

2022-01-08 Thread Dong-hee Na


Dong-hee Na  added the comment:


New changeset 45d44b950f1dab0ef90d0a8f4fa75ffaae71500b by Dong-hee Na in branch 
'main':
bpo-46299: Improve test_descr (GH-30475)
https://github.com/python/cpython/commit/45d44b950f1dab0ef90d0a8f4fa75ffaae71500b


--

___
Python tracker 

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