[issue47149] DatagramHandler doing DNS lookup on every log message

2022-03-29 Thread Eric V. Smith


Eric V. Smith  added the comment:

> I blame the lack of standard POSIX functions for doing DNS lookups 
> asynchronously and in a way that provides TTL information to the client.

I totally agree with that!

And I agree it would be nice to have some way of doing non-blocking lookups 
when the TTL expires (or whenever it decides it needs to do a lookup). But it's 
going to be non-trivial, I fear.

--

___
Python tracker 

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



[issue47155] Strange behavior on the tuple that includes list

2022-03-29 Thread Furkan Onder


New submission from Furkan Onder :

I am creating the tuple that includes a list and than I am trying to add new 
value to this list. Interpreter throw the error, but list is changing. I think 
it doesn't make sense. I think if we throw the type error, list shouldn't be 
change.

>>> tup = ('hi', 'test', ['a','b'])
>>> tup[2] += 'c'
Traceback (most recent call last):
File "", line 1, in 
TypeError: 'tuple' object does not support item assignment
>>> tup
('hi', 'test', ['a', 'b', 'c'])
>>>

--
components: Interpreter Core
messages: 416291
nosy: furkanonder
priority: normal
severity: normal
status: open
title: Strange behavior on the tuple that includes list
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



[issue39971] [doc] Error in functional how-to example

2022-03-29 Thread Eric V. Smith


Change by Eric V. Smith :


--
nosy: +rhettinger

___
Python tracker 

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



[issue47031] math.nan should note that NANs do not compare equal to anything

2022-03-29 Thread Charlie Zhao


Charlie Zhao  added the comment:

I started a PR and some simple examples were added. It is helpful for those who 
are new to IEEE-754.

According to Jelle's comments, the behavior of `float('nan') is float('nan')` 
may be changed in the future, so I just omit it and suggest users to use 
`math.isnan()`. This might make the documentation a bit clearer.

--

___
Python tracker 

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



[issue47149] DatagramHandler doing DNS lookup on every log message

2022-03-29 Thread Bruce Merry


Change by Bruce Merry :


--
type:  -> performance

___
Python tracker 

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



[issue47149] DatagramHandler doing DNS lookup on every log message

2022-03-29 Thread Bruce Merry


New submission from Bruce Merry :

logging.DatagramHandler uses socket.sendto to send the messages. If the given 
address is a hostname rather than an IP address, it will do a DNS lookup every 
time.

I suspect that fixing issue 14855 will also fix this, since fixing that issue 
requires resolving the hostname to determine whether it is an IPv4 or IPv6 
address to create a suitable socket.

I've run into this on 3.8, but tagging 3.10 since the code still looks the same.

--
components: Library (Lib)
messages: 416247
nosy: bmerry
priority: normal
severity: normal
status: open
title: DatagramHandler doing DNS lookup on every log message
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



[issue2604] doctest.DocTestCase fails when run repeatedly

2022-03-29 Thread Pi Delport

Pi Delport  added the comment:

Thanks! ️

--

___
Python tracker 

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



[issue45953] Statically allocate interpreter states as much as possible.

2022-03-29 Thread Julien Palard


Julien Palard  added the comment:

> Since you seem to be challenging the value of 9, my question to you 
> is, why do you care what the refcount of 1 is?

Yesterday I was teaching Python, and we were speaking of integer immutability, 
names being "labels to objects" and so on, and I was showing the memory layout 
of all of this by hand on a whiteboard while "prooving" my drawings using an 
interpreter.

While doing so came a question like "So, many modules can use the object 
int(1)?" So I answered yes, told that I expected many reuse of 1, and went 
importing sys.getrefcount to show them.

And boom, it printed 100209 so I bugged for a few seconds, the value was 
obviously not the real refcount, and was also obviously bumped by a constant 
like 1, so I went inspecting why and found this commit.

I have nothing against keeping 9, but in the other hand it could 
surprise other people, maybe we should at least document it near 
sys.getrefcount.

--

___
Python tracker 

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



[issue47148] sys.path.append before import the module causing module don't have doc-string?

2022-03-29 Thread Rukchad Wongprayoon


New submission from Rukchad Wongprayoon :

How to reproduce?

1. Make a random module with doc-string in the function
2. Make a python app in new folder (under the module folder) and import it by 
do 
```py
import sys
sys.path.append("..")
import 
```
3. then every function will don't have doc-string included in their function

--
components: Library (Lib)
messages: 416242
nosy: timelessnesses
priority: normal
severity: normal
status: open
title: sys.path.append before import the module causing module don't have 
doc-string?
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



[issue47148] sys.path.append before import the module causing module don't have doc-string?

2022-03-29 Thread Rukchad Wongprayoon


Change by Rukchad Wongprayoon :


--
type:  -> behavior

___
Python tracker 

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



[issue47148] sys.path.append before import the module causing module don't have doc-string?

2022-03-29 Thread Rukchad Wongprayoon


Rukchad Wongprayoon  added the comment:

here's the example code

parent/a.py
```py
def multiply():
 """multiply stuff"""
 return 69*420
```

parent/another folder/b.py
```py
import sys
sys.path.append('..')
import a
a.multiply.__doc__ # None
```

--

___
Python tracker 

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



[issue47148] sys.path.append before import the module causing module don't have doc-string?

2022-03-29 Thread Rukchad Wongprayoon


Rukchad Wongprayoon  added the comment:

seems like it doesn't appear in the help func too

--

___
Python tracker 

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



[issue47150] HTTPRedirectHandler fails on POST for 307 and 308

2022-03-29 Thread Jairo Llopis


New submission from Jairo Llopis :

urllib.request.HTTPRedirectHandler fails if there is a 307 HTTP return code in 
a POST request.

In 
https://github.com/python/cpython/commit/c379bc5ec9012cf66424ef3d80612cf13ec51006
 the same behaviour was implemented for 308.

According to https://datatracker.ietf.org/doc/html/rfc7538#section-3 IMHO this 
implementation is wrong for 308:

> Note: This status code is similar to 301 (Moved Permanently)
> ([RFC7231], Section 6.4.2), except that it does not allow changing
> the request method from POST to GET.

A similar note exists in 
https://datatracker.ietf.org/doc/html/rfc7231#section-6.4.7 regarding code 307.

So, as long as the original redirection is in POST and it gets redirected to 
another POST, it should not be an error.

FWIW, in https://github.com/traefik/traefik/issues/7829#issuecomment-770210080 
you can see that Traefik proxy uses 307 and 308 codes by default when 
redirecting non-GET requests.

Thus, urllib.request.HTTPRedirectHandler will fail to process any POST requests 
proxied by Traefik.

--
components: Library (Lib)
messages: 416249
nosy: Jairo Llopis
priority: normal
severity: normal
status: open
title: HTTPRedirectHandler fails on POST for 307 and 308
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



[issue32658] Metacharacter (\) documentation suggestion

2022-03-29 Thread mike mcleod


mike mcleod  added the comment:

Sorry, forgot this one. Would you like me to move this forward? Or do you want 
to take it? I don't mind either way.

--

___
Python tracker 

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



[issue47102] explore hashlib use of the Linux Kernel CryptoAPI

2022-03-29 Thread Christian Heimes


Change by Christian Heimes :


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

___
Python tracker 

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



<    1   2