[issue44881] Consider integration of PyObject_GC_UnTrack() with the trashcan C API

2021-08-12 Thread Neil Schemenauer


Neil Schemenauer  added the comment:

> The problem of PyObject_GC_UnTrack() is just the most visible effect of the
> trashcan mecanism: tp_dealloc can be called twice, and this is *not* expected
> by the tp_dealloc API.

The fact that Py_TRASHCAN_BEGIN and Py_TRASHCAN_END can cause tp_dealloc to be
called more than once is not a huge issue, IMHO.  The statements executed more
than once are the ones before or after the trashcan macros.  If you use them
properly, the multiple calls doesn't cause issues.  The big trap is
to use _PyObject_GC_UNTRACK before Py_TRASHCAN_BEGIN.  It is not safe to call
that macro multiple times.  Anywhere you see Py_TRASHCAN_BEGIN and
_PyObject_GC_UNTRACK before it, that's a bug.

The point of this PR is to make the macros harder to use incorrectly.  If there
is no need to call untrack, Py_TRASHCAN_BEGIN and Py_TRASHCAN_END can normally
be the first and last lines of the tp_dealloc function (declarations can be
inside).  Then, the fact that tp_dealloc is actually called more than once by 
the
trashcan doesn't cause an issue.

tp_dealloc can get called more than once for another reason.  If the object is
resurrected by tp_finalize or tp_del, then tp_dealloc can be called again.
It's pretty mind bending to try to understand all of implications of that. Most
of the ugliness is inside PyObject_CallFinalizerFromDealloc().  The type with
the finalizer has to be careful not to put the object in an invalid state
before it gets resurrected.

> Putting trashcan mecanism outside tp_dealloc can allow to make sure that
> tp_dealloc is called exactly once. _Py_Dealloc() sounds like a good
> candidate, but I didn't check if it's the only way to call tp_dealloc. Are
> there other places where tp_dealloc is called *directly*?

tp_dealloc is called from a few more places, as you found.  As for providing
C-stack exhaustion protection via the trashcan, I think we are only interested
in places were tp_dealloc is called as a result of a DECREF.  And I think that
only goes through _Py_Dealloc().

I suppose it would be possible to blow up the C stack via a call chain like:

subtype_dealloc -> basedealloc -> subtype_dealloc -> basedealloc -> ...

I think you would have to make a long chain of subclasses.  Seems unlikely in
real code so I'm not worried about trying to fix that.

> Using military grade regex, I found the following functions calling 
> tp_dealloc:
> 
> grep 'dealloc[) ]*([a-zA-Z]\+)' */*.c
> 
> * _Py_Dealloc() obviously
> * _PyTrash_thread_destroy_chain()
> * subtype_dealloc()
> * Modules/_testcapimodule.c: check_pyobject_freed_is_freed() <= unit test, it 
> can be ignored
> 
> So if we move the trashcan usage inside functions, 3 functions must be 
> modified:
> 
> * _Py_Dealloc()
> * _PyTrash_thread_destroy_chain()
> * subtype_dealloc()

Take a look at bpo-44897.  It implements the _Py_Dealloc approach. You can see
what needs to be modified.  I removed the Py_TRASHCAN_BEGIN/Py_TRASHCAN_END
macros as well, just because they are not needed anymore.  _PyObject_GC_UNTRACK
calls inside tp_dealloc methods need to be removed because _Py_Dealloc already
does the untrack.  For external extensions, they must be using
PyObject_GC_UnTrack() and so that's safe (object is already untracked and so it
does nothing).

I think the big change is calling tp_dealloc methods with the object already
untracked.  If an extension did something like:

mytype_dealloc(PyObject *self)
{
...
assert(PyObject_GC_IsTracked(self));
...
}

That would break after PR 27738, at least as it's currently written.

The other issue I'm not quite sure about is that
PyObject_CallFinalizerFromDealloc insists that GC objects are tracked when that
function is called.  I think it is okay to just call _PyObject_GC_TRACK on the
ones that are not tracked, to ensure that.  Maybe Tim Peters will jump in and
correct the errors of my thinking.

--
nosy: +tim.peters

___
Python tracker 

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



[issue44908] recommend httpx as well as requests in http.client/urllib.request docs

2021-08-12 Thread Thomas Grainger


New submission from Thomas Grainger :

HTTPX is a fully featured HTTP client for Python 3, which provides sync and 
async APIs, and support for both HTTP/1.1 and HTTP/2.

It's also broadly compatible and inspired by the requests API: 
https://github.com/encode/httpx/blob/master/docs/compatibility.md#requests-compatibility-guide


Currently the project is looking to get a link from the docs to 
https://www.python-httpx.org/

here's the upstream issue https://github.com/encode/httpx/issues/1772

--
assignee: docs@python
components: Documentation
messages: 399494
nosy: docs@python, graingert
priority: normal
severity: normal
status: open
title: recommend httpx as well as requests in http.client/urllib.request docs
versions: Python 3.10, Python 3.11

___
Python tracker 

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



[issue44907] examples code output do not macth the current version 3.9

2021-08-12 Thread 杨青

New submission from 杨青 :

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

I got like this following:
TypeError: function() got multiple values for argument 'a'
not:
TypeError: function() got multiple values for keyword argument 'a'

>>> def function(a):
... pass
...
>>> function(0, a=0)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: function() got multiple values for keyword argument 'a'

--
assignee: docs@python
components: Documentation
messages: 399493
nosy: docs@python, yangqing
priority: normal
severity: normal
status: open
title: examples code output do not macth the current version 3.9
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



[issue44895] refleak test failure in test_exceptions

2021-08-12 Thread Chris Jerdonek


Chris Jerdonek  added the comment:

Out of curiosity, is the failure deterministic in environments where it fails? 
If not, what is the source of the indeterminism -- some kind of race condition 
or something else?

--
nosy: +chris.jerdonek

___
Python tracker 

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



[issue44902] [Doc] Changing 'Mac OS X'/'OS X' to 'macOS'

2021-08-12 Thread meowmeowcat


meowmeowcat  added the comment:

> Isn't it a duplicate of issue41203?

Oh, sorry, I didn't notice that we have issue41203. I'll close this issue.

--
resolution:  -> duplicate
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



[issue34938] Fix mimetype.init() to account for from import

2021-08-12 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

How about returning the updated dicts from init() and showing an example in the 
docs of such usage?

--
nosy: +andrei.avk

___
Python tracker 

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



[issue41234] Remove symbol.sym_name

2021-08-12 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

This can be closed; from the PR note:
Resolved in PR #21624, can close.

--
nosy: +andrei.avk

___
Python tracker 

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



[issue24955] webbrowser broken on Mac OS X when using the BROWSER variable

2021-08-12 Thread Hugo Delgado


Hugo Delgado  added the comment:

Yes, I've created a PR for it.

https://github.com/python/cpython/pull/27751

Happy to adapt it as needed.
Thanks

--

___
Python tracker 

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



[issue24955] webbrowser broken on Mac OS X when using the BROWSER variable

2021-08-12 Thread Hugo Delgado


Change by Hugo Delgado :


--
pull_requests: +26228
stage: test needed -> patch review
pull_request: https://github.com/python/cpython/pull/27751

___
Python tracker 

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



[issue44906] Crash on deep call stack under Windows

2021-08-12 Thread Alejandro Reimondo


New submission from Alejandro Reimondo :

The py8.py file starts a S8 system, a Smalltalk system running on Python 
runtime, I am actually developing (in Beta).
The system is running w/o problems on OSX systems, but crash (fast exit w/o any 
information) when running on Windows.
The crash occurs while compiling a simple expression (simple but produce a deep 
recursion on parsing stage). The expression is shown in "fileMeIn.st".
The issue happens on Windows and python version Python 3.9.2
The stack depth is aprox 1800 frames.
Steps to reproduce the crash:
1.- decompress the zip file in a folder
2.- on command prompt "python -i py8.py"
3.- "Image loaded" must be shown in console
4.- evaluate "t()" to run tests that fileIn the code in "fileMeIn.st"
5.- after aprox. one minute working, the fast exit occurs and the Python VM 
exits without reporting anything on output

--
components: Windows
files: crashWin3.9-2021-08-12.zip
messages: 399487
nosy: aleReimondo, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Crash on deep call stack under Windows
type: crash
versions: Python 3.9
Added file: https://bugs.python.org/file50214/crashWin3.9-2021-08-12.zip

___
Python tracker 

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



[issue38656] mimetypes for python 3.7.5 fails to detect matroska video

2021-08-12 Thread Andrei Kulakov


Change by Andrei Kulakov :


--
keywords: +patch
nosy: +andrei.avk
nosy_count: 8.0 -> 9.0
pull_requests: +26227
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/27750

___
Python tracker 

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



[issue44905] Abstract instance and class attributes for abstract base classes

2021-08-12 Thread Tomasz Rzepecki


New submission from Tomasz Rzepecki :

There seems to be no way to transparently make an abstract base class enforce 
instance attributes for subclasses (without creating a custom metaclass, see 
e.g. 
https://newbedev.com/python-abstract-class-shall-force-derived-classes-to-initialize-variable-in-init).

The analogous problem for enforcing *class* attributes in subclasses can be 
solved by creating an abstract class property (which can then be overridden by 
a class attribute), but this feels like a hack and possibly a bug (see 
https://bugs.python.org/issue44904 for a related bug).

The corresponding "solution" for instance attributes does not work (see 
attached file), and probably rightly so.

This seems like an oversight to me.

--
files: example.py
messages: 399486
nosy: rzepecki.t
priority: normal
severity: normal
status: open
title: Abstract instance and class attributes for abstract base classes
type: enhancement
versions: Python 3.9
Added file: https://bugs.python.org/file50213/example.py

___
Python tracker 

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



[issue44895] refleak test failure in test_exceptions

2021-08-12 Thread Irit Katriel


Irit Katriel  added the comment:

My smallest failing example so far:


def test_recursion_in_except_handler(self):

self.test_no_hang_on_context_chain_cycle2()

def set_relative_recursion_limit(n):
depth = 1
while True:
try:
sys.setrecursionlimit(depth)
except RecursionError:
depth += 1
else:
break
sys.setrecursionlimit(depth+n)

def recurse_in_body_and_except():
try:
recurse_in_body_and_except()
except:
recurse_in_body_and_except()

recursionlimit = sys.getrecursionlimit()
try:
set_relative_recursion_limit(10)
try:
recurse_in_body_and_except()
except RecursionError:
pass
else:
self.fail("Should have raised a RecursionError")
finally:
sys.setrecursionlimit(recursionlimit)

--

___
Python tracker 

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



[issue44891] Tests for `id(a) == id(a * 1)` for `bytes` and `str`

2021-08-12 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

Perhaps it would be better to convert existing such tests to @cpython_only, 
since as far as I know, id() and `is` are implementation-defined for immutable 
objects.

--
nosy: +Dennis Sweeney

___
Python tracker 

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



[issue38856] asyncio ProactorEventLoop: wait_closed() can raise ConnectionResetError

2021-08-12 Thread Artem


Artem  added the comment:

Python 3.9.6 Linux same issue.

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



[issue44904] Erroneous behaviour for abstract class properties

2021-08-12 Thread Tomasz Rzepecki


New submission from Tomasz Rzepecki :

Subclassing an abc with an abstract class property yields to unexpected 
behaviour: the class property is called, and an abstract class may be 
erroneously considered concrete.

See https://stackoverflow.com/a/68763572/4434666 for details.

--
files: bug_report.py
messages: 399482
nosy: rzepecki.t
priority: normal
severity: normal
status: open
title: Erroneous behaviour for abstract class properties
type: behavior
versions: Python 3.9
Added file: https://bugs.python.org/file50212/bug_report.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-08-12 Thread Vinay Sajip


Vinay Sajip  added the comment:

> The assumed behaviour of TimedRotatingFileHandler is to rotate log files 
> older than configured. Even when the script is executed multiple times.

Ah, but is it? The purpose of TimedRotatingFileHandler is to rotate files based 
on time intervals, and is normally assumed to be for long-running processes 
(where the rotation allows one to focus on logs output during a period of 
interest). What's the practical, real-world use-case for the example scripts 
you added?

--

___
Python tracker 

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



[issue41322] unittest: deprecate test methods returning non-None values

2021-08-12 Thread Andrei Kulakov


Change by Andrei Kulakov :


--
keywords: +patch
nosy: +andrei.avk
nosy_count: 8.0 -> 9.0
pull_requests: +26226
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/27748

___
Python tracker 

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



[issue44873] base64 RFC4648 test cases

2021-08-12 Thread Andrei Kulakov


Change by Andrei Kulakov :


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

___
Python tracker 

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



[issue41930] Wrap sqlite3_serialize API in sqlite3 module

2021-08-12 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

I've been fiddling with this between others projects lately; the PR is mostly 
ready. The only remaining issue is how to include this in the Connection object:
- The serialize API was added as a compile-time option 
(SQLITE_ENABLE_DESERIALIZE) in SQLite 3.23.0
- The serialize API was included by default from SQLite 3.36.0, but can be 
disabled using the SQLITE_OMIT_DESERIALIZE compile-time option.

Solution 1: enable the Python sqlite3 serialize API if SQLITE_VERSION_NUMBER >= 
3023000 and force people to build their SQLite library _with_ 
SQLITE_ENABLE_DESERIALIZE defined for SQLite versions 3.23.0 through 3.35.x and 
_without_ SQLITE_OMIT_DESERIALIZE defined for SQLite versions 3.36.0 and onward.

Solution 2: enable the Python sqlite3 serialize API if SQLITE_VERSION_NUMBER >= 
3036000 and force people to build their SQLite library _without_ 
SQLITE_OMIT_DESERIALIZE defined.

Solution 3: build the Python sqlite3 serialize API as a "sub module" to 
_sqlite3 (for example _sqlite3._serialize) and add conditionally add it to 
sqlite3.Connection in Lib/sqlite3/__init__.py or Lib/sqlite3/dbapi2.py.

Solution 4: try to autodetect SQLite compile-time options in setup.py, 
autogenerate a sqlite-config.h header file, and conditionally enable the API 
based on that.

I suggest solution 2, as it adds little code (low maintenance), and will 
require no or minimal changes to the devguide, because (wild guess) in most 
cases SQLITE_OMIT_DESERIALIZE will not be a widely used compile-time option.

(For the python.org macOS and Windows installers, this will not be a problem, 
because we control the SQLite compile-time options.)

--

___
Python tracker 

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



[issue15533] subprocess.Popen(cwd) documentation: Posix vs Windows

2021-08-12 Thread Eryk Sun


Eryk Sun  added the comment:

> I don't understand the wording proposed (that seem backwards to me?)

Thanks. Looks like I inverted the logic of the quoted paragraph. It should have 
been a "relative path with a slash in it" is resolved against the current 
working directory, not "without a slash".

--

___
Python tracker 

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



[issue42560] Improve Tkinter Documentation

2021-08-12 Thread E. Paine


E. Paine  added the comment:

Thank you for looking at this in great detail Mark and that all seems like a 
very useful set of changes! I've got a few more specific comments below, but 
they're mostly just small details.

2. I'd personally prefer alphabetical order (except Tix, which should be last 
because it's deprecated) with a note before / elsewhere that a tkinter / 
tkinter.ttk combination is generally be the best way to create GUIs (perhaps in 
with the hello world example?).

3. IMO this is suited better grouped with the other Tcl/Tk bridge 
documentation. I agree we should probably remove Tix from this section, since 
we're trying to dissuade people from using it.

5. This sounds very reasonable. The accompanying description and list of kwargs 
was what concerned me, but this sounds easily maintainable. Maybe we could 
group e.g. the winfo methods and link directly to the version-independent Tk 
man page for those (https://www.tcl.tk/man/tcl/TkCmd/winfo.html - so we don't 
need to keep changing the links)?

--
components: +Tkinter
versions: +Python 3.11

___
Python tracker 

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



[issue43392] Optimize repeated calls to `__import__()`

2021-08-12 Thread Antoine Pitrou


Change by Antoine Pitrou :


--
components: +Interpreter Core
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
type:  -> performance
versions: +Python 3.11 -Python 3.10, 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



[issue43392] Optimize repeated calls to `__import__()`

2021-08-12 Thread miss-islington

miss-islington  added the comment:


New changeset 03648a2a91f9f1091cd21bd4cd6ca092ddb25640 by Germán Méndez Bravo 
in branch 'main':
bpo-43392: Optimize repeated calls to `__import__()` (GH-24735)
https://github.com/python/cpython/commit/03648a2a91f9f1091cd21bd4cd6ca092ddb25640


--
nosy: +miss-islington

___
Python tracker 

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



[issue42560] Improve Tkinter Documentation

2021-08-12 Thread Mason Ginter


Mason Ginter  added the comment:

Those changes sound great to me, Mark. I've been busy with work and don't think 
I'll have the time to implement those changes. If you or someone else would 
like to work on this, I would gladly let you take over.

--

___
Python tracker 

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



[issue44885] Incorrect exception highlighting for fstring format

2021-08-12 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 4b86c9c5146c339c689830619be9d29b8f7bf417 by Pablo Galindo Salgado 
in branch '3.9':
[3.9] bpo-44885: Correct the ast locations of f-strings with format specs and 
repeated expressions (GH-27729) (GH-27744)
https://github.com/python/cpython/commit/4b86c9c5146c339c689830619be9d29b8f7bf417


--

___
Python tracker 

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



[issue44902] [Doc] Changing 'Mac OS X'/'OS X' to 'macOS'

2021-08-12 Thread Jack DeVries


Jack DeVries  added the comment:

Oh yeah, sorry, it looks like this can be closed as duplicate.

--

___
Python tracker 

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



[issue44902] [Doc] Changing 'Mac OS X'/'OS X' to 'macOS'

2021-08-12 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Isn't it a duplicate of issue41203?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue44895] refleak test failure in test_exceptions

2021-08-12 Thread Irit Katriel


Irit Katriel  added the comment:

This fails (test_recursion_normalizing_with_no_memory is not needed):

./python.exe -m test -R 3:3 test_exceptions -m 
test_no_hang_on_context_chain_cycle2 -m 
test_recursion_normalizing_infinite_exception -m 
test_recursion_in_except_handler

--

___
Python tracker 

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



[issue44895] refleak test failure in test_exceptions

2021-08-12 Thread Irit Katriel


Change by Irit Katriel :


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

___
Python tracker 

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



[issue44891] Tests for `id(a) == id(a * 1)` for `bytes` and `str`

2021-08-12 Thread Nikita Sobolev


Change by Nikita Sobolev :


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

___
Python tracker 

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



[issue44885] Incorrect exception highlighting for fstring format

2021-08-12 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue44885] Incorrect exception highlighting for fstring format

2021-08-12 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset c28c2e1cb0dd5fc8b17514e2c4ee17415af733a4 by Pablo Galindo Salgado 
in branch '3.10':
[3.10] bpo-44885: Correct the ast locations of f-strings with format specs and 
repeated expressions (GH-27729) (GH-27743)
https://github.com/python/cpython/commit/c28c2e1cb0dd5fc8b17514e2c4ee17415af733a4


--

___
Python tracker 

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



[issue44894] HTTP request handler should check sys.stderr for None before use for logging

2021-08-12 Thread Xiaoling Bao


Xiaoling Bao  added the comment:

It looks https://bugs.python.org/issue43348 has the same root cause as this 
one. When running with pythonservice.exe or pythonw.exe, sys.stderr will be 
None and thus causing crash when logging messages (calling sys.stderr.write).

--
type:  -> behavior

___
Python tracker 

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



[issue44885] Incorrect exception highlighting for fstring format

2021-08-12 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +26222
pull_request: https://github.com/python/cpython/pull/27744

___
Python tracker 

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



[issue44885] Incorrect exception highlighting for fstring format

2021-08-12 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +26221
pull_request: https://github.com/python/cpython/pull/27743

___
Python tracker 

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



[issue44885] Incorrect exception highlighting for fstring format

2021-08-12 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 8e832fb2a2cb54d7262148b6ec15563dffb48d63 by Pablo Galindo Salgado 
in branch 'main':
bpo-44885: Correct the ast locations of f-strings with format specs and 
repeated expressions (GH-27729)
https://github.com/python/cpython/commit/8e832fb2a2cb54d7262148b6ec15563dffb48d63


--

___
Python tracker 

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



[issue44903] [Doc] How does one to about getting onto the "Other Graphical User Interface Packages" page?

2021-08-12 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

The direct answer is that you open an issue like you did, make an argument, as 
you did, and then submit a pull request.  But we certainly do not need two 
redundant lists.

The Othergui page has a link to
https://wiki.python.org/moin/GuiProgramming
which is not gated and where PySimpleGUI *is* listed.

I think that coredev should get out of the business of maintaining curated GUI 
lists.  I agree that the restricted Othergui page should be deleted (and any 
reference thereto removed) and think that the list on the faq should be 
replaced by a reference to the Wiki and to PyPI.  Zach, can you prepare a PR?

--
nosy: +terry.reedy

___
Python tracker 

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



[issue44903] [Doc] How does one to about getting onto the "Other Graphical User Interface Packages" page?

2021-08-12 Thread Zachary Ware


Zachary Ware  added the comment:

I don't have the bandwidth to do so at the moment, but am willing to review one 
:)

--
keywords: +easy, newcomer friendly
stage:  -> needs patch
type:  -> enhancement

___
Python tracker 

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



[issue42560] Improve Tkinter Documentation

2021-08-12 Thread Simão Afonso

Change by Simão Afonso :


--
nosy: +simao.afonso

___
Python tracker 

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



[issue44903] [Doc] How does one to about getting onto the "Other Graphical User Interface Packages" page?

2021-08-12 Thread Zachary Ware


Zachary Ware  added the comment:

Frankly, we should probably just remove that page, or replace it with a generic 
"Many other GUI toolkits can be found on PyPI" message.

--
nosy: +mdk, zach.ware
versions: +Python 3.11 -Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue44903] [Doc] How does one to about getting onto the "Other Graphical User Interface Packages" page?

2021-08-12 Thread PySimpleGUI


New submission from PySimpleGUI :

Some time ago I noticed that the Python documentation has a list of GUI 
packages that are not part of the Python standard library.

https://docs.python.org/3/library/othergui.html

The title of the page I'm talking about says:
Other Graphical User Interface Packages

Major cross-platform (Windows, macOS, Unix-like) GUI toolkits are available for 
Python:

What are the criteria for being listed?  PySimpleGUI has more monthly installs 
than Kivy & WxPython. They're not due to being bundled with a Linux 
distribution.

There is another page with a longer list:
https://docs.python.org/3/faq/gui.html

--
assignee: docs@python
components: Documentation
messages: 399465
nosy: PySimpleGUI, docs@python
priority: normal
severity: normal
status: open
title: [Doc] How does one to about getting onto the "Other Graphical User 
Interface Packages" page?
versions: Python 3.10, 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



[issue15533] subprocess.Popen(cwd) documentation: Posix vs Windows

2021-08-12 Thread ban


ban  added the comment:

>> "In particular, the function looks for executable (or for the 
>> first item in args) relative to cwd if the executable path is 
>> a relative path." 
>
> For POSIX, this should be stated as a "relative path without a slash in
> it" or a "relative path without a directory in it". An unqualified
> filename is a relative path that won't be resolved against `cwd`,
> unless there's a "." entry in PATH.

While I don't understand the wording proposed (that seem backwards to me?), I 
do think it would be important to fix this.

I just got puzzled and spent some effort writing a workaround *not to look in 
cwd* for a bare command name, before I got so skeptical I actually tried 
empirically what Python would do -- and see the behavior was sensible and `cwd` 
was taken into account *only if the executable had a path component in it*.

Any other behavior is annoying IMO as it means using a `cwd` *requires* one to 
pass in an absolute path to the executable not to risk running an unexpected 
executable, which basically makes support for looking up executable in the 
system PATH unusable if using a `cwd`.
It would also be somewhat inconsistent with the idea that `cwd` only *changes* 
the current directory prior to execution, as it would suggest the behavior is 
not the same when using `cwd=None` and `cwd=os.getcwd()`.

So I'd suggest amending the wording in some way, maybe something like
"In particular, the function looks for executable (or for the first item in 
args) relative to cwd if the executable has an explicit relative path."
or something like that, possibly even dropping in an example.
The problem with the current wording is that usually an unqualified name *is* a 
relative path, whereas here one should somehow understand that it means "if it 
has a path component and that path component is relative", or the more 
down-to-earthy "if the executable starts with './' or '../'".

--
nosy: +ban

___
Python tracker 

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



[issue44902] [Doc] Changing 'Mac OS X'/'OS X' to 'macOS'

2021-08-12 Thread Jack DeVries


Jack DeVries  added the comment:

Ok, that was no help... I'll just upload the diff.

--
keywords: +patch
Added file: https://bugs.python.org/file50211/os_x_to_macos_fix.diff

___
Python tracker 

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



[issue44895] refleak test failure in test_exceptions

2021-08-12 Thread Irit Katriel


Irit Katriel  added the comment:

The problem disappears if I add a gc.collect() loop at the beginning of the new 
test:

diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py
index 79798ecf05..e0aeac9d10 100644
--- a/Lib/test/test_exceptions.py
+++ b/Lib/test/test_exceptions.py
@@ -1014,6 +1014,7 @@ def cycle():
 
 def test_no_hang_on_context_chain_cycle2(self):
 # See issue 25782. Cycle at head of context chain.
+while gc.collect(): pass
 
 class A(Exception):
 pass

--

___
Python tracker 

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



[issue44902] [Doc] Changing 'Mac OS X'/'OS X' to 'macOS'

2021-08-12 Thread Jack DeVries


Jack DeVries  added the comment:

I've done it. See the changes here:

https://github.com/python/cpython/compare/main...jdevries3133:bpo-44902-macOS


I'll hold off on a PR pending some feedback on whether this change is 
desirable. Also, I did not make changes to whatsnew documents, because they 
were presumably referring to OS X accurately at the time they were written.

--
nosy: +jack__d

___
Python tracker 

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



[issue44902] [Doc] Changing 'Mac OS X'/'OS X' to 'macOS'

2021-08-12 Thread Jack DeVries


Jack DeVries  added the comment:

oops, the link was mutilated... maybe this will help::

````

--

___
Python tracker 

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



[issue42560] Improve Tkinter Documentation

2021-08-12 Thread Mark Roseman


Change by Mark Roseman :


--
nosy: +lukasz.langa, terry.reedy

___
Python tracker 

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



[issue44895] refleak test failure in test_exceptions

2021-08-12 Thread Irit Katriel


Irit Katriel  added the comment:

> I don't know why you need to kill it. It's not a long test.

Ah I see, -F.

--

___
Python tracker 

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



[issue42560] Improve Tkinter Documentation

2021-08-12 Thread Mark Roseman


Mark Roseman  added the comment:

Here are my broad suggestions for improvement (each of these would turn into a 
separate PR). Thoughts for/against each?

1. 'See also' section: use this to guide people to what they need. update to 
point out challenge of finding material given age etc., clearer what to use 
each resource for, update as needed (e.g. later editions of books)

2. Tkinter modules section: add ttk up front (i.e. usually use tkinter and 
tkinter.ttk), fill in a couple missing ones, move import/Tk() to later section 
(example or ref)

3. Architecture (was recently added). Merge in (and improve) material from how 
Tk and Tkinter are related, drop Tix from here

4. Replace life preserver with:

4a. Updated hello world example: use ttk and grid, explain each call

4b. How to introspect (figure out commands, arguments, and options... some of 
this is e.g. now in the reference section) so when don't have exact docs on 
something can figure out how to find answers

4c. Bridge from Tcl/Tk documentation: rewrite of 'quick look' and 'mapping' 
sections, more a list of how key concepts are realized in Tkinter, such as 
widget hierarchy. Less example based, more factual/reference oriented. 

5. 'Handy reference' section: drop most of what's there now, replace with lists 
of classes (e.g. widgets), general methods available on all widgets (grid, 
bind, winfo*, etc.),  organized into categories. Likely without (most) 
arguments or options, or descriptions. There have been a few starts on this 
including the PR that Mason did here.

--

___
Python tracker 

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



[issue44895] refleak test failure in test_exceptions

2021-08-12 Thread STINNER Victor


STINNER Victor  added the comment:

> I see it on Mac but not windows.

Aha, maybe there is something specific on Mac which triggers an exact code path 
to trigger to bug. I already saw bugs like that.

You can try to play with gc.set_threshold() to change how garbage collection is 
triggered.

--

___
Python tracker 

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



[issue44895] refleak test failure in test_exceptions

2021-08-12 Thread Irit Katriel


Irit Katriel  added the comment:

I don't know why you need to kill it. It's not a long test.

--

___
Python tracker 

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



[issue44901] Info about used pickle protocol used by multiprocessing.Queue

2021-08-12 Thread Eric V. Smith


Eric V. Smith  added the comment:

Because this is a usage question and not a bug, you'll get more help using the 
python-list mailing list or Stack Overflow, or some other Q&A forum.

--
nosy: +eric.smith

___
Python tracker 

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



[issue44890] Enable specialization stats collection when in Py_DEBUG

2021-08-12 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset 789a6af29f531f78abd2e2f6af80084ccabf80b1 by Irit Katriel in 
branch 'main':
bpo-44890: Fix AMD build error (GH-27740)
https://github.com/python/cpython/commit/789a6af29f531f78abd2e2f6af80084ccabf80b1


--

___
Python tracker 

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



[issue44895] refleak test failure in test_exceptions

2021-08-12 Thread STINNER Victor

STINNER Victor  added the comment:

> Victor, if the …cycle2 test is hanging then you need the change in PR27626.

That's the commit d5c217475c4957a8084ac3f92ae012ece5edc7cb. My main branch is 
up to date (commit 8ac0886091c27bf4b6bb0a9b571e174b554d31a4), it includes the 
commit d5c217475c4957a8084ac3f92ae012ece5edc7cb.

--

___
Python tracker 

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



[issue44895] refleak test failure in test_exceptions

2021-08-12 Thread STINNER Victor


STINNER Victor  added the comment:

I am not more lucky in the main branch. I ran it for 30 minutes and it didn't 
fail.

$ ./python -m test -R 3:3 test_exceptions -m 
test_no_hang_on_context_chain_cycle2 -m 
test_recursion_normalizing_infinite_exception -m 
test_recursion_in_except_handler -m test_recursion_normalizing_with_no_memory 
-F -j1
(...)
0:31:15 load avg: 1.88 [184] test_exceptions passed
beginning 6 repetitions
123456
..
^C
Kill  process group

== Tests result: INTERRUPTED ==
Test suite interrupted by signal SIGINT.

184 tests OK.

Total duration: 31 min 19 sec
Tests result: INTERRUPTED


I tested commit 8ac0886091c27bf4b6bb0a9b571e174b554d31a4.

--

___
Python tracker 

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



[issue44895] refleak test failure in test_exceptions

2021-08-12 Thread Irit Katriel

Irit Katriel  added the comment:

Victor, if the …cycle2 test is hanging then you need the change in PR27626.

--

___
Python tracker 

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



[issue44895] refleak test failure in test_exceptions

2021-08-12 Thread Irit Katriel

Irit Katriel  added the comment:

I see it on Mac but not windows.

Running the test with -v or adding prints makes the leak go away. I’m 
suspecting that one of the recursion tests fails to clear an exception or 
something like that.

Removing any one of the tests makes it stop failing.

--

___
Python tracker 

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



[issue44895] refleak test failure in test_exceptions

2021-08-12 Thread STINNER Victor


STINNER Victor  added the comment:

I fail to reproduce the issue on Linux on the 3.10 branch. I interrupted the 
job after 20 minutes:

$ ./python -m test -R 3:3 test_exceptions -m 
test_no_hang_on_context_chain_cycle2 -m 
test_recursion_normalizing_infinite_exception -m 
test_recursion_in_except_handler -m test_recursion_normalizing_with_no_memory 
-F -j1
(...)
0:21:38 load avg: 2.01 [134] test_exceptions passed
beginning 6 repetitions
123456
..

I tested the commit 5d34ad4e1943a88c9d3aadd300fd0f05dab7.

--

___
Python tracker 

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



[issue44902] [Doc] Changing 'Mac OS X'/'OS X' to 'macOS'

2021-08-12 Thread meowmeowcat


New submission from meowmeowcat :

Changing 'Mac OS X'/'OS X' to 'macOS' in docs.

https://www.python.org has already changed to 'macOS'.

--
assignee: docs@python
components: Documentation
messages: 399448
nosy: docs@python, meowmeowmeowcat
priority: normal
severity: normal
status: open
title: [Doc] Changing 'Mac OS X'/'OS X' to 'macOS'
type: enhancement

___
Python tracker 

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



[issue44901] Info about used pickle protocol used by multiprocessing.Queue

2021-08-12 Thread Christian Buhtz


New submission from Christian Buhtz :

I read some of the PEPs about pickeling. But I would not say that I understood 
everything.

Of course I checked the docu about multiprocessing.Queue. Currently it is not 
clear for me which pickle protocol is used by multiprocessing.Queue.
Maybe I missed something in the docu or the docu can be improved?

 - Is there a fixed default - maybe different between the Python versions?
 - Or is the pickle protocol version dynamicly selected depending on the 
kind/type/size of data put() into the Queue?

Is there a way to find out at runtime which protocol version is used for a 
specific Queue instance with a specific piece of data?

Background:
I use Python 3.7 and 3.9 with Pandas 1.3.5.
I parallelize work with hugh(?) pandas.DataFrame objects. I simply cut them 
into pieces (on row axis) which number is limited to the machines CPU cores 
(minus 1). The cutting happens several times in my sripts because
for some things I need the data as one complete DataFrame.
Just for example here is one of such pieces which is given to a worker by 
argument and send back via Queue - 7 workers!


RangeIndex: 226687 entries, 0 to 226686
Data columns (total 38 columns):
 #   Column  Non-Null Count   Dtype
---  --  --   -
 0   HASH_ 
 
 37  NAME_ORG226687 non-null  object
dtypes: datetime64[ns](6), float64(1), int64(1), object(30)
memory usage: 65.7+ MB 

I am a bit "scared" that Python wasting my CPU time and does some compression 
on that data. ;) I just want to get a better idea what is done in the 
background.

--
messages: 399447
nosy: buhtz
priority: normal
severity: normal
status: open
title: Info about used pickle protocol used by multiprocessing.Queue
versions: 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



[issue44900] Implement superinstructions

2021-08-12 Thread Mark Shannon


Change by Mark Shannon :


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

___
Python tracker 

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



[issue26228] pty.spawn hangs on FreeBSD 9.3, 10.x, 12.1

2021-08-12 Thread Łukasz Langa

Łukasz Langa  added the comment:

This is now merged. Thanks for all input, everyone! ✨ 🍰 ✨

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



[issue26228] pty.spawn hangs on FreeBSD 9.3, 10.x, 12.1

2021-08-12 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 5d34ad4e1943a88c9d3aadd300fd0f05dab7 by Miss Islington (bot) 
in branch '3.10':
bpo-26228: Fix pty EOF handling (GH-12049) (GH-27732)
https://github.com/python/cpython/commit/5d34ad4e1943a88c9d3aadd300fd0f05dab7


--

___
Python tracker 

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



[issue44890] Enable specialization stats collection when in Py_DEBUG

2021-08-12 Thread Irit Katriel


Change by Irit Katriel :


--
pull_requests: +26219
pull_request: https://github.com/python/cpython/pull/27740

___
Python tracker 

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



[issue44900] Implement superinstructions

2021-08-12 Thread Mark Shannon


New submission from Mark Shannon :

PEP 659 quickening provides a mechanism for replacing instructions.
We should exploit this to implement superinstructions when quickening.
See https://github.com/faster-cpython/ideas/issues/16

--
messages: 399444
nosy: Mark.Shannon
priority: normal
severity: normal
status: open
title: Implement superinstructions
type: performance

___
Python tracker 

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



[issue44899] tarfile: add support for creating an archive of potentially changing files

2021-08-12 Thread Marko Tuononen


New submission from Marko Tuononen :

I have a use case where I need to create a tar archive from a collection of 
potentially changing files. I need to use system resources sparingly and 
because of that it is not possible to first make a copy of the files.

Current state of the tarfile library: Creating a tar archive is interrupted 
with an OSError "unexpected end of data" (example below), if any of the files 
changes when it is collected. Using the tarfile library in streaming mode does 
not work either. You might find this bug report relevant: 
https://bugs.python.org/issue26877

   File "/usr/lib64/python3.7/tarfile.py", line 1946, in add
 self.addfile(tarinfo, f)
   File "/usr/lib64/python3.7/tarfile.py", line 1974, in addfile
 copyfileobj(fileobj, self.fileobj, tarinfo.size, bufsize=bufsize)
   File "/usr/lib64/python3.7/tarfile.py", line 249, in copyfileobj
 raise exception("unexpected end of data")
   OSError: unexpected end of data

Target state of the tarfile library: Creating a tar archive is not interrupted 
even if a file changes while collected. The tarfile library's add() method 
would just return an exit value indicating that some files were changed while 
being archived. See e.g. how GNU tar handles similar situation: 
https://man7.org/linux/man-pages/man1/tar.1.html#RETURN_VALUE

--
components: Library (Lib)
messages: 399443
nosy: marko-tuononen
priority: normal
severity: normal
status: open
title: tarfile: add support for creating an archive of potentially changing 
files
type: enhancement
versions: Python 3.7

___
Python tracker 

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



[issue44890] Enable specialization stats collection when in Py_DEBUG

2021-08-12 Thread Irit Katriel


Change by Irit Katriel :


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



[issue44890] Enable specialization stats collection when in Py_DEBUG

2021-08-12 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 8ac0886091c27bf4b6bb0a9b571e174b554d31a4 by Irit Katriel in 
branch 'main':
bpo-44890: collect specialization stats if Py_DEBUG (GH-27731)
https://github.com/python/cpython/commit/8ac0886091c27bf4b6bb0a9b571e174b554d31a4


--
nosy: +Mark.Shannon

___
Python tracker 

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



[issue44859] Improve some sqlite3 errors

2021-08-12 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

> Also, for SQLite 3.7.17 and above, we should raise sqlite3.Warning for error 
> codes SQLITE_NOTICE and SQLITE_WARNING.

Er, forget that. Neither are returned by any SQLite C interface, at the moment. 
They can (currently) only be used as the first argument to sqlite3_log().

--

___
Python tracker 

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



[issue44895] refleak test failure in test_exceptions

2021-08-12 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



[issue44878] Clumsy dispatching on interpreter entry.

2021-08-12 Thread Mark Shannon


Change by Mark Shannon :


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



[issue44878] Clumsy dispatching on interpreter entry.

2021-08-12 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset a530a9538f3f444bebd2d2b71fe5f2e747e76d73 by Mark Shannon in 
branch 'main':
bpo-44878: Remove loop from interpreter. All dispatching is done by gotos. 
(GH-27727)
https://github.com/python/cpython/commit/a530a9538f3f444bebd2d2b71fe5f2e747e76d73


--

___
Python tracker 

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



[issue44898] Path.read_bytes() failed when path contains chinese character

2021-08-12 Thread meowmeowcat


Change by meowmeowcat :


--
nosy: +meowmeowmeowcat

___
Python tracker 

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



[issue44898] Path.read_bytes() failed when path contains chinese character

2021-08-12 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Also, we need to know the version of Python and your OS.

--

___
Python tracker 

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



[issue44898] Path.read_bytes() failed when path contains chinese character

2021-08-12 Thread Steven D'Aprano

Steven D'Aprano  added the comment:

How did you enter the Chinese characters?

It works for me:

>>> filename = 'Beijing 北京市'
>>> with open(filename, 'w') as f:
... f.write('data')
... 
4
>>> from pathlib import Path
>>> p = Path(filename)
>>> p.read_bytes()
b'data'


Please provide a *minimal reproducible example*

https://stackoverflow.com/help/minimal-reproducible-example

http://www.sscce.org/

--
nosy: +steven.daprano

___
Python tracker 

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



[issue44881] Consider integration of PyObject_GC_UnTrack() with the trashcan C API

2021-08-12 Thread STINNER Victor


STINNER Victor  added the comment:

The problem of PyObject_GC_UnTrack() is just the most visible effect of the 
trashcan mecanism: tp_dealloc can be called twice, and this is *not* expected 
by the tp_dealloc API.

Putting trashcan mecanism outside tp_dealloc can allow to make sure that 
tp_dealloc is called exactly once. _Py_Dealloc() sounds like a good candidate, 
but I didn't check if it's the only way to call tp_dealloc. Are there other 
places where tp_dealloc is called *directly*?

Using military grade regex, I found the following functions calling tp_dealloc:

grep 'dealloc[) ]*([a-zA-Z]\+)' */*.c

* _Py_Dealloc() obviously
* _PyTrash_thread_destroy_chain()
* subtype_dealloc()
* Modules/_testcapimodule.c: check_pyobject_freed_is_freed() <= unit test, it 
can be ignored

So if we move the trashcan usage inside functions, 3 functions must be modified:

* _Py_Dealloc()
* _PyTrash_thread_destroy_chain()
* subtype_dealloc()

--

___
Python tracker 

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



[issue44898] Path.read_bytes() failed when path contains chinese character

2021-08-12 Thread russiavk


russiavk  added the comment:

It give me error :FileNotFoundError [errno 2] No such file or directory

--

___
Python tracker 

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



[issue44898] Path.read_bytes() failed when path contains chinese character

2021-08-12 Thread russiavk


New submission from russiavk :

Path.read_bytes() failed when this path contains chinese character

--
components: IO
messages: 399435
nosy: russiavk
priority: normal
severity: normal
status: open
title: Path.read_bytes() failed when path contains chinese character
type: behavior

___
Python tracker 

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



[issue44895] refleak test failure in test_exceptions

2021-08-12 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