[issue43424] Document the `controller.name` field in `webbrowser` module

2021-12-20 Thread Larry Hastings


Change by Larry Hastings :


--
components: +Documentation
nosy:  -larry

___
Python tracker 

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



[issue43424] Document the `controller.name` field in `webbrowser` module

2021-12-20 Thread Larry Hastings


Change by Larry Hastings :


--
components: +Library (Lib) -Argument Clinic

___
Python tracker 

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



[issue43424] Document the `controller.name` field in `webbrowser` module

2021-12-20 Thread Larry Hastings


Change by Larry Hastings :


--
components:  -2to3 (2.x to 3.x conversion tool), Build, C API, Cross-Build, 
Demos and Tools, Distutils, Documentation, Extension Modules, FreeBSD, IDLE, 
IO, Installation, Interpreter Core, Library (Lib), Parser, Regular Expressions, 
SSL, Subinterpreters, Tests, Tkinter, Unicode, Windows, XML, asyncio, ctypes, 
email, macOS

___
Python tracker 

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



[issue46144] math.log() returns improper output

2021-12-20 Thread Joshua Insel


Joshua Insel  added the comment:

The same problem occurs with the log function from the C standard library, 
which Python uses to implement its same-named function.

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



[issue43424] Document the `controller.name` field in `webbrowser` module

2021-12-20 Thread Filmy Talkies 24*7

Filmy Talkies 24*7  added the comment:

अब आप जीत सकते है 1 करोड़ रुपये 
oaya

--
components: +2to3 (2.x to 3.x conversion tool), Argument Clinic, Build, C API, 
Cross-Build, Demos and Tools, Distutils, Extension Modules, FreeBSD, IDLE, IO, 
Installation, Interpreter Core, Parser, Regular Expressions, SSL, 
Subinterpreters, Tests, Tkinter, Unicode, Windows, XML, asyncio, ctypes, email, 
macOS
hgrepos: +413
keywords: +patch
message_count: 1.0 -> 2.0
nosy: +Alex.Willmer, asvetlov, barry, dstufft, eric.araujo, ezio.melotti, 
gaurawgoshwami, koobs, larry, lys.nikolaou, mrabarnett, ned.deily, pablogsal, 
paul.moore, r.david.murray, ronaldoussoren, steve.dower, terry.reedy, 
tim.golden, vstinner, yselivanov, zach.ware
nosy_count: 2.0 -> 24.0
pull_requests: +28440
stage:  -> patch review
type: enhancement -> security
pull_request: https://github.com/python/cpython/pull/544
Added file: https://bugs.python.org/file50506/images (5).jpeg

___
Python tracker 

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



[issue46144] math.log() returns improper output

2021-12-20 Thread Joshua Insel


New submission from Joshua Insel :

math.log(536870912, 2) should return 29.0, because 2^29 = 536870912. However, 
it instead returns 29.004.

--
messages: 408986
nosy: joshinsel
priority: normal
severity: normal
status: open
title: math.log() returns improper output
type: behavior
versions: Python 3.10

___
Python tracker 

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



[issue46143] [docs] IO > Text Encoding info outdated

2021-12-20 Thread Inada Naoki


Inada Naoki  added the comment:

UTF-8 mode is not enabled by default. So locale encoding is still the default 
encoding.

--
nosy: +methane

___
Python tracker 

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



[issue37295] Possible optimizations for math.comb()

2021-12-20 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> Just curious about why the focus on the newer exp2 and log2?

No particular reason, those happened to give slighy best results on macOS.  
Across compilers, plain exp() is likely the most mature.

The quality of log() is irrelevant because it isn't used.  The table of log 
factorials can be precomputed to arbitrary exactness using tools other than the 
C math libraries.

--

___
Python tracker 

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



[issue46143] [docs] IO > Text Encoding info outdated

2021-12-20 Thread David Gilbertson


New submission from David Gilbertson :

On this page: https://docs.python.org/3/library/io.html#text-encoding it says 
"there is no concrete plan as of yet, Python may change the default text file 
encoding to UTF-8 in the future".

On this page https://docs.python.org/3/library/os.html#utf8-mode is says that 
from 3.7 onwards UTF-8 will be selected by default.

Does that mean that the text in the first section is now outdated, as it was 
addressed by PEP 540?

I'm a newbie, so apologies if I'm missing something obvious or filing this in 
the wrong spot.

--
assignee: docs@python
components: Documentation
messages: 408983
nosy: docs@python, gilbertson.david
priority: normal
severity: normal
status: open
title: [docs] IO > Text Encoding info outdated
type: behavior
versions: Python 3.10

___
Python tracker 

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



[issue46127] Missing HTML span element in exceptions.html

2021-12-20 Thread Vivek Vashist


Change by Vivek Vashist :


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



[issue46142] python --help output is too long

2021-12-20 Thread Barry A. Warsaw


Change by Barry A. Warsaw :


--
nosy: +barry

___
Python tracker 

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



[issue36906] Compile time textwrap.dedent() equivalent for str or bytes literals

2021-12-20 Thread Jack Wong


Change by Jack Wong :


--
nosy: +iforapsy

___
Python tracker 

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



[issue46142] python --help output is too long

2021-12-20 Thread Éric Araujo

Éric Araujo  added the comment:

Forgot to quote  -X help  to print help about X options.

--
components: +Interpreter Core

___
Python tracker 

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



[issue46142] python --help output is too long

2021-12-20 Thread Éric Araujo

New submission from Éric Araujo :

>From Serhiy in 
>https://mail.python.org/archives/list/python-...@python.org/thread/QUUBM7DGSXYWBOLZNWOSCQUDALWJIYZF/
> :

The output of "python -h" is 104 lines long now. It was only 51 lines in
3.6. 35% of it is about the -X option, and 30% about environment
variables. Also some lines in the -X option description are too long
(102 columns). Both topics are "advanced" and mostly interested for
debugging. I suggest to move them out of the main help output.  […]

Guido:

-X opt : implementation-specific option; use -X help to list options.

We could also see if we can put the help text for each of the supported -X
flags in the table defining these flags […]

GvR again:

--help-env […] prints info about env vars (new flag)


I would enjoy trying to make a patch around next week!

--
messages: 408981
nosy: eric.araujo, serhiy.storchaka
priority: normal
severity: normal
stage: needs patch
status: open
title: python --help output is too long
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



[issue46141] Fix ipaddress.ip_network TypeErrors

2021-12-20 Thread Bar Harel


Change by Bar Harel :


--
status: open -> pending

___
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

2021-12-20 Thread Bar Harel


New submission from Bar Harel :

IPv4Network accepts a tuple.

If you send a tuple to ip_network instead, it throws a TypeError while 
attempting to format the ValueError message.

--
components: Library (Lib)
messages: 408980
nosy: bar.harel
priority: normal
pull_requests: 28439
severity: normal
status: open
title: Fix ipaddress.ip_network TypeErrors
type: behavior
versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9

___
Python tracker 

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



[issue44413] Improvement mktime error reporting

2021-12-20 Thread Daniel McDonald


Daniel McDonald  added the comment:

Sounds good, thank you, Terry

--
type: enhancement -> behavior

___
Python tracker 

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



[issue44413] Improvement mktime error reporting

2021-12-20 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Daniel, I believe your proposal is an enhancement request that could only be 
implemented in a future version.  I changed headers accordingly.  I leave it to 
Christian or someone else to evaluate the request itself.

--
title: OverflowError: mktime argument out of range after 2019 -> Improvement 
mktime error reporting
type: behavior -> enhancement

___
Python tracker 

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



[issue46140] Some API methods could take const Py_buffer* instead of Py_buffer *

2021-12-20 Thread David Hewitt


Change by David Hewitt :


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

___
Python tracker 

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



[issue44413] OverflowError: mktime argument out of range after 2019

2021-12-20 Thread Daniel McDonald


Daniel McDonald  added the comment:

A definitive assessment was obtained by Aurelien with Debian:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1001774

In brief, the OverflowError is expected and correct. 

Two factors contribute to the difference in observed behavior. First, the 
production of the -1 from mktime which Python uses to raise OverflowError 
depends on whether timezone is or is not set (e.g. "Etc/UTC"). This was 
confirmed on the Github Actions 20.04 ubuntu instance independent of Python 
directly with the mktime() function from C. Second, mktime returning -1 to 
indicate overflow is dependent on glibc >= 2.29, and versions prior "do not 
report any error if the date is not representable." This second factor is 
supported by testing the lack of the -1 (and subsequent OverflowError) on 
Github Actions ubuntu 18.04, which uses an older version of glibc.

The full thread with Debian is here:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1001774

With regards to CPython, a possible change to consider would be to test if 
tm_isdst < 0 prior to the mktime call, and if that evaluates true to provide an 
error indicating use requires a timezone being set. I think that change would 
make Python's behavior consistent with glibc >= 2.29, and smooth over a 
potential platform dependency, while also providing an informative error 
message. However, I have limited knowledge of how timezones are implemented and 
am unsure if more than "Etc/UTC" would result in tm_isdst being < 0. 

If that change makes sense, I'd be happy to submit a pull request to that 
effect. However, I recognize there may be considerations not accounted for here 
particularly as this is a central module, so I'll hold off issuing a pull 
request until hearing back from on this matter.

--

___
Python tracker 

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



[issue46140] Some API methods could take const Py_buffer* instead of Py_buffer *

2021-12-20 Thread David Hewitt


New submission from David Hewitt :

The limited api methods `PyBuffer_GetPointer`, `PyBuffer_FromContiguous`, 
`PyBuffer_ToContiguous` and `PyMemoryView_FromBuffer` take buffer arguments as 
`Py_buffer *`.

They do not mutate the buffer info, so could simply take `const Py_buffer *`.

There is already precedent to take `const Py_buffer *` argument in 
`PyBuffer_IsContiguous`.

I'm going to submit a PR to fix.

--
messages: 408976
nosy: davidhewitt
priority: normal
severity: normal
status: open
title: Some API methods could take const Py_buffer* instead of Py_buffer *
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



[issue5993] python produces zombie in webbrowser.open

2021-12-20 Thread C.A.M. Gerlach


C.A.M. Gerlach  added the comment:

I can verify that this still occurs on Linux under an up to date Python 3.9 env 
(unknown browser; I can inquire), while on my Windows machine running an 
essentially identical Python 3.9 env, I don't get the warning. The practical 
problem arises when we are using `-X dev`/`-W error` and/or strict 
`filterwarnings` with Pytest, and the user passes a custom `--open-browser` 
flag to our test suite to open the resulting output in their web browser to 
inspect it for themselves. See 
[spyder-ide/docrepr#33](https://github.com/spyder-ide/docrepr/pull/33#discussion_r772164817)
 for details. I'm concerned this is going to be difficult to work around 
without doing over-broad silencing of warnings on the Pytest, because the 
warning is raised when the object is GC'ed, which may happen at a 
non-deterministic time or even after or even Python invocation level, and I 
can't reproduce it on my machine to test it.

--
nosy: +CAM-Gerlach
status: pending -> open

___
Python tracker 

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



[issue46137] Update/change built-in keyword type used in RE example

2021-12-20 Thread Vivek Vashist


Change by Vivek Vashist :


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



[issue46137] Update/change built-in keyword type used in RE example

2021-12-20 Thread Vivek Vashist


Vivek Vashist  added the comment:

Thanks Eric.

--

___
Python tracker 

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



[issue46139] Boolean Logic Check - Built-in Types Documentation page

2021-12-20 Thread Abri Vincent


Abri Vincent  added the comment:

A short circuit operator. 

x OR y - if x is false, then y, else x (1). 

(1) This is a short-circuit operator, so it only evaluates the second argument 
if the first one is false.

The first argument is 'if'
The second argument is 'then'
The third argument is 'else'

Move to the second argument if the first is false. 
Evaluate the first argument 'if x is false' - look at the second argument if 
the first argument is false - 'then y'.

--

___
Python tracker 

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



[issue46139] Boolean Logic Check - Built-in Types Documentation page

2021-12-20 Thread Abri Vincent


Change by Abri Vincent :


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



[issue46139] Boolean Logic Check - Built-in Types Documentation page

2021-12-20 Thread Abri Vincent

New submission from Abri Vincent :

On the documentation page https://docs.python.org/3/library/stdtypes.html the 
header 'Boolean Operations — and, or, not' provides a table (attached as an 
image). 

It states: 

a.1) x OR y - if x is false, then y, else x **
a.2) x AND y - if x is false, then x, else y **

When I read this i intuit the following

b.1) x OR y - if x is false, then x, else y
b.2) x AND y - if x is false, then y, else x

Providing an example with a.1 which is currently listed in the documentation

If x is false -> else x = False (we don't check if Y=True which is the 
definition of an OR operator). 

** This is a short-circuit operator, so it only evaluates the second argument 
if the first one is false.

I would appreciate clarification on this and if others see an issue with the 
documentation after reading my description able then movement on consensus to 
correct the documentation

--
assignee: docs@python
components: Documentation
messages: 408972
nosy: abriabrisham, docs@python
priority: normal
severity: normal
status: open
title: Boolean Logic Check - Built-in Types Documentation page

___
Python tracker 

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



[issue46024] Different behaviour with zipfile

2021-12-20 Thread Eric V. Smith


Eric V. Smith  added the comment:

It looks like this was changed in https://bugs.python.org/issue42043

@jaraco might have some insights.

--
nosy: +jaraco

___
Python tracker 

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



[issue37295] Possible optimizations for math.comb()

2021-12-20 Thread Tim Peters


Tim Peters  added the comment:

Just curious about why the focus on the newer exp2 and log2? Logs are logs, and 
the "natural" `exp()` and `log()` should work just as well. On Windows, exp2() 
is particularly poor for now (I've seen dozens of cases of errors over 2 ulp, 
with exp2(x) very much worse than the Windows pow(2, x)).

--

___
Python tracker 

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



[issue46051] Make @atexit.register work for functions with arguments

2021-12-20 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It cannot work this way.

atexit.register() as a function allows you to specify arguments which will be 
passed to the registered function, but if it is used as a decorator, only one 
argument (the function itself) is passed to atexit.register() (it is how 
decorators work). When used as a decorator it can only register functions 
without parameters.

On other hand, the function corresponding to a class method requires the class 
argument. There is no magic to determine it at the decoration time, because the 
class does not exist yet. It will be created only after the class definition 
body be executed.

It is possible to create a decorator which work the way you want. The simplest 
method perhaps to create a classmethod subclass with __set_name__() method. 
__set_name__() will be called after creating the class.

class mydecorator(classmethod):
def __set_name__(self, type, name):
atexit.register(self.__func__, type)

class Program:
@mydecorator
def clean_up(cls):
...

--

___
Python tracker 

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



[issue46051] Make @atexit.register work for functions with arguments

2021-12-20 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Yes, that is the list.

Serhiy, can you comment on using atexit.register and classmethod decorators 
together?  Or suggest someone else?

--
nosy: +serhiy.storchaka

___
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

2021-12-20 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset e5cf31d3c2b30d12f238c6ab26d15855eefb2a8a by Pablo Galindo Salgado 
in branch '3.9':
[3.9] bpo-46110: Add a recursion check to avoid stack overflow in the PEG 
parser (GH-30177) (#30215)
https://github.com/python/cpython/commit/e5cf31d3c2b30d12f238c6ab26d15855eefb2a8a


--

___
Python tracker 

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



[issue10483] http.server - what is executable on Windows

2021-12-20 Thread mike mcleod


Change by mike mcleod :


--
pull_requests: +28437
pull_request: https://github.com/python/cpython/pull/30216

___
Python tracker 

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



[issue41210] Docs: More description(warning) about LZMA1 + BCJ with FORMAT_RAW

2021-12-20 Thread Smith129

Smith129  added the comment:

https://hackemtu.com/mediaflix-plus-apk-mod/ Plus Apk Mod é sua fonte número um 
de filmes e séries gratuitas. Desfrute de milhões de filmes e séries 
gratuitamente e sem login. Aqui, oferecemos Mediaflix Plus Apk Mod 
gratuitamente. Então, vamos começar com uma visão geral rápida.

--
nosy: +Smith129

___
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

2021-12-20 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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



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

2021-12-20 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset dc73199a212a44553578eb4952631e5ba9e5f292 by Pablo Galindo Salgado 
in branch '3.10':
[3.10] bpo-46110: Add a recursion check to avoid stack overflow in the PEG 
parser (GH-30177) (GH-30214)
https://github.com/python/cpython/commit/dc73199a212a44553578eb4952631e5ba9e5f292


--

___
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

2021-12-20 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +28436
pull_request: https://github.com/python/cpython/pull/30215

___
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

2021-12-20 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +28435
pull_request: https://github.com/python/cpython/pull/30214

___
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

2021-12-20 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset e9898bf153d26059261ffef11f7643ae991e2a4c by Pablo Galindo Salgado 
in branch 'main':
bpo-46110: Add a recursion check to avoid stack overflow in the PEG parser 
(GH-30177)
https://github.com/python/cpython/commit/e9898bf153d26059261ffef11f7643ae991e2a4c


--

___
Python tracker 

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



[issue37295] Possible optimizations for math.comb()

2021-12-20 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
Removed message: https://bugs.python.org/msg408963

___
Python tracker 

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



[issue37295] Possible optimizations for math.comb()

2021-12-20 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Stand by.  I think I can implement this using only bit integer arithmetic. Will 
post tomorrow.

--

___
Python tracker 

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



[issue37295] Possible optimizations for math.comb()

2021-12-20 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> The problem here is that C gives no guarantees about accuracy of either log2 
> or exp2

* The input table has hard-wired constants so there is no dependency on log2(). 
 The inputs can be as exact as pi, tau, and e.

* The C library's exp2() function doesn't have to be perfect. Just being good 
would suffice.  Our test suite already requires that exp2() be within 5 ulp:

self.ftest('exp2(2.3)', math.exp2(2.3), 4.924577653379665)

* With a perfect exp2(), the first failure is at C(50, 22).  With a forced 
error of 5 ulp, it happens at C(48, 24).  So keeping n <= 47 that would let 
exp2() be off substantially and still give correct answers.

* Since exp2() is deterministic, it is easy to write a test that covers all 
C(n, r) where 0 <= r <= n <= 47.  If there were to be a problem, we would know 
right away and early during the release cycle.

* Also, it is easy to prove that C(n, r) always gives the correct result for a 
given ulp error bound on exp2() and a given limit on n.

* The speed-up is substantial, so this is worth consideration.



> factorial(49) has 163 significant binary digits.

Exact factorials aren't needed.  The important fact (no pun intended) is that 
comb(47, 23).bit_length() == 44.  For this to work, we need one addition and 
one subtraction of 53 bit approximations to come within 44 bits of the true 
answer.

--

___
Python tracker 

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



[issue46138] Strange behavior with lists

2021-12-20 Thread Eric V. Smith


Eric V. Smith  added the comment:

You're using a set (with {}), not a list (with []).

I'd give you a working example, but since you posted a picture I can't copy, 
paste, and edit your example. In the future, please post text, not pictures.

--
nosy: +eric.smith
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue46138] Strange behavior with lists

2021-12-20 Thread Daniel Frey


New submission from Daniel Frey :

Hi

I found a strange behavior with lists. When I want to save the list {3,1,8}, it 
saves the 8 at the first entry. Only when I add the integers 7 and 9, the 8 is 
placed correctly. (See the attached picture)

Can anyone help me understand what is going on here?

Thanks in advance!

--
files: python_strange_behavior.png
messages: 408960
nosy: daniel.frey
priority: normal
severity: normal
status: open
title: Strange behavior with lists
type: behavior
versions: Python 3.10
Added file: https://bugs.python.org/file50505/python_strange_behavior.png

___
Python tracker 

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



[issue34624] -W option and PYTHONWARNINGS env variable does not accept module regexes

2021-12-20 Thread Thomas Gläßle

Change by Thomas Gläßle :


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



[issue34624] -W option and PYTHONWARNINGS env variable does not accept module regexes

2021-12-20 Thread Thomas Gläßle

Thomas Gläßle  added the comment:

Ok, it seems at least the incorrect documentation has been fixed in the mean 
time.

I'm going to close this as there seems to be no capacity to deal with this.

--

___
Python tracker 

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



[issue46136] "dh low key " issue when try to connect mysql

2021-12-20 Thread Christian Heimes


Christian Heimes  added the comment:

DH_KEY_TOO_SMALL means that you are using weak and easy to break keys for your 
connections. Recent versions of OpenSSL prevent insecure connections. You can 
lower the security setting for a context with:

>>> import ssl
>>> context = ssl.create_default_context()
>>> context.set_ciphers("DEFAULT@SECLEVEL=1")

You need to figure out yourself how to pass an insecure context to your 
database connector.

--
resolution:  -> wont fix
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



[issue23819] test_asyncio fails when run under -O

2021-12-20 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 95948169d75bed3936284ea2225e83e07ec5fe20 by Miss Islington (bot) 
in branch '3.10':
bpo-23819: Get rid of assert statements in test_asyncio (GH-30212) (GH-30213)
https://github.com/python/cpython/commit/95948169d75bed3936284ea2225e83e07ec5fe20


--

___
Python tracker 

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



[issue46024] Different behaviour with zipfile

2021-12-20 Thread flvn.dev


flvn.dev  added the comment:

The output of:

```python
print(repr(path), repr(ZipPath(path)))

```

gives this in both versions:

```
PosixPath('logs/2020/2020101.zip') Path('logs/2020/2020101.zip', '')
PosixPath('logs/2021/2021101.zip') Path('logs/2021/2021101.zip', '')
```

--

___
Python tracker 

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



[issue46137] Update/change built-in keyword type used in RE example

2021-12-20 Thread Eric V. Smith


Eric V. Smith  added the comment:

"type" is a natural name to use in this example, and isn't causing any 
problems. I suggest not changing anything.

--
nosy: +eric.smith

___
Python tracker 

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



[issue37295] Possible optimizations for math.comb()

2021-12-20 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

factorial(49) has 163 significant binary digits. It cannot be represented in 
floating-point without losses. And C functions log2() and exp2() can add 
additional errors, depending on platform. We rely on the assumption that all 
errors will be compensated, but there are no guaranties of this.

--

___
Python tracker 

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



[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2021-12-20 Thread Petr Viktorin


Petr Viktorin  added the comment:

The docs for PyFrame_GetCode say it's returning an "int". 
https://docs.python.org/3/c-api/reflection.html#c.PyFrame_GetCode
Same for PyFrame_GetBack. Are there more?

"Get the frame code." is not very clear. Could this link to 
https://docs.python.org/3/c-api/code.html ?

--
nosy: +petr.viktorin

___
Python tracker 

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



[issue37295] Possible optimizations for math.comb()

2021-12-20 Thread Mark Dickinson


Mark Dickinson  added the comment:

> we can get faster code by using a small (3Kb) table of factorial logarithms

The problem here is that C gives no guarantees about accuracy of either log2 or 
exp2, so we'd be playing a guessing game about how far we can go before the 
calculation becomes unsafe (in the sense of the `round` operation potentially 
giving the wrong answer). I think it would be better to stick to integer-only 
arithmetic.

--

___
Python tracker 

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



[issue46137] Update/change built-in keyword type used in RE example

2021-12-20 Thread Vivek Vashist


New submission from Vivek Vashist :

Link: https://docs.python.org/3/library/re.html#writing-a-tokenizer

Noticed that built-in type() class is being used inside the Tokenizer example:

class Token(NamedTuple):
type: str
value: str
line: int
column: int

Should this attribute be updated/renamed to kind or name perhaps ? 

Happy to submit a PR once the change/replacement is confirmed.

--
assignee: docs@python
components: Documentation
messages: 408951
nosy: docs@python, vivekvashist
priority: normal
severity: normal
status: open
title: Update/change built-in keyword type used in RE example
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



[issue23819] test_asyncio fails when run under -O

2021-12-20 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 6ca78affc8023bc5023189d64d8050857662042a by Serhiy Storchaka in 
branch 'main':
bpo-23819: Get rid of assert statements in test_asyncio (GH-30212)
https://github.com/python/cpython/commit/6ca78affc8023bc5023189d64d8050857662042a


--

___
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

2021-12-20 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 6.0 -> 7.0
pull_requests: +28434
pull_request: https://github.com/python/cpython/pull/30213

___
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

2021-12-20 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +serhiy.storchaka
nosy_count: 5.0 -> 6.0
pull_requests: +28433
pull_request: https://github.com/python/cpython/pull/30212

___
Python tracker 

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



[issue46051] Make @atexit.register work for functions with arguments

2021-12-20 Thread quapka


quapka  added the comment:

Hi @terry.reedy,
are you talking about this
https://mail.python.org/mailman3/lists/python-ideas.python.org/
mailing list? Thanks for the tip. However, I don't understand why this isn't 
just buggy/unexpected behavior, because the 3) example seems to work without 
any (observed) issues.

--

___
Python tracker 

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



[issue45996] Worse error from asynccontextmanager in Python 3.10

2021-12-20 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Sorry, I closed it because async behavior reflects sync version now.

If you want to improve both -- you are welcome! Perhaps it is worth another 
issue with another problem description.

--
resolution: fixed -> wont fix

___
Python tracker 

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