[issue43289] step bug in turtle's for loop

2021-02-26 Thread Yehuda Katz


Yehuda Katz  added the comment:

Thank you Terry, and take care.

Yehuda


Virus-free.
www.avg.com

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Sat, Feb 27, 2021 at 4:41 AM Terry J. Reedy 
wrote:

>
> Terry J. Reedy  added the comment:
>
> Yehuda, one can also ask questions like this on python-list.
>
> In the future, when responding by email, please delete the message being
> responded to, so it does not get repeated when posted to the web page.
>
> --
> nosy: +terry.reedy
> resolution:  -> not a bug
> stage:  -> resolved
> status: open -> closed
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue43335] _ctypes/callbacks.c cannot be compiled by gcc 4.4.7 (RHEL6)

2021-02-26 Thread Dong-hee Na


Dong-hee Na  added the comment:

@Daniel

Do you want to submit the patch?

--

___
Python tracker 

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



[issue43335] _ctypes/callbacks.c cannot be compiled by gcc 4.4.7 (RHEL6)

2021-02-26 Thread Dong-hee Na


Change by Dong-hee Na :


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

___
Python tracker 

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



[issue43335] _ctypes/callbacks.c cannot be compiled by gcc 4.4.7 (RHEL6)

2021-02-26 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10

___
Python tracker 

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



[issue42128] Structural Pattern Matching (PEP 634)

2021-02-26 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

I am not sure if this was mentioned. There are a couple of places where 
switch/case is mentioned in the docs and it will be good if these places were 
updated to the tutorial or PEP.

https://docs.python.org/3/faq/design.html#why-isn-t-there-a-switch-or-case-statement-in-python
https://docs.python.org/3/tutorial/controlflow.html#if-statements (This is a 
tutorial so linking PEP 634 might be little advanced topic)

Thanks for all the effort into docs.

--
nosy: +xtreak

___
Python tracker 

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



[issue43281] Walrus comprehension rebind checking behavior

2021-02-26 Thread Guido van Rossum


Guido van Rossum  added the comment:

I'd like Emily to have a look at that.

--
nosy: +emilyemorehouse

___
Python tracker 

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



[issue43337] export the set newline value on TextIOBase/TextIOWrapper

2021-02-26 Thread Christoph Anton Mitterer


New submission from Christoph Anton Mitterer :

Hey.

It seems there is no way to determine the newline value (None, '', \n, \r, 
\r\n) of a given text stream.
.newlines rather gives the newlines that have been encountered so far.


Just like .encoding and .errors this would be quite useful for anything that 
gets a stream and operates on it, possibly needing to know which newlines it 
will see when reading from the stream.

One example would be, after line = stream.readline(4096+n) one want's to know 
whether actually a full line of 4096 characters has been read.
Putting aside newline="", for simplicity here, n already depends on whether 
newline was None, \n, \r or \r\n, as would any check like line.endswith(foo).


Maybe some attribute, that indicates the most recently read newline in 
newline="" mode, would be helpful, too.


Cheers,
Chris.

--
components: IO
messages: 387767
nosy: calestyo
priority: normal
severity: normal
status: open
title: export the set newline value on TextIOBase/TextIOWrapper
type: enhancement

___
Python tracker 

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



[issue43305] A typo in /Modules/_io/bufferedio.c

2021-02-26 Thread Ma Lin


Ma Lin  added the comment:

Close as invalid.

They the same effect:

PyErr_GivenExceptionMatches(v, PyExc_BlockingIOError))
PyErr_GivenExceptionMatches(t, PyExc_BlockingIOError))

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



[issue43326] About Zipfile

2021-02-26 Thread Fcant


Change by Fcant :


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



[issue43325] Documentation should warn that 'is' is not a safe comparison operator for most values.

2021-02-26 Thread Terry J. Reedy


Change by Terry J. Reedy :


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



[issue43324] asyncio: add socket getfqdn and gethostbyaddr functions

2021-02-26 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
nosy: +asvetlov, yselivanov
title: asyncio -> asyncio: add socket getfqdn and gethostbyaddr functions

___
Python tracker 

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



[issue43323] UnicodeEncodeError: surrogates not allowed when parsing invalid charset

2021-02-26 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
versions:  -Python 3.6, Python 3.7

___
Python tracker 

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



[issue43323] UnicodeEncodeError: surrogates not allowed when parsing invalid charset

2021-02-26 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
type:  -> behavior

___
Python tracker 

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



[issue43307] Sync site.py and sysconfig.py with PyPy

2021-02-26 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

You marked 3.7 here, which only gets security patches, but submitted a PR for 
master, which is appropriate for enhancements.  ('backport' here on the tracker 
means apply to older version after patching master.)

--
nosy: +terry.reedy
type:  -> enhancement
versions: +Python 3.10 -Python 3.7

___
Python tracker 

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



[issue43305] A typo in /Modules/_io/bufferedio.c

2021-02-26 Thread Ma Lin


Ma Lin  added the comment:

I am trying to write a test-case.

--

___
Python tracker 

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



[issue43306] Error in multiprocessing.Pool's initializer doesn't stop execution

2021-02-26 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Can you add a minimal example with the ignore behavior?

--
assignee: docs@python -> 
nosy: +davin, pitrou, terry.reedy

___
Python tracker 

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



[issue43300] "bisect" module should support reverse-sorted sequences

2021-02-26 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I think that we should just document the use of the new key parameter (and 
otherwise do nothing).

--
nosy: +terry.reedy

___
Python tracker 

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



[issue43289] step bug in turtle's for loop

2021-02-26 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Yehuda, one can also ask questions like this on python-list.

In the future, when responding by email, please delete the message being 
responded to, so it does not get repeated when posted to the web page.

--
nosy: +terry.reedy
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



[issue43281] Walrus comprehension rebind checking behavior

2021-02-26 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
nosy: +gvanrossum

___
Python tracker 

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



[issue43273] Mock `_mock_wraps` is undocumented and inconsistently named

2021-02-26 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Private attributes are not documented because they are private and subject to 
change.  Their use is at one's own risk.  I don't know mock well enough to 
understand 'inconsistent' or comment on the change proposal.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue20503] super behaviour and abstract base classes (either implementation or documentation/error message is wrong)

2021-02-26 Thread Larry Hastings


Change by Larry Hastings :


--
components: +Interpreter Core -Argument Clinic, Documentation
nosy:  -larry

___
Python tracker 

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



[issue43336] document whether io.TextIOBase.readline(size>0) will always read the full newline

2021-02-26 Thread Christoph Anton Mitterer


Christoph Anton Mitterer  added the comment:

"a n > 0size" should have read "a size > 0"

--

___
Python tracker 

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



[issue43336] document whether io.TextIOBase.readline(size>0) will always read the full newline

2021-02-26 Thread Christoph Anton Mitterer


New submission from Christoph Anton Mitterer :

Hey.

It would be nice if the following behaviour could be definitely clarified:

When reading from a text stream with readline(size) with a n > 0size it says: 
"If size is specified, at most size characters will be read."

Also, depending on the settings of newlines of the stream, \r\n would be 
converted to \n.


It's not definitely clear whether a string like
"abc\r\n"
read with a size of = 4 will return "abc\n" (which it seems to do, in other 
words, it reads actually 5 characters, but sill returns only 4), or whether it 
returns "abc\r".


Cheers,
Chris.

--
assignee: docs@python
components: Documentation
messages: 387758
nosy: calestyo, docs@python
priority: normal
severity: normal
status: open
title: document whether io.TextIOBase.readline(size>0) will always read the 
full newline

___
Python tracker 

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



[issue43233] test_os: test_copy_file_range_offset fails on FreeBSD CURRENT

2021-02-26 Thread Kubilay Kocak


Kubilay Kocak  added the comment:

I'll see if I can isolate

--

___
Python tracker 

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



[issue42967] [CVE-2021-23336] urllib.parse.parse_qsl(): Web cache poisoning - `; ` as a query args separator

2021-02-26 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

An example code snippet to detect if the API supports the new parameter at 
runtime for code that wants to use to use something other than the default '&'.

```
if 'separator' in inspect.signature(urllib.parse.parse_qs).parameters:
... parse_qs(..., separator=';')
else:
... parse_qs(...)
```

calling it with the arg and catching TypeError if that fails would also work, 
but might not be preferred as catching things like TypeError is non-specific 
and could hide other problems, making it a code maintenance headache.

--

___
Python tracker 

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



[issue43335] _ctypes/callbacks.c cannot be compiled by gcc 4.4.7 (RHEL6)

2021-02-26 Thread DANIEL VILLENEUVE


New submission from DANIEL VILLENEUVE :

gcc 4.4.7 does not accept #pragma's inside functions.
I made the following patch, inspired by code found in other Python source files.

diff -r U/Python-3.9.2/Modules/_ctypes/callbacks.c 
V/Python-3.9.2/Modules/_ctypes/callbacks.c
433c433
< #if defined(__GNUC__)
---
> #if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && 
> (__GNUC_MINOR__ > 5)))
442c442
< #if defined(__GNUC__)
---
> #if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && 
> (__GNUC_MINOR__ > 5)))

Regards

--
components: ctypes
messages: 387755
nosy: dvilleneuve
priority: normal
severity: normal
status: open
title: _ctypes/callbacks.c cannot be compiled by gcc 4.4.7 (RHEL6)
type: compile error
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



[issue13559] Use sendfile where possible in httplib

2021-02-26 Thread Senthil Kumaran


Senthil Kumaran  added the comment:

Yes, the point number 5. We will have to evaluate if sendfile side-steps and 
avoids the issues noted in issue23740

--

___
Python tracker 

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



[issue42128] Structural Pattern Matching (PEP 634)

2021-02-26 Thread Brandt Bucher


Brandt Bucher  added the comment:


New changeset 145bf269df3530176f6ebeab1324890ef7070bf8 by Brandt Bucher in 
branch 'master':
bpo-42128: Structural Pattern Matching (PEP 634) (GH-22917)
https://github.com/python/cpython/commit/145bf269df3530176f6ebeab1324890ef7070bf8


--

___
Python tracker 

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



[issue43334] venv does not install libpython

2021-02-26 Thread Anup Parikh


New submission from Anup Parikh :

The libpython.a or libpython.so objects are not copied/linked in new virtual 
environments when created with venv.

--
components: C API, Installation, Library (Lib)
messages: 387752
nosy: anuppari
priority: normal
severity: normal
status: open
title: venv does not install libpython
type: behavior

___
Python tracker 

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



[issue13559] Use sendfile where possible in httplib

2021-02-26 Thread Alex Willmer


Alex Willmer  added the comment:

To check my understanding

Is the motivation for the closer to

1. using sendfile() will break $X, and we know X
2. there's high probability sendfile() will break something
3. there's unknown probability sendfile() will break something
4. there's low probability sendfile() will break something, but it is still too 
high
5. any non-trivial change here is too risky, regardless of sendfile()
6. something else?

My guess is 5.

--

___
Python tracker 

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



[issue43328] make test errors

2021-02-26 Thread Alexei S


Alexei S  added the comment:

== Tests result: FAILURE ==

403 tests OK.

3 tests failed:
test_embed test_ssl test_tabnanny

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



[issue43333] utf8 in BytesGenerator

2021-02-26 Thread Darcy Beurle


New submission from Darcy Beurle :

I have some emails that I'm importing from an XML format according to rfc822. 
Some of these have some encoding other than ascii. I create the message with 
the default policy:

message = email.message_from_string(
# Extract text from xml
message_name.find("property_string").text,
policy=email.policy.default)

Then I want to convert this to bytes so I can append it to an IMAP folder using 
the imap_tools package:

mailbox.append(email.as_bytes(),
   "INBOX",
   dt=None,
   flag_set=(imap_tools.MailMessageFlags.SEEN))

Which then leads to the following output:

line 405, in parse_goldmine_output
email.as_bytes(),
  File "/usr/lib64/python3.9/email/message.py", line 178, in as_bytes
g.flatten(self, unixfrom=unixfrom)
  File "/usr/lib64/python3.9/email/generator.py", line 116, in flatten
self._write(msg)
  File "/usr/lib64/python3.9/email/generator.py", line 181, in _write
self._dispatch(msg)
  File "/usr/lib64/python3.9/email/generator.py", line 218, in _dispatch
meth(msg)
  File "/usr/lib64/python3.9/email/generator.py", line 276, in _handle_multipart
g.flatten(part, unixfrom=False, linesep=self._NL)
  File "/usr/lib64/python3.9/email/generator.py", line 116, in flatten
self._write(msg)
  File "/usr/lib64/python3.9/email/generator.py", line 181, in _write
self._dispatch(msg)
  File "/usr/lib64/python3.9/email/generator.py", line 218, in _dispatch
meth(msg)
  File "/usr/lib64/python3.9/email/generator.py", line 436, in _handle_text
super(BytesGenerator,self)._handle_text(msg)
  File "/usr/lib64/python3.9/email/generator.py", line 253, in _handle_text
self._write_lines(payload)
  File "/usr/lib64/python3.9/email/generator.py", line 155, in _write_lines
self.write(line)
  File "/usr/lib64/python3.9/email/generator.py", line 410, in write
self._fp.write(s.encode('ascii', 'surrogateescape'))
UnicodeEncodeError: 'ascii' codec can't encode characters in position 41-43: 
ordinal not in range(128)


If I change the line:

self._fp.write(s.encode('ascii', 'surrogateescape'))

to:

self._fp.write(s.encode('utf8', 'surrogateescape'))

then it writes the email body with the strange characters (same as in the xml). 
I'm not sure how to proceed. Those emails should be able to be processed, but 
the bytes writer doesn't seem to inherit the utf8 encoding from anywhere (e.g. 
if a utf8 policy is used).

--
components: email
messages: 387749
nosy: barry, darcy.beurle, r.david.murray
priority: normal
severity: normal
status: open
title: utf8 in BytesGenerator
type: crash
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



[issue27149] Implement socket.sendmsg() for Windows

2021-02-26 Thread jakirkham


Change by jakirkham :


--
nosy: +jakirkham

___
Python tracker 

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



[issue40007] An attempt to make asyncio.transport.writelines (selector) use Scatter I/O

2021-02-26 Thread jakirkham


Change by jakirkham :


--
nosy: +jakirkham

___
Python tracker 

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



[issue29829] Documentation lacks clear warning of subprocess issue with pythonw

2021-02-26 Thread Eryk Sun


Eryk Sun  added the comment:

This problem can be addressed most easily in _get_handles() by combining the 
case of an invalid standard handle with that of a NULL standard handle, for 
which a file handle is validated via GetFileType(). However, that leaves a 
small window for the handle to become invalid before duplicating it. Instead, 
_get_handles() could deal with a failed _make_inheritable() call by 
substituting a pipe handle.

--
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.6, Python 
3.7

___
Python tracker 

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



[issue43332] http/client.py: - uses multiple network writes, possibly causing excessive network usage and increased implementation complexity on the other end

2021-02-26 Thread Zveinn


Zveinn  added the comment:

also found this: 
https://dynatrace.github.io/OneAgent-SDK-for-Python/docs/encoding.html

It might be relevant ?

--

___
Python tracker 

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



[issue29045] Outdated C api doc about Windows error

2021-02-26 Thread Eryk Sun


Eryk Sun  added the comment:

The documentation still has two references to 
PyErr_SetFromWindowsErrWithFilenameObject, which is not a defined function in 
the C API.

https://docs.python.org/3.10/c-api/exceptions.html#c.PyErr_SetFromWindowsErrWithFilename

--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware
type:  -> enhancement
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.5, Python 
3.6, Python 3.7

___
Python tracker 

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



[issue43332] http/client.py: - uses multiple network writes, possibly causing excessive network usage and increased implementation complexity on the other end

2021-02-26 Thread Zveinn


Zveinn  added the comment:

def _tunnel(self):
connect_str = "CONNECT %s:%d HTTP/1.0\r\n" % (self._tunnel_host,
self._tunnel_port)
connect_bytes = connect_str.encode("ascii") <

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



[issue28474] WinError(): Python int too large to convert to C long

2021-02-26 Thread Eryk Sun


Eryk Sun  added the comment:

format_error() can use format "L" (long long) and then check for a value in the 
accepted range `value >= LONG_MIN && value <= ULONG_MAX`. If the value is out 
of range, raise OverflowError. Otherwise assign the value to DWORD `code`.

--
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.5, Python 
3.6, Python 3.7

___
Python tracker 

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



[issue43332] http/client.py: - uses multiple network writes, possibly causing excessive network usage and increased implementation complexity on the other end

2021-02-26 Thread Zveinn

Zveinn  added the comment:

P.s. Sorry for the formatting of the previous message, I´m new :S

--

___
Python tracker 

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



[issue43332] http/client.py: - uses multiple network writes, possibly causing excessive network usage and increased implementation complexity on the other end

2021-02-26 Thread Zveinn


Change by Zveinn :


--
title: def _tunnel(self): - uses multiple network writes, possibly causing 
excessive network usage and increased implementation complexity on the other 
end -> http/client.py: - uses multiple network writes, possibly causing 
excessive network usage and increased implementation complexity on the other end

___
Python tracker 

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



[issue43332] def _tunnel(self): - uses multiple network writes, possibly causing excessive network usage and increased implementation complexity on the other end

2021-02-26 Thread Zveinn


Change by Zveinn :


--
title: def _tunnel(self): - uses multiple network writes, possibly causing 
unnecessary implementation complexity on the receiving end -> def 
_tunnel(self): - uses multiple network writes, possibly causing excessive 
network usage and increased implementation complexity on the other end

___
Python tracker 

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



[issue43332] def _tunnel(self): - uses multiple network writes, possibly causing unnecessary implementation complexity on the receiving end

2021-02-26 Thread Zveinn


New submission from Zveinn :

Hey, some time ago I ran into some code in the cpython code I thought might be 
possible to improve it a little bit.

https://github.com/python/cpython/blob/master/Lib/http/client.py#L903

This code specifically. 

Notice how the self.send() method is used multiple time to construct the 
CONNECT request. When the network load is high, these different parts actually 
get split into separate network frames.

This causes additional meta data to be sent, effectively costing more bandwidth 
and causing the request to be split into multiple network frames.

This has some interesting behavior on the receiving end as well. 

If you send everything as a single network frame, then the receiver can read 
the entire thing in a single read call. If you send multiple frames, the main 
reader pipe now needs a temporary buffer to encapsulate the multiple calls. 

Because of this, sending requests as many network frames actually causes a rise 
in processing complexity on the receiving end. 

Here is a github issue I made about this problem some time ago: 
https://github.com/psf/requests/issues/5384
In this issue you will find detailed information and screenshots.

My recommendation would be to construct the query as a whole before using a 
single self.send() to send the whole payload in one network frame. Even if we 
ignore the added complexity on the receivers end, the gain in network 
performance is worth it.

--
components: C API
messages: 387742
nosy: zveinn
priority: normal
severity: normal
status: open
title: def _tunnel(self): - uses multiple network writes, possibly causing 
unnecessary implementation complexity on the receiving end
type: performance
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



[issue38302] [3.10] __pow__ and __rpow__ are not reached when __ipow__ returns NotImplemented for **=

2021-02-26 Thread Brett Cannon


Change by Brett Cannon :


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



[issue38302] [3.10] __pow__ and __rpow__ are not reached when __ipow__ returns NotImplemented for **=

2021-02-26 Thread Brett Cannon


Brett Cannon  added the comment:


New changeset cc02b4f2e810ab524d845daa18bc94df5b092dd8 by Alex in branch 
'master':
bpo-38302: __pow__/__rpow__ now called when __ipow__ returns NotImplemented 
(#16459)
https://github.com/python/cpython/commit/cc02b4f2e810ab524d845daa18bc94df5b092dd8


--

___
Python tracker 

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



[issue28462] subprocess pipe can't see EOF from a child in case of a few children run with subprocess

2021-02-26 Thread Eryk Sun


Change by Eryk Sun :


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

___
Python tracker 

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



[issue24045] Behavior of large returncodes (sys.exit(nn))

2021-02-26 Thread Eryk Sun


Eryk Sun  added the comment:

It's still the case in 3.10 that unsigned status codes are limited to 
0x7FFF_, and any larger value gets mapped to -1 (0x_). For example:

>>> rc = subprocess.call([sys.executable, '-c', 'raise 
SystemExit(0x7FFF_)'])
>>> hex(rc)
'0x7fff'
>>> rc = subprocess.call([sys.executable, '-c', 'raise 
SystemExit(0x8000_)'])
>>> hex(rc)
'0x'
>>> rc = subprocess.call([sys.executable, '-c', 'raise 
SystemExit(0xC000_0005)'])
>>> hex(rc)
'0x'

WinAPI ExitProcess() and GetExitCodeProcess() use unsigned values. The latter 
is called by subprocess.Popen.wait(). In practice, this return code, which may 
be larger than 0x7FFF_, might get passed to SystemExit() or os._exit().

--
type:  -> behavior
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.5

___
Python tracker 

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



[issue42962] Windows: SystemError during os.kill(..., signal.CTRL_C_EVENT)

2021-02-26 Thread El Samuko


El Samuko  added the comment:

I'm getting [WinError 87], too, when using the PID.

--

___
Python tracker 

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



[issue42962] Windows: SystemError during os.kill(..., signal.CTRL_C_EVENT)

2021-02-26 Thread El Samuko


El Samuko  added the comment:

@eryksun

I can run the script successfully under cygwin and mingw(git bash).
The python version is 3.9.2

--

___
Python tracker 

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



[issue43331] [Doc][urllib.request] Explicit the fact that header keys are sent in Camel case

2021-02-26 Thread Alix Lourme


Change by Alix Lourme :


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

___
Python tracker 

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



[issue27612] socket.gethostbyname resolving octal IP addresses incorrectly

2021-02-26 Thread Eryk Sun


Eryk Sun  added the comment:

Update from my previous comment in 2016: in Python 3.7+, the socket module's 
setipaddr() function calls Winsock inet_pton() instead of inet_addr(), and 
falls back on getaddrinfo(). Neither supports octal addresses. At least using 
octal fails instead of mistakenly parsing as decimal.

--
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.3, Python 
3.5

___
Python tracker 

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



[issue43331] [Doc][urllib.request] Explicit the fact that header keys are sent in Camel case

2021-02-26 Thread Alix Lourme


New submission from Alix Lourme :

Currently, the Request 
(https://docs.python.org/3/library/urllib.request.html#urllib.request.Request) 
send header keys in Camel case.

This is a choice strategy (no problem with that) and even if headers should be 
considered insensitively (RFC 7230 - 3.2. Header Fields: 
https://tools.ietf.org/html/rfc7230#section-3.2), this is not always the case.

The fact that header keys are "rewritten" (in Camel case) could occurs 
complexity in troubleshooting (for sample: 
https://github.com/probot/adapter-aws-lambda-serverless/issues/62).

Having a note/mention about that in documentation would be nice.

PR will come.

--
assignee: docs@python
components: Documentation
messages: 387736
nosy: axel3rd, docs@python
priority: normal
severity: normal
status: open
title: [Doc][urllib.request] Explicit the fact that header keys are sent in 
Camel case
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



[issue27496] unicodedata.name() doesn't have names for control characters

2021-02-26 Thread Eryk Sun


Change by Eryk Sun :


--
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.5, Python 
3.6

___
Python tracker 

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



[issue42967] [CVE-2021-23336] urllib.parse.parse_qsl(): Web cache poisoning - `; ` as a query args separator

2021-02-26 Thread Matej Cepl


Matej Cepl  added the comment:

Port of the patch to 2.7.18.

--
Added file: 
https://bugs.python.org/file49839/CVE-2021-23336-only-amp-as-query-sep.patch

___
Python tracker 

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



[issue42962] Windows: SystemError during os.kill(..., signal.CTRL_C_EVENT)

2021-02-26 Thread Eryk Sun


Eryk Sun  added the comment:

El Samuko, is that a Windows (Win32), Cygwin, MSYS2, WSL, or some other version 
of bash? The same for Python, and which version of Python is it. With these 
details, I can tell you what `os.kill($WINPID, signal.CTRL_C_EVENT)"` is 
probably doing.

--

___
Python tracker 

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



[issue27263] Tkinter sets the HOME environment variable, breaking scripts

2021-02-26 Thread Eryk Sun


Eryk Sun  added the comment:

ntpath.expanduser() no longer uses HOME (though the doc string still refers to 
$HOME), so at least that problem is resolved. 

I suppose IDLE could work around the HOME issue in Windows by passing 
env=os.environ.copy() in the subprocess.Popen() call that creates the 
subprocess. os.environ will not contain the HOME value that TCL sets in the 
underlying process environment.

--
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.5, Python 
3.6

___
Python tracker 

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



[issue20503] super behaviour and abstract base classes (either implementation or documentation/error message is wrong)

2021-02-26 Thread meanboy Sarikavanich


Change by meanboy Sarikavanich :


--
components: +Argument Clinic
nosy: +larry
type: enhancement -> behavior

___
Python tracker 

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



[issue42962] Windows: SystemError during os.kill(..., signal.CTRL_C_EVENT)

2021-02-26 Thread El Samuko


El Samuko  added the comment:

FWIW, I could send CTRL-C to ffmpeg (else it won't write a valid mp4 header) 
under Windows by using the WINPID and not the PID returned from ps .

```
WINPID=$(ps aux | grep ffmpeg | awk '{print $4}')
python -c "import os, signal; os.kill($WINPID, signal.CTRL_C_EVENT)"
```

I put an example here:
https://gist.github.com/elsamuko/9c3fe69f00a0f847251ffa3ef1d080a2

--
nosy: +elsamuko

___
Python tracker 

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



[issue26565] [ctypes] Add value attribute to non basic pointers.

2021-02-26 Thread Eryk Sun


Change by Eryk Sun :


--
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.6

___
Python tracker 

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



[issue20010] time.strftime('%z') didn't make +HHMM return in windows xp

2021-02-26 Thread Eryk Sun


Change by Eryk Sun :


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

___
Python tracker 

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



[issue11361] suggestion for os.kill(pid,CTRL_C_EVENT) in tests

2021-02-26 Thread Eryk Sun


Change by Eryk Sun :


--
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.4, Python 
3.5, Python 3.6

___
Python tracker 

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



[issue26158] File truncate() not defaulting to current position as documented

2021-02-26 Thread Eryk Sun


Change by Eryk Sun :


--
type:  -> behavior
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.5, Python 
3.6

___
Python tracker 

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



[issue20503] super behaviour and abstract base classes (either implementation or documentation/error message is wrong)

2021-02-26 Thread Eryk Sun


Eryk Sun  added the comment:

The docs still need to clarified that isinstance(obj, type) is a necessary but 
not sufficient condition for success. It would also be helpful if the error 
message were less confusing in the case of registered subclasses such as 
numbers.Number.

--
type:  -> enhancement
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.4, Python 
3.5, Python 3.6

___
Python tracker 

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



[issue43330] xmlrpc.Server URI query and fragment are discarded from HTTP query since py3

2021-02-26 Thread Julien Castiaux


New submission from Julien Castiaux :

Hello,

There is a backward incompatibility between xmlrpc.client and xmlrpclib in 
server classes about how the URI is parsed and used to connect to the remote 
server. While py2's xmlrpclib use the path, query and fragment parts of the URI 
request the server, py3's xmlrpc.client solely uses the path and discard both 
the query and the fragment parts.

In the ProxyServer init method, py2 xmlrpclib does the following to extract the 
URI:

def __init__(self, uri, transport=None, encoding=None, verbose=0,
 allow_none=0, use_datetime=0, context=None):
import urllib
type, uri = urllib.splittype(uri)
self.__host, self.__handler = urllib.splithost(uri)
if not self.__handler:
self.__handler = "/RPC2"

While in ProxyServer init method, py3 xmlrpc.client does the following:

def __init__(self, uri, transport=None, encoding=None, verbose=False,
 allow_none=False, use_datetime=False, use_builtin_types=False,
 *, headers=(), context=None):
p = urllib.parse.urlparse(uri)
self.__host = p.netloc
self.__handler = p.path or "/RPC2"

A Pull Request is coming shortly

--
components: Library (Lib)
messages: 387730
nosy: Julien Castiaux
priority: normal
severity: normal
status: open
title: xmlrpc.Server URI query and fragment are discarded from HTTP query since 
py3
type: behavior
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



[issue24747] ctypes silently truncates ints larger than C int

2021-02-26 Thread Eryk Sun


Change by Eryk Sun :


--
type:  -> behavior
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.4, Python 
3.5, Python 3.6

___
Python tracker 

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



[issue23425] Windows getlocale unix-like with french, german, portuguese, spanish

2021-02-26 Thread Eryk Sun


Change by Eryk Sun :


--
versions: +Python 3.8

___
Python tracker 

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



[issue23425] Windows getlocale unix-like with french, german, portuguese, spanish

2021-02-26 Thread Eryk Sun


Change by Eryk Sun :


--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware
versions: +Python 3.10, Python 3.9 -Python 2.7, Python 3.3, Python 3.4

___
Python tracker 

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



[issue13559] Use sendfile where possible in httplib

2021-02-26 Thread Senthil Kumaran


Senthil Kumaran  added the comment:

Alex, https://bugs.python.org/issue23740 is identified as a dependency on this 
issue. We will have to resolve that first, and come back to this. And yes, if 
you contribute on other's patch, both the contributions will be included and 
appropriately credited.

--

___
Python tracker 

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



[issue17343] Add a version of str.split which returns an iterator

2021-02-26 Thread Juancarlo Añez

Juancarlo Añez  added the comment:

def isplit(text, sep=None, maxsplit=-1):
"""
A lowmemory-footprint version of:

iter(text.split(sep, maxsplit))

Adapted from https://stackoverflow.com/a/9770397
"""

if maxsplit == 0:
yield text
else:
rsep = re.escape(sep) if sep else r'\s+'
regex = fr'(?:^|{rsep})((?:(?!{rsep}).)*)'

for n, p in enumerate(re.finditer(regex, text)):
if 0 <= maxsplit <= n:
yield p.string[p.start(1):]
return
yield p.group(1)

--
nosy: +apalala

___
Python tracker 

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



[issue43315] Decimal.__str__ has no way to force exact decimal representation

2021-02-26 Thread Mark Dickinson


Mark Dickinson  added the comment:

Sure, but that has nothing to do with string representations or formatting, so 
I don't see how it's relevant for this issue: the rounding happens when you 
call `normalize`.

--

___
Python tracker 

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



[issue43329] Multiprocessing Manager Client Not Reconnecting

2021-02-26 Thread Michael L. Boom


New submission from Michael L. Boom :

The client doesn't reconnect automatically, or explicitly.  I just get 
BrokenPipeError over and over.


Manager:
import multiprocessing.managers, os, sys, time
class TestClass(object):
def test_method(self):
print("In test_method")
return "TEST"

class TestManager(multiprocessing.managers.BaseManager):
pass

address = ("127.0.0.1", 54321)
TestManager.register("Test", TestClass)
manager = TestManager(address = address, authkey = "1234".encode("utf-8"))
manager.get_server().serve_forever()


Client:
import multiprocessing.managers, os, sys, time

class TestManager(multiprocessing.managers.BaseManager):
pass

address = ("127.0.0.1", 54321)
TestManager.register("Test")
manager = TestManager(address = address, authkey = "1234".encode("utf-8"))
manager.connect()
test_class = manager.Test()

def call_it():
time.sleep(1)
result = test_class.test_method()
print("result: '" + str(type(result)) + ", " + str(result) + "'")

call_it()

print("Kill and restart the server and press return")
sys.stdin.readline()

error = False
while (True):
try:
if (error):
print("Reconnecting")
manager.connect()
test_class = manager.Test()
call_it()
error = False
except Exception as e:
print("Got exception " + str(type(e)) + ", " + repr(e))
error = True
time.sleep(1)

--
components: Library (Lib)
messages: 387726
nosy: boom0192
priority: normal
severity: normal
status: open
title: Multiprocessing Manager Client Not Reconnecting
type: behavior
versions: Python 3.8

___
Python tracker 

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



[issue43294] [sqlite3] unused variables in Connection begin, commit, and rollback

2021-02-26 Thread Berker Peksag


Change by Berker Peksag :


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



[issue43294] [sqlite3] unused variables in Connection begin, commit, and rollback

2021-02-26 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset 5e48e836883ac577acd69c7b9bdfe5c439cef47f by Erlend Egeberg 
Aasland in branch 'master':
bpo-43294: Remove unused variables in pysqlite_connection_*() (GH-24658)
https://github.com/python/cpython/commit/5e48e836883ac577acd69c7b9bdfe5c439cef47f


--

___
Python tracker 

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



[issue43315] Decimal.__str__ has no way to force exact decimal representation

2021-02-26 Thread Szymon


Szymon  added the comment:

One more thing: It's worth mentioning that by default, you'll get only 28 
significant digits of precision, so doing 
f"{Decimal('1234567890123456789012.12345678').normalize():f}" will produce 
'1234567890123456789012.123457' (two last digits got rounded).

--

___
Python tracker 

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



[issue43060] Convert _decimal C API from pointer array to struct

2021-02-26 Thread Mark Dickinson


Change by Mark Dickinson :


--
nosy:  -mark.dickinson

___
Python tracker 

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



[issue43328] make test errors

2021-02-26 Thread Alexei S


New submission from Alexei S :

this commands are successful:
CXX=/usr/bin/g++ ./configure --enable-optimizations >> log_configure.log
make -j4 >> log_make.log

errors on make test:
make -j4 test >> log_make_test.log


my system:
uname -a
Linux home 5.8.0-43-generic #49~20.04.1-Ubuntu SMP Fri Feb 5 09:57:56 UTC 2021 
x86_64 x86_64 x86_64 GNU/Linux

Linux Mint 20.1 x64 Cinnamon

--
files: PythonCompileLogs.tar.gz
messages: 387723
nosy: asholomitskiy84
priority: normal
severity: normal
status: open
title: make test errors
type: compile error
versions: Python 3.9
Added file: https://bugs.python.org/file49838/PythonCompileLogs.tar.gz

___
Python tracker 

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



[issue43317] python -m gzip could use a larger buffer

2021-02-26 Thread Inada Naoki


Change by Inada Naoki :


--
nosy:  -methane
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions:  -Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue43317] python -m gzip could use a larger buffer

2021-02-26 Thread Inada Naoki


Inada Naoki  added the comment:


New changeset 7956ef884965ac6f9f7f2a27b835ea80e471c886 by Ruben Vorderman in 
branch 'master':
bpo-43317: Use io.DEFAULT_BUFFER_SIZE instead of 1024 in gzip CLI (#24645)
https://github.com/python/cpython/commit/7956ef884965ac6f9f7f2a27b835ea80e471c886


--
nosy: +methane

___
Python tracker 

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



[issue17343] Add a version of str.split which returns an iterator

2021-02-26 Thread Paweł Miech

Paweł Miech  added the comment:

Making string.split iterator sounds like an interesting task. I found this 
issue because recently we talked in project that string.split returns a list 
and it can cause increased memory usage footprint for some tasks when there is 
large response to parse. 

Here is small script, created by my friend Juancarlo Anez, with iterator 
version of string.split. Compared with default string split it uses much less 
memory. When running with memory-profiler tool: 
https://pypi.org/project/memory-profiler/

It creates this output
329
Filename: main.py

Line #Mem usageIncrement  Occurences   Line Contents

24   39.020 MiB   39.020 MiB   1   @profile
25 def generate_string():
26   39.020 MiB0.000 MiB   1   n = 10
27   49.648 MiB4.281 MiB  13   long_string = " 
".join([uuid.uuid4().hex.upper() for _ in range(n)])
28   43.301 MiB   -6.348 MiB   1   print(len(long_string))
29 
30   43.301 MiB0.000 MiB   1   z = isplit(long_string)
31   43.301 MiB0.000 MiB  11   for line in z:
32   43.301 MiB0.000 MiB  10   continue
33 
34   52.281 MiB0.297 MiB  11   for line in 
long_string.split():
35   52.281 MiB0.000 MiB  10   continue


You can see that default string.split uses much more memory.

--
nosy: +Paweł Miech
Added file: https://bugs.python.org/file49837/main.py

___
Python tracker 

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



[issue40469] TimedRotatingFileHandler rotating on use not time

2021-02-26 Thread Ivan Marton


Change by Ivan Marton :


--
keywords: +patch
nosy: +martonivan
nosy_count: 1.0 -> 2.0
pull_requests: +23445
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/24660

___
Python tracker 

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



[issue43326] About Zipfile

2021-02-26 Thread Eric V. Smith


Eric V. Smith  added the comment:

I don't think there's a problem with Python here.

The complaint seems to be one or more of:
- The creating software allowed a newline to be in the filename.
- Windows allows the creation of filenames with newlines.
- The Windows UI doesn't handle filenames with newlines well.

In any event, Python can't do anything about these problems. I suggest we close 
this issue.

--
nosy: +eric.smith

___
Python tracker 

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



[issue43296] [sqlite3] Fix sqlite3_value_blob() usage

2021-02-26 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

> If sqlite3_value_blob() returns NULL, we should check if sqlite3_errcode() 
> equals SQLITE_NOMEM and raise MemoryError if it does.

This also applies to sqlite3_value_text().

It also applies to sqlite3_value_bytes() if a conversion takes place. We don't 
need to care about that as long as we call sqlite3_value_bytes() after 
conversion.

Also, PyTuple_SetItem() errors are not checked.

I would also suggest using PyUnicode_FromStringAndSize() iso. 
PyUnicode_FromString() in case SQLITE_TEXT, to avoid the unneeded strlen(). 
After sqlite3_value_text() is called, we can just use sqlite3_value_bytes(), 
since the length is precomputed as a result of the conversion.

Berker, would you allow a PR to improve all these issues in 
_pysqlite_build_py_params(), or would you prefer them split up in multiple PR's?

--

___
Python tracker 

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



[issue43293] Move note about GIL to top of threading module

2021-02-26 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 30927fa4658a36f647155e9582b598434582a5ce by Guanzhong Chen in 
branch '3.7':
[3.7] bpo-43293: Doc: move note about GIL to top of threading module (GH-24622) 
(#24642)
https://github.com/python/cpython/commit/30927fa4658a36f647155e9582b598434582a5ce


--

___
Python tracker 

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



[issue43296] [sqlite3] Fix sqlite3_value_blob() usage

2021-02-26 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


--
title: [sqlite3] sqlite3_value_bytes() should be called after 
sqlite3_value_blob() -> [sqlite3] Fix sqlite3_value_blob() usage

___
Python tracker 

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



[issue41972] bytes.find consistently hangs in a particular scenario

2021-02-26 Thread Carl Friedrich Bolz-Tereick


Carl Friedrich Bolz-Tereick  added the comment:

> BTW, this initialization in the FASTSEARCH code appears to me to be a  
> mistake:

>skip = mlast - 1;

Thanks for pointing that out Tim! Turns out PyPy had copied that mindlessly and 
I just fixed it.

(I'm also generally following along with this issue, I plan to implement the 
two-way algorithm for PyPy as well, once you all have decided on a heuristic. 
We are occasionally in a slightly easier situation, because for constant-enough 
needles we can have the JIT do the pre-work on the  needle during code 
generation.)

--
nosy: +Carl.Friedrich.Bolz

___
Python tracker 

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



[issue43327] The docs falsely state that PyImport_ImportFrozenModuleObject() returns a new reference

2021-02-26 Thread Zackery Spytz


Change by Zackery Spytz :


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

___
Python tracker 

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



[issue43327] The docs falsely state that PyImport_ImportFrozenModuleObject() returns a new reference

2021-02-26 Thread Zackery Spytz


New submission from Zackery Spytz :

The docs state that PyImport_ImportFrozenModuleObject() returns a new reference,
but it actually returns an int.

https://docs.python.org/3.10/c-api/import.html#c.PyImport_ImportFrozenModuleObject

--
assignee: docs@python
components: Documentation
messages: 387716
nosy: ZackerySpytz, docs@python
priority: normal
severity: normal
status: open
title: The docs falsely state that PyImport_ImportFrozenModuleObject() returns 
a new reference
versions: Python 3.10, 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



[issue43326] About Zipfile

2021-02-26 Thread Fcant

Fcant  added the comment:

Because these special symbols are not handled under the Window, he will report 
an error and will not work properly

From:樊乘乘
Email:fcsc...@outlook.com
Tel:17826260016

发件人: Ronald Oussoren
发送时间: 2021年2月26日 樊乘 17:15
收件人: fcsc...@outlook.com
主题: [issue43326] About Zipfile

Ronald Oussoren  added the comment:

I'm not sure what you are asking here.

Looking at the screenshot I'd say that the zipfile you are trying to extract 
contains files with a newline in their name. That's a perfectly valid (although 
annoying) name on unix-y platforms.

The zipfile module does not have an API for rewriting the file name when 
extracting. It is far from clear to me that adding such a API would be 
generally useful.

Emulating this is fairly easy though, something like:

zf = zipfile.ZipFile(...)
for name in zf.namelist():
stream = zf.open(name)
data = stream.read()
stream.close()
with open(name.replace(...), "w") as stream:
stream.write(data)

--
nosy: +ronaldoussoren

___
Python tracker 

___

--

___
Python tracker 

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



[issue43326] About Zipfile

2021-02-26 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

I'm not sure what you are asking here.

Looking at the screenshot I'd say that the zipfile you are trying to extract 
contains files with a newline in their name. That's a perfectly valid (although 
annoying) name on unix-y platforms. 

The zipfile module does not have an API for rewriting the file name when 
extracting. It is far from clear to me that adding such a API would be 
generally useful. 

Emulating this is fairly easy though, something like:

zf = zipfile.ZipFile(...)
for name in zf.namelist():
stream = zf.open(name)
data = stream.read()
stream.close()
with open(name.replace(...), "w") as stream:
stream.write(data)

--
nosy: +ronaldoussoren

___
Python tracker 

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



[issue43294] [sqlite3] unused variables in Connection begin, commit, and rollback

2021-02-26 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


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

___
Python tracker 

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



[issue40642] Cpython "pystate.h" subdirectory wrong

2021-02-26 Thread Andrew Tomazos


Andrew Tomazos  added the comment:

After studying the include directives in the Include folder, I think the best 
fix would be:

In Include/cpython/state.h:

- #include "cpython/initconfig.h"
+ #include "initconfig.h"

this will mean that state.h will find initconfig.h using a file-relative 
include (as all the other include directives do), instead of relying on the 
installed Include directory being put in the header search path.

As this include directive is the only one with this property, the benefit of 
this change would be that the Include folder would be able to be installed in 
any subdirectory of a search path, rather than requiring its own dedicated one.

This would mean (for example) you could install different versions of the 
Python headers side by side and then select between them using preprocessor 
directives - rather than having to switch up global compiler options.

--

___
Python tracker 

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



[issue42967] [CVE-2021-23336] urllib.parse.parse_qsl(): Web cache poisoning - `; ` as a query args separator

2021-02-26 Thread Matej Cepl


Matej Cepl  added the comment:

> FYI - This was somewhat of an unfortuate API change.  I'm coming across code 
> that relies on ; also being treated as a separator by parse_qs().  That code 
> is now broken with no easy way around it.

So far, we at openSUSE had to package at least SQLAlchemy, Twisted, yarl and 
furl. The author of the first one acknowledged use of semicolon as a bug. I 
don't think it was so bad.

--
nosy: +mcepl

___
Python tracker 

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



[issue40642] Cpython "pystate.h" subdirectory wrong

2021-02-26 Thread Andrew Tomazos


Andrew Tomazos  added the comment:

Related: https://stackoverflow.com/q/63211981/1131467

--

___
Python tracker 

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



[issue40642] Cpython "pystate.h" subdirectory wrong

2021-02-26 Thread Andrew Tomazos


Andrew Tomazos  added the comment:

The problem occurs if you:

   #include 

on *nix systems.  Note `/usr/include/` is in the system include path.  One 
workaround is to `-I/usr/include/python3.8` and then `#include `.  
Another workaround is to comment out:

   // #include "cpython/initconfig.h"

in `cpython/pystate.h`.

A fix would be appreciated, so that `#include ` would work 
out of the box (without having to add `-I`).

--
nosy: +andrewtomazos

___
Python tracker 

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