[issue46004] Incorrect bad token identified in 3.10.1

2021-12-06 Thread Andre Roberge


Andre Roberge  added the comment:

>From 
>(https://friendly-traceback.github.io/docs/syntax_tracebacks_en_3.10.html#for-loop-missing-in-operator),
> this is what was shown for Python 3.10.0

for x range(4):
^^
SyntaxError: invalid syntax. Perhaps you forgot a comma?

Same as Python 3.11.0a2.

--

___
Python tracker 

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



[issue46004] Incorrect bad token identified in 3.10.1

2021-12-06 Thread Andre Roberge


New submission from Andre Roberge :

In Python 3.10.1, a change occurred compared with 3.10.0 so that an incorrect 
token is flagged for a SyntaxError.  Also, in 3.11.0a2, the suggestion made 
about having forgotten a comma is incorrect.


Python 3.10.1
for x range(4):
  ^
SyntaxError: invalid syntax

(I no longer have 3.10.0 available but I know from my tests that it was 
identifying correctly the wrong token.)


Python 3.11.0a2
for x range(4):
^^
SyntaxError: invalid syntax. Perhaps you forgot a comma?

Python 3.9.5
for x range(4):
  ^
SyntaxError: invalid syntax

Python 3.8.10
for x range(4):
  ^
SyntaxError: invalid syntax

Python 3.7.8
for x range(4):
  ^
SyntaxError: invalid syntax

Python 3.6.8
for x range(4):
  ^
SyntaxError: invalid syntax

--
components: Parser
messages: 407894
nosy: aroberge, lys.nikolaou, pablogsal
priority: normal
severity: normal
status: open
title: Incorrect bad token identified in 3.10.1
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



[issue14965] super() and property inheritance behavior

2021-12-06 Thread Markus Kitsinger (he/him/his)


Change by Markus Kitsinger (he/him/his) :


--
nosy: +SwooshyCueb
nosy_count: 23.0 -> 24.0
pull_requests: +28175
pull_request: https://github.com/python/cpython/pull/29950

___
Python tracker 

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



[issue31879] Launcher fails on custom command starting with "python"

2021-12-06 Thread Eryk Sun


Eryk Sun  added the comment:

Whether it should be this way or not, here's how it currently works. 

The builtin virtual paths all end with "python":

static SHEBANG builtin_virtual_paths [] = {
{ L"/usr/bin/env python", TRUE },
{ L"/usr/bin/python", FALSE },
{ L"/usr/local/bin/python", FALSE },
{ L"python", FALSE },
{ NULL, FALSE },
};

parse_shebang() loops over this list, simply matching up to the length of each 
virtual path. Thus "/usr/bin/env python-xyz" is matched as a virtual path. 

Supporting user configured "python*" commands would require more sophisticated 
matching. A virtual command has to consume a suffix that looks like a version 
string in the form "[x[.y]][-32|-64]", as determined by validate_version(). But 
otherwise configured "python*" commands don't have to be matched as virtual 
commands.

--
nosy: +eryksun

___
Python tracker 

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



[issue44092] [sqlite3] Remove special rollback handling

2021-12-06 Thread Ma Lin


Ma Lin  added the comment:

If the special rollback handling is removed, the behavior of 
Connection.rollback() and 'ON CONFLICT ROLLBACK' clause will be consistent.
See attached file on_conflict_rollback.py.

--
Added file: https://bugs.python.org/file50481/on_conflict_rollback.py

___
Python tracker 

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



[issue45798] Move _decimal build setup into configure

2021-12-06 Thread Ned Deily


Ned Deily  added the comment:

The issue here turned out to be that the architecture selection code for 
libmpdec builds on macOS had been scrambled a bit on the move from setup.py to 
configure. To support universal builds correctly, libmpdec has code to decide 
itself which arch(s) to build with on macOS. PR 29949 restores that behavior 
and macOS universal2 builds (builds which have both native arm64 and x86_64 
binaries in each executable or library file) now work again for 3.11.

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



[issue45798] Move _decimal build setup into configure

2021-12-06 Thread Ned Deily


Ned Deily  added the comment:


New changeset ddbab69b6d44085564a9b5022b96b002a52b2f2b by Ned Deily in branch 
'main':
bpo-45798: Let libmpdec decide which archs to build on macOS as done 
previously. (GH-29949)
https://github.com/python/cpython/commit/ddbab69b6d44085564a9b5022b96b002a52b2f2b


--

___
Python tracker 

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



[issue45950] Reintroduce bootstrap_python for freezing

2021-12-06 Thread Ned Deily


Ned Deily  added the comment:

I've now verified that the _bootstrap_python fix for framework builds works - 
removing "release blocker" status. Thanks, Christian!

--
priority: release blocker -> 

___
Python tracker 

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



[issue45798] Move _decimal build setup into configure

2021-12-06 Thread Ned Deily


Change by Ned Deily :


--
pull_requests: +28174
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29949

___
Python tracker 

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



[issue46002] py Launcher for Windows with MSYS2

2021-12-06 Thread Zernoxi


Zernoxi  added the comment:

My bad, I guess its not a bug. Didn't read the documents correctly.

--

___
Python tracker 

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



[issue46002] py Launcher for Windows with MSYS2

2021-12-06 Thread Zernoxi


Zernoxi  added the comment:

Is there a way to "ignore" MSYS2 "bin" folder? Because "pyenv" is a wrapper for 
python versions and its python.exe is not explicitly in the PATH environment 
variable.

--

___
Python tracker 

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



[issue46002] py Launcher for Windows with MSYS2

2021-12-06 Thread Zernoxi


Zernoxi  added the comment:

I did some more testing more testing some more testing and saw that eryksun 
pointed out that the PATH environment variable is also being checked. I thought 
that it only checked for registered pythons but anyway. If I remove the "bin" 
folder to MSYS2 then the issue goes away.

--

___
Python tracker 

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



[issue21761] [doc] language reference describes the role of module.__file__ inaccurately

2021-12-06 Thread Eric Snow


Eric Snow  added the comment:

The key point is that loaders should be using the spec, not any of the module 
attrs (like `__file__` and `__cached__`), nor setting them.

For the specific paragraph I referenced, it would look more like:

  It is also appropriate to set __cached__ when __file__ is not set.
  However, that scenario is quite atypical.  Ultimately, __file__ and
  __cached__ are set by the import system from the module spec provided
  by the finder.  The spec instructs the loader.  If a loader can load
  from a cached module but otherwise does not load from a file, that
  atypical scenario may be appropriate.

--

___
Python tracker 

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



[issue46003] os.replace is not cross-platform: at least improve documentation

2021-12-06 Thread Eryk Sun


Eryk Sun  added the comment:

The os module tries to avoid documenting low-level OS behaviors. It would be 
unreliable and difficult to maintain. 

In the case of os.replace(), in Windows it calls MoveFileExW() with the flag 
MOVEFILE_REPLACE_EXISTING [1]. The source and destination paths must be on the 
same volume. The caller must have permission to delete the source path and, if 
it already exists, the destination path. The caller must have permission to add 
a file or directory to the destination directory. Existing opens of the source 
path must share delete access. If the source path is a directory, none of the 
files and directories in its tree is allowed to be open. If the destination 
path already exists, it cannot be a directory, a readonly file, or mapped as a 
process image (i.e. a data mapping is allowed, but an executing EXE or DLL is 
disallowed). Currently, existing opens of the destination path are not allowed, 
even if they share delete access. 

In Windows 10+, there's new support at the NT system call level (i.e. the layer 
beneath the Windows API) to support replacing a file that has existing opens, 
if the file system supports it (e.g. NTFS, ReFS). Delete access is still 
required, so the opens must share delete access. MoveFileExW() has not been 
updated yet to use this new capability. If and when it's supported, the 
requirement for existing opens to share delete access means it won't help in 
general. Most Windows programs, including Python, do not share delete access on 
open files. To share delete access in Python, one can use a custom opener 
function that calls CreateFileW() and wraps the OS handle in an fd via 
msvcrt.open_osfhandle().

---
[1] 
https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-movefileexw

--
nosy: +eryksun

___
Python tracker 

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



[Python-announce] [RELEASE] Python 3.10.1 is available

2021-12-06 Thread Pablo Galindo Salgado
I hope you like bug fixes, because we have a whole shipment of them! Python
3.10.1 is the first maintenance release of Python 3.10 as we have packed
more than 330 commits of fixes and general improvements. You can get it
here:

https://www.python.org/downloads/release/python-3101/

# This is the first maintenance release of Python 3.10

Python 3.10.1 is the newest major release of the Python programming
language, and it contains many new features and optimizations.

# Major new features of the 3.10 series, compared to 3.9

Among the new major new features and changes so far:

* [PEP 623](https://www.python.org/dev/peps/pep-0623/) -- Deprecate and
prepare for the removal of the wstr member in PyUnicodeObject.
* [PEP 604](https://www.python.org/dev/peps/pep-0604/) -- Allow writing
union types as X | Y
* [PEP 612](https://www.python.org/dev/peps/pep-0612/) -- Parameter
Specification Variables
* [PEP 626](https://www.python.org/dev/peps/pep-0626/) -- Precise line
numbers for debugging and other tools.
* [PEP 618 ](https://www.python.org/dev/peps/pep-0618/) -- Add Optional
Length-Checking To zip.
* [bpo-12782](https://bugs.python.org/issue12782): Parenthesized context
managers are now officially allowed.
* [PEP 632 ](https://www.python.org/dev/peps/pep-0632/) -- Deprecate
distutils module.
* [PEP 613 ](https://www.python.org/dev/peps/pep-0613/) -- Explicit Type
Aliases
* [PEP 634 ](https://www.python.org/dev/peps/pep-0634/) -- Structural
Pattern Matching: Specification
* [PEP 635 ](https://www.python.org/dev/peps/pep-0635/) -- Structural
Pattern Matching: Motivation and Rationale
* [PEP 636 ](https://www.python.org/dev/peps/pep-0636/) -- Structural
Pattern Matching: Tutorial
* [PEP 644 ](https://www.python.org/dev/peps/pep-0644/) -- Require OpenSSL
1.1.1 or newer
* [PEP 624 ](https://www.python.org/dev/peps/pep-0624/) -- Remove
Py_UNICODE encoder APIs
* [PEP 597 ](https://www.python.org/dev/peps/pep-0597/) -- Add optional
EncodingWarning

[bpo-38605](https://bugs.python.org/issue38605): `from __future__ import
annotations` ([PEP 563](https://www.python.org/dev/peps/pep-0563/)) used to
be on this list
in previous pre-releases but it has been postponed to Python 3.11 due to
some compatibility concerns. You can read the Steering Council
communication about it [here](
https://mail.python.org/archives/list/python-...@python.org/thread/CLVXXPQ2T2LQ5MP2Y53VVQFCXYWQJHKZ/)
to learn more.

# More resources

* [Changelog](https://docs.python.org/3.10/whatsnew/changelog.html#changelog
)
* [Online Documentation](https://docs.python.org/3.10/)
* [PEP 619](https://www.python.org/dev/peps/pep-0619/), 3.10 Release
Schedule
* Report bugs at [https://bugs.python.org](https://bugs.python.org).
* [Help fund Python and its community](/psf/donations/).

# And now for something completely different

The Meissner effect (or Meissner–Ochsenfeld effect) is the expulsion of a
magnetic field from a superconductor during its transition to the
superconducting state when it is cooled below the critical temperature.
This expulsion will repel a nearby magnet. The German physicists Walther
Meissner and Robert Ochsenfeld discovered this phenomenon in 1933 by
measuring the magnetic field distribution outside superconducting tin and
lead samples. The experiment demonstrated for the first time that
superconductors were more than just perfect conductors and provided a
uniquely defining property of the superconductor state. The ability for the
expulsion effect is determined by the nature of equilibrium formed by the
neutralization within the unit cell of a superconductor.

You can do [ver cool things](https://www.youtube.com/watch?v=HRLvVkkq5GE)
with it!

# We hope you enjoy the new releases!

Thanks to all of the many volunteers who help make Python Development and
these releases possible! Please consider supporting our efforts by
volunteering yourself or through organization contributions to the Python
Software Foundation.

https://www.python.org/psf/

Your friendly release team,
Ned Deily @nad https://discuss.python.org/u/nad
Steve Dower @steve.dower https://discuss.python.org/u/steve.dower
Pablo Galindo Salgado @pablogsal https://discuss.python.org/u/pablogsal
___
Python-announce-list mailing list -- python-announce-list@python.org
To unsubscribe send an email to python-announce-list-le...@python.org
https://mail.python.org/mailman3/lists/python-announce-list.python.org/
Member address: arch...@mail-archive.com


[issue45620] A misleading url in 'Floating Point Arithmetic' page

2021-12-06 Thread Eric V. Smith


Eric V. Smith  added the comment:

I notified lahey.com, and it looks like the behavior is now normal (at least, 
it looks okay by testing with the curl commands). Could someone who say this 
problem in a browser please double-check?

--

___
Python tracker 

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



[issue28953] Use `raise from` when raising new IncompleteRead

2021-12-06 Thread Andrew Svetlov


Change by Andrew Svetlov :


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



[issue28953] Use `raise from` when raising new IncompleteRead

2021-12-06 Thread miss-islington


miss-islington  added the comment:


New changeset c5c365220ed2c867fe81078f70b827de22db2ee6 by 180909 in branch 
'main':
bpo-28953: Use `raise from` when raising new IncompleteRead (GH-29861)
https://github.com/python/cpython/commit/c5c365220ed2c867fe81078f70b827de22db2ee6


--
nosy: +miss-islington

___
Python tracker 

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



[issue45582] Rewrite getpath.c in Python

2021-12-06 Thread Steve Dower


Steve Dower  added the comment:


New changeset b7ef27bc084665ce58d89fc69530c6f9d2d37754 by Steve Dower in branch 
'main':
bpo-45582: Ensure PYTHONHOME still overrides detected build prefixes (GH-29948)
https://github.com/python/cpython/commit/b7ef27bc084665ce58d89fc69530c6f9d2d37754


--

___
Python tracker 

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



[RELEASE] Python 3.10.1 is available

2021-12-06 Thread Pablo Galindo Salgado
I hope you like bug fixes, because we have a whole shipment of them! Python
3.10.1 is the first maintenance release of Python 3.10 as we have packed
more than 330 commits of fixes and general improvements. You can get it
here:

https://www.python.org/downloads/release/python-3101/

# This is the first maintenance release of Python 3.10

Python 3.10.1 is the newest major release of the Python programming
language, and it contains many new features and optimizations.

# Major new features of the 3.10 series, compared to 3.9

Among the new major new features and changes so far:

* [PEP 623](https://www.python.org/dev/peps/pep-0623/) -- Deprecate and
prepare for the removal of the wstr member in PyUnicodeObject.
* [PEP 604](https://www.python.org/dev/peps/pep-0604/) -- Allow writing
union types as X | Y
* [PEP 612](https://www.python.org/dev/peps/pep-0612/) -- Parameter
Specification Variables
* [PEP 626](https://www.python.org/dev/peps/pep-0626/) -- Precise line
numbers for debugging and other tools.
* [PEP 618 ](https://www.python.org/dev/peps/pep-0618/) -- Add Optional
Length-Checking To zip.
* [bpo-12782](https://bugs.python.org/issue12782): Parenthesized context
managers are now officially allowed.
* [PEP 632 ](https://www.python.org/dev/peps/pep-0632/) -- Deprecate
distutils module.
* [PEP 613 ](https://www.python.org/dev/peps/pep-0613/) -- Explicit Type
Aliases
* [PEP 634 ](https://www.python.org/dev/peps/pep-0634/) -- Structural
Pattern Matching: Specification
* [PEP 635 ](https://www.python.org/dev/peps/pep-0635/) -- Structural
Pattern Matching: Motivation and Rationale
* [PEP 636 ](https://www.python.org/dev/peps/pep-0636/) -- Structural
Pattern Matching: Tutorial
* [PEP 644 ](https://www.python.org/dev/peps/pep-0644/) -- Require OpenSSL
1.1.1 or newer
* [PEP 624 ](https://www.python.org/dev/peps/pep-0624/) -- Remove
Py_UNICODE encoder APIs
* [PEP 597 ](https://www.python.org/dev/peps/pep-0597/) -- Add optional
EncodingWarning

[bpo-38605](https://bugs.python.org/issue38605): `from __future__ import
annotations` ([PEP 563](https://www.python.org/dev/peps/pep-0563/)) used to
be on this list
in previous pre-releases but it has been postponed to Python 3.11 due to
some compatibility concerns. You can read the Steering Council
communication about it [here](
https://mail.python.org/archives/list/python-...@python.org/thread/CLVXXPQ2T2LQ5MP2Y53VVQFCXYWQJHKZ/)
to learn more.

# More resources

* [Changelog](https://docs.python.org/3.10/whatsnew/changelog.html#changelog
)
* [Online Documentation](https://docs.python.org/3.10/)
* [PEP 619](https://www.python.org/dev/peps/pep-0619/), 3.10 Release
Schedule
* Report bugs at [https://bugs.python.org](https://bugs.python.org).
* [Help fund Python and its community](/psf/donations/).

# And now for something completely different

The Meissner effect (or Meissner–Ochsenfeld effect) is the expulsion of a
magnetic field from a superconductor during its transition to the
superconducting state when it is cooled below the critical temperature.
This expulsion will repel a nearby magnet. The German physicists Walther
Meissner and Robert Ochsenfeld discovered this phenomenon in 1933 by
measuring the magnetic field distribution outside superconducting tin and
lead samples. The experiment demonstrated for the first time that
superconductors were more than just perfect conductors and provided a
uniquely defining property of the superconductor state. The ability for the
expulsion effect is determined by the nature of equilibrium formed by the
neutralization within the unit cell of a superconductor.

You can do [ver cool things](https://www.youtube.com/watch?v=HRLvVkkq5GE)
with it!

# We hope you enjoy the new releases!

Thanks to all of the many volunteers who help make Python Development and
these releases possible! Please consider supporting our efforts by
volunteering yourself or through organization contributions to the Python
Software Foundation.

https://www.python.org/psf/

Your friendly release team,
Ned Deily @nad https://discuss.python.org/u/nad
Steve Dower @steve.dower https://discuss.python.org/u/steve.dower
Pablo Galindo Salgado @pablogsal https://discuss.python.org/u/pablogsal
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue20936] test_strftime: enormous allocation, fails under Clang sanitizer

2021-12-06 Thread Irit Katriel


Irit Katriel  added the comment:

3.5 is no longer maintained. Please create a new issue if you see this on a 
current version (>= 3.().

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



[issue21731] Calendar Problem with Windows (XP)

2021-12-06 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> locale.py resetlocale throws exception on Windows 
(getdefaultlocale returns value not usable in setlocale)

___
Python tracker 

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



[issue45582] Rewrite getpath.c in Python

2021-12-06 Thread Steve Dower


Change by Steve Dower :


--
pull_requests: +28173
pull_request: https://github.com/python/cpython/pull/29948

___
Python tracker 

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



[issue23819] test_asyncio fails when run under -O

2021-12-06 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset 265918bb1d782ab85c7dbc835eb62d6cfc2145b7 by Kumar Aditya in 
branch 'main':
bpo-23819: asyncio: Replace AssertionError with TypeError where it makes sense 
(GH-29894)
https://github.com/python/cpython/commit/265918bb1d782ab85c7dbc835eb62d6cfc2145b7


--
nosy: +asvetlov

___
Python tracker 

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



[issue20459] [doc] No Argument Clinic documentation on how to specify a return converter

2021-12-06 Thread Irit Katriel


Change by Irit Katriel :


--
keywords: +easy
title: No Argument Clinic documentation on how to specify a return converter -> 
[doc] No Argument Clinic documentation on how to specify a return converter
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.4

___
Python tracker 

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



[issue25633] The documentation for urllib.request should mention http.client.HTTPException

2021-12-06 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> out of date
stage: needs patch -> resolved
status: pending -> closed

___
Python tracker 

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



[issue18531] Undocumented different between METH_KEYWORDS and **kws

2021-12-06 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> fixed
stage:  -> resolved
status: pending -> closed

___
Python tracker 

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



[issue22684] message.as_bytes() produces recursion depth exceeded

2021-12-06 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> works for me
stage:  -> resolved
status: pending -> closed

___
Python tracker 

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



[issue36706] Python script on startup stucks at import

2021-12-06 Thread Irit Katriel


Change by Irit Katriel :


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

___
Python tracker 

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



[issue38522] Py_USING_MEMORY_DEBUGGER is referenced in docs but not present in code

2021-12-06 Thread Irit Katriel


Change by Irit Katriel :


--
keywords: +easy
versions: +Python 3.10, Python 3.11 -Python 2.7, Python 3.5, 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



[issue8161] inconsistency behavior in ctypes.c_char_p dereferencing

2021-12-06 Thread Eryk Sun


Eryk Sun  added the comment:

This appears to be misreported. The implementation in 3.1.2rc1 looks correct to 
me [1]. Either way, it's out of date.

That said, the emulation of a simple type in an aggregate type is still 
incomplete nowadays. It's not implemented when a c_char or c_wchar array type 
is itself the type of an array. It's also inconsistent with simple types 
because the automatic get-set conversion isn't disabled for subclasses of 
c_char and c_wchar array types. For a subclass, one should have to use the 
`value` attribute.

---
[1] 
https://github.com/python/cpython/blob/v3.1.2rc1/Modules/_ctypes/cfield.c#L110-L137

--
nosy: +eryksun
resolution:  -> out of date
stage: needs patch -> resolved
status: pending -> closed

___
Python tracker 

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



[issue13548] line number when tracing an implicit return

2021-12-06 Thread Irit Katriel


Irit Katriel  added the comment:

Yes, you're right. I don't know what I thought I saw before. It works on the 
mac as well.

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



[issue46003] os.replace is not cross-platform: at least improve documentation

2021-12-06 Thread Eric V. Smith


Eric V. Smith  added the comment:

I suspect anti-virus software.

--
nosy: +eric.smith

___
Python tracker 

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



[issue45476] [C API] PEP 674: Disallow using macros as l-value

2021-12-06 Thread STINNER Victor


STINNER Victor  added the comment:

> python-snappy-0.6.0: maybe_resize() in snappy/snappymodule.cc

I proposed a fix: https://github.com/andrix/python-snappy/pull/114

--

___
Python tracker 

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



[issue45798] Move _decimal build setup into configure

2021-12-06 Thread Ned Deily


Ned Deily  added the comment:

It looks like this change broke macOS universal2 builds of libmpdec. I'm 
looking at it now but wanted to flag it as a "release blocker" for tagging 
3.11.0a3.

--
nosy: +ned.deily
priority: normal -> release blocker
resolution: fixed -> 
stage: resolved -> 
status: closed -> open

___
Python tracker 

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



[issue13548] line number when tracing an implicit return

2021-12-06 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

The attached badlineevent.py with print updated.

--

___
Python tracker 

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



[Python-announce] TatSu 5.7.0

2021-12-06 Thread Juancarlo Añez
TatSu 5.7.0 is now available.

   - https://pypi.org/project/TatSu/5.7.0/
   - https://tatsu.readthedocs.io/
   - https://github.com/neogeny/TatSu


竜 TatSu is a tool that takes grammars in a variation of EBNF as input, and
outputs memoizing (Packrat) PEG parsers in Python.

竜 TatSu can compile a grammar stored in a string into a
tatsu.grammars.Grammar object that can be used to parse any given input,
much like the *re* module does with regular expressions, or it can generate
a Python module that implements the parser.

竜 TatSu supports left-recursive rules in PEG grammars using the algorithm
by Laurent and Mens. The generated AST has the expected left associativity.

CHANGELOG:

   - Now ``config: ParserConfig`` is used in ``__init__()`` and ``parse()``
   methods of ``contexts.ParseContext``, ``grammars.Grammar``, and elsewhere
   to avoid long parameter lists. ``ParserConfig` also provides clean and
   clear ways of overriding a group of settings
   - All names defined in the successful choice in a rule are now defined
   in the resulting AST. Names within optionals that did not match will have
   their values set to ``None``, and closures that did not match will be set
   to ``[]`
   - Moved build configuration from ``setup.py`` in favor of ``setup.cfg``
   and ``pyproject.toml`` (@KOLANICH_)
   - ``Node.children()`` is now computed only when required, and cached
   - Classes in generated object models are now ``@dataclass``
   - Optimize and get rid of bugs and annoyances while keeping backwards
   compatibility
   - Drop support for Python < 3.10
___
Python-announce-list mailing list -- python-announce-list@python.org
To unsubscribe send an email to python-announce-list-le...@python.org
https://mail.python.org/mailman3/lists/python-announce-list.python.org/
Member address: arch...@mail-archive.com


[issue45476] [C API] PEP 674: Disallow using macros as l-value

2021-12-06 Thread STINNER Victor


STINNER Victor  added the comment:

> In the PyPI top 5000, I found two projects using PyDescr_TYPE() and 
> PyDescr_NAME() as l-value: M2Crypto and mecab-python3. In both cases, it was 
> code generated by SWIG

I proposed a first PR for Py_TYPE():
https://github.com/swig/swig/pull/2116

--

___
Python tracker 

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



[issue13548] line number when tracing an implicit return

2021-12-06 Thread Irit Katriel


Irit Katriel  added the comment:

Terry, I'm pretty sure I saw the problem on the mac earlier. Can you paste the 
contents of tem.py?

--

___
Python tracker 

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



[issue45957] _tkinter.TclError: expected boolean value but got ""

2021-12-06 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Or use python.org installer ;-).

--

___
Python tracker 

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



[issue13548] line number when tracing an implicit return

2021-12-06 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

This seems to be fixed.  On 3.11.0a2 installed on Windows and fresh build of 
.0a2+, I see return on line 11, which is correct.

f:\dev\3x>python ../tem/tem.py
Running Debug|x64 interpreter...
f:\dev\tem\tem.py 7 call
f:\dev\tem\tem.py 8 line
f:\dev\tem\tem.py 10 line
f:\dev\tem\tem.py 11 line
f:\dev\tem\tem.py 11 return

Irit, please confirm (or not) on your *nix system.

--
nosy: +Mark.Shannon

___
Python tracker 

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



[issue41174] asyncio.coroutine decorator returns a non-generator function when using PYTHONASYNCIODEBUG

2021-12-06 Thread Irit Katriel


Irit Katriel  added the comment:

asyncio.coroutine was removed in 3.11, and I don't think this will be changed 
in stable versions. I will close this issue unless I am corrected.

--
nosy: +iritkatriel
resolution:  -> wont fix
status: open -> pending

___
Python tracker 

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



[issue21761] [doc] language reference describes the role of module.__file__ inaccurately

2021-12-06 Thread Irit Katriel


Change by Irit Katriel :


--
keywords: +easy

___
Python tracker 

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



[issue28516] contextlib.ExitStack.__enter__ has trivial but undocumented behavior

2021-12-06 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

It's a bit more readable to start by stating what a function does rather than 
what it doesn't do. I also wouldn't worry about possible future minor 
optimizations that might be added, because if that happens, a simple ".. aside 
from internal optimizations, ... " would suffice.

Something like this should work:

The __enter__ method returns the ExitStack instance, and performs no additional 
operations.

 OR

 ... and does not perform any additional operations.

--
nosy: +andrei.avk

___
Python tracker 

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



[issue44077] IP_RECVTOS option is missing from socket module

2021-12-06 Thread Andrei Kulakov


Change by Andrei Kulakov :


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



[issue21761] [doc] language reference describes the role of module.__file__ inaccurately

2021-12-06 Thread Brett Cannon


Brett Cannon  added the comment:

> "Ultimately, the loader set the values of __file__ and/or __cached__"

Change it to "sets" and +1 from me!

--

___
Python tracker 

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



Re: Python child process in while True loop blocks parent

2021-12-06 Thread Barry Scott


> On 6 Dec 2021, at 21:05, Jen Kris  wrote:
> 
> Here is what I don't understand from what you said.  "The child process is 
> created with a single thread—the one that called fork()."  To me that implies 
> that the thread that called fork() is the same thread as the child process.  
> I guess you're talking about the distinction between logical threads and 
> physical threads.  

The thread that called fork is cloned into a new thread in the new process.
It has a clone of the processor registers of the thread, stack memory segment 
of that thread,
which means that it has all the stack variables and stack frames from the 
parent process's thread.


> But the main issue is your suggestion that I should call fork-execv from the 
> thread that runs the main C program, not from a separate physical pthread.  
> That would certainly eliminate the overhead of creating a new pthread. 

Forget about physical threads, they only matter when you are performance tuning 
your code.

> I am working now to finish this, and I will try your suggestion of calling 
> fork-execv from the "main" thread.  When I reply back next I can give you a 
> complete picture of what I'm doing. 
> 
> Your comments, and those of Peter Holzer and Chris Angelico, are most 
> appreciated. 

Barry


> 
> 
> Dec 6, 2021, 10:37 by ba...@barrys-emacs.org:
> 
> On 6 Dec 2021, at 17:09, Jen Kris via Python-list  
> wrote:
> 
> I can't find any support for your comment that "Fork creates a new
> process and therefore also a new thread." From the Linux man pages 
> https://www.man7.org/linux/man-pages/man2/fork.2.html, "The child process is 
> created with a single thread—the one that called fork()."
> 
> You just quoted the evidence!
> 
> All new processes on unix (may all OS) only ever have one thread when they 
> start.
> The thread-id of the first thread is the same as the process-id and referred 
> to as the main thread.
> 
> I have a one-core one-thread instance at Digital Ocean available running 
> Ubuntu 18.04. I can fork and create a new process on it, but it doesn't 
> create a new thread because it doesn't have one available.
> 
> 
> By that logic it can only run one process...
> 
> It has one hardware core that support one hardware thread.
> Linux can create as many software threads as it likes.
> You may also want to see "Forking vs Threading" 
> (https://www.geekride.com/fork-forking-vs-threading-thread-linux-kernel), 
> "Fork vs Thread" 
> (https://medium.com/obscure-system/fork-vs-thread-38e09ec099e2), and "Linux 
> process and thread" (https://zliu.org/post/linux-process-and-thread) ("This 
> means that to create a normal process fork() is used that further calls 
> clone() with appropriate arguments while to create a thread or LWP, a 
> function from pthread library calls clone() with relvant flags. So, the main 
> difference is generated by using different flags that can be passed to 
> clone() funciton(to be exact, it is a system call"). 
> 
> You may be confused by the fact that threads are called light-weight 
> processes.
> 
> No Peter and I are not confused.
> 
> Or maybe I'm confused :)
> 
> Yes you are confused.
> 
> If you have other information, please let me know. Thanks.
> 
> Please get the book I recommended, or another that covers systems programming 
> on unix, and have a read.
> 
> Barry
> 
> Jen
> 
> 
> Dec 5, 2021, 18:08 by hjp-pyt...@hjp.at:
> On 2021-12-06 00:51:13 +0100, Jen Kris via Python-list wrote:
> The C program creates two threads (using pthreads), one for itself and
> one for the child process. On creation, the second pthread is pointed
> to a C program that calls fork-execv to run the Python program. That
> way Python runs on a separate thread. 
> 
> I think you have the relationship between processes and threads
> backwards. A process consists of one or more threads. Fork creates a new
> process and therefore also a new thread.
> 
> hp
> 
> -- 
> _ | Peter J. Holzer | Story must make more sense than reality.
> |_|_) | |
> | | | h...@hjp.at | -- Charles Stross, "Creative writing
> __/ | http://www.hjp.at/ | challenge!"
> 
> -- 
> https://mail.python.org/mailman/listinfo/python-list
> 

-- 
https://mail.python.org/mailman/listinfo/python-list


[issue46000] NetBSD curses compatibility

2021-12-06 Thread Thomas Klausner


Thomas Klausner  added the comment:

Done: https://github.com/python/cpython/pull/29947

--

___
Python tracker 

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



[issue46000] NetBSD curses compatibility

2021-12-06 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
nosy: +python-dev
nosy_count: 2.0 -> 3.0
pull_requests: +28172
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29947

___
Python tracker 

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



[issue46003] os.replace is not cross-platform: at least improve documentation

2021-12-06 Thread nobody


New submission from nobody :

When using threads, os.replace gives no errors on Linux. On Windows however you 
get PermissionErrors like: '[WinError 5] Access is denied' for os.replace and 
'[Errno 13] Permission denied' when reading the os.replace file.
The only way I could get this to work was to add retries with delay.
At least the documentation should be improved.

--
messages: 407864
nosy: hancos
priority: normal
severity: normal
status: open
title: os.replace is not cross-platform: at least improve documentation
type: behavior
versions: Python 3.8

___
Python tracker 

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



[issue46000] NetBSD curses compatibility

2021-12-06 Thread Christian Heimes


Christian Heimes  added the comment:

Could you please open a pull request on GitHub? A PR will run our CI and our 
bots will verify that your changeset follows our guidelines.

--
nosy: +christian.heimes

___
Python tracker 

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



Re: Python child process in while True loop blocks parent

2021-12-06 Thread Jen Kris via Python-list
Here is what I don't understand from what you said.  "The child process is 
created with a single thread—the one that called fork()."  To me that implies 
that the thread that called fork() is the same thread as the child process.  I 
guess you're talking about the distinction between logical threads and physical 
threads.  

But the main issue is your suggestion that I should call fork-execv from the 
thread that runs the main C program, not from a separate physical pthread.  
That would certainly eliminate the overhead of creating a new pthread. 

I am working now to finish this, and I will try your suggestion of calling 
fork-execv from the "main" thread.  When I reply back next I can give you a 
complete picture of what I'm doing. 

Your comments, and those of Peter Holzer and Chris Angelico, are most 
appreciated. 




Dec 6, 2021, 10:37 by ba...@barrys-emacs.org:

>
>
>> On 6 Dec 2021, at 17:09, Jen Kris via Python-list  
>> wrote:
>>
>> I can't find any support for your comment that "Fork creates a new
>> process and therefore also a new thread."  From the Linux man pages 
>> https://www.man7.org/linux/man-pages/man2/fork.2.html, "The child process is 
>> created with a single thread—the one that called fork()."
>>
>
> You just quoted the evidence!
>
> All new processes on unix (may all OS) only ever have one thread when they 
> start.
> The thread-id of the first thread is the same as the process-id and referred 
> to as the main thread.
>
>>
>> I have a one-core one-thread instance at Digital Ocean available running 
>> Ubuntu 18.04.  I can fork and create a new process on it, but it doesn't 
>> create a new thread because it doesn't have one available.
>>
>
>
> By that logic it can only run one process...
>
> It has one hardware core that support one hardware thread.
> Linux can create as many software threads as it likes.
>
>> You may also want to see "Forking vs Threading" 
>> (https://www.geekride.com/fork-forking-vs-threading-thread-linux-kernel), 
>> "Fork vs Thread" 
>> (https://medium.com/obscure-system/fork-vs-thread-38e09ec099e2), and "Linux 
>> process and thread" (https://zliu.org/post/linux-process-and-thread) ("This 
>> means that to create a normal process fork() is used that further calls 
>> clone() with appropriate arguments while to create a thread or LWP, a 
>> function from pthread library calls clone() with relvant flags. So, the main 
>> difference is generated by using different flags that can be passed to 
>> clone() funciton(to be exact, it is a system call"). 
>>
>> You may be confused by the fact that threads are called light-weight 
>> processes.
>>
>
> No Peter and I are not confused.
>
>>
>> Or maybe I'm confused :)
>>
>
> Yes you are confused.
>
>>
>> If you have other information, please let me know.  Thanks.
>>
>
> Please get the book I recommended, or another that covers systems programming 
> on unix, and have a read.
>
> Barry
>
>>
>> Jen
>>
>>
>> Dec 5, 2021, 18:08 by hjp-pyt...@hjp.at:
>>
>>> On 2021-12-06 00:51:13 +0100, Jen Kris via Python-list wrote:
>>>
 The C program creates two threads (using pthreads), one for itself and
 one for the child process.  On creation, the second pthread is pointed
 to a C program that calls fork-execv to run the Python program.  That
 way Python runs on a separate thread. 

>>>
>>> I think you have the relationship between processes and threads
>>> backwards. A process consists of one or more threads. Fork creates a new
>>> process and therefore also a new thread.
>>>
>>> hp
>>>
>>> -- 
>>> _  | Peter J. Holzer| Story must make more sense than reality.
>>> |_|_) ||
>>> | |   | h...@hjp.at |-- Charles Stross, "Creative writing
>>> __/   | http://www.hjp.at/ |   challenge!"
>>>
>>
>> -- 
>> https://mail.python.org/mailman/listinfo/python-list
>>

-- 
https://mail.python.org/mailman/listinfo/python-list


[issue46002] py Launcher for Windows with MSYS2

2021-12-06 Thread Eryk Sun


Eryk Sun  added the comment:

The shebang "#!/usr/bin/env python" searches PATH for 
"python" plus the PATHEXT file extensions.

The shebang "#!/usr/bin/env python3" uses the highest version of Python 3 from 
the registry. It doesn't search PATH because Python installations do not 
necessarily include "python3.exe" or "python3.x.exe" binaries. Alternatives 
that also search PATH for this case have been discussed in prior issues.

--
nosy: +eryksun

___
Python tracker 

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



[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2021-12-06 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset fc012d801202a9ea139df143b934778060d51a60 by Christian Heimes in 
branch 'main':
bpo-45847: Fix uuid detection on macOS (GH-29946)
https://github.com/python/cpython/commit/fc012d801202a9ea139df143b934778060d51a60


--

___
Python tracker 

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



[issue38523] ignore_dangling_symlinks in shutil.copytree does not apply recursively

2021-12-06 Thread Irit Katriel


Change by Irit Katriel :


--
type:  -> behavior
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.5, 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



[issue45957] _tkinter.TclError: expected boolean value but got ""

2021-12-06 Thread Ned Deily


Ned Deily  added the comment:

> How does one go about upgrading their tkinter version?

Since, based on your path names, you appear to be using a Python from 
miniconda, you should check with that project. Perhaps they have a newer 
version available. Good luck!

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



[issue45957] _tkinter.TclError: expected boolean value but got ""

2021-12-06 Thread Ali Amin-Nejad


Ali Amin-Nejad  added the comment:

It seems like it must be a mac-specific issue just on 8.6.11 then if ned 
couldn't reproduce on 8.6.12. How does one go about upgrading their tkinter 
version? Thanks

--

___
Python tracker 

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



[issue46002] py Launcher for Windows with MSYS2

2021-12-06 Thread Steve Dower


Steve Dower  added the comment:

("2" and "3" are just arbitrary numbers... substitute however many Python 
runtimes you actually have, or "N" and "N+1" if you prefer.)

--

___
Python tracker 

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



[Python-announce] ANN: Lea 3.4.1 released

2021-12-06 Thread pie.denis
Lea 3.4.1 is now released!
---> https://pypi.org/project/lea/

What is Lea?

Lea is a Python module for playing with discrete probability distributions
in an intuitive way.
This ranges from simple dice, coin flipping, random sampling . to Bayesian
networks, Probabilistic Programming (PP), machine learning and symbolic
computation.
One salient feature of Lea is the ability to change the probability
representation, viz. float, fractions, decimals, and symbols.
Lea can be used for education, AI, PP, etc. Comprehensive tutorials are
available online (see Wiki pages).
For a 5 minutes tour, check out the poster presented at PROBPROG2020
conference:
https://probprog.cc/2020/assets/posters/fri/69.pdf

What's new in Lea 3.4.1?

1) Reading BIF files (Bayesian Interchange Format):
https://bitbucket.org/piedenis/lea/wiki/Lea3_Tutorial_2
2) Misc corrections on Markov chain advanced functions (repair
dependencies):
https://bitbucket.org/piedenis/lea/issues/63/
3) Enhance the test suite, especially for information theory

To learn more...

Lea on PyPI -> http://pypi.org/project/lea
Lea project page -> http://bitbucket.org/piedenis/lea
Documentation -> http://bitbucket.org/piedenis/lea/wiki/Home

With the hope that Lea can make this universe less random (or more?),

Pierre Denis

___
Python-announce-list mailing list -- python-announce-list@python.org
To unsubscribe send an email to python-announce-list-le...@python.org
https://mail.python.org/mailman3/lists/python-announce-list.python.org/
Member address: arch...@mail-archive.com


[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2021-12-06 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +28171
pull_request: https://github.com/python/cpython/pull/29946

___
Python tracker 

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



[issue46002] py Launcher for Windows with MSYS2

2021-12-06 Thread Steve Dower


Steve Dower  added the comment:

So if I've understood you, there are three Python installs on your machine. Two 
of them are Windows builds, which are listed in the registry and discovered by 
py.exe -0p. The third is the MSYS2 build, which is *not* listed in the registry 
and is *not* discovered by py.exe -0p.

However, when you specify the shebang line "/usr/bin/env python" in a file and 
launch it as "py.exe myfile.py" from a non-MSYS2 prompt, it launches the MSYS2 
Python.

Is that correct?

--

___
Python tracker 

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



[issue45995] string formatting: normalize negative zero

2021-12-06 Thread Mark Dickinson


Mark Dickinson  added the comment:

I'd support having this functionality available for `format` and for f-strings. 
(As Steven says, changing %-formatting doesn't seem viable.) It really _is_ 
awkward to do this in any other way, and I'm reliably informed that normal 
people don't expect to see negative zeros in formatted numeric output.

It did take me a few minutes to get my head around the idea that 
`f"{-0.01:+.1f}"` would return `"+0.0"` rather than `"-0.0"` or `" 0.0"` or 
just plain `"0.0"` under this proposal, but I agree that it seems like the only 
thing that can be consistent and make sense.

I'm not 100% convinced by the particular spelling proposed, but I don't have 
anything better to suggest. If C++ might be going with a "z", would it make 
sense to do the same for Python?

I don't forsee any implementation difficulties for float and complex types. For 
Decimal, we'd need to "own" the string formatting, taking that responsibility 
away from mpdecimal, but there are already other reasons to do that. Once we've 
done that, again the implementation doesn't seem onerous.

--

___
Python tracker 

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



Re: threading and multiprocessing deadlock

2021-12-06 Thread Dieter Maurer
Johannes Bauer wrote at 2021-12-6 00:50 +0100:
>I'm a bit confused. In my scenario I a mixing threading with
>multiprocessing. Threading by itself would be nice, but for GIL reasons
>I need both, unfortunately. I've encountered a weird situation in which
>multiprocessing Process()es which are started in a new thread don't
>actually start and so they deadlock on join.

The `multiprocessing` doc
(--> 
"https://docs.python.org/3/library/multiprocessing.html#module-multiprocessing;)
has the following warning:
"Note that safely forking a multithreaded process is problematic."

Thus, if you use the `fork` method to start processes, some
surprises are to be expected.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue45436] test_tk.test_configure_type() fails with Tcl/Tk 8.6.11

2021-12-06 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

import tkinter as tk
tk.Menu(type='')

crashes on current Windows 3.9-11 with 8.6.12

--

___
Python tracker 

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



Re: threading and multiprocessing deadlock

2021-12-06 Thread Barry Scott



> On 5 Dec 2021, at 23:50, Johannes Bauer  wrote:
> 
> Hi there,
> 
> I'm a bit confused. In my scenario I a mixing threading with
> multiprocessing. Threading by itself would be nice, but for GIL reasons
> I need both, unfortunately. I've encountered a weird situation in which
> multiprocessing Process()es which are started in a new thread don't
> actually start and so they deadlock on join.
> 
> I've created a minimal example that demonstrates the issue. I'm running
> on x86_64 Linux using Python 3.9.5 (default, May 11 2021, 08:20:37)
> ([GCC 10.3.0] on linux).
> 
> Here's the code:

I suggest that you include the threading.current_thread() in your messages.
Then you can see which thread is saying what.

Barry

> 
> 
> import time
> import multiprocessing
> import threading
> 
> def myfnc():
>   print("myfnc")
> 
> def run(result_queue, callback):
>   result = callback()
>   result_queue.put(result)
> 
> def start(fnc):
>   def background_thread():
>   queue = multiprocessing.Queue()
>   proc = multiprocessing.Process(target = run, args = (queue, 
> fnc))
>   proc.start()
>   print("join?")
>   proc.join()
>   print("joined.")
>   result = queue.get()
>   threading.Thread(target = background_thread).start()
> 
> start(myfnc)
> start(myfnc)
> start(myfnc)
> start(myfnc)
> while True:
>   time.sleep(1)
> 
> 
> What you'll see is that "join?" and "joined." nondeterministically does
> *not* appear in pairs. For example:
> 
> join?
> join?
> myfnc
> myfnc
> join?
> join?
> joined.
> joined.
> 
> What's worse is that when this happens and I Ctrl-C out of Python, the
> started Thread is still running in the background:
> 
> $ ps ax | grep minimal
> 370167 pts/0S  0:00 python3 minimal.py
> 370175 pts/2S+ 0:00 grep minimal
> 
> Can someone figure out what is going on there?
> 
> Best,
> Johannes
> -- 
> https://mail.python.org/mailman/listinfo/python-list
> 

-- 
https://mail.python.org/mailman/listinfo/python-list


[issue19864] [doc] multiprocessing Proxy docs need locking semantics explained

2021-12-06 Thread Irit Katriel


Change by Irit Katriel :


--
keywords: +easy
title: multiprocessing Proxy docs need locking semantics explained -> [doc] 
multiprocessing Proxy docs need locking semantics explained
type:  -> enhancement
versions: +Python 3.11 -Python 2.7, Python 3.3, Python 3.4

___
Python tracker 

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



Re: Python child process in while True loop blocks parent

2021-12-06 Thread Barry Scott


> On 6 Dec 2021, at 17:09, Jen Kris via Python-list  
> wrote:
> 
> I can't find any support for your comment that "Fork creates a new
> process and therefore also a new thread."  From the Linux man pages 
> https://www.man7.org/linux/man-pages/man2/fork.2.html, "The child process is 
> created with a single thread—the one that called fork()." 

You just quoted the evidence!

All new processes on unix (may all OS) only ever have one thread when they 
start.
The thread-id of the first thread is the same as the process-id and referred to 
as the main thread.

> 
> I have a one-core one-thread instance at Digital Ocean available running 
> Ubuntu 18.04.  I can fork and create a new process on it, but it doesn't 
> create a new thread because it doesn't have one available. 


By that logic it can only run one process...

It has one hardware core that support one hardware thread.
Linux can create as many software threads as it likes.

> You may also want to see "Forking vs Threading" 
> (https://www.geekride.com/fork-forking-vs-threading-thread-linux-kernel), 
> "Fork vs Thread" 
> (https://medium.com/obscure-system/fork-vs-thread-38e09ec099e2), and "Linux 
> process and thread" (https://zliu.org/post/linux-process-and-thread) ("This 
> means that to create a normal process fork() is used that further calls 
> clone() with appropriate arguments while to create a thread or LWP, a 
> function from pthread library calls clone() with relvant flags. So, the main 
> difference is generated by using different flags that can be passed to 
> clone() funciton(to be exact, it is a system call"). 
> 
> You may be confused by the fact that threads are called light-weight 
> processes. 

No Peter and I are not confused.

> 
> Or maybe I'm confused :)

Yes you are confused.

> 
> If you have other information, please let me know.  Thanks. 

Please get the book I recommended, or another that covers systems programming 
on unix, and have a read.

Barry

> 
> Jen
> 
> 
> Dec 5, 2021, 18:08 by hjp-pyt...@hjp.at:
> 
>> On 2021-12-06 00:51:13 +0100, Jen Kris via Python-list wrote:
>> 
>>> The C program creates two threads (using pthreads), one for itself and
>>> one for the child process.  On creation, the second pthread is pointed
>>> to a C program that calls fork-execv to run the Python program.  That
>>> way Python runs on a separate thread. 
>>> 
>> 
>> I think you have the relationship between processes and threads
>> backwards. A process consists of one or more threads. Fork creates a new
>> process and therefore also a new thread.
>> 
>> hp
>> 
>> -- 
>> _  | Peter J. Holzer| Story must make more sense than reality.
>> |_|_) ||
>> | |   | h...@hjp.at |-- Charles Stross, "Creative writing
>> __/   | http://www.hjp.at/ |   challenge!"
>> 
> 
> -- 
> https://mail.python.org/mailman/listinfo/python-list

-- 
https://mail.python.org/mailman/listinfo/python-list


[issue8161] inconsistency behavior in ctypes.c_char_p dereferencing

2021-12-06 Thread Irit Katriel


Irit Katriel  added the comment:

On 3.11 I'm not getting str for the second expression, I get an empty bytes 
object:


>>> import ctypes
>>> class T(ctypes.Structure):
... _fields_ = (
... ('member', ctypes.c_char * 16),
... )
... 
>>> print('%r'%((ctypes.c_char * 16)()[:]))
b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
>>> print('%r'%(T().member[:]))
b''

--
nosy: +iritkatriel
status: open -> pending

___
Python tracker 

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



Re: Python child process in while True loop blocks parent

2021-12-06 Thread Chris Angelico
On Tue, Dec 7, 2021 at 4:10 AM Jen Kris via Python-list
 wrote:
>
> I can't find any support for your comment that "Fork creates a new
> process and therefore also a new thread."  From the Linux man pages 
> https://www.man7.org/linux/man-pages/man2/fork.2.html, "The child process is 
> created with a single thread—the one that called fork()."
>
> I have a one-core one-thread instance at Digital Ocean available running 
> Ubuntu 18.04.  I can fork and create a new process on it, but it doesn't 
> create a new thread because it doesn't have one available.
>

A CPU core is capable of running one or more threads *concurrently*,
and having multiple cores obviously multiplies that out. But for what
you're doing here, there's no material difference between threads
running concurrently and threads switching out between themselves
(other than performance, of course). From the operating system and
application perspectives, a "thread" is one runnable thread.

Every Unix process must contain a minimum of one thread. As a rough
rule of thumb, a process owns resources, a thread runs code. Without a
thread, you can't run any code.

Forking a process creates a child process and leaves the parent
running. The child process must by definition have a minimum of one
thread, and the man page is stating that one thread is all it gets.

Hope that helps explain things a bit. I don't know exactly what's
going on in your code, but maybe that'll clarify the word "thread".

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue41062] Advanced Debugger Support C-API is useless without HEAD_LOCK()/HEAD_UNLOCK()

2021-12-06 Thread Irit Katriel


Change by Irit Katriel :


--
type: behavior -> enhancement
versions: +Python 3.11 -Python 3.10, Python 3.5, 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



[issue27016] BlockingIOError not raised inside function.

2021-12-06 Thread Irit Katriel


Irit Katriel  added the comment:

On a Mac I get the "BlockingIOError: [Errno 35] Resource temporarily 
unavailable" with both version (with and without the function).

--
nosy: +iritkatriel
status: open -> pending

___
Python tracker 

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



[issue45995] string formatting: normalize negative zero

2021-12-06 Thread Mark Dickinson


Change by Mark Dickinson :


--
nosy: +eric.smith

___
Python tracker 

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



[issue45582] Rewrite getpath.c in Python

2021-12-06 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset f16f93e5279f957ca25dd8b91233a44833167a8a by Christian Heimes in 
branch 'main':
bpo-45582: framework build: modPath must not be const (GH-29944)
https://github.com/python/cpython/commit/f16f93e5279f957ca25dd8b91233a44833167a8a


--

___
Python tracker 

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



[issue46002] py Launcher for Windows with MSYS2

2021-12-06 Thread Zernoxi


Zernoxi  added the comment:

I am launching "py" from a regular prompt ("powershell"). I should only have 2 
registered python versions in the registry. "py -0p" shows the correct 
information.

One thing to note is that if I "#!/usr/bin/env python3 -V", it will show the 
correct default python3 version and is consistence when in a virtual 
environment.

--

___
Python tracker 

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



[issue45992] distutils paths are scattered between PythonXY and PythonXY-32 on WoW64

2021-12-06 Thread Tzu-ping Chung

Tzu-ping Chung  added the comment:

They are old, but so are purelib and platlib, which were changed regardless. 
The problem is that distutils’s values are now half wrong and half right, 
neither matching pre-3.10 behaviour, nor matching post-3.10 sysconfig behaviour.

--

___
Python tracker 

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



[issue46001] JSON module documentation mentions OverflowError for case that raises RecursionError

2021-12-06 Thread James Gerity


James Gerity  added the comment:

Correction: the bug whose resolution adds the OverflowError mentioned above is 
bpo-24522, not bpo-43255

--

___
Python tracker 

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



[issue45582] Rewrite getpath.c in Python

2021-12-06 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +28170
pull_request: https://github.com/python/cpython/pull/29944

___
Python tracker 

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



[issue46002] py Launcher for Windows with MSYS2

2021-12-06 Thread Steve Dower


Steve Dower  added the comment:

Are you launching "py" from inside MSYS2? Or a regular prompt?

What does the output of "py -0p" show? (It should list all the discovered 
installs)

We might need someone who understands how MSYS2 works here, because I don't.

--

___
Python tracker 

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



[issue45992] distutils paths are scattered between PythonXY and PythonXY-32 on WoW64

2021-12-06 Thread Steve Dower


Steve Dower  added the comment:

They should all be under "-32" when in roaming appdata, because otherwise 
having 32-bit and 64-bit installs side-by-side will conflict.

If these fields were newly added to distutils then should probably fix them to 
match sysconfig. If they're old and wrong, I'd just ignore them.

--

___
Python tracker 

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



[issue45582] Rewrite getpath.c in Python

2021-12-06 Thread Steve Dower


Steve Dower  added the comment:


New changeset af1db4eb555e02d2bff3476f99f7a653764203b0 by neonene in branch 
'main':
bpo-45582: Fix getpath_isxfile() and test_embed on Windows (GH-29930)
https://github.com/python/cpython/commit/af1db4eb555e02d2bff3476f99f7a653764203b0


--

___
Python tracker 

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



[issue31879] Launcher fails on custom command starting with "python"

2021-12-06 Thread Steve Dower


Steve Dower  added the comment:

Not sure if Mark and Martin are part of an expert group, but neither are active 
in this area these days.

For the original question, I have no idea why the command can't use a builtin 
name, so hard to say whether we'd change it. A summary of why it's broken and 
what the fix would be is needed before we can say whether the change would be 
accepted or not.

--

___
Python tracker 

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



[issue45934] python curses newterm implementation

2021-12-06 Thread Julius Hamilton

Julius Hamilton  added the comment:

I’m currently planning on studying the C code for initscr and newterm so I can 
really understand how they work.

I’ll post any updates about this soon.

Thanks.

--

___
Python tracker 

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



[issue45997] asyncio.Semaphore waiters deque doesn't work

2021-12-06 Thread Yevhenii Hyzyla


Yevhenii Hyzyla  added the comment:

Thanks for response!

> A hero who can help is welcome!

I will try to make PR :raising_hand

--
type: behavior -> 
versions: +Python 3.8 -Python 3.11

___
Python tracker 

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



Re: Python child process in while True loop blocks parent

2021-12-06 Thread Jen Kris via Python-list
I can't find any support for your comment that "Fork creates a new
process and therefore also a new thread."  From the Linux man pages 
https://www.man7.org/linux/man-pages/man2/fork.2.html, "The child process is 
created with a single thread—the one that called fork()." 

I have a one-core one-thread instance at Digital Ocean available running Ubuntu 
18.04.  I can fork and create a new process on it, but it doesn't create a new 
thread because it doesn't have one available. 

You may also want to see "Forking vs Threading" 
(https://www.geekride.com/fork-forking-vs-threading-thread-linux-kernel), "Fork 
vs Thread" (https://medium.com/obscure-system/fork-vs-thread-38e09ec099e2), and 
"Linux process and thread" (https://zliu.org/post/linux-process-and-thread) 
("This means that to create a normal process fork() is used that further calls 
clone() with appropriate arguments while to create a thread or LWP, a function 
from pthread library calls clone() with relvant flags. So, the main difference 
is generated by using different flags that can be passed to clone() funciton(to 
be exact, it is a system call"). 

You may be confused by the fact that threads are called light-weight processes. 

Or maybe I'm confused :)

If you have other information, please let me know.  Thanks. 

Jen


Dec 5, 2021, 18:08 by hjp-pyt...@hjp.at:

> On 2021-12-06 00:51:13 +0100, Jen Kris via Python-list wrote:
>
>> The C program creates two threads (using pthreads), one for itself and
>> one for the child process.  On creation, the second pthread is pointed
>> to a C program that calls fork-execv to run the Python program.  That
>> way Python runs on a separate thread. 
>>
>
> I think you have the relationship between processes and threads
> backwards. A process consists of one or more threads. Fork creates a new
> process and therefore also a new thread.
>
>  hp
>
> -- 
>  _  | Peter J. Holzer| Story must make more sense than reality.
> |_|_) ||
> | |   | h...@hjp.at |-- Charles Stross, "Creative writing
> __/   | http://www.hjp.at/ |   challenge!"
>

-- 
https://mail.python.org/mailman/listinfo/python-list


[issue46002] py Launcher for Windows with MSYS2

2021-12-06 Thread Tze Chian Kam


Tze Chian Kam  added the comment:

This is not in a a virtual environment by the way.

--

___
Python tracker 

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



[issue45997] asyncio.Semaphore waiters deque doesn't work

2021-12-06 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Or, maybe, there is a way to do everything without changing public API.

The idea is: _wake_up_next can create a future which is set by *waked up task* 
on its acquiring. acquire method should wait for this future first before 
entering in `while self._value < 0:` loop.

If the future is cancelled, `_wake_up_next` should be called again and waiting 
for the next future acquiring to be performed.

If there is no *acquire waiting* future exists -- do everything as usual.

All other lock objects should be modified also.

--
title: asyncio.Semaphore waiters deqeueu doesn't work -> asyncio.Semaphore 
waiters deque doesn't work
type:  -> behavior
versions: +Python 3.11 -Python 3.8

___
Python tracker 

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



[issue46002] py Launcher for Windows with MSYS2

2021-12-06 Thread Tze Chian Kam


New submission from Tze Chian Kam :

Using "pyenv" for python installations. "py" launcher detects all installed 
python versions from "pyenv". When using the shebang feature, if the following 
shebang is specified, "#!/usr/bin/env python -V", it will detect python version 
of "3.9.9" from MSYS2 (where the latest version is "3.9.9"). But MSYS2 python 
is not in registered in registry so it should not be detecting it.

--
components: Windows
messages: 407840
nosy: Zernoxi, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: py Launcher for Windows with MSYS2
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



[issue46001] JSON module documentation mentions OverflowError for case that raises RecursionError

2021-12-06 Thread James Gerity


Change by James Gerity :


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

___
Python tracker 

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



Re: threading and multiprocessing deadlock

2021-12-06 Thread Johannes Bauer
Am 06.12.21 um 13:56 schrieb Martin Di Paola:
> Hi!, in short your code should work.
> 
> I think that the join-joined problem is just an interpretation problem.
> 
> In pseudo code the background_thread function does:
> 
> def background_thread()
>   # bla
>   print("join?")
>   # bla
>   print("joined")
> 
> When running this function in parallel using threads, you will probably
> get a few "join?" first before receiving any "joined?". That is because
> the functions are running in parallel.
> 
> The order "join?" then "joined" is preserved within a thread but not
> preserved globally.

Yes, completely understood and really not the issue. That these pairs
are not in sequence is fine.

> Now, I see another issue in the output (and perhaps you was asking about
> this one):
> 
> join?
> join?
> myfnc
> myfnc
> join?
> join?
> joined.
> joined.
> 
> So you have 4 "join?" that correspond to the 4 background_thread
> function calls in threads but only 2 "myfnc" and 2 "joined".

Exactly that is the issue. Then it hangs. Deadlocked.

> Could be possible that the output is truncated by accident?

No. This is it. The exact output varies, but when it hangs, it always
also does not execute the function (note the lack of "myfnc"). For example:

join?
join?
myfnc
join?
myfnc
join?
myfnc
joined.
joined.
joined.

(only three threads get started there)

join?
myfnc
join?
join?
join?
joined.

(this time only a single one made it)

join?
join?
join?
myfnc
join?
myfnc
joined.
myfnc
joined.
joined.

(three get started)

> I ran the same program and I got a reasonable output (4 "join?", "myfnc"
> and "joined"):
> 
> join?
> join?
> myfnc
> join?
> myfnc
> join?
> joined.
> myfnc
> joined.
> joined.
> myfnc
> joined.

This happens to me occasionally, but most of the time one of the
processes deadlocks. Did you consistently get four of each? What
OS/Python version were you using?

> Another issue that I see is that you are not joining the threads that
> you spawned (background_thread functions).

True, I kindof assumed those would be detached threads.

> I hope that this can guide you to fix or at least narrow the issue.

Depending on what OS/Python version you're using, that points in that
direction and kindof reinforces my belief that the code is correct.

Very curious.

Thanks & all the best,
Joe
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue45994] Add simple usage to email module

2021-12-06 Thread Taiga Katarao


Taiga Katarao  added the comment:

There are the simplest example to send text email and a little bit complicated 
example to an email with some files.

However, beginners like me want simple example to create an email composed of 
the combination of multipart/alternative and multipart/mixed.

There are many web sites to explain sending an email composed of 
multipart/alternative and multipart/mixed, but all of them use MIMEText and 
MIMEMultipart, which can be replaced and simplified with EmailMessage like 
below.

```
import smtplib
from email.message import EmailMessage

msg = EmailMessage()
msg['From'] = 'f...@example.com'
msg['To'] = 't...@example.com'
msg['Subject'] = 'Subject'

msg.add_alternative('Hello, world.', subtype='text')
msg.add_alternative('Helo, world.', subtype='html')
with open('example.pdf', 'rb') as f:
msg.add_attachment(
f.read(),
maintype='application',
subtype='pdf',
filename='example.pdf'
)

with smtplib.SMTP('SMTP_HOST', 'SMTP_PORT') as smtp:
smtp.starttls()
smtp.login('USER', 'PASSWORD')
smtp.send_message(msg)
```

Of cause I know we can obtain the code above from the combination of existing 
example codes, but it's a little bit difficult.

I guess the reason why they cannot find simple way partially because the 
official documentation does not provide example.

--

___
Python tracker 

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



[issue45755] Specialized generic class does not return class attributes in dir

2021-12-06 Thread Ken Jin


Ken Jin  added the comment:

Not exactly sure if this is a bug, but the reason is that Foo[int] used to be a 
class, now it's a plain object. It's a change brought in 3.7 by PEP 560.

3.6:
>>> isinstance(Foo[int], type)
True
>>> Foo[int].__dir__
>> type(Foo[int].__dir__)


main:
>>> isinstance(Foo[int], type)
False
>>> Foo[int].__dir__

>>> type(Foo[int].__dir__)


The fix is just a 2-line change in either _GenericAlias or _BaseGenericAlias:
+def __dir__(self):
+return dir(self.__origin__)

Should we go ahead with this?

--

___
Python tracker 

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



[issue46001] JSON module documentation mentions OverflowError for case that raises RecursionError

2021-12-06 Thread James Gerity


New submission from James Gerity :

The docstrings for `json.JSONEncoder, json.dump(), json.dumps()` all refer to 
`OverflowError` when describing the behavior of the `check_circular` parameter, 
but the module's test of this parameter catches a `RecursionError` and the 
documentation does make reference to recursion.

Since the fix for bpo-43225 (7b78d43) the string-escaping machinery in 
`_json.c` is capable of raising OverflowError, but the reference in the 
documentation predates this addition by quite a long time.

--
assignee: docs@python
components: Documentation
messages: 407837
nosy: SnoopJeDi, docs@python
priority: normal
severity: normal
status: open
title: JSON module documentation mentions OverflowError for case that raises 
RecursionError
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



[issue45997] asyncio.Semaphore waiters deqeueu doesn't work

2021-12-06 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Good point.
Currently, asyncio lock objects don't provide a strong FIFO guarantee.

In a tight loop, a task can re-acquire the lock just after releasing even if 
there are pending waiters that were scheduled earlier. It's true also for Lock, 
Conditional, Event, etc.

The solution requires *async* release method. Since the change is not backward 
compatible, a new method should be added, e.g. `await sem.release_and_wait()` 
for endorsing the context switch if there are pending waiters.

async context manager can be modified for using the new method without backward 
compatibility problems easily.

A hero who can help is welcome!

--
assignee:  -> asvetlov
title: asyncio.Semaphore waiters deque doesn't work -> asyncio.Semaphore 
waiters deqeueu doesn't work
type: behavior -> 

___
Python tracker 

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



[issue45973] Not possible to clear PyImport_Inittab after PyImport_AppendInittab

2021-12-06 Thread STINNER Victor


STINNER Victor  added the comment:

See also bpo-1 (fixed).

--

___
Python tracker 

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



[issue22815] unexpected successes are not output

2021-12-06 Thread Irit Katriel


Irit Katriel  added the comment:

Or do you mean that there should be more output?

--
status: pending -> open

___
Python tracker 

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



[issue22815] unexpected successes are not output

2021-12-06 Thread Irit Katriel


Irit Katriel  added the comment:

I think this has been fixed:

% cat mm.py 
import unittest

class TestStringMethods(unittest.TestCase):

@unittest.expectedFailure
def test_upper(self):
self.assertEqual(2, 2)

if __name__ == '__main__':
unittest.main()




% ./python.exe mm.py 
x
--
Ran 1 test in 0.001s

OK (expected failures=1)
iritkatriel@Irits-MBP cpython % vi mm.py  
iritkatriel@Irits-MBP cpython % ./python.exe mm.py
u
--
Ran 1 test in 0.000s

FAILED (unexpected successes=1)

--
nosy: +iritkatriel
resolution:  -> out of date
status: open -> pending

___
Python tracker 

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



[issue45973] Not possible to clear PyImport_Inittab after PyImport_AppendInittab

2021-12-06 Thread STINNER Victor


STINNER Victor  added the comment:

Currently, the global variable PyImport_Inittab is used. It should be made 
per-interpreter and I suggest to add something like PyConfig_AppendInittab() to 
the PyConfig API, so the configuration change would only impact a single 
interpreter. It would be possible to run two interpreters with two different 
inittab configuration.

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



[issue31139] Improve tracemalloc demo code in docs

2021-12-06 Thread STINNER Victor


STINNER Victor  added the comment:

https://github.com/python/cpython/pull/3020 is closed, I close this issue as 
well.

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



[issue45950] Reintroduce bootstrap_python for freezing

2021-12-06 Thread Christian Heimes


Christian Heimes  added the comment:

Ned, I have implemented a fix for _bootstrap_python for framework builds and 
re-enabled --with-build-python for all builds. Previously I disabled the option 
for standard builds, because --with-build-python can cause build issues when a 
user runs ./configure --with-build-python with an older 3.11 alpha build.

--

___
Python tracker 

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



[issue21952] fnmatch.py can appear in tracemalloc diffs

2021-12-06 Thread STINNER Victor


STINNER Victor  added the comment:

Exposing internal caches in tracemalloc is not a bug but a deliberate choice. 
It's easy to write your own filters to ignore selected files (or even specific 
functions if you can locate them by line nubmers).

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



  1   2   >