New submission from Ashwin Ramaswami <aramaswamis(a)gmail.com>:
It would be good to preview the cpython documentation on PRs using Netlify.
See https://github.com/python/core-workflow/issues/348
----------
assignee: docs@python
components: Documentation
messages: 349752
nosy: docs@python, epicfaace
priority: normal
severity: normal
status: open
title: Add netlify deploy preview for docs
versions: Python 3.9
_______________________________________
Python tracker <report(a)bugs.python.org>
<https://bugs.python.org/issue37860>
_______________________________________
New submission from Ken Healy <healykb+pythonbugs(a)gmail.com>:
The documentation for time.perf_counter() indicates it should return a system-wide value: https://docs.python.org/3/library/time.html#time.perf_counter
This is not true on Windows, as a process-specific offset is subtracted from the underlying QueryPerformanceCounter() value. The code comments indicate this is to reduce precision loss: https://github.com/python/cpython/blob/master/Python/pytime.c#L995-L997
This is relevant in multiprocess applications, where accurate timing is required across multiple processes. Here is a simple test case:
-----------------------------------------------------------
import concurrent.futures
import time
def worker():
return time.perf_counter()
if __name__ == '__main__':
pool = concurrent.futures.ProcessPoolExecutor()
futures = []
for i in range(3):
print('Submitting worker {:d} at time.perf_counter() == {:.3f}'.format(i, time.perf_counter()))
futures.append(pool.submit(worker))
time.sleep(1)
for i, f in enumerate(futures):
print('Worker {:d} started at time.perf_counter() == {:.3f}'.format(i, f.result()))
-----------------------------------------------------------
Output:
-----------------------------------------------------------
C:\...>Python37\python.exe -VV
Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05)
[MSC v.1916 64 bit (AMD64)]
C:\...>Python37\python.exe perf_counter_across_processes.py
Submitting worker 0 at time.perf_counter() == 0.376
Submitting worker 1 at time.perf_counter() == 1.527
Submitting worker 2 at time.perf_counter() == 2.529
Worker 0 started at time.perf_counter() == 0.380
Worker 1 started at time.perf_counter() == 0.956
Worker 2 started at time.perf_counter() == 1.963
-----------------------------------------------------------
See my stackoverflow question for a comparison with Linux: https://stackoverflow.com/questions/56502111/should-time-perf-counter-be-co…
----------
assignee: docs@python
components: Documentation, Library (Lib), Windows
messages: 345057
nosy: docs@python, kh90909, paul.moore, steve.dower, tim.golden, vstinner, zach.ware
priority: normal
severity: normal
status: open
type: behavior
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9
_______________________________________
Python tracker <report(a)bugs.python.org>
<https://bugs.python.org/issue37205>
_______________________________________
New submission from Niels Albers <nralbers(a)gmail.com>:
raise <Exception> from <exception instance> has been in the language since python 3, yet the tutorial page teaching about exceptions does not mention it. (see https://docs.python.org/3.7/tutorial/errors.html#raising-exceptions)
It would be especially helpful to language newcomers to touch on the possibility of passing error context when raising a new exception in an exception handler.
----------
assignee: docs@python
components: Documentation
messages: 349994
nosy: Niels Albers, docs@python
priority: normal
severity: normal
status: open
title: Exceptions tutorial page does not mention raise from
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9
_______________________________________
Python tracker <report(a)bugs.python.org>
<https://bugs.python.org/issue37891>
_______________________________________
New submission from Baruch Sterin <python(a)bsterin.com>:
In addition to the description text, most C API functions have a one-line, emphasized specification whether they return a new or a borrowed reference. (e.g. 'Return value: New reference.').
The following API functions are missing that. Some of them, like PyMemoryView_FromBuffer(), have descriptions that are clear, but it would still be nice to have an unambiguous statement like most other API functions have.
The list has been generated automatically, so it might contain some errors.
Doc/c-api/arg.rst: Py_VaBuildValue
Doc/c-api/buffer.rst: PyMemoryView_FromBuffer
Doc/c-api/buffer.rst: PyMemoryView_FromObject
Doc/c-api/buffer.rst: PyMemoryView_GetContiguous
Doc/c-api/bytearray.rst: PyByteArray_Concat
Doc/c-api/bytearray.rst: PyByteArray_FromObject
Doc/c-api/bytearray.rst: PyByteArray_FromStringAndSize
Doc/c-api/code.rst: PyCode_New
Doc/c-api/codec.rst: PyCodec_BackslashReplaceErrors
Doc/c-api/codec.rst: PyCodec_Decode
Doc/c-api/codec.rst: PyCodec_Decoder
Doc/c-api/codec.rst: PyCodec_Encode
Doc/c-api/codec.rst: PyCodec_Encoder
Doc/c-api/codec.rst: PyCodec_IgnoreErrors
Doc/c-api/codec.rst: PyCodec_IncrementalDecoder
Doc/c-api/codec.rst: PyCodec_IncrementalEncoder
Doc/c-api/codec.rst: PyCodec_LookupError
Doc/c-api/codec.rst: PyCodec_ReplaceErrors
Doc/c-api/codec.rst: PyCodec_StreamReader
Doc/c-api/codec.rst: PyCodec_StreamWriter
Doc/c-api/codec.rst: PyCodec_StrictErrors
Doc/c-api/codec.rst: PyCodec_XMLCharRefReplaceErrors
Doc/c-api/exceptions.rst: PyUnicodeDecodeError_Create
Doc/c-api/exceptions.rst: PyUnicodeDecodeError_GetEncoding
Doc/c-api/exceptions.rst: PyUnicodeDecodeError_GetObject
Doc/c-api/exceptions.rst: PyUnicodeDecodeError_GetReason
Doc/c-api/exceptions.rst: PyUnicodeEncodeError_Create
Doc/c-api/exceptions.rst: PyUnicodeTranslateError_Create
Doc/c-api/float.rst: PyFloat_GetInfo
Doc/c-api/import.rst: PyImport_GetImporter
Doc/c-api/import.rst: PyImport_ImportModuleNoBlock
Doc/c-api/import.rst: _PyImport_FindExtension
Doc/c-api/import.rst: _PyImport_FixupExtension
Doc/c-api/init.rst: PyEval_GetCallStats
Doc/c-api/int.rst: PyInt_FromSize_t
Doc/c-api/long.rst: PyLong_FromSize_t
Doc/c-api/long.rst: PyLong_FromSsize_t
Doc/c-api/number.rst: PyNumber_Index
Doc/c-api/number.rst: PyNumber_ToBase
Doc/c-api/object.rst: PyObject_Bytes
Doc/c-api/object.rst: PyObject_GenericGetAttr
Doc/c-api/unicode.rst: PyUnicode_AsUTF32String
Doc/c-api/unicode.rst: PyUnicode_DecodeMBCSStateful
Doc/c-api/unicode.rst: PyUnicode_DecodeUTF32
Doc/c-api/unicode.rst: PyUnicode_DecodeUTF32Stateful
Doc/c-api/unicode.rst: PyUnicode_DecodeUTF7
Doc/c-api/unicode.rst: PyUnicode_DecodeUTF7Stateful
Doc/c-api/unicode.rst: PyUnicode_EncodeUTF32
Doc/c-api/unicode.rst: PyUnicode_EncodeUTF7
Doc/c-api/veryhigh.rst: PyEval_EvalCodeEx
Doc/c-api/veryhigh.rst: PyEval_EvalFrame
Doc/c-api/veryhigh.rst: PyEval_EvalFrameEx
----------
assignee: docs@python
components: Documentation
messages: 154877
nosy: baruch.sterin, docs@python
priority: normal
severity: normal
status: open
title: Documentation for some C APIs is missing clear specification of the type of reference they return
type: behavior
versions: Python 2.7
_______________________________________
Python tracker <report(a)bugs.python.org>
<http://bugs.python.org/issue14189>
_______________________________________
New submission from Paul Watson <paul.hermeneutic(a)gmail.com>:
The 3.6.4 documentation on venv specifies using 'python3', but no python3 executable is in the 3.6.4 kit.
https://docs.python.org/3/library/venv.html?highlight=venv#module-venv
----------
assignee: docs@python
components: Documentation
messages: 309943
nosy: Paul Watson, docs@python
priority: normal
severity: normal
status: open
title: venv says to use python3 which does not exist in 3.6.4
type: enhancement
versions: Python 3.6
_______________________________________
Python tracker <report(a)bugs.python.org>
<https://bugs.python.org/issue32553>
_______________________________________
New submission from Chris Jerdonek:
The sentence describing Popen()'s cwd argument in the subprocess documentation seems reversed to me:
http://docs.python.org/dev/library/subprocess.html#subprocess.Popen
It says, "If cwd is not None, the child’s current directory will be changed to cwd before it is executed. Note that this directory is not considered when searching the executable, so you can’t specify the program’s path relative to cwd."
However, when cwd is not None, it seems like you *must* specify the program's path relative to cwd. For example, when running a script containing the following using `./python.exe` from a source checkout--
p = Popen(['./python.exe', '-V'], stdout=PIPE, stderr=PIPE, cwd='temp')
you get an: "OSError: [Errno 2] No such file or directory."
In contrast, when you *do* specify the program's path relative to cwd, it works--
p = Popen(['../python.exe', '-V'], stdout=PIPE, stderr=PIPE, cwd='temp')
Issue 6374 seems to have made the same point in its second bullet, but the issue was closed without addressing that part of it.
----------
assignee: docs@python
components: Documentation
keywords: easy
messages: 167194
nosy: cjerdonek, docs@python
priority: normal
severity: normal
status: open
title: subprocess.Popen(cwd) documentation
versions: Python 2.7, Python 3.3
_______________________________________
Python tracker <report(a)bugs.python.org>
<http://bugs.python.org/issue15533>
_______________________________________
New submission from Terry J. Reedy <tjreedy(a)udel.edu>:
Python Setup and Usage, 3.3.1. Excursus: Setting environment variables
https://docs.python.org/3/using/windows.html#excursus-setting-environment-v…
The word 'excursus' is so rare and archaic that this is my first encounter with it. Could we drop it?
The last paragraph starts with "To permanently modify the default environment variables, click Start and search for ‘edit environment variables’,". This part is fine on Windows 10 as it brings up "Edit the system environment variables" and "Edit environmental variables for your account". Both take one to an Environmental variables dialog. The former requires than one be or become an admin user (via UAC dialog).
The paragraph continues "or open System properties, Advanced system settings and click the Environment Variables button. In this dialog, you can add or modify User and System variables. To change System variables, you need non-restricted access to your machine (i.e. Administrator rights)."
On Windows 10, at least, this is confusing or wrong. Control Panel has 'System' linked to the System dialog. This has 'Advanced systems settings' linked to System Properties, but one only get there by being or becoming (via UAC) an admin user. This has the Environmental Properties button mentioned above. It opens Environmental Variables for the admin user you are or are acting as. This route cannot change EVs for non-admin users. I have the impression that this has changed since Win 7.
----------
assignee: docs@python
components: Documentation, Windows
messages: 303560
nosy: docs@python, paul.moore, steve.dower, terry.reedy, tim.golden, zach.ware
priority: normal
severity: normal
stage: needs patch
status: open
title: Edit "Setting [windows] environmental variables"
type: behavior
versions: Python 3.6, Python 3.7
_______________________________________
Python tracker <report(a)bugs.python.org>
<https://bugs.python.org/issue31665>
_______________________________________
New submission from Adrian Chan:
I uninstalled python 2.7 and 3.4, then performed a fresh install of 3.5.3.
Running pip with `python -m pip` as per https://docs.python.org/3.5/installing gives the following error:
C:\Python\Python35-32\python.exe: No module named pip.__main__; 'pip' is a package and cannot be directly executed
Installation details:
* win 7 64 bit.
* python 3.5.3 32 bit.
* chose options for pip, tcl/tk/idle, test suite, py launcher, shortcuts, add to env, precompile std lib.
* installed to non-standard directory.
----------
assignee: docs@python
components: Documentation, Installation, Windows
messages: 287986
nosy: Adrian Chan, docs@python, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Cannot run pip in fresh install of py 3.5.3
type: behavior
versions: Python 3.5
_______________________________________
Python tracker <report(a)bugs.python.org>
<http://bugs.python.org/issue29586>
_______________________________________
New submission from Nathan Marrow:
The documentation for emulating callable objects with __call__ seems to imply only positional arguments are supported. For instance, it says __call__ is "object.__call__(self[, args…])" and describes:
Called when the instance is “called” as a function; if this method is defined, x(arg1, arg2, ...) is a shorthand for x.__call__(arg1, arg2, ...).
When it should be something like (Not sure exactly what the syntax would be here):
"object.__call__(self[, args…] [,**kwargs...])"
Called when the instance is “called” as a function; if this method is defined, x(arg1, arg2, ..., arg3=arg3) is a shorthand for x.__call__(arg1, arg2, ..., arg3=arg3).
----------
assignee: docs@python
components: Documentation
messages: 302185
nosy: docs@python, nmarrow
priority: normal
severity: normal
status: open
title: "Emulating callable objects" documentation misleading
versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7
_______________________________________
Python tracker <report(a)bugs.python.org>
<https://bugs.python.org/issue31472>
_______________________________________