[issue25094] [EASY][Windows] test_tools fails on Windows when passing

2021-05-04 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests:  -24577

___
Python tracker 

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



[issue44039] Duplicated assignment in Modules/_randommodule.c

2021-05-04 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue44043] 3.10 b1 armhf Bus Error in hashlib test: test_gil

2021-05-04 Thread Anthony Sottile


New submission from Anthony Sottile :

terribly sorry, I don't have much information to go off on this other than the 
build logs from deadsnakes.

I retried this build twice and it seems it consistently fails in this position:

https://launchpadlibrarian.net/537139233/buildlog_ubuntu-bionic-armhf.python3.10_3.10.0~b1-1+bionic2_BUILDING.txt.gz

The relevant logs from the build:

```
./python -m test --pgo --timeout=1200 || true
0:00:00 load avg: 2.37 Run tests sequentially (timeout: 20 min)
0:00:00 load avg: 2.37 [ 1/44] test_array
0:00:11 load avg: 2.23 [ 2/44] test_base64
0:00:15 load avg: 2.13 [ 3/44] test_binascii
0:00:16 load avg: 2.13 [ 4/44] test_binop
0:00:17 load avg: 2.13 [ 5/44] test_bisect
0:00:18 load avg: 2.13 [ 6/44] test_bytes
0:01:18 load avg: 1.41 [ 7/44] test_bz2 -- test_bytes passed in 1 min
0:01:25 load avg: 1.35 [ 8/44] test_cmath
0:01:28 load avg: 1.35 [ 9/44] test_codecs
0:01:52 load avg: 1.23 [10/44] test_collections
0:02:10 load avg: 1.16 [11/44] test_complex
0:02:16 load avg: 1.15 [12/44] test_dataclasses
0:02:23 load avg: 1.14 [13/44] test_datetime
0:03:18 load avg: 1.09 [14/44] test_decimal -- test_datetime passed in 54.9 sec
0:05:06 load avg: 1.01 [15/44] test_difflib -- test_decimal passed in 1 min 47 
sec
0:05:24 load avg: 1.01 [16/44] test_embed
0:05:27 load avg: 1.01 [17/44] test_float
0:05:32 load avg: 1.01 [18/44] test_fstring
0:05:43 load avg: 1.00 [19/44] test_functools
0:05:47 load avg: 1.00 [20/44] test_generators
0:05:51 load avg: 1.00 [21/44] test_hashlib
Fatal Python error: Bus error

Current thread 0xf7901220 (most recent call first):
  File "/<>/Lib/test/test_hashlib.py", line 842 in test_gil
  File "/<>/Lib/unittest/case.py", line 549 in _callTestMethod
  File "/<>/Lib/unittest/case.py", line 592 in run
  File "/<>/Lib/unittest/case.py", line 652 in __call__
  File "/<>/Lib/unittest/suite.py", line 122 in run
  File "/<>/Lib/unittest/suite.py", line 84 in __call__
  File "/<>/Lib/unittest/suite.py", line 122 in run
  File "/<>/Lib/unittest/suite.py", line 84 in __call__
  File "/<>/Lib/unittest/suite.py", line 122 in run
  File "/<>/Lib/unittest/suite.py", line 84 in __call__
  File "/<>/Lib/test/support/testresult.py", line 169 in run
  File "/<>/Lib/test/support/__init__.py", line 959 in _run_suite
  File "/<>/Lib/test/support/__init__.py", line 1082 in 
run_unittest
  File "/<>/Lib/test/libregrtest/runtest.py", line 210 in 
_test_module
  File "/<>/Lib/test/libregrtest/runtest.py", line 246 in 
_runtest_inner2
  File "/<>/Lib/test/libregrtest/runtest.py", line 282 in 
_runtest_inner
  File "/<>/Lib/test/libregrtest/runtest.py", line 154 in _runtest
  File "/<>/Lib/test/libregrtest/runtest.py", line 194 in runtest
  File "/<>/Lib/test/libregrtest/main.py", line 423 in 
run_tests_sequential
  File "/<>/Lib/test/libregrtest/main.py", line 521 in run_tests
  File "/<>/Lib/test/libregrtest/main.py", line 694 in _main
  File "/<>/Lib/test/libregrtest/main.py", line 641 in main
  File "/<>/Lib/test/libregrtest/main.py", line 719 in main
  File "/<>/Lib/test/__main__.py", line 2 in 
  File "/<>/Lib/runpy.py", line 86 in _run_code
  File "/<>/Lib/runpy.py", line 196 in _run_module_as_main
```

--
components: Build
messages: 392973
nosy: Anthony Sottile
priority: normal
severity: normal
status: open
title: 3.10 b1 armhf Bus Error in hashlib test: test_gil
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



[issue14965] super() and property inheritance behavior

2021-05-04 Thread wyz23x2


Change by wyz23x2 :


--
components: +Interpreter Core -Extension Modules
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.7

___
Python tracker 

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



[issue44039] Duplicated assignment in Modules/_randommodule.c

2021-05-04 Thread Raymond Hettinger


Change by Raymond Hettinger :


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



[issue25094] [EASY][Windows] test_tools fails on Windows when passing

2021-05-04 Thread miss-islington


Change by miss-islington :


--
pull_requests: +24577
pull_request: https://github.com/python/cpython/pull/25909

___
Python tracker 

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



Unsubscribe/can't login

2021-05-04 Thread Rasig Kosonmontri
Hi I wanted to unsubscribe from the python mailing list because I has been
sending me countless mails over the months but when I try to login on my
browser it doesn't recognize this email as a user even though the mails
that are coming it are to this email address
If there's anything thing to fix or anyway to do this manually please let
me know
Thanks
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue44039] Duplicated assignment in Modules/_randommodule.c

2021-05-04 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Just curious, how did you find this?

--

___
Python tracker 

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



[issue44039] Duplicated assignment in Modules/_randommodule.c

2021-05-04 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
assignee:  -> rhettinger
nosy: +rhettinger

___
Python tracker 

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



Re: uninstall

2021-05-04 Thread Chris Nyland
So it seems counter intuitive but you might also have luck just
reinstalling Python3.8 back over top. If the uninstall was botch then that
should put everything back in place and then you can just run the uninstall
again and see if it clears out this time. Otherwise I agree with stack
overflow you can just go in and do it manually. If you have multiple Python
installs I would recommend make sure to use the py launcher instead of
adding any of the Pythons to the Windows path. I also don't like the new
default install location in the program folders for development machines
and find that it can sometimes cause conflicts so for those machines where
I need multiple versions I still install Python on the root of the the C
drive or and additional hard drive and name the folders PythonXX_32 or 64
depending on the type of install where XX is of course the major and minor
version 36, 37, 38 etc. Then I use py -3.6 and so on to execute the
different installs from the command line.

On Tue, May 4, 2021 at 2:10 AM Sian Doherty  wrote:

> Thanks for the advice. I found a stack overflow post that suggested just
> removing manually and cleaning out the registry too. I think I have it
> under control but I haven't gotten around to reinstalling it yet.
>
> On Sun, 2 May 2021, 10:05 Mats Wichmann,  wrote:
>
> > On 4/29/21 6:59 PM, Sian Doherty wrote:
> > > I’m trying to uninstall Python 3.8.5 on Windows 10 Pro 20H2 as I had
> > multiple environments and as a result corrupted them.
> > >
> > > When I uninstall from control panel, it takes less than a second and
> > says it uninstalled successfully but I can still access python through
> the
> > command prompt by typing python.
> > >
> > > Is there a different way to uninstall that isn’t through the control
> > panel? I would have thought I would do that and then clean out the
> registry
> > separately and the %localappdata%\pip folder.
> > >
> > > Any thoughts?
> >
> > There are some uninstall tools, of varying quality. Some depend on you
> > having been running them while the install happened, which is probably
> > not the case for you. Once you've messed up Windows' idea of the install
> > subsystem, it's not that easy to recover. Though some may disagree,
> > that's not really Python's fault, the install system seems pretty
> > fragile.  Sometimes if the the files needed to process the uninstall
> > have been removed but the uninstall itself didn't finish you're in
> > trouble - which isn't really the fault of the install system, but then
> > you ask how that scenario arose? anyway...
> >
> > You could look for this tool:
> > MicrosoftProgram_Install_and_Uninstall.meta.diagcab - an Internet search
> > should find it. it usually does a fairly good job of cleaning up messes
> > (well - it's worked well for me in a few dire situations).
> >
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Transistion from module to package and __init__.py

2021-05-04 Thread Chris Nyland
Hello,

I have a design question that for me primarily occurs when I have a module
that needs to transition to a package. Lets assume I have module that
services a database. Initially the module just has some functions to pull
data out of the database format them etc. As the project grows I add tables
some of the tables have static data or initialization data that are stored
in CSVs. I build functions that initialize the database a schema file is
now used. Now my module is still the only Python code file I have but I
have these other data files the module needs, time to make a package. So
naturally I make a package folder called database, put and empty
__init__.py, in goes my database module and all resource files. Here is
where I my primary design question comes in. As organized now as described
to import and use the package I need

from database import database

or I have to put in the init file

from database import *

Either of these still leaves a database.database namespace laying about and
to me it just seems untidy. So for a while now I have taken to converting
my module, in this example database.py, to the __init__.py of the package.
I remember reading years back that having code in the __init__.py was bad
practice but I can't remember reading for any specific reason. So then I
ask is there anything in fact wrong with this practice? I have probably a
dozen packages now that are used internal to my organization that follow
this pattern and I haven't encountered any issues. So I was hoping to get
feed back from a wider audience about if there are any issues with this
type of design that I just haven't encounter yet or find out what other
people do with this same problem.

Thanks

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


[issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs.

2021-05-04 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

Both Django and Botocore issues appear to be in the category of: "depending on 
invalid data being passed through our urlsplit API so that they could look for 
it later"  Not much sympathy.  We never guaranteed we'd pass invalid data 
through.  They're depending on an implementation detail (Hyrum's law).  Invalid 
data causes other people who don't check for it problems.  There is no valid 
solution on our end within the stdlib that won't frustrate somebody.

We chose to move towards safer (undoubtedly not perfect) by default.

Instead of the patches as you see them, we could've raised an exception.  I'm 
sure that would also also have tripped up existing code depending on the 
undesirable behavior.

If one wants to reject invalid data as an application/library/framework, they 
need a validator.  The Python stdlib does not provide a URL validation API.  
I'm not convinced we would even want to (though that could be something 
issue43883 winds up providing) given how perilous that is to get right: Who's 
version of right? which set of standards? when and why? Conclusion: The web... 
such a mess.

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



[issue43933] Regression in python3.10 with traceback frame having lineno of -1

2021-05-04 Thread Ned Batchelder


Ned Batchelder  added the comment:

Mark, I'm not clear if the line number can still be None in some circumstances. 

With this code (from site.py in the stdlib):

545: def execsitecustomize():
546: """Run custom site specific code, if available."""
547: try:
548: try:
549: import sitecustomize
550: except ImportError as exc:
551: if exc.name == 'sitecustomize':
552: pass
553: else:
554: raise
555: except Exception as err:
556: if sys.flags.verbose:
557: sys.excepthook(*sys.exc_info())
558: else:
559: sys.stderr.write(
560: "Error in sitecustomize; set PYTHONVERBOSE for 
traceback:\n"
561: "%s: %s\n" %
562: (err.__class__.__name__, err))

I get traces with these events and line numbers:

exception 549 (ModuleNotFoundError("No module named 'sitecustomize'"))
line 550
line 551
line 552
return None

Is this what you expected?

--

___
Python tracker 

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



[issue43883] Making urlparse WHATWG conformant

2021-05-04 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

FWIW rather than implementing our own URL parsing at all... wrapping a library 
extracted from a compatible-license major browser (Chromium or Firefox) and 
keeping it updated would avoid disparities.

Unfortunately, I'm not sure how feasible this really is.  Do all of the API 
surfaces we must support in the stdlib for compatibility's sake with urllib 
line up with such a browser core URL parsing library?

Something to ponder.  Unlikely something we'll actually do.

--

___
Python tracker 

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



[issue44026] IDLE: print "Did you mean?" for AttributeError and NameError

2021-05-04 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

I unfortunately don't have the time/internet access this week to do a PR.

--

___
Python tracker 

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



[issue42367] Restore os.makedirs ability to apply mode to all directories created

2021-05-04 Thread JustAnotherArchivist


Change by JustAnotherArchivist :


--
nosy: +JustAnotherArchivist

___
Python tracker 

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



[issue29842] Make Executor.map work with infinite/large inputs correctly

2021-05-04 Thread Leonard Lausen


Change by Leonard Lausen :


--
nosy: +leezu

___
Python tracker 

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



[issue44042] [sqlite3] _pysqlite_connection_begin() optimisations

2021-05-04 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


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

___
Python tracker 

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



[issue44042] [sqlite3] _pysqlite_connection_begin() optimisations

2021-05-04 Thread Erlend Egeberg Aasland


New submission from Erlend Egeberg Aasland :

The following optimisations can be applied to _pysqlite_connection_begin():

1. Return an int instead of a PyObject pointer

   Per now, we do Py_RETURN_NONE and Py_DECREF(result) if 
_pysqlite_connection_begin() was successful (normally the case). There's no 
reason to do this. Let's just it the C way: return -1 on error and 0 if things 
are ok.


2. Defer error checking till post sqlite3_finalize()

   Any error code returned by sqlite3_step() will also be returned by 
sqlite3_finalize() for the same statement. From the SQLite docs:
   "If the most recent evaluation of statement S failed, then 
sqlite3_finalize(S) returns the appropriate error code or extended error code."


3. Move _pysqlite_connection_begin() to Modules/_sqlite/cursor.c

   The single use is in _pysqlite_query_execute() in cursor.c. Moving it makes 
it possible for the compiler to apply more optimisations. At least so I've 
heard :)
   (As a side effect, the namespace will be cleaner.)

--
messages: 392967
nosy: berker.peksag, erlendaasland, serhiy.storchaka
priority: normal
severity: normal
status: open
title: [sqlite3]  _pysqlite_connection_begin() optimisations
type: performance
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



[issue44026] IDLE: print "Did you mean?" for AttributeError and NameError

2021-05-04 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Pablo, unless you are suggesting rewriting IDLE's custom exception handing in 
C, I don't see how making it a single function would be an improvement.  As 
long as it is Python code, the problem is accessing the message supplement.

After reading your comment, I agree that injecting Python code into the C 
exception handling is a bad idea.  It also, I see now, not needed

run.print_exception first calls traceback.extract_tb (line 238).  The doc says 
" It is useful for alternate formatting of stack traces", which IDLE does.  
print_exception next calls the undocumented traceback.print_list, which is 
format_list + print*.  Finally, print_exception calls 
traceback.format_exception_only (line 2440), which returns a list of lines that 
is immediately printed.

So all IDLE needs is for format_exception_only to include the extra lines, 
either by default or by option.  But it just calls 
TracebackException.format_exception)only, which call a private Python-coded 
function, which can only add the lines if accessible from Python-code.

Dennis cleverly pointed out that such access is available, even if awkwardly, 
by capturing the standard excepthook outout and keeping only the missing part.  
(test.support.captured_stderr just wraps io.StringIO as a context manager.  
IDLE can borrow and edits its code.)

Dennis, would you like to prepare a PR that follows the format_exception_only 
call with something like

if isinstance(typ, (AttributeError, NameError)):
lines.extend(extract_extra_message())

and a definition of the new function?  (and a new test)?  Or perhaps better, 
replace format_exception_only with a function that gets all lines at once.

Pablo, do any other exception types have such omitted help info?  Do you have 
plans for any more?

--
title: IDLE doesn't offer "Did you mean?" for AttributeError and NameError -> 
IDLE: print "Did you mean?" for AttributeError and NameError

___
Python tracker 

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



[issue43192] Argparse complains argument required when default is provided

2021-05-04 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> Specifying a 'default' with a positional doesn't make much sense.

That was my thought as well.  Perhaps that is worth a note in the docs but 
there is likely no real need to change the behavior.

--
nosy: +rhettinger

___
Python tracker 

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



[issue44041] [sqlite3] optimisation: only call sqlite3_column_count when needed

2021-05-04 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


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

___
Python tracker 

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



[issue44041] [sqlite3] optimisation: only call sqlite3_column_count when needed

2021-05-04 Thread Erlend Egeberg Aasland


New submission from Erlend Egeberg Aasland :

Pr. now, we call sqlite3_column_count() for every iteration in the 
_pysqlite_query_execute() loop. If detect_types is set, we call it twice for 
every loop.

Suggesting to move it out of the loop and into the pysqlite_Statement object. 
In pysqlite_statement_create(), after sqlite3_prepare_v2(), if self->is_dml == 
0 we fetch the column count: self->column_count = sqlite3_column_count(). Else, 
it's 0.


# SQLite API interaction examples (pseudo-code), as diffs
--- now
+++ patched

## Create table
 sqlite3_prepare_v2
+sqlite3_column_count
 sqlite3_bind_blob_parameter_count
 sqlite3_step
-sqlite3_column_count
 sqlite3_last_insert_rowid
 sqlite3_reset

## Triple insert (executemany)
 sqlite3_prepare_v2
 sqlite3_get_autocommit
 sqlite3_bind_blob_parameter_count
 sqlite3_bind_int64
 sqlite3_step
-sqlite3_column_count
 sqlite3_changes
 sqlite3_reset
 sqlite3_bind_blob_parameter_count
 sqlite3_bind_int64
 sqlite3_step
-sqlite3_column_count
 sqlite3_changes
 sqlite3_reset
 sqlite3_bind_blob_parameter_count
 sqlite3_bind_int64
 sqlite3_step
-sqlite3_column_count
 sqlite3_changes
 sqlite3_reset

--
components: Extension Modules
messages: 392964
nosy: berker.peksag, erlendaasland, serhiy.storchaka
priority: normal
severity: normal
status: open
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



[issue40521] [subinterpreters] Make free lists and unicode caches per-interpreter

2021-05-04 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
pull_requests: +24574
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/25906

___
Python tracker 

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



[issue43583] make test failures, 2 tests failed: test_embed test_tabnanny

2021-05-04 Thread Alexei S

Alexei S  added the comment:

i rename folder and tried
python3 -m '~/Загрузки/Python-389/Lib/test/test_embed' -v

/usr/bin/python3: No module named ~/Загрузки/Python-389/Lib/test/test_embed

???

--

___
Python tracker 

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



[issue43583] make test failures, 2 tests failed: test_embed test_tabnanny

2021-05-04 Thread Alexei S

Alexei S  added the comment:

python3 -m ~/Загрузки/Python-3.8.9/Lib/test/test_embed -v
/usr/bin/python3: Error while finding module specification for 
'/home/alexei/Загрузки/Python-3.8.9/Lib/test/test_embed' (ModuleNotFoundError: 
No module named '/home/alexei/Загрузки/Python-3')

it doesn't recognize '-' ??

--

___
Python tracker 

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



[issue44040] Update broken link in pathlib source

2021-05-04 Thread Kevin Follstad


Change by Kevin Follstad :


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

___
Python tracker 

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



[issue44031] python3.8.9, python3.9.2 test_embed test_tabnanny failed

2021-05-04 Thread Alexei S


Alexei S  added the comment:

the same issue also in
https://bugs.python.org/issue43583

--

___
Python tracker 

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



[issue44040] Update broken link in pathlib source

2021-05-04 Thread Kevin Follstad


New submission from Kevin Follstad :

Update broken link (repeated in several places) in pathlib sources.

- # (see https://bitbucket.org/pitrou/pathlib/issue/12/)
+ # (see 
http://web.archive.org/web/20200623061726/https://bitbucket.org/pitrou/pathlib/issues/12/
 )

--
assignee: docs@python
components: Documentation
messages: 392960
nosy: docs@python, kfollstad
priority: normal
severity: normal
status: open
title: Update broken link in pathlib source
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



[issue44037] Broad performance regression from 3.10a7 to 3.10b1 with python.org macOS binaries

2021-05-04 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> There is no reason to suspect a general Python performance regression
> on this benchmark between a7 and b1.

Pablo just ran the same benchmarks on Arch Linux and did not observe the 
degradation, so this does seem specific to the macOS build.

--
nosy: +ronaldoussoren

___
Python tracker 

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



[issue43121] Incorrect SyntaxError message for missing comma (3.10.a5)

2021-05-04 Thread Alex Hall


Alex Hall  added the comment:

Pablo, check out https://github.com/aroberge/friendly/discussions/197, 
particularly the second bullet point which has a dataset of syntax errors.

--
nosy: +alexmojaki

___
Python tracker 

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



[issue43192] Argparse complains argument required when default is provided

2021-05-04 Thread paul j3


paul j3  added the comment:

To a large degree the Action parameters operate independently.  That is, 
different parts of the code use the parameters for their own purposes. The 
composite behavior is a result of those individual actors, rather than some 
sort of overall coordinated plan.

First your Action is 'positional' (no flag string), and "store" type.  nargs is 
the default None.  The only extra is the default value (the default default is 
None).

_ActionsContainer._get_positional_kwargs processes such an argument, setting 
the 'required' parameter with:

# mark positional arguments as required if at least one is
# always required
if kwargs.get('nargs') not in [OPTIONAL, ZERO_OR_MORE]:
kwargs['required'] = True
if kwargs.get('nargs') == ZERO_OR_MORE and 'default' not in kwargs:
kwargs['required'] = True

At the start of parsing, all 'default' values are added to the 'args' Namespace.

If an Action is "seen", either via the appropriate flag string, or a positional 
value, it is added to the "seen_actions" list.

At the end of parsing, it iterates through all the '_actions'.  If it is not in 
the 'seen_actions' list, and is marked "required", it gets added to the 
'reqiuired_action' error list.

So even though your Action has a 'default' it is still required.  The default 
is, in effect, ignored.  The nargs value (default or not) has priority in 
setting the 'required' value.

'?/*' nargs require special handling.  This nargs requirement is satisfied by 
an empty list.  Such a positional will, in effect, always be seen. But if a 
explicit default is provided, that will over write the empty list. 

Handling defaults is inherently tricky.  But except for the special '?/*' case, 
specifying a 'default' with a positional doesn't make much sense.

--
nosy: +paul.j3

___
Python tracker 

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



[issue43942] RawDescriptionHelpFormatter seems to be ignored for argument descriptions

2021-05-04 Thread Reuben Thomas


Reuben Thomas  added the comment:

D'oh! Sorry for the noise. And congratulations to the author/designer of 
`RawDescriptionHelpFormatter` for designing/implementing exactly what I wanted 
all along!

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



[issue44037] Broad performance regression from 3.10a7 to 3.10b1 with python.org macOS binaries

2021-05-04 Thread Ned Deily


Ned Deily  added the comment:

Thanks for the report, Raymond, and for taking the time to check performance.

I am able to reliably reproduce the slowdowns in the benchmark between the 
3.10.0a7 and 3.10.0b1 versions provided by the macOS installers on python.org. 
A similar slowdown is seen on both Intel and Apple Silicon Macs running macOS 
11.3.1. Doing a quick build from source, I see no similar large differences 
between 3.10.0a7 and 3.10.0b1 on either macOS (with XC 12.5 Clang 12.0.5) or on 
a Debian Linux VM (with GCC 10.2.1). So it does seem to a difference in how the 
two macOS installers were built. There were some changes in the build env and 
process between a7 and b1. I will investigate further and report back here. 
But, the good news is that, AFAICT, there is no reason to suspect a general 
Python performance regression on this benchmark between a7 and b1.

--
assignee:  -> ned.deily
priority: normal -> critical
title: Broad performance regression from 3.10a7 to 3.10b1 -> Broad performance 
regression from 3.10a7 to 3.10b1 with python.org macOS binaries

___
Python tracker 

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



[issue40297] test_socket.CANTest is broken at HEAD on master

2021-05-04 Thread Zachary Ware


Zachary Ware  added the comment:

Thanks for the thoroughly researched patch and your patience!  Sorry it took so 
long to get it merged.

--
nosy: +zach.ware
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



[issue40297] test_socket.CANTest is broken at HEAD on master

2021-05-04 Thread miss-islington


miss-islington  added the comment:


New changeset df99532a05e4cfba8d9835375d4a3830b84472ad by Miss Islington (bot) 
in branch '3.9':
bpo-40297: Fix test_socket.CANTest.testSendFrame (GH-19548)
https://github.com/python/cpython/commit/df99532a05e4cfba8d9835375d4a3830b84472ad


--

___
Python tracker 

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



[issue40297] test_socket.CANTest is broken at HEAD on master

2021-05-04 Thread miss-islington


miss-islington  added the comment:


New changeset 7b4725a210bcfe3dc65f37cbada423cbd1e9f063 by Miss Islington (bot) 
in branch '3.10':
bpo-40297: Fix test_socket.CANTest.testSendFrame (GH-19548)
https://github.com/python/cpython/commit/7b4725a210bcfe3dc65f37cbada423cbd1e9f063


--

___
Python tracker 

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



[issue43976] Allow Python distributors to add custom site install schemes

2021-05-04 Thread Steve Dower


Steve Dower  added the comment:

> "pip install as root" will need to continue to work and thus distros
> need to get a way to make sure that it doesn't corrupt the system
> installed packages

Excuse my ignorance, but does "as root" imply that there's no user 
site-packages directory at all?

I'm not imagining a solution that doesn't require *users* to change their 
commands, so if they're currently running "sudo pip install" because they need 
to, but we change it so they shouldn't, then I'm okay with them having to 
remove the "sudo". (At least for this discussion - we can evaluate transition 
plans separately.)

And yeah, patching sysconfig.py seems easier. But then, adding a file to the 
distro is even easier, and if it's easiest for Linux distros to do that via 
configure than to add a copy step into their build (which is how I'll do it for 
Windows distros that need it), then I'll leave that to others to 
decide/implement.

--

___
Python tracker 

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



[issue43976] Allow Python distributors to add custom site install schemes

2021-05-04 Thread Marc-Andre Lemburg


Marc-Andre Lemburg  added the comment:

On 04.05.2021 22:29, Steve Dower wrote:
> 
> Would "pip install --user ..." in a Docker container also work, though? 
> Presumably all the filesystem paths are being redirected anyway, so is there 
> a difference?
> 
> (My assumption is that "--user" would essentially become the default if 
> you're using the OS provided pip/Python. If you do your own build/install of 
> it then you obviously get "default" behaviour, for better or worse.)

More modern Docker setups run the application itself under a non-root
user, but still install the packages and other dependencies as root.

See eg. Zammad's Dockerfile:
https://github.com/zammad/zammad-docker/blob/master/Dockerfile

Not sure whether that answers your question, though.

It's rather uncommon to install venvs inside Docker containers: one of the
main reasons for using containers is the added isolation, but it doesn't
make a lot of sense to add another layer of isolation inside the container.

"pip install as root" will need to continue to work and thus distros
need to get a way to make sure that it doesn't corrupt the system
installed packages. And perhaps distros can also patch pip to not
output those silly warnings anymore when using the system pip package :-)

Regarding the proposed solution: I'm not sure whether a new configure
option is the right way to go about this. Distros could simply patch
sysconfig.py, since that's the golden source of this information from
Python 3.10 onward.

setuptools' distutils version (and other packages which ship distutils)
will have to use this information instead of the copy which is/was
backed into distutils/sysconfig.py on Python 3.10+

--

___
Python tracker 

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



[issue44039] Duplicated assignment in Modules/_randommodule.c

2021-05-04 Thread Brad Larsen


Change by Brad Larsen :


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

___
Python tracker 

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



[issue44039] Duplicated assignment in Modules/_randommodule.c

2021-05-04 Thread Brad Larsen


New submission from Brad Larsen :

In Modules/_randommodule.c:600, `longval` is used in its own initialization.  
This seems to be a typo introduced in commit cc0cd43c0f9 for bpo-1635741.

  585 static int
  586 _random_exec(PyObject *module)
  587 {
  588 _randomstate *state = get_random_state(module);
  589
  590 state->Random_Type = PyType_FromModuleAndSpec(
  591 module, _Type_spec, NULL);
  592 if (state->Random_Type == NULL) {
  593 return -1;
  594 }
  595 if (PyModule_AddType(module, (PyTypeObject *)state->Random_Type) < 0) 
{
  596 return -1;
  597 }
  598
  599 /* Look up and save int.__abs__, which is needed in random_seed(). */
* 600 PyObject *longval = longval = PyLong_FromLong(0);
  601 if (longval == NULL) {
  602 return -1;
  603 }
  604
  605 PyObject *longtype = PyObject_Type(longval);
  606 Py_DECREF(longval);
  607 if (longtype == NULL) {
  608 return -1;
  609 }
  610
  611 state->Long___abs__ = PyObject_GetAttrString(longtype, "__abs__");
  612 Py_DECREF(longtype);
  613 if (state->Long___abs__ == NULL) {
  614 return -1;
  615 }
  616 return 0;
  617 }

--
components: Extension Modules
messages: 392949
nosy: blarsen, christian.heimes
priority: normal
severity: normal
status: open
title: Duplicated assignment in Modules/_randommodule.c
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



[issue44024] Improve the error message for non-string second arguments passed to the built-in functions getattr and hasattr

2021-05-04 Thread Géry

Change by Géry :


--
title: Use common TypeError message for built-in functions getattr and hasattr 
-> Improve the error message for non-string second arguments passed to the 
built-in functions getattr and hasattr

___
Python tracker 

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



[issue40297] test_socket.CANTest is broken at HEAD on master

2021-05-04 Thread miss-islington


Change by miss-islington :


--
pull_requests: +24571
pull_request: https://github.com/python/cpython/pull/25903

___
Python tracker 

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



[issue40297] test_socket.CANTest is broken at HEAD on master

2021-05-04 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 1.0 -> 2.0
pull_requests: +24570
pull_request: https://github.com/python/cpython/pull/25902

___
Python tracker 

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



[issue43976] Allow Python distributors to add custom site install schemes

2021-05-04 Thread Steve Dower


Steve Dower  added the comment:

Would "pip install --user ..." in a Docker container also work, though? 
Presumably all the filesystem paths are being redirected anyway, so is there a 
difference?

(My assumption is that "--user" would essentially become the default if you're 
using the OS provided pip/Python. If you do your own build/install of it then 
you obviously get "default" behaviour, for better or worse.)

--

___
Python tracker 

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



[issue43942] RawDescriptionHelpFormatter seems to be ignored for argument descriptions

2021-05-04 Thread paul j3


paul j3  added the comment:

You test with RawDescriptionHelpFormatter, but quote from the 
RawTextHelpFormatter.

--
nosy: +paul.j3

___
Python tracker 

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



Re: [issue43976] Allow Python distributors to add custom site install schemes

2021-05-04 Thread M.-A. Lemburg
On 04.05.2021 22:07, Steve Dower wrote:
> 
> Perhaps what I'm suggesting here is that I don't see any reason for "sudo pip 
> install ..." into a distro-installed Python to ever need to work, and would 
> be quite happy for it to just fail miserably every time (which is already the 
> case for the Windows Store distro of Python).

The "pip install" into a root environment approach is the standard way
to setup Docker (and similar) containers, so I think trying to break
this on purpose will not do Python a good service.

The pip warning about this kind of setup which apparently got added
in one of the more recent versions of pip already is causing a lot
of unnecessary noise when building containers and doesn't make Python
look good in that environment.

-- 
Marc-Andre Lemburg
eGenix.com

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



[issue44026] IDLE doesn't offer "Did you mean?" for AttributeError and NameError

2021-05-04 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

Another idea: do what test_exceptions() does:

try:
f()
except NameError as exc:
with support.captured_stderr() as err:
sys.__excepthook__(*sys.exc_info())

self.assertNotIn("a1", err.getvalue())

Then instead of the assert, do something like

last_line = err.getvalue().rsplit("\n", 2)[-2]
_, did_you_mean, suggestion = last_line.rpartition("Did you mean: ")
if did_you_mean:
   print(did_you_mean + suggestion)

This can probably be done without test.support.

--

___
Python tracker 

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



[issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs.

2021-05-04 Thread Mike Lissner


Mike Lissner  added the comment:

I haven't watched that Blackhat presentation yet, but from the slides, it seems 
like the fix is to get all languages parsing URLs the same as the browsers. 
That's what @orsenthil has been doing here and plans to do in 
https://bugs.python.org/issue43883.

Should we get a bug filed with requests/urllib3 too? Seems like a good idea if 
it suffers from the same problems.

--

___
Python tracker 

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



[issue44038] In documentation Section 8.6, the definition of parameter_list need correcting

2021-05-04 Thread Webb Scales


New submission from Webb Scales :

In Section 8.6 ("Function definitions"; 
https://docs.python.org/3/reference/compound_stmts.html#function-definitions), 
the definition of "parameter_list" looks slightly wrong:

parameter_list ::= defparameter ("," defparameter)* "," "/" ["," 
[parameter_list_no_posonly]] | parameter_list_no_posonly

The "/" (and the comma preceding it) is not a required component.  (Sorry, I'm 
afraid I'm not smart enough right now to suggest a correction.  :-p )

--
assignee: docs@python
components: Documentation
messages: 392943
nosy: docs@python, webbnh
priority: normal
severity: normal
status: open
title: In documentation Section 8.6, the definition of parameter_list need 
correcting
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



[issue43976] Allow Python distributors to add custom site install schemes

2021-05-04 Thread Steve Dower


Steve Dower  added the comment:

> I'd rather not have a new option here ...

Perhaps what I'm suggesting here is that I don't see any reason for "sudo pip 
install ..." into a distro-installed Python to ever need to work, and would be 
quite happy for it to just fail miserably every time (which is already the case 
for the Windows Store distro of Python).

Admin installed all-user packages is the expert scenario here, and can be as 
twisted as possible. Pip installed per-user packages and system-tool installed 
packages are the defaults, and the more easily those can be overridden by a 
file in the distro, the better.

--

___
Python tracker 

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



[issue43976] Allow Python distributors to add custom site install schemes

2021-05-04 Thread Steve Dower


Steve Dower  added the comment:

The best option for restricting the import while still having it be a Python 
import is to find the file (if it's present in the expected location under 
sys.whatever), and then use importlib to import it: 
https://docs.python.org/3/library/importlib.html#importing-a-source-file-directly

I'd rather not have a new option here, I would much prefer "-S" in this context 
to mean "run Python with only core libraries" and "-s" to mean "run Python with 
only core and distro libraries" (and neither to mean "run Python with core, 
distro and user libraries").

That may be a bigger change, but there's enough angst around this issue that we 
would be better off getting it right this time, even if it changes things, than 
continuing to preserve the system that people dislike so much.

--

___
Python tracker 

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



[issue44027] Python 3.9 UWP does not create key in PythonCore

2021-05-04 Thread Steve Dower


Steve Dower  added the comment:

Correct. It does, however, write to the lookaside space, which Windows will map 
back if you access it.

So reading HKLM\Software\Python\PythonCore\3.9 will return all the values that 
would be there. It's only enumeration that doesn't work. I've reported that to 
the team responsible, and they think it's not necessary, so I have no qualms 
about saying that you should *also* look in 
"SOFTWARE\\Microsoft\\AppModel\\Lookaside\\user\\Software\\Python\\PythonCore". 
(And if another redistributor also does a UWP package of Python, they'll have 
their own registry section for it to go into.)

Not writing into shared registry locations is one of the *best* features of 
this form of packaging, so I'm not inclined to try too hard to break it. 
Overall the robustness and stability is worthwhile, so it'll just fall to tool 
developers to catch up a bit, or alternatively win over the team that could 
just fix it properly.

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



[issue44026] IDLE doesn't offer "Did you mean?" for AttributeError and NameError

2021-05-04 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Those are intesting options, I will think about this. I am still afraid of 
adding more APIs in this area as having arbitrary Python getting call in the 
middle of handling the exceptions it can be quite tricky: think that we are 
handling an exception already so other exceptions can mess up stuff in very 
subtle ways or we need to ignore exceptions and that can also be dangerous.

Another thing we could do is reproduce the feature in idle itself with a custom 
display hook, which would be easier as we can just use difflib. It would be 
slightly different than the built-in one but honestly I don't think that's a 
problem at all. I understand that other people may think differently so I am 
open minded as well. But I wanted to clarify what are my worries :)

--

___
Python tracker 

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



[issue44033] Adding multiple keys of the same name to a dict doesn't raise an exception

2021-05-04 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

Ok. I'm closing this then. (I wasn't aware that this was an intended behavior.)

--

___
Python tracker 

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



[issue44033] Adding multiple keys of the same name to a dict doesn't raise an exception

2021-05-04 Thread Shreyan Avigyan


Change by Shreyan Avigyan :


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



[issue44033] Adding multiple keys of the same name to a dict doesn't raise an exception

2021-05-04 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:

Looks like the same issue to me as the rejected issue that Karthikeyan 
mentioned. Changing it to use the first value is a non-starter because it would 
break compatibility. I'd suggest using a linter that warns about duplicate keys 
in literals; we implemented that internally.

--
nosy: +Jelle Zijlstra

___
Python tracker 

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



[issue44037] Broad performance regression from 3.10a7 to 3.10b1

2021-05-04 Thread Jelle Zijlstra


Change by Jelle Zijlstra :


--
nosy: +Jelle Zijlstra

___
Python tracker 

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



[issue44037] Broad performance regression from 3.10a7 to 3.10b1

2021-05-04 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Here's the screen shot for Intel silicon running the python dot org macOS build 
on Big Sur 11.3.1:

https://www.dropbox.com/s/7lmf74osvq5seg2/Screen%20Shot%202021-05-03%20at%208.41.52%20PM.png?dl=0

Here are the results on M1 Apple silicon with Big Sure 11.2.3:

https://www.dropbox.com/s/u2w4tmv1alzybrt/Screen%20Shot%202021-05-03%20at%209.24.03%20PM.png?dl=0

--
nosy: +ned.deily, pablogsal, vstinner

___
Python tracker 

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



[issue38946] IDLE on macOS 10.15 Catalina does not open double-clicked files if app already launched

2021-05-04 Thread Irv Kalb


Irv Kalb  added the comment:

This is a quick follow up to the original issue.

I am now running Mac OS X 11.2.3 with IDLE 3.9.1 (and pygame 2.0.1).

In this environment, the issue of opening files is completely fixed and works 
perfectly.

Thank you very much (and a big thank you from my students who rely on this set 
up every day).

--

___
Python tracker 

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



[issue44037] Broad performance regression from 3.10a7 to 3.10b1

2021-05-04 Thread Raymond Hettinger


New submission from Raymond Hettinger :

Running Tools/scripts/var_access_benchmark.py on the production macOS builds on 
python.org shows a performance drop-off between alpha-7 and beta-1.

Apple Silicon
-
read local4.1ns ->  4.5ns
read non_local4.1ns ->  4.6ns
read global   4.2ns ->  4.9ns
read builtin  4.2ns ->  5.3ns
classvar from cls10.1ns -> 12.6ns
classvar from inst9.5  11.7
read instvar  9.2  11.3
instvar with slots5.8   8.2
namedtuple   11.1  14.2
  ...

Since the effects are seen in almost every category, I suspect a build problem, 
a change to the eval loop, or a failure to inline some of the shared functions 
that used to be macros.

--
components: Build
keywords: 3.10regression
messages: 392934
nosy: rhettinger
priority: normal
severity: normal
status: open
title: Broad performance regression from 3.10a7 to 3.10b1
type: performance
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



[issue44026] IDLE doesn't offer "Did you mean?" for AttributeError and NameError

2021-05-04 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I realized after posting that looking for close matching is a performance issue 
and does not need to be done unless the exception is going to be displayed.  
But it is a shame to keep such great work away from many users.

What would you think of either

1. add sys.tracebackhook, to be called by the traceback display functions if 
not None.  Then idlelib.run.print_exception would not have to duplicate the 
sometimes changing logic for chaining or otherwise joining multiple tracebacks 
into one mega-traceback.  Instead, from what Dennis said above, it could set 
the hook and call the built-in exceptionhook.

2. add a new optional parameter to exceptionhook and the traceback display 
function.  This would have the same advantage as above.

--

___
Python tracker 

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



[issue44035] Regenerating the configure script fails even if dependencies are satisfied

2021-05-04 Thread Christian Heimes


Christian Heimes  added the comment:

Container image definition is at https://github.com/tiran/cpython_autoconf

I propose to test this a bit, get feedback, and then move the code and image to 
python infrastructure. I chose Alpine because it's the least controversial one.

--
assignee:  -> christian.heimes
type:  -> compile error
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



[issue44019] operator.call/operator.__call__

2021-05-04 Thread Shatabarto Bhattacharya


Change by Shatabarto Bhattacharya :


--
nosy: +hrik2001

___
Python tracker 

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



[issue44035] Regenerating the configure script fails even if dependencies are satisfied

2021-05-04 Thread Christian Heimes


Christian Heimes  added the comment:

I got you covered:

$ podman run -v.:/src:Z tiran/cpython_autoconf
$ docker run -v.:/src tiran/cpython_autoconf

--

___
Python tracker 

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



[issue44035] Regenerating the configure script fails even if dependencies are satisfied

2021-05-04 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Yep, I am also setting ACLOCAL_PATH to make sure it picks it up. 

To be honest I think this has to be something about the weird setup in this 
machine but I think more people may run into this so it may be worth to include 
this in the News entry and close the issue once I figure it out

--

___
Python tracker 

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



[issue44025] Match doc: Clarify '_' as a soft keyword

2021-05-04 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

bedevere-bot malfunctioned.  Lukasz merged PR 25873 into main, and I verified 
the change on the main branch.  But the PR is listed above as closed, not 
merged, and commit 3b200b2aa648fcc8a2673871807c1463afe00195 is not listed.

--
nosy: +Mariatta, lukasz.langa

___
Python tracker 

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



[issue44034] Incorrect type casting of float into int

2021-05-04 Thread Tim Peters


Tim Peters  added the comment:

Please study the docs first:

https://docs.python.org/3/tutorial/floatingpoint.html

That will give you the background to understand why `int()` has nothing to do 
with this.

>>> 1.
2.0

That is, `int()` was passed 2.0 to begin with, because the binary float closest 
to the decimal value 1. is in fact 2.0.

If you can't live with that, use the `decimal` module instead:

>>> import decimal
>>> int(decimal.Decimal("1."))
1

--
nosy: +tim.peters
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



[issue44033] Adding multiple keys of the same name to a dict doesn't raise an exception

2021-05-04 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

I've read that issue but it seems that it actually was based on "Should there 
be a warning or error?". I actually suggest something different. I suggest that 
"Either raise an exception or just use the first key-value pair if the key is 
repeated during initialization". (By "initialization" I mean to say creating a 
new dict object)

--

___
Python tracker 

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



[issue44034] Incorrect type casting of float into int

2021-05-04 Thread Shreyan Avigyan


Change by Shreyan Avigyan :


--
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.6

___
Python tracker 

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



[issue44033] Adding multiple keys of the same name to a dict doesn't raise an exception

2021-05-04 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Looks like a duplicate of https://bugs.python.org/issue16385

--
nosy: +xtreak

___
Python tracker 

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



[issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs.

2021-05-04 Thread Seth Michael Larson


Seth Michael Larson  added the comment:

Leaving a thought here, I'm highlighting that we're now implementing two 
different standards, RFC 3986 with hints of WHATWG-URL. There are pitfalls to 
doing so as now a strict URL parser for RFC 3986 (like the one used by 
urllib3/requests) will give different results compared to Python and thus opens 
up the door for SSRF vulnerabilities [1].

[1]: 
https://www.blackhat.com/docs/us-17/thursday/us-17-Tsai-A-New-Era-Of-SSRF-Exploiting-URL-Parser-In-Trending-Programming-Languages.pdf

--
nosy: +sethmlarson

___
Python tracker 

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



[issue44035] Regenerating the configure script fails even if dependencies are satisfied

2021-05-04 Thread Christian Heimes


Christian Heimes  added the comment:

Dpes /opt/bb/bin/autoconf pick up the files in /share/aclocal? Both are rather 
unusual file locations.

--

___
Python tracker 

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



[issue44036] asyncio SSL server can be DOSed, event loop gets blocked: busy loops and uses 100% CPU

2021-05-04 Thread ghost43


New submission from ghost43 :

This is about a potential DOS vector that can get an asyncio server serving SSL 
connections to enter a busy loop and hang. To recover the server (python 
process) needs to be restarted.

See downstream report at https://github.com/spesmilo/electrumx/issues/92

ElectrumX is server software that serves JSON-RPC requests either directly over 
plaintext TCP or over SSL/TLS (no HTTP involved). The server code is written 
using asyncio. The most popular client is also written using python+asyncio. 
However, there are other server implementations (e.g. in Rust), and other 
clients (e.g. in javascript, scala, java). The servers are part of a federated 
network and peer with each other.

In the last 1+ year, server operators have started reporting that the python 
process (of ElectrumX) sporadically hangs: it uses 100% CPU and stops serving 
clients or accepting new connections. The only way we could find to recover is 
restarting the server (the python process); waiting for even days did not help, 
python was stuck. The hang seemed to mostly happen on busy servers that serve 
several thousands of concurrent sessions, and even on those only happened e.g. 
once a month. So the hang was difficult to reproduce.

Nevertheless we observed that the hang only happens if it is the asyncio server 
that handles SSL, i.e. if the server operator put nginx in front of the python 
process and handles SSL termination in nginx, they would be unaffected. One 
server operator whose server at one point hanged multiple times a day confirmed 
this, and reported that nginx subsequently started logging lines like this:
```
2021/01/11 02:28:30 [crit] 21#21: *437620 SSL_shutdown() failed (SSL: 
error:14094123:SSL routines:ssl3_read_bytes:application data after close 
notify) while proxying connection, client: REDACTED, server: 0.0.0.0:50002, 
upstream: "127.0.0.1:50213", bytes from/to client:81/205, bytes from/to 
upstream:205/0
```

Over these last months, the hang has been reproduced on many different python 
versions by different people, e.g. 3.7.1, 3.7.5, 3.8.5, 3.9.1, 3.9.4.

A few days ago, many servers hanged almost simultaneously, and when restarted, 
they would soon hang again at most a few hours later. Presumably someone either 
flooded the network with buggy clients, or it might have been an attack. 
Anyway, this allowed me to look into this better. I set up gdb and waited. This 
was on ubuntu 20.04 with python 3.8.5 and openssl=1.1.1f-1ubuntu2.3.

It seems the event loop thread is stuck in a busy loop.
The deepest common stack frame looks to be at
https://github.com/python/cpython/blob/v3.8.5/Lib/asyncio/sslproto.py#L675

```
(gdb) py-bt
Traceback (most recent call first):
  File "/usr/lib/python3.8/asyncio/sslproto.py", line 535, in feed_appdata

  File "/usr/lib/python3.8/asyncio/sslproto.py", line 675, in 
_process_write_backlog
ssldata, offset = self._sslpipe.feed_appdata(data, offset)
  File "/usr/lib/python3.8/asyncio/sslproto.py", line 599, in _write_appdata
self._process_write_backlog()
  File "/usr/lib/python3.8/asyncio/sslproto.py", line 387, in write
self._ssl_protocol._write_appdata(data)
  File "/usr/local/lib/python3.8/dist-packages/aiorpcx/rawsocket.py", line 118, 
in write
self._asyncio_transport.write(framed_message)
  File "/usr/local/lib/python3.8/dist-packages/aiorpcx/session.py", line 153, 
in _send_message
await self.transport.write(message)
  File "/usr/local/lib/python3.8/dist-packages/aiorpcx/session.py", line 496, 
in _throttled_request
await self._send_message(message)
  
  File "/usr/lib/python3.8/asyncio/events.py", line 81, in _run
self._context.run(self._callback, *self._args)
  File "/usr/lib/python3.8/asyncio/base_events.py", line 2627, in _run_once
--Type  for more, q to quit, c to continue without paging--
  File "/usr/lib/python3.8/asyncio/base_events.py", line 826, in run_forever
None, getaddr_func, host, port, family, type, proto, flags)
  File "/usr/lib/python3.8/asyncio/base_events.py", line 603, in 
run_until_complete
self.run_forever()
  File "/usr/lib/python3.8/asyncio/runners.py", line 299, in run
  File "/usr/local/bin/electrumx_server", line 35, in main
asyncio.run(controller.run())
  File "/usr/local/bin/electrumx_server", line 43, in 
main()
```
```
(gdb) py-list
 530except (SystemExit, KeyboardInterrupt):
 531raise
 532except BaseException as e:
 533self._fatal_error(e, 'SSL error in data received')
 534return
>535
 536for chunk in ssldata:
 537self._transport.write(chunk)
 538
 539for chunk in appdata:
 540if chunk:
```
```
(gdb) py-locals
self = <_SSLPipe(_context=, 
_server_side=True, _server_hostname=None, _state='WRAPPED', 
_incoming=<_ssl.MemoryBIO at remote 0x7f09cc0925b0>, _outgoing=<_ssl.MemoryBIO 
at remote 0x7f09b919c430>, _sslobj=) at remote 0x7f09db428910>, 

[issue44035] Regenerating the configure script fails even if dependencies are satisfied

2021-05-04 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Also:

grep -r AX_C_FLOAT_WORDS_BIGENDIAN /share/aclocal/
ax_c_float_words_bigendian.m4:#   AX_C_FLOAT_WORDS_BIGENDIAN([ACTION-IF-TRUE], 
[ACTION-IF-FALSE], [ACTION-IF-UNKNOWN])
ax_c_float_words_bigendian.m4:AC_DEFUN([AX_C_FLOAT_WORDS_BIGENDIAN],
ax_c_float_words_bigendian.m4:])# AX_C_FLOAT_WORDS_BIGENDIAN

--

___
Python tracker 

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



[issue44035] Regenerating the configure script fails even if dependencies are satisfied

2021-05-04 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Reverting 
https://github.com/python/cpython/commit/5d6e8c1c1a5f667cdce99cb3c563ac922198678d
 works

--

___
Python tracker 

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



[issue44034] Incorrect type casting of float into int

2021-05-04 Thread Backbench Family


New submission from Backbench Family :

y = int(1.999) # fifteen decimal points
print(y)
1   # output is 1

y = int(1.) # sixteen decimal points
print(y)
2   # output is 2
It shows 1 when we type fifteen decimal whereas when we add sixteen decimal 
points the output becomes 2.

--
components: Windows
messages: 392919
nosy: hbutt4319, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Incorrect type casting of float into int
type: compile error
versions: Python 3.6

___
Python tracker 

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



[issue44035] Regenerating the configure script fails even if dependencies are satisfied

2021-05-04 Thread Pablo Galindo Salgado


New submission from Pablo Galindo Salgado :

I have installed autoconf-archive and autoconf 2.69 and tried to regenerate the 
configure script and it fails:


$ ls /share/aclocal/ax_* | wc -l
572

$ autoconf --version
autoconf (GNU Autoconf) 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+/Autoconf: GNU GPL version 3 or later
, 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by David J. MacKenzie and Akim Demaille.

$ autoreconf -v -f -i
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force
autoreconf: configure.ac: tracing
autoreconf: configure.ac: not using Libtool
autoreconf: running: /opt/bb/bin/autoconf --force
autoreconf: running: /opt/bb/bin/autoheader --force
autoreconf: configure.ac: not using Automake
autoreconf: Leaving directory `.'

$ ./configure
configure: error: Please install autoconf-archive package and re-run autoreconf

--
messages: 392920
nosy: christian.heimes, pablogsal
priority: normal
severity: normal
status: open
title: Regenerating the configure script fails even if dependencies are 
satisfied

___
Python tracker 

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



[issue44033] Adding multiple keys of the same name to a dict doesn't raise an exception

2021-05-04 Thread Shreyan Avigyan


New submission from Shreyan Avigyan :

Adding multiple keys of the same name to a dict should raise an exception but 
instead causes a different behavior. For example consider this code,

>>> d = {"x" : "First value", "x" : "Second value", "y" : "Third value"}

One would expect a error because there two keys with the same name or that 
Python will add "x" : "First value" and will skip "x" : "Second value". But the 
result is opposite,

>>> d
{'x': 'Second value', 'y': 'Third value'}

Is this a bug or is this an intended behavior? (I may have missed out 
information related to this in the documentation. Kindly correct me if that's 
the case.)

--
messages: 392918
nosy: shreyanavigyan
priority: normal
severity: normal
status: open
title: Adding multiple keys of the same name to a dict doesn't raise an 
exception
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



[issue44001] typing.Literal: args must be hashable, not immutable

2021-05-04 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset ab0a54adad8ddf488ccfb92970be9e4027673d19 by Jelle Zijlstra in 
branch '3.9':
[3.9] bpo-44001: improve Literal documentation (GH-25877). (#25897)
https://github.com/python/cpython/commit/ab0a54adad8ddf488ccfb92970be9e4027673d19


--

___
Python tracker 

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



pytest 6.2.4 has been released!

2021-05-04 Thread Anthony Sottile
pytest-6.2.4
===

pytest 6.2.4 has just been released to PyPI.

This is a bug-fix release, being a drop-in replacement. To upgrade::

  pip install --upgrade pytest

The full changelog is available at
https://docs.pytest.org/en/stable/changelog.html.

Thanks to all of the contributors to this release:

* Anthony Sottile
* Bruno Oliveira
* Christian Maurer
* Florian Bruhin
* Ran Benita


Happy testing,
The pytest Development Team
___
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


[issue43933] Regression in python3.10 with traceback frame having lineno of -1

2021-05-04 Thread Anthony Sottile


Anthony Sottile  added the comment:

I've released pytest 6.2.4 for the other breakage (which is unrelated to this 
bpo -- it was the asname source position issue)

--

___
Python tracker 

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



[issue43933] Regression in python3.10 with traceback frame having lineno of -1

2021-05-04 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> The pytest failure still happens with 3.10.0b1 and pytest 6.2.3.

What I am missing? 3.10.0b1 includes the fixes for this issue, no? Is it 
because the fixes still require some changes in the source? If that's the case, 
we should mention it in the What's New

> I'm asking if pytest can make a release to update.

In any case, shouldn't that be requested in the pytest issue tracker?

--

___
Python tracker 

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



[issue44001] typing.Literal: args must be hashable, not immutable

2021-05-04 Thread Ken Jin


Ken Jin  added the comment:

Well something was amiss: the 3.9 backport PR ;-).

Sorry for closing this issue too early. I didn't notice there was still one 
more to go.

--
resolution: fixed -> 
status: closed -> open

___
Python tracker 

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



[issue44001] typing.Literal: args must be hashable, not immutable

2021-05-04 Thread Jelle Zijlstra


Change by Jelle Zijlstra :


--
pull_requests: +24569
pull_request: https://github.com/python/cpython/pull/25897

___
Python tracker 

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



[issue43978] Incorrect "versionadded" info in typing.NoReturn documentation

2021-05-04 Thread Ken Jin


Ken Jin  added the comment:

To answer the person who posted this on docs mailing list, after much 
investigation, it seems that this made it into 3.7.0, 3.5.4 and 3.6.2 .

Here's the 3.7.0 (alpha) commit for the initial implementation of 
typing.NoReturn:
https://github.com/python/cpython/commit/f06e0218ef6007667f5d61184b85a81a0466d3ae

The backport to 3.6 (at the time, this was 3.6.2rc1):
https://github.com/python/cpython/commit/e612c28513b406779d187e5f816445c7d40d292b

The backport to 3.5 (at the time, this was 3.5.4rc1):
https://github.com/python/cpython/commit/4b15e45895ca56ac5f7837cacb8cd3ccc26d1f66

I'm sorry if I got anything wrong (this is somewhat confusing for me too).

--

___
Python tracker 

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



[issue43355] __future__.annotations breaks inspect.signature()

2021-05-04 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:

Python 3.10 will add an eval_str= argument to inspect.signature() that lets you 
evaluate string annotations. I don't think it makes sense to change anything in 
the bugfix branches, so I propose that this issue be closed.

--
nosy: +Jelle Zijlstra

___
Python tracker 

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



[issue43624] Add underscore as a decimal separator for string formatting

2021-05-04 Thread Terry Davis


Terry Davis  added the comment:

If no one else has any comments, I'll assume there is consensus and start 
working on this. I have not contributed to CPython before, nor have I worked on 
production C code, so it may be a while before I get anywhere.

--
versions: +Python 3.11 -Python 3.10

___
Python tracker 

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



[issue43978] Incorrect "versionadded" info in typing.NoReturn documentation

2021-05-04 Thread Rahul Kumaresan


Rahul Kumaresan  added the comment:

Hello Ken Jin, Thanks for this clarification!

--

___
Python tracker 

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



[issue42067] Type annotation in for-loops

2021-05-04 Thread Ken Jin


Ken Jin  added the comment:

Thanks for your input Mark!

--
components:  -Build
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue44001] typing.Literal: args must be hashable, not immutable

2021-05-04 Thread Ken Jin


Ken Jin  added the comment:

Jelle, thanks for fixing up the docs. You're right here - anything that can be 
an element in a frozenset or used as a key in a dict works. And the current 
docs for sets says that means anything hashable: 
https://docs.python.org/3/library/stdtypes.html#set-types-set-frozenset

If you feel anything's amiss. Please don't hesitate to re-open this issue.

--
nosy: +kj
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



[issue44032] Function locals and evaluation stack should be stored in a contiguous, per-thread stack

2021-05-04 Thread Ken Jin


Change by Ken Jin :


--
nosy: +kj

___
Python tracker 

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



[issue43978] Incorrect "versionadded" info in typing.NoReturn documentation

2021-05-04 Thread Ken Jin


Ken Jin  added the comment:

Hi Miguel, with reference to 
https://github.com/python/cpython/pull/25760#issuecomment-830338306, Guido 
rejected the PR because he said that the current docs are correct.

This is a major point of confusion for many people, but here's why a single 
feature can be added in 2 versions: PEP 484 (Type Hints) was initially accepted 
as 'Provisional' (you can see what this means in PEP 1). To spare you the 
details, it's a special pass for typing.py to add new features in point 
releases, and to backport new features to older versions - even if they aren't 
bugfixes! This goes against what most of CPython allows (new features usually 
aren't allowed to be backported). However, at the time, typing.py was pretty 
new, so there wasn't much existing code to break anyways.

Another example is asyncio. Which has since lost its provisional status a long 
time ago AFAIK. typing.py became de-facto non-provisional in 3.7, though PEP 
484 hasn't been updated yet. This is why you may see stuff overlapping between 
3.5 and 3.6.

I hope you learnt something cool :). Hope to see you around contributing to 
other parts of CPython!

--
nosy: +kj
resolution:  -> not a bug
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue44032] Function locals and evaluation stack should be stored in a contiguous, per-thread stack

2021-05-04 Thread Mark Shannon


Change by Mark Shannon :


--
title: Store locals and evaluation stack should be stored in a contiguous, 
per-thread stack -> Function locals and evaluation stack should be stored in a 
contiguous, per-thread stack

___
Python tracker 

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



[issue44032] Store locals and evaluation stack should be stored in a contiguous, per-thread stack

2021-05-04 Thread Mark Shannon


New submission from Mark Shannon :

Currently, the local variables (inc. cell and free vars) for functions and the 
evaluation stack are kept in per-activation chunks in the frame object. This is 
not a good design for modern hardware.
The local variables and stack are amongst the hottest memory in the VM and 
should be stored in a contiguous stack in memory.

Allocating a per-thread stack would improve memory locality considerably, and 
pave the way to allocating heap objects for function activations lazily, only 
when needed for debugging and introspection.

Generators would still need heap allocated locals and stack, but that would be 
no worse than currently.

--
assignee: Mark.Shannon
components: Interpreter Core
messages: 392906
nosy: Mark.Shannon
priority: normal
severity: normal
status: open
title: Store locals and evaluation stack should be stored in a contiguous, 
per-thread stack
type: performance

___
Python tracker 

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



library not initialized pygame

2021-05-04 Thread Quentin Bock
code:
#imports and variable for loop
import pygame
running = True

#initializes pygame
pygame.init()
pygame.mixer.init()
pygame.font.init()

#creates the pygame window
screen = pygame.display.set_mode((1200, 800))

#Title and Icon of window
pygame.display.set_caption("3.02 Project")
icon = pygame.image.load('3.02 icon.png')
pygame.display.set_icon(icon)

#setting up font
pygame.font.init()
font = pygame.font.Font('C:\Windows\Fonts\OCRAEXT.ttf', 16)
font_x = 10
font_y = 40
items_picked_up = 0
items_left = 3

def main():
global running, event

#Game Loop
while running:
#sets screen color to black
screen.fill((0, 0, 0))

#checks if the user exits the window
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
pygame.quit()

def music():
pygame.mixer.init()
pygame.font.init()
pygame.mixer.music.load('onoken - load.mp3')  #places song into
queue
pygame.mixer.music.play(10, 0, 3)  #fist number indicates the
loop amount, second is the offset of the song, third is fading the song in
song_text = font.render("Song: onoken - load", True, (255, 255,
255))
screen.blit(song_text, (10, 750))
music()

def display_instruction(x, y):
pygame.font.init()
pygame.mixer.init()
instructions = font.render("Each level contains 3 items you
must pick up in each room.", True, (255, 255, 255))
instructions_2 = font.render("When you have picked up 3 items,
you will advance to the next room, there are 3.", True, (255, 255, 255))
instructions_3 = font.render("You will be able to change the
direction you are looking in the room, this allows you to find different
objects.", True, (255, 255, 255))

screen.blit(instructions, (10, 40))
screen.blit(instructions_2, (10, 60))
screen.blit(instructions_3, (10, 80))

display_instruction(font_x, font_y)
pygame.display.update()

main()

if you try to run this, I'm aware that the icon and music file will not
load because you don't have the file on your device, but if it somehow
works for you please let me know, and if you think there's any difference
between my code and when you ran it I need this figured out. Thanks
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue38135] Depth first search in compile.c creates wrong BB order for certain CFG.

2021-05-04 Thread Mark Shannon


Mark Shannon  added the comment:

This seems to have been fixed sometime.

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



[issue43054] What does the existence of a struct in a header file imply about the C-API

2021-05-04 Thread Mark Shannon


Mark Shannon  added the comment:

Thanks for the responses.
Probably nothing to do for now.

--
resolution:  -> postponed
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue42067] Type annotation in for-loops

2021-05-04 Thread Mark Shannon


Mark Shannon  added the comment:

Definitely one for Python ideas.
Quite a good idea though.

--
nosy: +Mark.Shannon

___
Python tracker 

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



[issue42067] Type annotation in for-loops

2021-05-04 Thread Ken Jin


Ken Jin  added the comment:

@pablo, may I close this issue as 'not a bug'? I think it looks like a feature 
request that belongs on https://discuss.python.org/c/ideas/ or 
https://mail.python.org/mailman3/lists/python-ideas.python.org/ instead. What 
do you think?

--
nosy: +pablogsal

___
Python tracker 

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



  1   2   >