[issue29688] Add support for Path.absolute()

2021-03-17 Thread Eryk Sun


Change by Eryk Sun :


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

___
Python tracker 

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



[issue25012] pathlib should allow converting to absolute paths without resolving symlinks

2021-03-17 Thread Eryk Sun


Change by Eryk Sun :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Add support for Path.absolute()

___
Python tracker 

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



[issue34297] Windows py launcher fails to handle a quoted version argument

2021-03-17 Thread Eryk Sun


Change by Eryk Sun :


--
stage: test needed -> needs patch
title: Windows py.exe launcher fail to handle quote correctly -> Windows py 
launcher fails to handle a quoted version argument
versions: +Python 3.10, Python 3.9 -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



[issue35216] misleading error message from shutil.copy()

2021-03-17 Thread Eryk Sun


Change by Eryk Sun :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> shutil.copy raises IsADirectoryError when the directory does 
not actually exist

___
Python tracker 

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



[issue43502] [C-API] Convert obvious unsafe macros to static inline functions

2021-03-17 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

Pablo:
> I agree we should be careful here. There are several things to consider:

Yes, and thanks for your thorough reply and insights. I do not suggest 
converting macros blindly, and I have no intention of doing so. Apart from the 
three PyUnicode_*() cases mentioned in msg388870, I've not found any misuse of 
macros that reuse their arguments in the CPython code base.

Perhaps using a meta-issue is the wrong approach. I guess a PEP is too much? 
I'll start a thread on dpo (or on the list).

Thanks.

--

___
Python tracker 

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



[issue43214] site: Potential UnicodeDecodeError when handling pth file

2021-03-17 Thread Inada Naoki


Inada Naoki  added the comment:

locale-specific encoding is not good especially for Windows.
But we used it for a long time. Changing the encoding for pth files is breaking 
change.

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

___
Python tracker 

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



[issue43526] Programmatic management of BytesWarning doesn't work for native triggers.

2021-03-17 Thread Xavier Morel


New submission from Xavier Morel :

When setting `BytesWarning` programmatically (via the warnings API), though the 
`warnings.filters` value matches what's obtained via `python -b` and an 
explicit `warnings.warn` trigger will trigger, "native" triggers of the warning 
fail to trigger properly:

import warnings
warnings.simplefilter('default', category=BytesWarning)
str(b'')
warnings.warn('test', category=BytesWarning)

If run using `python`, this will print:

test.py:4: BytesWarning: test
  warnings.warn('test', category=BytesWarning)

There is no warning for the string-ification of the bytes instance.

If run using `python -b`, the behaviour is as one would expect:

test.py:3: BytesWarning: str() on a bytes instance
  str(b'')
test.py:4: BytesWarning: test
  warnings.warn('test', category=BytesWarning)

Inspecting `warnings.filters` shows now difference in their contents, in both 
cases it is:

[('default', None, , None, 0), ('default', None, 
, '__main__', 0), ('ignore', None, , None, 0), ('ignore', None, , None, 0), ('ignore', None, , None, 0), ('ignore', None, , None, 
0)]

(in Python 3.9).

The warning module's own suggestion:

import sys
if not sys.warnoptions:
import warnings
warnings.simplefilter("default") # Change the filter in this process

also fails to enable BytesWarning.

If this is intended behaviour, which seems to be the case according to 
ncoghlan's comment https://bugs.python.org/issue32230#msg307721, it should be 
clearly documented, as it's rather frustrating.

--
components: Library (Lib)
messages: 388912
nosy: xmorel
priority: normal
severity: normal
status: open
title: Programmatic management of BytesWarning doesn't work for native triggers.
type: behavior
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



[issue43526] Programmatic management of BytesWarning doesn't work for native triggers.

2021-03-17 Thread Xavier Morel


Xavier Morel  added the comment:

Addendum: is there a way to force `-b` from within the running Python program?

--

___
Python tracker 

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



[issue43527] Support full stack trace extraction in warnings.

2021-03-17 Thread Xavier Morel


New submission from Xavier Morel :

When triggering warnings, it's possible to pass in a `stacklevel` in order to 
point to a more informative cause than the `warnings.warn` call. 

For instance `stacklevel=2` is a common one for DeprecationWarning in order to 
mark the call itself as deprecated in the caller's codebase.

The problem with this is that it's not transitive, so when a dependency 
triggers a warning it can be hard to know where that comes from in the codebase 
(at least without `-Werror` which can prevent reaching the interesting warning 
entirely), and whether this is an issue in the codebase (e.g. passing bytes 
where the library really works in terms of strings) or whether it would be 
possible to work around the warning by using some other API.

In that case, the ability to show a full stack trace from the `stacklevel` down 
is very useful to diagnose such issues.

Not quite sure how it would be managed though: I'd think this should be part of 
the warnings filter information, but the `stacklevel` currently isn't stored 
there, and it might be risky to extend the warnings filter with a 6th field).

--
components: Library (Lib)
messages: 388914
nosy: xmorel
priority: normal
severity: normal
status: open
title: Support full stack trace extraction in warnings.
type: enhancement
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



[issue43526] Programmatic management of BytesWarning doesn't work for native triggers.

2021-03-17 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Yes, it is intended behaviour. BytesWarning is only emitted when you set a 
special internal flag (by the -b option). Warning filters control what happen 
with that warning later: be it ignored, printed, or converted to exception.

In normal circumstances you should never deal with BytesWarning. The -b option 
is only used for testing your program for some possible bugs caused by 
migration from Python 2. If your program always worked only with Python 3, the 
-b option has no use for you.

It may be more complicated if you write a library which support bytes and 
strings. Since you do not know in what program it will be used, it may be nice 
to to test it with mixed bytes and str data and ensure that it works with bytes 
warnings enabled.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue43214] site: Potential UnicodeDecodeError when handling pth file

2021-03-17 Thread STINNER Victor


STINNER Victor  added the comment:

Since it's a Python script, the default encoding should be UTF-8, as any Python 
script. I guess that most pth files don't use characters outside ASCII so it's 
fine.

I think that distutils made a few changes to switch UTF-8 last years, so it's 
possible.

--
nosy: +vstinner

___
Python tracker 

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



[issue43511] tkinter with Tk 8.6.11 is slow on macOS

2021-03-17 Thread Thomas Wamm


Thomas Wamm  added the comment:

I spent a few hours running numerous configurations (M1 Mac Mini, iMac24-2007, 
Win10 on i5-8250U, Raspberry Pi 4B, various Pythons from 3.7.3 to 3.10.0a6). It 
can get confusing. 
The primary interesting result is that Python 3.9.2 and 3.10.0a6 arm64 versions 
on M1 Mac Mini are the absolute worst performers by factors of 2 to 15, when 
relying on tkinter/Tcl/Tk for windows or graphics. Any Python3 on Windows 10 on 
an Intel i5 was at least 8x faster than the M1 Mac.  Intel Python 3.9.2 beats 
arm64 Python 3.9.2 or 3.10.0a6.  The problem is somewhere in the tkinter/Tcl/Tk 
layers or their connection to MacOS and arm64.  Python 3.7.3 on Raspberry OS 
(Linux) performs in the middle between slow MacOS and fast Windows.
The fastest configuration I found on the M1 Mac was Python 3.8.2 (Intel code) 
in combination with deprecated Tcl/Tk 8.5.9; that config was about 8x faster 
than 3.9.2 arm64 with Tcl/Tk 8.6.11.

The simplest qualitative performance test is just use 
>>> help('modules')   (in IDLE vs. python in a Terminal window) 
though my TerraLunar.py graphics program can give quantitative results.

The Turtle graphics demo programs in IDLE also perform slow on the M1 Mac.

--

___
Python tracker 

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



[issue42246] Implement PEP 626 -- Precise line numbers for debugging

2021-03-17 Thread Mark Shannon


Change by Mark Shannon :


--
pull_requests: +23665
pull_request: https://github.com/python/cpython/pull/24902

___
Python tracker 

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



[issue43353] Document that logging.getLevelName() can return a numeric value.

2021-03-17 Thread Fred Drake


Fred Drake  added the comment:


New changeset 9bdb5802361016704fb3434369741cc6c5e08f02 by Mariusz Felisiak in 
branch '3.8':
bpo-43353: Document that logging.getLevelName() accepts string representation 
of logging level. (GH-24693) (#24825)
https://github.com/python/cpython/commit/9bdb5802361016704fb3434369741cc6c5e08f02


--

___
Python tracker 

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



[issue43353] Document that logging.getLevelName() can return a numeric value.

2021-03-17 Thread Mariusz Felisiak


Change by Mariusz Felisiak :


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



[issue43528] "connect_read_pipe" raises errors on Windows for STDIN

2021-03-17 Thread Ivan Kravets


New submission from Ivan Kravets :

Hi there,

It seems that "connect_read_pipe" is not implemented in ProactorEventLoop. Does 
it make sense to update docs in these places?
- https://docs.python.org/3/library/asyncio-platforms.html#windows
- https://docs.python.org/3/library/asyncio-eventloop.html#working-with-pipes 

Or, this is a bug?

# The code to reproduce

```
import asyncio
import sys


async def read_stdin():
reader = asyncio.StreamReader()
protocol = asyncio.StreamReaderProtocol(reader)
await asyncio.get_running_loop().connect_read_pipe(lambda: protocol, 
sys.stdin)
while True:
line = await reader.readline()
print("stdin > ", line)


async def main():
task = asyncio.create_task(read_stdin())
await asyncio.sleep(5)
task.cancel()


if __name__ == "__main__":
asyncio.run(main())
```

P.S: The "loop.add_reader()" raises "NotImplementedError" which is clear 
according to the docs.

Thanks in advance!

# Log

```
C:\Users\USER>.platformio\python3\python.exe test.py
Exception in callback _ProactorReadPipeTransport._loop_reading()
handle: 
Traceback (most recent call last):
  File "C:\Users\USER\.platformio\python3\lib\asyncio\proactor_events.py", line 
299, in _loop_reading
self._read_fut = self._loop._proactor.recv(self._sock, 32768)
  File "C:\Users\USER\.platformio\python3\lib\asyncio\windows_events.py", line 
445, in recv
self._register_with_iocp(conn)
  File "C:\Users\USER\.platformio\python3\lib\asyncio\windows_events.py", line 
718, in _register_with_iocp
_overlapped.CreateIoCompletionPort(obj.fileno(), self._iocp, 0, 0)
OSError: [WinError 6] The handle is invalid

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\USER\.platformio\python3\lib\asyncio\events.py", line 80, in 
_run
self._context.run(self._callback, *self._args)
  File "C:\Users\USER\.platformio\python3\lib\asyncio\proactor_events.py", line 
309, in _loop_reading
self._fatal_error(exc, 'Fatal read error on pipe transport')
  File "C:\Users\USER\.platformio\python3\lib\asyncio\proactor_events.py", line 
131, in _fatal_error
self._force_close(exc)
  File "C:\Users\USER\.platformio\python3\lib\asyncio\proactor_events.py", line 
134, in _force_close
if self._empty_waiter is not None and not self._empty_waiter.done():
AttributeError: '_ProactorReadPipeTransport' object has no attribute 
'_empty_waiter'
Exception ignored in: 
Traceback (most recent call last):
  File "C:\Users\USER\.platformio\python3\lib\asyncio\proactor_events.py", line 
116, in __del__
self.close()
  File "C:\Users\USER\.platformio\python3\lib\asyncio\proactor_events.py", line 
108, in close
self._loop.call_soon(self._call_connection_lost, None)
  File "C:\Users\USER\.platformio\python3\lib\asyncio\base_events.py", line 
746, in call_soon
self._check_closed()
  File "C:\Users\USER\.platformio\python3\lib\asyncio\base_events.py", line 
510, in _check_closed
raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
```

--
components: asyncio
messages: 388919
nosy: asvetlov, ivankravets, yselivanov
priority: normal
severity: normal
status: open
title: "connect_read_pipe" raises errors on Windows for STDIN
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



[issue43065] Delegating to thread and process deadlocks

2021-03-17 Thread doublex


Change by doublex :


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



[issue43352] Add a Barrier object in asyncio lib

2021-03-17 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
nosy: +python-dev
nosy_count: 4.0 -> 5.0
pull_requests: +23666
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/24903

___
Python tracker 

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



[issue43503] [subinterpreters] PyObject statics exposed in the limited API break isolation.

2021-03-17 Thread STINNER Victor


STINNER Victor  added the comment:

Eric Snow proposes that C extensions which want to be compatible with 
subinterpreters must use an hypothetical variant of the C API which doesn't 
inherit flaws of the current C API. For example, static types like 
"&PyLong_Type" would be excluded.

To be clear, the limited C API does expose (indirectly) "&PyLong_Type". We are 
talking about a new variant of the C API.

The main interpreter would continue to use its static type "&PyLong_Type", 
whereas each subinterpreter would get its own "int" type allocated on the heap 
(heap type).

Someone has to write a PoC to ensure that this idea works in practice.

In bpo-40601, I proposed that all interpreters including the main interpreter 
only use heap types: remove "&PyLong_Type" from the C API which is a backward 
incompatible C API change.

--

___
Python tracker 

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



[issue39511] [subinterpreters] Per-interpreter singletons (None, True, False, etc.)

2021-03-17 Thread STINNER Victor


STINNER Victor  added the comment:

Raymond Hettinger: "Shouldn't this wait to see if the subinterpreters PEP is 
approved?  Because if it isn't, then no chance should be made.  We shouldn't 
change something this fundamental without good cause."

I agree that we reached a point where a PEP is needed before pushing further 
"controversial" changes related to subinterpreters and bpo-1635741 (especially 
converting static types to heap types (bpo-40077).

I plan to write multiple PEPs:

* One general PEP about the idea of isolating subinterpreters to be able to run 
them in parallel, without requesting any specific technical change
* One PEP to solve the problem of static types like &PyLong_Type: see bpo-40601 
and bpo-43503
* More PEPs for other controversial changes

--

___
Python tracker 

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



[issue43503] [subinterpreters] PyObject statics exposed in the limited API break isolation.

2021-03-17 Thread Eric Snow


Eric Snow  added the comment:

> I am confused. How can widening the usable number of functions (i.e. using
> the whole C-API rather than the limited API) help c-extension modules be
> usable in subinterpreters? Aren't the same singletons, exception types, and
> other types exposed in the full C-API?

If Py_LIMITED_API is defined then things would stay the same.  Otherwise we 
would replace the names with macros to do the appropriate lookup.  (That isn't 
the whole story since the Py*_Type names are PyTypeObject and not PyObject*.)

--

___
Python tracker 

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



[issue43503] [subinterpreters] PyObject statics exposed in the limited API break isolation.

2021-03-17 Thread Eric Snow


Eric Snow  added the comment:

> PEP 489 is *very much* part of the limited API.

Gah, I missed that.  That said, I don't think it matters; I just lose an easy 
point in the rationale. :)

--

___
Python tracker 

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



[issue43503] [subinterpreters] PyObject statics exposed in the limited API break isolation.

2021-03-17 Thread Eric Snow


Eric Snow  added the comment:

FYI, I'm going to focus discussion on the capi-sig thread.

--

___
Python tracker 

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



[issue43284] Inability to fetch build 20H2

2021-03-17 Thread Steve Dower


Steve Dower  added the comment:

Yeah, that all makes sense. 90%+ of the time, checking the version number is a 
compatibility issue waiting to happen.

For the other 10% (diagnostic logging), it would be nice to have a better 
option than running "cmd /c ver", but that might be the easiest thing to do. 
I'd want to remove any pretence that the returned version is a comparable 
number, and I'm not sure how easily we can do that without hurting 
compatibility...

--

___
Python tracker 

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



[issue43512] Bug in isinstance(instance, cls) with cls being a protocol? (PEP 544)

2021-03-17 Thread Guido van Rossum


Guido van Rossum  added the comment:

Yes, discussion on a close issue is still read, unless people explicitly
unsubscribe (which they rarely do unless the chatter is spam).

--

___
Python tracker 

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



[issue29687] smtplib does not support proxy

2021-03-17 Thread Ryan Hiebert


Change by Ryan Hiebert :


--
nosy: +ryanhiebert

___
Python tracker 

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



[issue43529] pathlib.Path.glob causes OSError encountering symlinks to long filenames

2021-03-17 Thread Eric Frederich


New submission from Eric Frederich :

Calling pathlib.Path.glob("**/*) on a directory containing a symlink which 
resolves to a very long filename causes OSError.

This is completely avoidable since symlinks are not followed anyway.

In pathlib.py, the _RecursiveWildcardSelector has a method _iterate_directories 
which first calls entry.is_dir() prior to excluding based on entry.is_symlink().

It's the entry.is_dir() which is failing.
If the check for entry.is_symlink() were to happen first this error would be 
avoided.

It's worth noting that on Linux "ls -l bad_link" works fine.
Also "find /some/path/containing/bad/link" works fine.
You do get an error however when running "ls bad_link"
I believe Python's glob() should act like "find" on Linux and not fail.
Because it is explicitly ignoring symlinks anyway, it has no business calling 
is_dir() on a symlink.

I have attached a file which reproduces this problem.  It's meant to be ran 
inside of an empty directory.

--
files: uhoh.py
messages: 388927
nosy: eric.frederich
priority: normal
severity: normal
status: open
title: pathlib.Path.glob causes OSError encountering symlinks to long filenames
Added file: https://bugs.python.org/file49884/uhoh.py

___
Python tracker 

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



[issue43529] pathlib.Path.glob causes OSError encountering symlinks to long filenames

2021-03-17 Thread Eric Frederich


Change by Eric Frederich :


--
versions: +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



[issue43529] pathlib.Path.glob causes OSError encountering symlinks to long filenames

2021-03-17 Thread Eric Frederich


Eric Frederich  added the comment:

I verified against all versions available for me to select.
For 3.10 I used the 3.10-rc Docker image.

--
versions: +Python 3.10, 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



[issue43530] email.parser.BytesParser failed to parse mail when it is with BOM

2021-03-17 Thread tzing


New submission from tzing :

Python's builtin `email.parser.BytesParser` could not properly parse the 
message when the bytes starts with BOM.

Not 100% ensured- but this issue seems cause by that `FeedParser._parsegen` 
could not match any of the header line after the data is decoded.

Steps to reproduce:
1. get email sample. any from 
https://github.com/python/cpython/tree/master/Lib/test/test_email/data. I use 
msg_01.txt in following code
2. re-encoded the mail sample to some encoding with BOM
3. use `email.parser.BytesParser` to parse it

```py
import email
with open('msg_01.txt', 'rb') as fp:
msg = email.parser.BytesParser().parse(fp)
print(msg.get('Message-ID'))
```

Expect output `<15090.61304.110929.45...@aaa.zzz.org>`, got `None`

--
components: Library (Lib)
messages: 388929
nosy: tzing
priority: normal
severity: normal
status: open
title: email.parser.BytesParser failed to parse mail when it is with BOM
type: behavior
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



[issue43483] Loss of content in simple (but oversize) SAX parsing

2021-03-17 Thread Larry Trammell


Larry Trammell  added the comment:

Assuming that my understanding is completely correct, the situation is that the 
xml parser has an unspecified behavior.  This is true in any text content 
handler, at any time, and applies to the expat parser as well as SAX. In some 
rare cases, the behavior of the current implementation (and also many past 
ones) sometimes seems inconsistent and can catch users by surprise -- even some 
who are relatively knowledgable (which does not include me). 

This is a little abstract, but two things could be done to improve this:

1. Modify the implementation so that the behavior remains unspecified but falls 
more in line with plausible expectations of the users.  This makes things a 
little more complicated for the implementer, but does not invalidate the 
documentation of present or past versions. 

2. The documentation could be updated to expose the new constraints on the 
previously unspecified behavior, giving users a better chance to recognize and 
prepare for any remaining difficulties.  However, the implementation changes 
could be made even without these documentation changes.

So I remain confused about whether this is really a "bug" -- it is an "easy but 
unfortunate implementation choice" that is technically not wrong, even if 
sometimes baffling.  Established applications that already use older parser 
versions are relatively unlikely to start failing given the kind of documents 
they process, so backport changes might be helpful but do not seem urgent. 

Eric, with this clarification, what is your opinion about how to properly post 
a new issue -- improvement or bug fix?  I can provide a more detailed technical 
explanation where a new issue is posted.

--

___
Python tracker 

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



[issue39511] [subinterpreters] Per-interpreter singletons (None, True, False, etc.)

2021-03-17 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



[issue43531] Turtle module does not work

2021-03-17 Thread Adrian LeDeaux


New submission from Adrian LeDeaux :

So when I try to do the command "import turtle" all I get back is: 

Traceback (most recent call last):
  File "", line 1, in 
import turtle
  File "/Users/Virsatech/Documents/turtle.py", line 2, in 
t = turtle.Pen()
AttributeError: partially initialized module 'turtle' has no attribute 'Pen' 
(most likely due to a circular import)

that error exactly. And I have tried many times. Anyone know how to fix?

--
assignee: terry.reedy
components: IDLE
messages: 388931
nosy: aledeaux, terry.reedy
priority: normal
severity: normal
status: open
title: Turtle module does not work
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



[issue43483] Loss of content in simple (but oversize) SAX parsing

2021-03-17 Thread Eric V. Smith


Eric V. Smith  added the comment:

Could you give an example (using a list of callbacks and values or something) 
that shows how it's behaving that you think is problematic? That's the part I'm 
not understanding. This doesn't have to be a real example, just show what the 
user is getting that's not obvious to the normal user.

--

___
Python tracker 

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



[issue43531] Turtle module does not work

2021-03-17 Thread Mark Dickinson


Mark Dickinson  added the comment:

You have a local file named `turtle.py`, which is conflicting with the standard 
library `turtle` module.  Rename your local file to something else, then you'll 
be able to import the standard library `turtle` module.

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue43531] Turtle module does not work

2021-03-17 Thread Adrian LeDeaux


Adrian LeDeaux  added the comment:

Oh, OK. I am not an expert on python so I did not understand the error. Thanks 
for the help, and I will update you if the problems continue.

--

___
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-03-17 Thread Christoph Anton Mitterer


Christoph Anton Mitterer  added the comment:

I guess that the translation from CRLF to LF simply happens before the size 
restriction is enforced (which is good so, btw), so effectively it:

will not *read* at most size characters from the stream, but *return* at most 
size characters from it (with any newlines translated before, and thus more 
characters read from the stream than returned)

--

___
Python tracker 

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



[issue43531] Turtle module does not work

2021-03-17 Thread Adrian LeDeaux


Adrian LeDeaux  added the comment:

That fixed it.

--

___
Python tracker 

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



[issue43531] Turtle module does not work

2021-03-17 Thread Mark Dickinson


Change by Mark Dickinson :


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



[issue43284] Inability to fetch build 20H2

2021-03-17 Thread Eryk Sun


Eryk Sun  added the comment:

> For the other 10% (diagnostic logging), it would be nice to have a
> better option than running "cmd /c ver"

CMD's VER command (cmd!eVersion) calls GetVersion(), for which, in its case, 
the API calls the internal function GetVersion_Current(). The VER command also 
reads the UBR value (update build revision) directly from the registry.

Other than using CMD, I suppose there's the option of creating an extension 
module in C++ that gets the Win32_OperatingSystem WMI data, which includes the 
"major.minor.build" version string. But that's much more complicated.

--

___
Python tracker 

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



[issue43483] Loss of content in simple (but oversize) SAX parsing

2021-03-17 Thread Larry Trammell


Larry Trammell  added the comment:

Sure...  I'll cut and paste some of the text I was organizing to go into a 
possible new issue page.

The only relevant documentation I could find was in the "xml.sax.handler" page 
in the Python 3.9.2 Documentation for the Python Standard Library (as it has 
been through many versions):

---
ContentHandler.characters(content) -- The Parser will call this method to 
report each chunk of character data.  SAX parsers may return all contiguous 
character data in a single chunk, or they may split it into several chunks...
---

As an example, here is a typical snippet taken from Web page

 https://www.tutorialspoint.com/parsing-xml-with-sax-apis-in-python 

The application example records the tag name "type" in the "CurrentData" 
member, and shortly thereafter, the "type" tag's content is received:

   # Call when a character is read
   def characters(self, content):
  if self.CurrentData == "type":
 self.type = content

Suppose that the parser receives the following text line from the input file.  

SciFi

Though there seems no reason for it, the parser could decide to deliver the 
content text as "Sc" followed by "iFi".  In that case, a second invocation of 
the "characters" method would overwrite the characters received in the first 
invocation, and some of the content text seems "lost."  

Given how rarely it happens, I suspect that when internal processing reaches 
the end of a block of buffered text from the input file, the easiest thing to 
do is to report any fragments of text that happen to remain at the end, no 
matter how tiny, and start fresh with the next internal buffer. Easy for the 
implementer, but baffling to the application developer.  And rare enough to 
elude application testing.

--

___
Python tracker 

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



[issue43483] Loss of content in simple (but oversize) SAX parsing

2021-03-17 Thread Eric V. Smith


Eric V. Smith  added the comment:

Thanks, that's very helpful. Does this only affect content text?

This should definitely be documented.

As far as changing it, I think the best thing to do is say that if the context 
text is less than some size (I don't know, maybe 1MB?) that it's guaranteed to 
be in one callback, but if it's larger than that it might be in multiple 
chunks. I think you could open this as a feature request. I have no idea how 
difficult or expensive it would be to implement this.

--

___
Python tracker 

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



[issue43483] Loss of content in simple (but oversize) SAX parsing

2021-03-17 Thread Larry Trammell


Larry Trammell  added the comment:

Great minds think alike I guess... 

I was thinking of a much smaller carryover size... maybe 1K. With individual 
text blocks longer than that, the user will almost certainly be dealing with 
collecting and aggregating content text anyway, and in that case, the problem 
is solved before it happens. 

Here is a documentation change I was experimenting with...

---
ContentHandler.characters(content) -- The Parser will call this method to 
report chunks of character data.  In general, character data may be reported as 
a single chunk or as sequence of chunks; but character data sequences with 
fewer than  xml.sax.handler.ContiguousChunkLength characters, when 
uninterrupted any other xml.sax.handler.ContentHandler event, are guaranteed to 
be delivered as a single chunk...  
---

That puts users on notice, "...wait, are my chunks of text smaller than that?" 
and they are less likely to be caught unaware.  But of course, the 
implementation change would be helpful even without this extra warning.

--

___
Python tracker 

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



[issue43471] Fails to import bz2 on Ubuntu

2021-03-17 Thread Eric V. Smith


Eric V. Smith  added the comment:

I'm going to close this. @xmm: If you can provide more information showing that 
this is a bug in Python or its build process, please re-open this issue.

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



[issue43483] Loss of content in simple (but oversize) SAX parsing

2021-03-17 Thread Eric V. Smith


Eric V. Smith  added the comment:

I think that's good text, once the enhancement is made. But for existing 
versions of python, shouldn't we just document that the text might come back in 
chunks?

I don't have a feel for what the limit should be.

--

___
Python tracker 

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



[issue43477] from x import * behavior inconsistent between module types.

2021-03-17 Thread Brett Cannon


Brett Cannon  added the comment:

Having `test_pkg.test_submodule` be set after your import based on the sequence 
of imports your example executes is entirely expected and a side-effect of how 
import is (at least now) designed. So I disagree with the assessment "that 
nothing here was requested by the user", since imports have side-effects, and 
one of those is setting submodules as attributes on packages post-import.

Thanks for the report and all the details, Thomas, but I am still going to 
close this as not a bug.

--
resolution:  -> not a bug
status: open -> closed

___
Python tracker 

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



[issue43284] Inability to fetch build 20H2

2021-03-17 Thread Steve Dower


Steve Dower  added the comment:

CMD is not going to be subjected to compatibility shims that hide the version 
number, and I *think* those are not inherited by child processes. So it can use 
the basic APIs. (It's also likely to be the comparison that most people will 
check against.)

I agree that using WMI is probably overkill. PyWin32 or a new extension module 
could handle it for people who have a more urgent need.

--

___
Python tracker 

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



[issue43531] Turtle module does not work

2021-03-17 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

For next time, the turtle module is not part of IDLE.

--
assignee: terry.reedy -> 
components: +Library (Lib) -IDLE

___
Python tracker 

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



[issue43483] Loss of content in simple (but oversize) SAX parsing

2021-03-17 Thread Larry Trammell


Larry Trammell  added the comment:

Oh, and whether this affects only content text...

I would presume so, but I don't know how to tell for sure.  Unspecified 
behaviors can be very mysterious!

--

___
Python tracker 

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



[issue29687] smtplib does not support proxy

2021-03-17 Thread Christian Heimes


Christian Heimes  added the comment:

The Python standard library has no builtin support for socks proxy. I suggest 
that you report issues with socks library to the author of the package.

By the way the smptlib makes it really easy to override the socket object with 
a custom implementation:

class SocksSMTP(smtplib.SMTP):
def _get_socket(self, host, port, timeout):
return some_socket_like_object(...)

--
nosy: +christian.heimes
resolution:  -> third party
stage:  -> resolved
status: open -> closed
type:  -> behavior

___
Python tracker 

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



[issue34535] queue.Queue(timeout=0.001) avg delay Windows:14.5ms, Ubuntu: 0.063ms

2021-03-17 Thread Eryk Sun


Eryk Sun  added the comment:

See the related discussion in bpo-41299. The system interrupt period can be 
lowered to 1 ms with timeBeginPeriod() -- or lower with undocumented 
NtSetTimerResolution(). This affects the resolution of dispatcher waits such as 
Sleep() and WaitForSingleObject(), as well as the resolution of 
Query[Unbiased]InterruptTime(). But apparently GetTickCount[64]() has a fixed 
update frequency of 64 ticks/second (15.625 ms period), regardless of the 
system interrupt period. The combination of WaitForSingleObject() with 
GetTickCount64() has marginally better resolution and consistent performance if 
the system interrupt period is lowered to 1 ms.

If a wait needs to be resumable in order to handle SIGINT, and it should 
perform consistently with other waits, then there are two choices. One option 
is to base the timeout on Query[Unbiased]InterruptTime(), for which the 
resolution depends on the system interrupt period. Conversely, if we want all 
waits to perform consistently and independent of the system interrupt period, 
then they should all depend on GetTickCount64(). This could be implemented in 
one place, such as Modules/signalmodule.c, with the addition of _Py_Sleep(), 
Py_WaitForSingleObject(), and _Py_WaitForMultipleObjects(). On the main thread, 
these wait functions would include the SIGINT event and resume the wait if the 
SIGINT handler doesn't raise an exception.

--
versions: +Python 3.10, Python 3.8, Python 3.9 -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



[issue43532] Add keyword-only fields to dataclasses

2021-03-17 Thread Eric V. Smith


New submission from Eric V. Smith :

The idea is that a keyword-only field becomes a keyword-only argument to 
__init__().

For the proposal and a discussion, see 
https://mail.python.org/archives/list/python-id...@python.org/message/FI6KS4O67XDEIDYOFWCXMDLDOSCNSEYG/

The @dataclass decorator will get a new parameter, kw_only, which defaults to 
False. If kw_only=True, all fields in the dataclass will be by efault 
keyword-only. In addition, field() will have a new kw_only parameter. If true, 
the field will be keyword-only. If false, it will not be keyword-only. If 
unspecified, it will use the value of dataclass's kw_only parameter.

In addition, a module-level variable KW_ONLY will be added. If a field has this 
type, then all fields after it will default to kw_only=True. The field is 
otherwise completely ignored.

Examples:

@dataclasses.dataclass
class A:
a: Any = field(kw_only=True) 

Will have __init__(self, *, a)

@dataclasses.dataclass(kw_only=True)
class B:
a: Any
b: Any 

Will have __init__(self, *, a, b)

@dataclasses.dataclass
class C:
a: Any
_: dataclasses.KW_ONLY
b: Any
c: Any

Will have __init__(self, a, *, b, c)

If any non-keyword-only parameters are present, they will be moved before all 
keyword-only parameters, only for the generated __init__. All other generated 
methods (__repr__, __lt__, etc.) will keep fields in the declared order, which 
is the case in versions 3.9 and earlier.

@dataclasses.dataclass
class D:
a: Any
b: Any = field(kw_only=True)
c: Any

Will have __init__(self, a, c, *, b)

PR to follow.

--
assignee: eric.smith
components: Library (Lib)
messages: 388949
nosy: eric.smith
priority: normal
severity: normal
status: open
title: Add keyword-only fields to dataclasses
type: enhancement
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



[issue34535] queue.Queue(timeout=0.001) avg delay Windows:14.5ms, Ubuntu: 0.063ms

2021-03-17 Thread Steve Dower


Steve Dower  added the comment:

Given that extra info, I'd say we're fine to document that our timeouts can't 
do any better than the OS, which "for example, is typically around 15ms on 
Windows", and recommend using non-blocking calls instead.

--

___
Python tracker 

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



[issue43532] Add keyword-only fields to dataclasses

2021-03-17 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

This looks like a duplicate of https://bugs.python.org/issue33129 or that 
ticket can be closed.

--
nosy: +xtreak

___
Python tracker 

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



[issue43483] Loss of content in simple (but oversize) SAX parsing

2021-03-17 Thread Larry Trammell


Larry Trammell  added the comment:

I think the existing ContentHandler.characters(content) documentation DOES say 
that the text can come back in chunks... but it is subtle.  It might be 
possible to say more explicitly that any content no matter how small is allowed 
to be returned as any number of chunks at any time... Though true, that is 
harsh, overstating considerably what actually happens.   Concentrating on a 
better implementation would be more effective than worrying about existing 
documentation, given how long the existing conditions have prevailed. My 
opinion, as one who has been bitten.

--

___
Python tracker 

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



[issue33129] Add kwarg-only option to dataclass

2021-03-17 Thread Eric V. Smith


Eric V. Smith  added the comment:

Closing this in favor of issue 43532, which has a slightly elaborated approach.

--
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> Add keyword-only fields to dataclasses

___
Python tracker 

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



[issue43499] Compiler warnings in building Python 3.9 on Windows

2021-03-17 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset db733761060be92915b5f5cba209dcaada88f94e by Ammar Askar in branch 
'3.9':
[3.9] bpo-43499: Restrict co_code to be under INT_MAX in codeobject (GH-20628) 
(GH-24896)
https://github.com/python/cpython/commit/db733761060be92915b5f5cba209dcaada88f94e


--

___
Python tracker 

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



[issue43499] Compiler warnings in building Python 3.9 on Windows

2021-03-17 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Thank you Ammar.

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



[issue43531] Turtle module does not work

2021-03-17 Thread Adrian LeDeaux


Adrian LeDeaux  added the comment:

OK.

--

___
Python tracker 

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



[issue43511] tkinter with Tk 8.6.11 is slow on macOS

2021-03-17 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

The result of help('modules') depends on Python version. Do you have any 
example which does not depend on Python version?

Could you also run some pure Tcl/Tk demos to check whether the difference is in 
Tcl/Tk instead of the wrapper?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue29687] smtplib does not support proxy

2021-03-17 Thread Ryan Hiebert


Ryan Hiebert  added the comment:

Thank you, Christian. It sounds like you believe that we should view the 
`_get_socket` method as a public interface? That at least makes it possible to 
use a proxy socket through an appropriate mechanism, which solves my use-case.

--

___
Python tracker 

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



[issue43483] Loss of content in simple (but oversize) SAX parsing

2021-03-17 Thread Larry Trammell


Larry Trammell  added the comment:

If there were a decision NOT TO FIX... maybe then it would make sense to 
consider documentation patches at a higher priority.  That way, SAX-Python (and 
expat-Python) tutorials across the Web could start patching their presentations 
accordingly.

--

___
Python tracker 

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



[issue29687] smtplib does not support proxy

2021-03-17 Thread Christian Heimes


Christian Heimes  added the comment:

It's not a public API but it's a stable API. It hasn't changed since Python 2.6 
and commit 366d6262f81 from 2007. It's unlikely to change in the near future.

--

___
Python tracker 

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



[issue43532] Add keyword-only fields to dataclasses

2021-03-17 Thread Kamil Turek


Change by Kamil Turek :


--
nosy: +kamilturek

___
Python tracker 

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



[issue43532] Add keyword-only fields to dataclasses

2021-03-17 Thread Ryan Hiebert


Change by Ryan Hiebert :


--
nosy: +ryanhiebert

___
Python tracker 

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



[issue34535] queue.Queue(timeout=0.001) avg delay Windows:14.5ms, Ubuntu: 0.063ms

2021-03-17 Thread Eryk Sun


Eryk Sun  added the comment:

> Given that extra info, I'd say we're fine to document that our timeouts 
> can't do any better than the OS, which "for example, is typically 
> around 15ms on Windows", and recommend using non-blocking calls 
> instead.

The 15.625 ms resolution limit is fine, as long as performance is predictable. 
I don't like the random inconsistency introduced by extending only certain 
waits, in different ways, to support SIGINT and/or waits longer than 49.7 days. 
For example, time.sleep() doesn't ignore WAIT_TIMEOUT to recompute the 
remaining time, so it's not subject to the resolution limit that's imposed by 
GetTickCount64().

I'd prefer a common implementation of _Py_Sleep, _Py_WaitForSingleObject, and 
_Py_WaitForMultiple objects in order to be able to definitively state that all 
wait timeouts are unconditionally limited to the resolution reported by 
time.get_clock_info('monotonic').resolution; are not limited to 49.7 days; and 
can be interrupted by Ctrl+C in the main thread -- except for waiting on I/O. 
(There's an open issue to enable Ctrl+C to cancel synchronous I/O in the main 
thread -- such as reading from a pipe.)

--

___
Python tracker 

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



[issue34535] queue.Queue(timeout=0.001) avg delay Windows:14.5ms, Ubuntu: 0.063ms

2021-03-17 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue21822] KeyboardInterrupt during Thread.join hangs that Thread

2021-03-17 Thread Eryk Sun


Change by Eryk Sun :


--
components: +Extension Modules, Interpreter Core
versions: +Python 3.10, Python 3.9 -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



[issue42855] pathlib.exists on Windows raises an exception on URL like/bad input

2021-03-17 Thread Eryk Sun


Change by Eryk Sun :


--
components: +Library (Lib)
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



[issue43395] os.path states that bytes can't represent all MBCS paths under Windows

2021-03-17 Thread Eryk Sun


Change by Eryk Sun :


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



[issue32451] venv activate bash script has wrong line endings in Windows

2021-03-17 Thread Eryk Sun


Eryk Sun  added the comment:

The POSIX "Lib/venv/scripts/common/activate" script needs a line-ending 
exception in ".gitattributes":

https://github.com/python/cpython/blob/master/.gitattributes

--
title: python -m venv activation issue when using cygwin on windows -> venv 
activate bash script has wrong line endings in Windows
versions: +Python 3.10, Python 3.9 -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



[issue43437] venv activate bash script has wrong line endings on windows

2021-03-17 Thread Eryk Sun


Change by Eryk Sun :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> venv activate bash script has wrong line endings in Windows

___
Python tracker 

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



[issue39340] shutil.rmtree and write protected files

2021-03-17 Thread Eryk Sun


Eryk Sun  added the comment:

> What I would expect is a consistent behaviour and as a 
> user I am not interested in inner guts of differences 
> between filesystems.

It's already consistent. msg360033 contains a misunderstanding about what write 
permission on a file means in Unix. The parent directory controls whether a 
file can be unlinked -- except for immutable files. For example:

$ mkdir test; touch test/file.txt; chmod -w test
$ python3.8 -c "import shutil; shutil.rmtree('test')"
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.8/shutil.py", line 715, in rmtree
_rmtree_safe_fd(fd, path, onerror)
  File "/usr/lib/python3.8/shutil.py", line 672, in _rmtree_safe_fd
onerror(os.unlink, fullname, sys.exc_info())
  File "/usr/lib/python3.8/shutil.py", line 670, in _rmtree_safe_fd
os.unlink(entry.name, dir_fd=topfd)
PermissionError: [Errno 13] Permission denied: 'file.txt'

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



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

2021-03-17 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



[issue33240] shutil.rmtree fails if inner folder is open in Windows Explorer

2021-03-17 Thread Eryk Sun


Eryk Sun  added the comment:

> Explorer keeps handles open to directories to get updates via
> ReadDirectoryChangesExW. It opens watched directories with 
> shared delete access, so deleting the child succeeds. But as 
> discussed above, the directory isn't unlinked from the parent
> until Explorer closes its handle.

In Windows 10, NTFS allows deleting an empty directory that's currently opened 
with shared-delete access, so this race condition will be increasingly less 
common. For example:

access = GENERIC_READ
sharing = FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE
disposition = OPEN_EXISTING
flags = FILE_FLAG_BACKUP_SEMANTICS

os.mkdir('spam')
h = CreateFile('spam', access, sharing, None, disposition, flags, None)
os.rmdir('spam')

>>> print(GetFinalPathNameByHandle(h, 0))
\\?\C:\$Extend\$Deleted\004E632F70819337

FAT filesystems do not support this capability, and may never support it, so 
the problem hasn't gone away completely.

--
versions: +Python 3.10, Python 3.9 -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



[issue33240] shutil.rmtree fails if inner folder is open in Windows Explorer

2021-03-17 Thread Eryk Sun


Change by Eryk Sun :


--
components:  -IO

___
Python tracker 

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



[issue35883] Python startup fails with a fatal error if a command line argument contains an invalid Unicode character

2021-03-17 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 9976834f807ea63ca51bc4f89be457d734148682 by Victor Stinner in 
branch 'master':
bpo-35883: Py_DecodeLocale() escapes invalid Unicode characters (GH-24843)
https://github.com/python/cpython/commit/9976834f807ea63ca51bc4f89be457d734148682


--

___
Python tracker 

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



[issue35883] Python startup fails with a fatal error if a command line argument contains an invalid Unicode character

2021-03-17 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 7.0 -> 8.0
pull_requests: +23667
pull_request: https://github.com/python/cpython/pull/24905

___
Python tracker 

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



[issue35883] Python startup fails with a fatal error if a command line argument contains an invalid Unicode character

2021-03-17 Thread miss-islington


Change by miss-islington :


--
pull_requests: +23668
pull_request: https://github.com/python/cpython/pull/24906

___
Python tracker 

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



[issue40533] [subinterpreters] Don't share Python objects between interpreters

2021-03-17 Thread STINNER Victor


STINNER Victor  added the comment:

> To get one GIL per interpreter (bpo-40512), either PyObject.ob_refcnt member 
> must become an atomic variable, or subinterpreters must not share any object.

The current plan is to not share any object between two interpreters, so this 
PR is not needed. I close my PR 19958 which marked PyObject.ob_refcnt as atomic.

--

___
Python tracker 

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



[issue25386] msvcrt_putch/msvcrt_putwch don't check the return value of _putch/_putwch

2021-03-17 Thread Eryk Sun


Change by Eryk Sun :


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

___
Python tracker 

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



[issue43068] test_subprocess: test_specific_shell() fails on AMD64 FreeBSD Shared 3.x

2021-03-17 Thread STINNER Victor


STINNER Victor  added the comment:

The two FreeBSD 3.x buildbot are back to green, I close the issue.

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



[issue42370] test_ttk_guionly: test_to() fails on the GitHub Ubuntu job

2021-03-17 Thread STINNER Victor


Change by STINNER Victor :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue43228] Regression in function builtins

2021-03-17 Thread STINNER Victor


STINNER Victor  added the comment:

Issue fixed in bpo-42990.

--
priority: release blocker -> 
resolution:  -> fixed
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



[issue42990] Improve the C code for calling Python code: _PyEval_EvalCode()

2021-03-17 Thread STINNER Victor


STINNER Victor  added the comment:

I checked manually cloudpickle_bug.py attached to bpo-43228: it works as 
expected. The bpo-43228 regression has been fixed. I close again the issue.

It was proposed to add a builtins parameter to the types.FunctionType 
constructor. If someone wants to add it: please go ahead ;-)

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



[issue39090] Document various options for getting the absolute path from pathlib.Path objects

2021-03-17 Thread 4-launchpad-kalvdans-no-ip-org


Change by 4-launchpad-kalvdans-no-ip-org :


--
nosy: +4-launchpad-kalvdans-no-ip-org

___
Python tracker 

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



[issue35883] Python startup fails with a fatal error if a command line argument contains an invalid Unicode character

2021-03-17 Thread miss-islington


miss-islington  added the comment:


New changeset aa967ec4d4c2fc844f8f16b339140b050ae4d5e2 by Miss Islington (bot) 
in branch '3.9':
bpo-35883: Py_DecodeLocale() escapes invalid Unicode characters (GH-24843)
https://github.com/python/cpython/commit/aa967ec4d4c2fc844f8f16b339140b050ae4d5e2


--

___
Python tracker 

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



[issue43244] Move PyArena C API to the internal C API

2021-03-17 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +23669
pull_request: https://github.com/python/cpython/pull/24907

___
Python tracker 

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



[issue30044] shutil.copystat should (allow to) copy ownership, and other attributes

2021-03-17 Thread Steve Dower


Steve Dower  added the comment:

Just wanted to add that the sooner we can offer a wrapper around CopyFileEx on 
Windows (with no callbacks), the sooner we can take advantage of some 
significant optimisations that are being done to this function (which I can't 
share details of right now, but concrete work is being done).

Personally, I'm fine with it being copy2() and we take the slight behaviour 
change. But it should definitely be easy for users to access and use.

--
nosy: +steve.dower

___
Python tracker 

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



[issue42730] TypeError/hang inside of Time.Sleep() when _thread.interrupt_main()

2021-03-17 Thread Eryk Sun


Eryk Sun  added the comment:

> Shouldn't the behaviour for _thread.interrupt_main() be always to 
> interrupt the main thread. 

The underlying C API function, PyErr_SetInterrupt(), simulates SIGINT without 
actually sending the signal to the process via kill() or raise(), but the doc 
string of interrupt_main() doesn't explain this, or at least it didn't used to. 
bpo-43356 generalized _thread.interrupt_main() to support simulating any 
available signal, and hopefully the new doc string [1] clarifies the intent.

---

[1] 
https://github.com/python/cpython/blob/9976834f807ea63ca51bc4f89be457d734148682/Modules/_threadmodule.c#L1194

--
stage:  -> resolved
status: open -> closed
superseder:  -> _thread.interrupt_main() errors if SIGINT handler in SIG_DFL, 
SIG_IGN

___
Python tracker 

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



[issue43244] Move PyArena C API to the internal C API

2021-03-17 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset b4536e1c6abe4c6219177a89e16575d05ea22f64 by Victor Stinner in 
branch 'master':
bpo-43244: Rename pycore_ast.h to pycore_ast_state.h (GH-24907)
https://github.com/python/cpython/commit/b4536e1c6abe4c6219177a89e16575d05ea22f64


--

___
Python tracker 

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



[issue22128] patch: steer people away from codecs.open

2021-03-17 Thread Irit Katriel


Irit Katriel  added the comment:

Since Martin corrected the docs in issue 19548 for python 3, and python 2 is no 
longer relevant, I believe this can be closed.

--
nosy: +iritkatriel
resolution:  -> duplicate
status: open -> pending
superseder:  -> 'codecs' module docs improvements

___
Python tracker 

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



[issue43244] Move PyArena C API to the internal C API

2021-03-17 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +23670
pull_request: https://github.com/python/cpython/pull/24908

___
Python tracker 

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



[issue43532] Add keyword-only fields to dataclasses

2021-03-17 Thread Eric V. Smith


Change by Eric V. Smith :


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

___
Python tracker 

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



[issue27901] DOC: inspect.ismethod returns different results on the same basic code between Python2.7 Python3.5

2021-03-17 Thread Irit Katriel


Irit Katriel  added the comment:

There seems to be agreement on this resolution:

> add a cross link from 'bound method' to
> the 'instance methods' section of the data model docs.

I'm updating version and marking as easy.

--
keywords: +easy
nosy: +iritkatriel
title: inspect.ismethod returns different results on the same basic code 
between Python2.7 Python3.5 -> DOC: inspect.ismethod returns different results 
on the same basic code between Python2.7 Python3.5
type:  -> enhancement
versions: +Python 3.10 -Python 3.5

___
Python tracker 

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



[issue43244] Move PyArena C API to the internal C API

2021-03-17 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 526fdeb2278b61653df704d7cfcaedde504dee48 by Victor Stinner in 
branch 'master':
bpo-43244: Add pycore_ast.h header file (GH-24908)
https://github.com/python/cpython/commit/526fdeb2278b61653df704d7cfcaedde504dee48


--

___
Python tracker 

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



[issue43244] Move PyArena C API to the internal C API

2021-03-17 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +23672
pull_request: https://github.com/python/cpython/pull/24910

___
Python tracker 

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



[issue12575] add a AST validator

2021-03-17 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +vstinner
nosy_count: 8.0 -> 9.0
pull_requests: +23674
pull_request: https://github.com/python/cpython/pull/24911

___
Python tracker 

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



[issue43244] Move PyArena C API to the internal C API

2021-03-17 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +23673
pull_request: https://github.com/python/cpython/pull/24911

___
Python tracker 

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



[issue31861] add aiter() and anext() functions

2021-03-17 Thread jack1142


Change by jack1142 :


--
nosy: +jack1142

___
Python tracker 

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



  1   2   >