[issue32658] Metacharacter (\) documentation suggestion

2022-04-01 Thread Jack DeVries


Jack DeVries  added the comment:

Did you run ``make venv`` to setup your virtual environment? Sphynx themes are 
usually pip dependencies, so if you're getting a "missing theme" error, it 
sounds like your virtual environment is not setup right.

--
nosy: +jack__d

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



[issue38668] Update os.path documentation regarding recommended types

2022-04-01 Thread Jack DeVries


Change by Jack DeVries :


--
keywords: +patch
nosy: +jack__d
nosy_count: 2.0 -> 3.0
pull_requests: +30304
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/32232

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



[issue44347] Unclear documentation for shutil.copytree()

2021-06-09 Thread Jack DeVries


Jack DeVries  added the comment:

I would like to submit a patch for this. This would be my first contribution :)

I am starting on a patch now.

--
nosy: +jack__d

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



[issue44347] Unclear documentation for shutil.copytree()

2021-06-09 Thread Jack DeVries


Change by Jack DeVries :


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

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



[issue44347] Unclear documentation for shutil.copytree()

2021-06-09 Thread Jack DeVries


Jack DeVries  added the comment:

I've created a PR: https://github.com/python/cpython/pull/26634

I forgot to put a news entry, but hopefully that's ok since this is a very 
small change.

--

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



[issue44362] improve documentation of SSL deprecations

2021-06-09 Thread Jack DeVries


Jack DeVries  added the comment:

These changes are part of PEP 644; support for OpenSSL v1.1.1. The benefits are 
detailed in `the PEP <https://www.python.org/dev/peps/pep-0644/#benefits>`_.

Later, the deprecation process began in `bpo-43880 
<https://bugs.python.org/issue43880>`_. It seems like `PROTOCOL_TLS` is the 
only thing with a deprecation warning that does not have a suggested 
alternative.

I'm confused as to how this can be deprecated; what will be the new mechanism 
for selecting a protocol? If someone can provide some brief clarification, I'd 
be more than happy to update the docs!

--
nosy: +jack__d

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



[issue44347] Unclear documentation for shutil.copytree()

2021-06-10 Thread Jack DeVries


Change by Jack DeVries :


--
pull_requests: +25229
pull_request: https://github.com/python/cpython/pull/26643

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



[issue44362] improve documentation of SSL deprecations

2021-06-10 Thread Jack DeVries


Jack DeVries  added the comment:

Would you like me to submit a PR for this simple patch?

https://github.com/jdevries3133/cpython/commit/42d9bd7f97f03b49d4fc89780616704998492ac1

--

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



[issue44387] Not obvious that locale.LC_MESSAGES may not exist sometimes (e.g. on Windows)

2021-06-10 Thread Jack DeVries


Jack DeVries  added the comment:

Could it be that _locale throws an ImportError whenever LC_MESSAGES doesn't 
exist? Then, there are fall-backs defined here:

https://github.com/python/cpython/blob/62f1d2b3d7dda99598d053e10b785c463fdcf591/Lib/locale.py#L45-L85

--
nosy: +jack__d

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



[issue44387] Not obvious that locale.LC_MESSAGES may not exist sometimes (e.g. on Windows)

2021-06-10 Thread Jack DeVries


Jack DeVries  added the comment:

Follow-up: nope! My hypothesis was incorrect. This is all that _localemodule.c 
has to say about LC_MESSAGES:

#ifdef LC_MESSAGES
ADD_INT(module, LC_MESSAGES);
#endif /* LC_MESSAGES */

--

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



[issue44382] Python 3.9+ on Windows 8.0

2021-06-10 Thread Jack DeVries


Jack DeVries  added the comment:

https://buildbot.python.org/all/#/waterfall?tags=win64

Buildbot is only running against 8.1, not 8.0. I'm guessing that means that the 
docs are correct and python.org main page is wrong. I'd open an issue over 
there:

https://github.com/python/pythondotorg/issues

--
nosy: +jack__d

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



[issue44386] importlib and math.pi interact strangely

2021-06-10 Thread Jack DeVries


Jack DeVries  added the comment:

That is because pi, along with other constants in the math module are defined 
during module execution, not module creation:

https://github.com/python/cpython/blob/62f1d2b3d7dda99598d053e10b785c463fdcf591/Modules/cmathmodule.c#L1257-L1262

Taking the example right here 
(https://docs.python.org/3/library/importlib.html#checking-if-a-module-can-be-imported)
 from the docs, you can see how they call exec_module() after module_from_spec.

If you change your code to do that as well, you will find that pi is now 
defined:



from importlib import util

mathmodule = util.find_spec("math")
math1 = util.module_from_spec(mathmodule)
mathmodule.loader.exec_module(math1)
print(math1.pi)



--
nosy: +jack__d

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



[issue38323] asyncio: MultiLoopWatcher has a race condition (test_asyncio: test_close_kill_running() hangs on AMD64 RHEL7 Refleaks 3.x)

2021-06-11 Thread Jack DeVries


Change by Jack DeVries :


--
nosy: +jack__d
nosy_count: 10.0 -> 11.0
pull_requests: +25270
pull_request: https://github.com/python/cpython/pull/26643

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



[issue37880] For argparse add_argument with action='store_const', const should default to None.

2021-06-12 Thread Jack DeVries


Jack DeVries  added the comment:

Hi Joannah, I'm a new contributor and happy to take a crack at this if you 
haven't already started on a fix / would like me to do that. Thanks!

--
nosy: +jack__d

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



[issue44411] regrtests fail with segfault after failing calls to malloc

2021-06-13 Thread Jack DeVries

New submission from Jack DeVries :

When running regrtests via `./python.exe -m test` on my system, several 
warnings about failing calls to malloc are generated during `test_decorators`. 
Then, a segmentation fault happens shortly thereafter in `test_descrtut`.

The most recent commit on the main branch as of this test run was 
17b16e13bb444001534ed6fccb459084596c8bcf.

Here are some details about my system:

Model Name: MacBook Pro
  Model Identifier: MacBookPro12,1
  Processor Name:   Dual-Core Intel Core i5
  Processor Speed:  2.7 GHz
  Number of Processors: 1
  Total Number of Cores:2
  L2 Cache (per Core):  256 KB
  L3 Cache: 3 MB
  Hyper-Threading Technology:   Enabled
  Memory:   8 GB
  System Firmware Version:  427.0.0.0.0
  SMC Version (system): 2.28f7
  Serial Number (system):   C02P9EMTFVH5
  Hardware UUID:ABA9DB61-5A93-54BC-8057-6F0E0DA6544B
  Provisioning UDID:ABA9DB61-5A93-54BC-8057-6F0E0DA6544B



Here is the full output from cloning all the way down to segfault
=


➜  tmp.kw3WJpEs git clone g...@github.com:python/cpython.git . --depth=1
Cloning into '.'...
remote: Enumerating objects: 4779, done.
remote: Counting objects: 100% (4779/4779), done.
remote: Compressing objects: 100% (4362/4362), done.
remote: Total 4779 (delta 488), reused 1570 (delta 314), pack-reused 0
Receiving objects: 100% (4779/4779), 24.71 MiB | 11.00 MiB/s, done.
Resolving deltas: 100% (488/488), done.
Updating files: 100% (4537/4537), done.
➜  tmp.kw3WJpEs git:(main) ./configure --with-pydebug
checking for git... found
checking build system type... x86_64-apple-darwin20.5.0
checking host system type... x86_64-apple-darwin20.5.0
checking for python3.11... no
checking for python3... python3
checking for --enable-universalsdk... no
checking for --with-universal-archs... no
checking MACHDEP... "darwin"
Configured with: --prefix=/Library/Developer/CommandLineTools/usr 
--with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for a sed that does not truncate output... /usr/bin/sed
checking for --with-cxx-main=... no
checking for g++... no
configure:

  By default, distutils will build C++ extension modules with "g++".
  If this is not intended, then set CXX on the configure command line.
  
checking for the platform triplet based on compiler characteristics... darwin
checking for -Wl,--no-as-needed... no
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for the Android API level... not Android
checking for --with-suffix... 
checking for case-insensitive build directory... yes
checking LIBRARY... libpython$(VERSION)$(ABIFLAGS).a
checking LINKCC... $(PURIFY) $(MAINCC)
checking EXPORTSYMS... 
checking for GNU ld... no
checking for --enable-shared... no
checking for --enable-profiling... no
checking LDLIBRARY... libpython$(VERSION)$(ABIFLAGS).a
checking for ar... ar
checking for readelf... no
checking for a BSD-compatible install... /usr/bin/install -c
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for --with-pydebug... yes
checking for --with-trace-refs... no
checking for --with-assertions... implied by --with-pydebug
checking for --enable-optimizations... no
checking PROFILE_TASK... -m test --pgo --timeout=$(TESTTIMEOUT)
checking for --with-lto... no
checking for llvm-profdata... no
configure: llvm-profdata found via xcrun: /usr/bin/xcrun llvm-profdata
checking for -Wextra... yes
checking whether gcc accepts and needs -fno-strict-aliasing... no
checking if we can turn off gcc unused result warning... yes
checking if we can turn off gcc unused parameter warning... yes
checking if we can turn off gcc missing field initializers warning... yes
checking if we can turn on gcc mixed sign comparison warning... yes
checking if we can turn on gcc unreachable code warning... no
checking if we can turn on gcc strict-prototypes warning... yes
ch

[issue44411] regrtests fail with segfault after failing calls to malloc

2021-06-13 Thread Jack DeVries


Change by Jack DeVries :


--
components: +Library (Lib), macOS
nosy: +ned.deily, ronaldoussoren

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



[issue44411] regrtests fail with segfault after failing calls to malloc

2021-06-13 Thread Jack DeVries


Change by Jack DeVries :


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

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



[issue37880] For argparse add_argument with action='store_const', const should default to None.

2021-06-13 Thread Jack DeVries


Change by Jack DeVries :


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

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



[issue38323] asyncio: MultiLoopWatcher has a race condition (test_asyncio: test_close_kill_running() hangs on AMD64 RHEL7 Refleaks 3.x)

2021-06-14 Thread Jack DeVries


Change by Jack DeVries :


--
nosy:  -jack__d

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



[issue38323] asyncio: MultiLoopWatcher has a race condition (test_asyncio: test_close_kill_running() hangs on AMD64 RHEL7 Refleaks 3.x)

2021-06-14 Thread Jack DeVries


Change by Jack DeVries :


--
pull_requests:  -25270

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



[issue44421] random.uniform() hangs will eating up all available RAM

2021-06-14 Thread Jack DeVries


Jack DeVries  added the comment:

This doesn't look like a bug. It's hard to disentangle what your code is doing, 
exactly, but it's most likely that between all your nested loops and classes 
initializing each other, there is an exponential or greater growth in time 
complexity happening. As your input values grow, the program slows down at an 
exponential rate until it appears to just "hang".

The RAM is growing because the program hasn't really stopped running, it's just 
dutifully chugging along and filling up more and more memory, and if you waited 
long enough the program would either crash having run out of memory or maybe 
the program would complete in a very, very long time.

I hope I'm not missing something; feel free to let me know, or share a more 
minimal example to reproduce the issue.

--
nosy: +jack__d

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



[issue14879] invalid docs for subprocess exceptions with shell=True

2021-06-16 Thread Jack DeVries


Change by Jack DeVries :


--
keywords: +patch
nosy: +jack__d
nosy_count: 6.0 -> 7.0
pull_requests: +25340
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/26755

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



[issue44435] There is no description of PY_SSIZE_T_CLEAN in docs

2021-06-16 Thread Jack DeVries


New submission from Jack DeVries :

In the intro to the C API 
(https://docs.python.org/3/c-api/intro.html#include-files), it says, "see 
Parsing arguments and building values for a description of this macro." There 
is a link which leads to ``arg.rst``, but there is no description of the macro 
there, just a note to include the macro like elsewhere.

I propose to remove this sentence from the docs, since it is my understanding 
that there is no need to document the details of why this macro must be 
defined, only to ensure that users define it.

Alternatively, add a description of the macro in the appropriate place in the C 
API docs, and fix the link in this blurb.

I'm happy to submit a documentation patch, but I'd need someone to advise on 
which of these options are more desired.

--
messages: 395935
nosy: jack__d
priority: normal
severity: normal
status: open
title: There is no description of PY_SSIZE_T_CLEAN in docs

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



[issue44435] There is no description of PY_SSIZE_T_CLEAN in docs

2021-06-16 Thread Jack DeVries


Change by Jack DeVries :


--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python

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



[issue44411] regrtests fail with segfault after failing calls to malloc

2021-06-16 Thread Jack DeVries


Change by Jack DeVries :


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

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



[issue44411] regrtests fail with segfault after failing calls to malloc

2021-06-16 Thread Jack DeVries


Jack DeVries  added the comment:

I'm closing this because I have the sense that this is a problem with my 
system, but I'm continuing to investigate.

--

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



[issue44433] processes created by subprocess.Popen is not terminating

2021-06-16 Thread Jack DeVries


Jack DeVries  added the comment:

For future reference, here are some good guidelines for submitting bug reports 
and asking for help to debug your code:

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

http://www.sscce.org/

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

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



[issue40928] OS X: malloc(): set default diagnostics to DEBUG_WRITE_ON_CRASH

2021-06-18 Thread Jack DeVries


Change by Jack DeVries :


--
keywords: +patch
nosy: +jack__d
nosy_count: 4.0 -> 5.0
pull_requests: +25368
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/26783

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



[issue40928] OS X: malloc(): set default diagnostics to DEBUG_WRITE_ON_CRASH

2021-06-18 Thread Jack DeVries


Jack DeVries  added the comment:

>From my pr, "This is a bandaid to help people save time debugging this 
>non-bug. I don't think this solution is very strong; I'm just hoping to move 
>the discussion forward on the bpo, and hoping for a hint on how to suppress 
>these warnings all together or come up with some other optimal solution.

I applied the function in test_decimal because that test consistently generates 
these malloc warnings on my system."

I'm still trying to find a true solution. Can anyone help to point me in a 
better direction?

--

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



[issue40928] OS X: malloc(): set default diagnostics to DEBUG_WRITE_ON_CRASH

2021-06-18 Thread Jack DeVries


Change by Jack DeVries :


--
pull_requests: +25371
pull_request: https://github.com/python/cpython/pull/26786

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



[issue40928] OS X: malloc(): set default diagnostics to DEBUG_WRITE_ON_CRASH

2021-06-18 Thread Jack DeVries


Jack DeVries  added the comment:

Alternatively, my latest PR implements what @ronaldoussoren suggested: capping 
OS X memory allocations at 4TB.

--

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



[issue27752] [doc] CSV DictReader default dialect name 'excel' is misleading, as MS Excel doesn't actually use ', ' as a separator.

2021-06-18 Thread Jack DeVries


Change by Jack DeVries :


--
keywords: +patch
nosy: +jack__d
nosy_count: 3.0 -> 4.0
pull_requests: +25378
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/26795

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



[issue27752] [doc] CSV DictReader default dialect name 'excel' is misleading, as MS Excel doesn't actually use ', ' as a separator.

2021-06-18 Thread Jack DeVries


Jack DeVries  added the comment:

If you need semicolon delimiters, can't you just pass ``delimiter=';'`` to the 
reader or writer? I don't think there's a need for a separate dialect class for 
that, since dialect classes should only provide a baseline for the most broad 
use cases. Users have plenty of options for extending or customizing behavior 
without adding more dialect classes.

I also think the docs around dialects are confusing. I remember being confused 
by them when I was learning! I made quite a few changes to try to add clarity 
around dialects to the documentation. Let me know if anybody has feedback!

--

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



[issue44494] Overhaul of Doc/library/__main__.rst

2021-06-22 Thread Jack DeVries

New submission from Jack DeVries :

I made a proposal on discourse to redraft Doc/library/__main__.rst as it is 
currently quite terse and there have been a series of bpo's asking for more. 
See my discourse post:

https://discuss.python.org/t/proposed-overhaul-of-main-py-documentation-doc-library-main-rst/9344

There have been many complaints about the shortcoming of the documentation
towards informing users about __main__. Both the popular __name__ == '__main__' 
construct, and the role of __main__.py in a python module.

bpo-17359
bpo-24632
bpo-38452

I propose a broad overhaul of Doc/library/__main__.rst to address these
shortcomings and to provide a single source of truth on __main__ (in
general!). This is an appropriate place to put this information.
Both the __name__ == '__main__' and fooModule/__main__.py
constructs reasonably fall under the category of “Python Runtime Services,”
because they both control the way that programs run depending on how they are
used (command-line versus import versus running directly).

The new Doc/library/__main__.rst should have a new synopsis of, “CLIs,
import-time behavior, and if __name__ == ‘__main__’”, reflecting its new and
broader focus.

Additionally, the new docs should have the following distinct sections:

Differentiating between __name__ == ‘__main__’ and __main.__.py
__main__.py and the -m flag (this is roughly what is there already, although
it’s not as descriptive as it should be).
__name__ and the if __name__ == '__main__' construct.

If there is interest, I would be happy to open uptake this work on as soon as 
there is
consensus around this plan. I’m looking forward to hearing what you think!


Anyway, I have a first draft ready. I'm sure there will be plenty of feedback, 
so let it rip! I will open a GitHub PR and attach it to this bpo in just a 
moment.

--
assignee: docs@python
components: Documentation
messages: 396380
nosy: docs@python, jack__d
priority: normal
severity: normal
status: open
title: Overhaul of Doc/library/__main__.rst
type: enhancement
versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 
3.9

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



[issue44494] Overhaul of Doc/library/__main__.rst

2021-06-22 Thread Jack DeVries


Change by Jack DeVries :


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

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



[issue44494] Overhaul of Doc/library/__main__.rst

2021-06-23 Thread Jack DeVries


Jack DeVries  added the comment:

@iritkatriel, ok, I will close this issue, close PR26867, and move the work I 
have over there. I probably can merge in and build upon the work from the 
contributor on bpo-39452.

--

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



[issue44494] Overhaul of Doc/library/__main__.rst

2021-06-23 Thread Jack DeVries


Change by Jack DeVries :


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

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



[issue44494] Overhaul of Doc/library/__main__.rst

2021-06-23 Thread Jack DeVries


Change by Jack DeVries :


--
pull_requests: +25461
pull_request: https://github.com/python/cpython/pull/26883

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



[issue39452] Improve the __main__ module documentation

2021-06-23 Thread Jack DeVries


Change by Jack DeVries :


--
keywords: +patch
nosy: +jack__d
nosy_count: 6.0 -> 7.0
pull_requests: +25460
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/26883

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



[issue39452] Improve the __main__ module documentation

2021-06-23 Thread Jack DeVries


Jack DeVries  added the comment:

Hi All,

As I wrote on the PR::

I am picking up the torch on 39452, continuing where @maggyero left 
off, and also implementing my discourse proposal, which seemed to be 
well-liked.

Feel free to leave any feedback for me on the GitHub PR, I'm looking forward to 
continuing to develop this work based on community feedback.

--

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



[issue39452] Improve the __main__ module documentation

2021-06-23 Thread Jack DeVries


Change by Jack DeVries :


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

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



[issue40620] [doc] Range tutorial shorthand could be made clearer

2021-06-26 Thread Jack DeVries


Change by Jack DeVries :


--
keywords: +patch
nosy: +jack__d
nosy_count: 5.0 -> 6.0
pull_requests: +25492
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/26919

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



[issue38062] Clarify that atexit.unregister matches by equality, not identity

2021-06-28 Thread Jack DeVries


Change by Jack DeVries :


--
keywords: +patch
nosy: +jack__d
nosy_count: 2.0 -> 3.0
pull_requests: +25504
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/26935

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



[issue44523] weakref.proxy documentation might be outdated

2021-06-28 Thread Jack DeVries


Change by Jack DeVries :


--
keywords: +patch
nosy: +jack__d
nosy_count: 3.0 -> 4.0
pull_requests: +25505
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/26936

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



[issue44521] str.removeprefix(): add strict: bool

2021-06-28 Thread Jack DeVries


Jack DeVries  added the comment:

@Jelle Zijlstra, they did think about this in the pep; see here 
https://www.python.org/dev/peps/pep-0616/#id26

The PEP authors suggested a kwarg of ``required`` which is certainly better. 
Maybe ``raise_exception`` would be even more explicit albeit verbose.

It might be a useful feature; consider the following example::

dogs = ['mydog_spot', 'mydog_sally', 'jill']
new_dogs = [d.removeprefix('mydog_', required=True) for d in dogs]

If there is support for this feature, I would like to work on it. Let me know 
what you think, and whether you think that ``required`` or ``raise_exception`` 
is a better name for the keyword argument.

--
nosy: +jack__d

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



[issue44523] weakref.proxy documentation might be outdated

2021-06-28 Thread Jack DeVries


Jack DeVries  added the comment:

I'm going to close my PR; it seems like documentation is not the direction 
we're going, so no need to keep it open.

--

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



[issue44521] str.removeprefix(): add strict: bool

2021-06-28 Thread Jack DeVries


Jack DeVries  added the comment:

@lemburg, hopefully I'm asking the right person... you're down as the devguide 
expert on unicode and these changes would (I think) need to be applied here::

Objects/unicodeobject.c::12814 unicode_removeprefix_impl

Anyway, do you think this would be a useful feature that you'd like to see 
added?

--

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



[issue44521] str.removeprefix(): add strict: bool

2021-06-28 Thread Jack DeVries


Change by Jack DeVries :


--
nosy: +lemburg

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



[issue44529] Using typing.Union in isinstance checks

2021-06-28 Thread Jack DeVries


Jack DeVries  added the comment:

I think this already works unless you are using TypeVars::

t = Union[str, int]

isinstance(1, t)# True
isinstance('1', t)  # True

If you are using TypeVars, though, it cannot work:

T = TypeVar('my_type')
thing = Union[T, str]

isinstance('hi', thing)  # Exception

This makes sense, because ``T`` is just a name, not related to an actual object.

Sorry if I'm missing something, because I did try the non-working example and 
my exception actually says, "issubclass() arg 2 must be a class, a tuple of 
classes, or a union." The exception makes sense, but its difference from yours 
might mean I'm doing something differently.

--
nosy: +jack__d

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



[issue44526] Doc typo in "What’s New In Python 3.10" (x/y-axis)

2021-06-28 Thread Jack DeVries


Change by Jack DeVries :


--
keywords: +patch
nosy: +jack__d
nosy_count: 2.0 -> 3.0
pull_requests: +25511
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/26944

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



[issue44526] Doc typo in "What’s New In Python 3.10" (x/y-axis)

2021-06-28 Thread Jack DeVries


Jack DeVries  added the comment:

@serif2 nice catch!

--

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



[issue44490] PEP 604 Union (int | str) doesn't have __parameters__

2021-06-29 Thread Jack DeVries

Jack DeVries  added the comment:

mypy does not support __parameters__:

(venv) ➜  cpython git:(main) cat repro.py 
from typing import TypeVar
T = TypeVar('T')

(int | list[T]).__parameters__
(venv) ➜  cpython git:(main) mypy --version
mypy 0.920+dev.cae5d3c8b5f14d0796914aa6a113473ca3ffc38e
(venv) ➜  cpython git:(main) python --version
Python 3.11.0a0
(venv) ➜  cpython git:(main) mypy repro.py 
repro.py:4: error: "types.Union" has no attribute "__parameters__"
Found 1 error in 1 file (checked 1 source file)
(venv) ➜  cpython git:(main)


mypy also does not support __getitem__

(venv) ➜  cpython git:(main) cat repro.py 
from typing import TypeVar
T = TypeVar('T')

(int | list[T]).__getitem__
(venv) ➜  cpython git:(main) mypy --version
./mypy 0.920+dev.cae5d3c8b5f14d0796914aa6a113473ca3ffc38e
(venv) ➜  cpython git:(main) python --version
Python 3.11.0a0
(venv) ➜  cpython git:(main) mypy repro.py 
repro.py:4: error: Value of type "types.Union" is not indexable
Found 1 error in 1 file (checked 1 source file)
(venv) ➜  cpython git:(main)

--
nosy: +jack__d

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



[issue44543] Remove depreciated logging.warn() method

2021-07-01 Thread Jack DeVries


Change by Jack DeVries :


--
keywords: +patch
nosy: +jack__d
nosy_count: 2.0 -> 3.0
pull_requests: +25544
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/26982

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



[issue44543] Remove depreciated logging.warn() method

2021-07-01 Thread Jack DeVries


Jack DeVries  added the comment:

I'm not sure if there will be interest in merging this PR since it hasn't 
happened in all this time, but then again we've been emitting deprecation 
warnings from these functions and methods for a *decade* now.

If the decision at this point is still not to move forward with removal, we 
should just remove the deprecation warnings and document it as a supported and 
bona-fide alias. Should that be the case, I'll close the PR I just created and 
get started with that work instead.

--

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



[issue44544] Add full list of possible args to textwrap: wrap, fill, shorten

2021-07-02 Thread Jack DeVries


Change by Jack DeVries :


--
keywords: +patch
nosy: +jack__d
nosy_count: 2.0 -> 3.0
pull_requests: +25559
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/26999

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



[issue44552] incomplete documentation of __main__.py

2021-07-02 Thread Jack DeVries


Jack DeVries  added the comment:

This is documented in Doc/library/runpy.rst. Specifically, here:

> For a simple script, the specified code is simply executed in a fresh module 
> namespace. For a valid sys.path entry (typically a zipfile or directory), the 
> entry is first added to the beginning of sys.path. The function then looks 
> for and executes a __main__ module using the updated path. Note that there is 
> no special protection against invoking an existing __main__ entry located 
> elsewhere on sys.path if there is no such module at the specified location.

https://docs.python.org/3/library/runpy.html#runpy.run_path


However, I fully agree that Doc/library/__main__.rst is severely lacking; 
that's why I've rewritten it! Please consider providing your feedback on the 
open PR, and see bpo-39452

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



Note that the new docs in __main__.rst does explicitly reference runpy, so once 
merged, it'll guide people looking for this information in __main__.rst to the 
right place.

--
nosy: +jack__d

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



[issue44534] unittest.mock.Mock.unsafe doc is garbled

2021-07-02 Thread Jack DeVries


Change by Jack DeVries :


--
keywords: +patch
nosy: +jack__d
nosy_count: 2.0 -> 3.0
pull_requests: +25560
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/27000

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



[issue44589] Pattern Matching - duplicate keys in mapping patterns

2021-07-13 Thread Jack DeVries


Change by Jack DeVries :


--
keywords: +patch
nosy: +jack__d
nosy_count: 3.0 -> 4.0
pull_requests: +25674
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/27131

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



[issue44589] Pattern Matching - duplicate keys in mapping patterns

2021-07-13 Thread Jack DeVries


Jack DeVries  added the comment:

@brandtbucher, I think that my PR implements the solution you've described 
here. What do you think?

--

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



[issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit()

2021-07-13 Thread Jack DeVries


Jack DeVries  added the comment:

I wonder if the middle ground here is to let it be a teachable moment, and to 
inform the user by having the string returned by __repr__ be a bit more 
descriptive. Currently, it is:

> Use exit() or Ctrl-Z plus Return to exit

I propose:

> exit is the function that closes Python when called. To call a Python 
> function, add parenthesis! For example, "exit()".

To share a personal anecdote, Python was my first programming language. I can 
remember this specific case of REPL-stubbornness being instrumental in teaching 
me about referencing versus calling a function. Special cases cause confusion, 
and a shortcut that removes two characters at the expense of skirting past an 
essential understanding is not the right choice. The place we should be *most* 
careful about breaking language idioms are in the spots that are exposed to 
beginners and newcomers to the language.

--
nosy: +jack__d

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



[issue44589] Pattern Matching - duplicate keys in mapping patterns

2021-07-14 Thread Jack DeVries


Jack DeVries  added the comment:

@brandtbucher, I'm sorry for the miscommunication. I started working on this 
patch at the beginning of the week after message 397215... I'm a new 
contributor too, and I wasn't sure if I would be able to make something that 
worked, so I just kept my mouth shut. Then, all of a sudden, it came together 
and I had a (mostly) working patch.

I'm going to incorporate your review now; thank you for the feedback, and I'm 
very sorry for any toes I may have stepped on.

--

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



[issue44640] Typos in error messages of isinstance() & issubclass()

2021-07-14 Thread Jack DeVries


Jack DeVries  added the comment:

The current string is correct. The word "union" is actually an exception to the 
"a/an" rule. Here is more detail:

https://english.stackexchange.com/questions/266309/why-is-union-an-exception-to-the-a-an-rule

--
nosy: +jack__d

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



[issue44639] [sqlite3] Confusing typo "transation"

2021-07-14 Thread Jack DeVries


Change by Jack DeVries :


--
keywords: +patch
nosy: +jack__d
nosy_count: 3.0 -> 4.0
pull_requests: +25687
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/27145

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



[issue44639] [sqlite3] Confusing typo "transation"

2021-07-14 Thread Jack DeVries


Jack DeVries  added the comment:

To my understanding, it's supposed to say "transaction".

The source code is here:

https://github.com/python/cpython/blob/a158b20019b50e3ece6e4743ec4e6ae8d818b690/Modules/_sqlite/connection.c#L1434-L1467

I've opened a PR to fix the typo.

--

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



[issue44473] logging.handlers.QueueHandler acts unexpected

2021-07-14 Thread Jack DeVries


Jack DeVries  added the comment:

I have another question about the docstring in the source beneath 
logging.handlers.QueueHandler.prepare. It says:

> The object returned by this method is enqueued.

But, the prepare method doesn't do the enqueuing operation, it just prepares 
the record and returns it back, so it seems like this statement is not accurate?

--
nosy: +jack__d

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



[issue44638] zipfile.ZipFile is closed when zipfile.Path is closed

2021-07-14 Thread Jack DeVries


Jack DeVries  added the comment:

I'm not able to reproduce this on my machine; the script runs without any issue.

> the `TestClass` instance is being closed

What do you mean by this statement? You aren't doing anything to TestClass or 
its instance ("test") in this script. They remain in scope, so they will always 
be referenced.

--
nosy: +jack__d

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



[issue44658] No ValueError for duplicate key value in mapping patern when lengths do not match

2021-07-16 Thread Jack DeVries


New submission from Jack DeVries :

Consider the following code:

class A:
a = 'a'

# runs without error
match {'a': 1}:
case {'a': 1, A.a: 1}:
pass

# raises ValueError
match {'a': 1, 'b': 1}:
case {'a': 1, A.a: 1}:
pass

In both cases, the mapping pattern is the same (and both are not valid due to 
duplicate key values). However, the pattern is only evaluated in the second 
case. This is because a key-length optimization provides a shortcut around 
pattern evaluation. The docs gives users a hint that things like this might 
happen, which is a good thing:

> Users should generally never rely on a pattern being evaluated. Depending on 
> > implementation, the interpreter may cache values or use other optimizations 
> > which skip repeated evaluations. 

> https://docs.python.org/3.10/reference/compound_stmts.html#overview

However, I can't help but think that these ergonomics are strange. Consider if 
some other code is mutating the value of `A.a`. This could create some very 
strange and flaky bugs where the state of `A.a` can change and make the pattern 
invalid, but nonetheless not cause an exception until much later, or not at all.

There is mapping pattern validation code in the `match_keys` function in 
ceval.c. I haven't looked, but I assume there is some other runtime validation 
for other match case types. I propose factoring Exception-raising validation 
into a separate procedure that is called before any optimization jumps occur.

This trades speed for consistent behavior, and I'm interested to hear what 
others think!

--
components: Interpreter Core
messages: 397662
nosy: jack__d
priority: normal
severity: normal
status: open
title: No ValueError for duplicate key value in mapping patern when lengths do 
not match
type: behavior
versions: Python 3.10, Python 3.11

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



[issue44658] No ValueError for duplicate key value in mapping patern when lengths do not match

2021-07-16 Thread Jack DeVries


Jack DeVries  added the comment:

Another option if this problem is isolated to mapping patterns, we could 
introduce a new op-code: BUILD_MATCH_MAP, which is essentially a wrapper around 
BUILD_MAP that disallows duplicate key values.

--

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



[issue44589] Pattern Matching - duplicate keys in mapping patterns

2021-07-16 Thread Jack DeVries


Jack DeVries  added the comment:

The PR and backport to 3.10 have both been merged, so I think this issue can be 
closed.

--

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



[issue44600] match/case statements trace incorrectly in 3.10.0b4

2021-07-17 Thread Jack DeVries


Jack DeVries  added the comment:

@brandtbucher, is anyone working on this yet? I'd like to take a crack at it 
this week if it's still available!

--
nosy: +jack__d

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



[issue44664] builtins.chr and the 'c' format flag raise different errors

2021-07-17 Thread Jack DeVries


Change by Jack DeVries :


--
nosy: +jack__d

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



[issue44651] An unclear definition in Doc/glossary.rst

2021-07-17 Thread Jack DeVries


Jack DeVries  added the comment:

@StevenHsuYL yes, you can go ahead and create a PR for this if you'd like! Just 
follow the directions in the dev guide (link in sidebar).

I can't really tell for sure because I'm on my phone right now, but it looks 
like this might be your first time contributing to cpython; welcome! If you 
have any questions about the process, feel free to put them here.

--
nosy: +jack__d

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



[issue44681] time.sleep(0.001) not working properly

2021-07-19 Thread Jack DeVries

Jack DeVries  added the comment:

This is not a bug. See the docs:

The precision of the various real-time functions may be less than suggested by 
the units in which their value or argument is expressed. E.g. on most Unix 
systems, the clock “ticks” only 50 or 100 times a second.

On the other hand, the precision of time() and sleep() is better than their 
Unix equivalents: times are expressed as floating point numbers, time() returns 
the most accurate time available (using Unix gettimeofday() where available), 
and sleep() will accept a time with a nonzero fraction (Unix select() is used 
to implement this, where available).



Assuming a clock speed of 50x/second as the documentation names, the cpu only 
cycles every 0.02 seconds.

--
nosy: +jack__d

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



[issue44700] Python fails to build (aarch64-apple-darwin20.5.0)

2021-07-21 Thread Jack DeVries

New submission from Jack DeVries :

I believe this is a problem with my machine because I've tried checking out to 
known good commits (which worked on my machine before) and have the same issue, 
but I've tried everything and don't really know what to do next. I'm hoping 
someone can help me, and who knows – maybe it is a bug!

This is the command that fails::

   gcc  -Wl,-stack_size,100  -framework CoreFoundation \
  -o Programs/_testembed Programs/_testembed.o libpython3.11d.a -ldl   \
  -framework CoreFoundation

The linker is ignoring `libpython3.11d.a`, providing the following warning::

   ignoring file libpython3.11d.a, building for macOS-arm64 but attempting to 
link with file 
   built for macOS-arm64

Of course, what follows is a ton of undefined symbol errors; no surprises 
there. I don't understand how to fix the error, why it is happening, or how 
this issue could have possibly cropped up overnight. These are the things I've 
tried to fix it:

1. Run autoconf to regenerate the configure script.
2. Delete everything. Reconfigure and rebuild from a clean slate.
3. Comment out `.zshenv`, `.zshrc`, and `.zprofile`
4. Try configuring and compiling on bash and sh instead of zsh

--
components: Build
messages: 397957
nosy: jack__d
priority: normal
severity: normal
status: open
title: Python fails to build (aarch64-apple-darwin20.5.0)

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



[issue44700] Python fails to build (aarch64-apple-darwin20.5.0)

2021-07-21 Thread Jack DeVries


Change by Jack DeVries :


--
type:  -> compile error
versions: +Python 3.11

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



[issue44700] Python fails to build (aarch64-apple-darwin20.5.0)

2021-07-21 Thread Jack DeVries


Jack DeVries  added the comment:

I'm also getting this warning:

   ld: warning: object file (Programs/python.o) was built for newer 
   macOS version (11.5) than being linked (11.0)

--

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



[issue44700] Python fails to build (aarch64-apple-darwin20.5.0)

2021-07-21 Thread Jack DeVries


Jack DeVries  added the comment:

UGH I was experimenting with installing / compilingi gdb and had accidentally 
installed a different version of `ar` :/

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

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



[issue44435] There is no description of PY_SSIZE_T_CLEAN in docs

2021-07-21 Thread Jack DeVries


Jack DeVries  added the comment:

Looking back at this issue, I can see that there is documentation for this in 
the 'note' block. I'm just going to close this issue.

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

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



[issue35183] os.path.splitext documentation needs typical example

2021-07-21 Thread Jack DeVries

Jack DeVries  added the comment:

@jstockwin, the process usually goes like this:

1. You open a PR
2. The discussion continues over there. non-core-dev volunteers review your PR 
and get it into a polished state.
3. A core dev will quickly take a look, provide feedback if necessary, or just 
merge if not.

There's no need to credit anyone – if Shaun wanted credit, he could have 
included a PR with his bug report! Plus, the commit will include this bpo#, so 
future onlookers can always trace the commit back to this thread.

Follow the dev guide as you go and don't hesitate to post any questions you 
have right here!

--
nosy: +jack__d

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



[issue19217] Calling assertEquals for moderately long list takes too long

2021-07-22 Thread Jack DeVries


Jack DeVries  added the comment:

Hi all!

@eamanu, I went ahead and picked up where you left off. I stopped short of
opening up a PR, because I don't want to step on any toes, but I definitely
want to do what I can to give this bpo one final shove over the finish line.

Despite not creating a PR, you can see the changes here:

https://github.com/python/cpython/compare/main...jdevries3133:bpo-19217-slow-assertEq

@eamanu, if you prefer, you can probably just merge this branch into
`eamanu:fix_bpo-19217`, and the conversation can move forward on GH-11204.

Also, below is a summary of what I've done:


Revert Change to difflib


Link to the original thread where this change was discussed a bit:

https://github.com/python/cpython/pull/11204#discussion_r242369775

I assume this was a performance improvement. It's not clear to me why we are
not interested in this part of the diff when the input is a list or tuple.
I'm sure someone will help to explain, but this is why I reverted this change:

1. It is not an issue with unittest, and reaches beyond the scope of this bpo
2. The performance problem at the root of this bpo is solved without this
   change.
3. Reverting this change fixes most of the cascading failures throughout other
   parts of the test suite. It better constrains this fix to improving the
   implementation's performance issues while limiting changes to behavior.

Obviously, I don't have knowledge of the reasoning behind this change
sufficient to write a new bpo, but I think that this small change does deserve
its own bpo with an independent explaination of what it does and why it should
be done.

It's definitely possible that I'm missing something here, so let me know if
that's the case!


Add Regression Test
===

The regression test basically attempts to reproduce the problem and asserts
that the code will complete within one second. It's a pretty rough approach,
but I think that it will catch a future regression. If anyone has any better
ideas, I'm all ears.


Misc


I also fixed the one failing test in unittest's own test case, and added a
blurb.

--
nosy: +jack__d

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



[issue44713] subprocess.rst typo ``"shell=True"`` => ``shell=True``

2021-07-22 Thread Jack DeVries


New submission from Jack DeVries :

Good feedback from @merwork just missed the merge, but he is right: it should 
be ``shell=True``, not ``"shell=True"``.

https://github.com/python/cpython/pull/26755#discussion_r675128438

I'll be attaching a PR in just a moment.

--
messages: 398010
nosy: jack__d
priority: normal
severity: normal
status: open
title: subprocess.rst typo ``"shell=True"`` => ``shell=True``

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



[issue44713] subprocess.rst typo ``"shell=True"`` => ``shell=True``

2021-07-22 Thread Jack DeVries


Change by Jack DeVries :


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

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



[issue44050] [subinterpreters] _PyImport_FixupExtensionObject() regression in Python 3.9

2021-07-22 Thread Jack DeVries


Jack DeVries  added the comment:

I just took a look at this, and I'm getting an output of "no data" (just one 
time) on 3.9.6. Has this been fixed?

--
nosy: +jack__d

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



[issue29555] Update Python Software Foundation Copyright Year

2021-07-22 Thread Jack DeVries


Jack DeVries  added the comment:

Hi,

Found while sleuthing random issues. Can we close this?

--
nosy: +jack__d

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



[issue41256] activate script created by venv is not smart enough

2021-07-23 Thread Jack DeVries


Jack DeVries  added the comment:

What do you think about this as an entrypoint?

```sh
#!/usr/bin/env

# this becomes venv/bin/activate
# the old venv/bin/activate is now venv/bin/activate.sh

# Try to execute a `return` statement,
# but do it in a sub-shell and catch the results.
# If this script isn't sourced, that will raise an error.
$(return >/dev/null 2>&1)

# What exit code did that give?
if [ "$?" -ne "0" ]
then
echo "Warning: this script must be sourced, not run in a subshell."
echo "Try \"source /path/to/activate\" on unix-like systems."
fi

# dispatch to shell-specific activate scripts
# *ignore proper path construction for the sake of demonstration...*
[ $BASH_VERSION ] || [ $ZSH_VERSION ] && . ./activate.sh
[ $FISH_VERSION ] && . ./activate.fish
[ $csh_version ] && . ./activate.csh
```

The try-to-return trick was shamelessly taken from here:
https://stackoverflow.com/a/34642589/13262536

I am a shell scripting novice, so I am certain that there are many unaddressed 
edge cases here. I know that reliably detecting whether a script has been 
sourced or "ran" is essentially impossible to do in a cross-platform way.

--
nosy: +jack__d

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



[issue41256] activate script created by venv is not smart enough

2021-07-23 Thread Jack DeVries


Jack DeVries  added the comment:

*please disregard the typo in the shebang line!*

--

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



[issue43944] Processes in Python 3.9 exiting with code 1 when It's created inside a ThreadPoolExecutor

2021-07-24 Thread Jack DeVries


Jack DeVries  added the comment:

I am working on a fix for this bug. I'm a beginner cpython contributor, so if 
anyone recognizes this as a fool's errand, please let me know!

--
nosy: +jack__d

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



[issue43944] Processes in Python 3.9 exiting with code 1 when It's created inside a ThreadPoolExecutor

2021-07-24 Thread Jack DeVries


Jack DeVries  added the comment:

Ah never mind. @Genarito, the ThreadPoolExecutor is supposed to be used as a 
context manager. In your current code, the script ends and Python starts 
tearing itself down while `execute_error` is still running in a subprocess.

If you simply use the ThreadPoolExecutor to a context manager, the error goes 
away::

```python
from multiprocessing import Process
from concurrent.futures import ThreadPoolExecutor


def some_task():
pass


def execute_error():
p = Process(target=some_task)
p.start()
p.join()
print(p.exitcode)  # This is always 1 on a ThreadPoolExecutor!!!


# THIS IS THE IMPORTANT CHANGE
with ThreadPoolExecutor(max_workers=4) as executor:
executor.submit(execute_error)
```

--

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



[issue43944] Processes in Python 3.9 exiting with code 1 when It's created inside a ThreadPoolExecutor

2021-07-25 Thread Jack DeVries


Jack DeVries  added the comment:

I've identified the first bad commit with git-bisect:

commit b61b818d916942aad1f8f3e33181801c4a1ed14b
Author: Kyle Stanley 
Date:   Fri Mar 27 15:31:22 2020 -0400

bpo-39812: Remove daemon threads in concurrent.futures (GH-19149)

Remove daemon threads from :mod:`concurrent.futures` by adding
an internal `threading._register_atexit()`, which calls registered functions
prior to joining all non-daemon threads. This allows for compatibility
with subinterpreters, which don't support daemon threads.

--

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



[issue43944] Processes in Python 3.9 exiting with code 1 when It's created inside a ThreadPoolExecutor

2021-07-25 Thread Jack DeVries


Jack DeVries  added the comment:

The first bad commit was a fix for bpo-39812.

--

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



[issue39812] Avoid daemon threads in concurrent.futures

2021-07-25 Thread Jack DeVries


Jack DeVries  added the comment:

The regression that @janfrederik.konopka points out also has it's own open 
issue: bpo-43944. 

I'm trying to work on a fix for this regression. Slowly but surely. Now I've 
finally found these threads, this information will be a big help! Any tips are 
appreciated.

--
nosy: +jack__d

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



[issue44752] Tab completion executes @property getter function

2021-07-27 Thread Jack DeVries


Jack DeVries  added the comment:

Woah, til the python shell has tab completion! This does seem like undesirable 
behavior. I'd like to work on a fix for this if that's all right, assuming that 
this behavior should not occur.

I haven't exactly found where the tab autocomplete is implemented, but I'm 
assuming I'll find in one of the functions I see in the backtrace when I pause 
python at the interpreter prompt; maybe one of these? (my best quick guesses by 
function name).

- _PyRun_InteractiveLoopObject
- PyRun_InteractiveOneObjectEx
- interactive_rule
- statement_newline_rule

If anyone can point me in the right direction, that'd be great, and I think I 
can work on this one tomorrow if that's all right!

--
nosy: +jack__d

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



[issue44752] Tab completion executes @property getter function

2021-07-27 Thread Jack DeVries


Change by Jack DeVries :


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

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



[issue44752] Tab completion executes @property getter function

2021-07-27 Thread Jack DeVries


Jack DeVries  added the comment:

> Now that I see hasattr() uses getattr(), it looks like the tab completion 
> issue might not stem from line 155, but from line 180 
> (https://github.com/python/cpython/blob/bb3e0c240bc60fe08d332ff5955d54197f79751c/Lib/rlcompleter.py#L180)
>  where it calls getattr().

That is correct! I was able to fix the undesirable behavior by adding an early 
exit condition if we appear to have a property object. I checked for the 
existence of a property object like this:

class Foo:

@property
def bar(self):
return 'baz'

def is_property(object, attr):
return isinstance(getattr(type(object), attr, None), property)

assert is_property(Foo(), 'bar')

The code that follows line 180 in the loop just checks if ``object.attribute`` 
is callable, and whether the callable takes arguments in order to determine 
whether to add parenthesis to the completion. In my opinion, we never really 
want to add parenthesis when providing completion for a property attribute 
anyway, so there's no reason to go through that code block if we are dealing 
with a property.

I opened a GitHub PR. Let me know what you think!

--

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



[issue44756] In ./Doc, "make html" and "make build" should depend on "make venv"

2021-07-27 Thread Jack DeVries

New submission from Jack DeVries :

In Doc/Makefile, all of the build rules should be dependent on the existence of 
a virtual environment. I could see this being controversial, because folks who 
have these tools installed elsewhere might prefer not to have a venv made for 
them, but my personal workflow is to strive to keep my system site-packages 
folder as empty as possible and to use virtual environments frequently. In any 
case, I'm interested to hear what we think.

Momentarily, I will attach a PR where I went ahead and made these changes. Here 
is a summary of the changes:

- venv rule is now conditional, and only does anything if $VENVDIR does 
  not exist
- add rule "clean-venv". This can be removed – what do you all think?
- build rule is dependent on venv
- as a result, rules dependent on build are dependent on venv
  - html
  - latex
  - etc.
- update Doc/README.rst appropriately. Now users only need to type 
  ``make html`` – nice!

Let me know what you think. I may have a blind spot to others' workflows! Also, 
I'm not a Windows user, so I have no insight as to whether ``make.bat`` needs 
to be updated as well.

--
assignee: docs@python
components: Demos and Tools, Documentation
messages: 398344
nosy: docs@python, jack__d
priority: normal
severity: normal
status: open
title: In ./Doc, "make html" and "make build" should depend on "make venv"
type: enhancement
versions: Python 3.11

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



[issue44756] In ./Doc, "make html" and "make build" should depend on "make venv"

2021-07-27 Thread Jack DeVries


Change by Jack DeVries :


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

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



[issue44763] "width defaults to 70." in textwrap.wrap documentation is repetitive.

2021-07-28 Thread Jack DeVries


New submission from Jack DeVries :

The phrase "width defaults to 70." in the documentation for textwrap.wrap is 
repetitive, because that information is already communicated in the function 
signature.

The desire to fix this came up this discussion around this PR:
https://github.com/python/cpython/pull/26999#discussion_r678322870

I will attach a PR momentarily.

--
assignee: docs@python
components: Documentation
messages: 398392
nosy: docs@python, jack__d
priority: normal
severity: normal
status: open
title: "width defaults to 70." in textwrap.wrap documentation is repetitive.
type: enhancement
versions: Python 3.11

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



[issue44763] "width defaults to 70." in textwrap.wrap documentation is repetitive.

2021-07-28 Thread Jack DeVries


Change by Jack DeVries :


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

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



[issue44763] "width defaults to 70." in textwrap.wrap documentation is repetitive.

2021-07-28 Thread Jack DeVries


Change by Jack DeVries :


--
pull_requests: +25952
pull_request: https://github.com/python/cpython/pull/26999

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



[issue44752] Tab completion executes @property getter function

2021-07-28 Thread Jack DeVries


Change by Jack DeVries :


--
pull_requests: +25962
pull_request: https://github.com/python/cpython/pull/27433

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



  1   2   >