New submission from Brett Cannon:
https://docs.python.org/3/extending/extending.html#a-simple-example uses PyModule_Create() instead of PyModuleDef_Init().
----------
assignee: docs@python
components: Documentation
messages: 261398
nosy: brett.cannon, docs@python, eric.snow, ncoghlan
priority: normal
severity: normal
stage: needs patch
status: open
title: Update extending/embedding docs to new way to build modules in C
versions: Python 3.5, Python 3.6
_______________________________________
Python tracker <report(a)bugs.python.org>
<http://bugs.python.org/issue26515>
_______________________________________
New submission from Alex LordThorsen:
Had a friend get stuck on the CSV documentation. They didn't know what a CSV was (to start with) and couldn't find an example that made sense to them. they went to other sources to figure out how to read CSV files in the end.
I made this patch in the hope that starting out with a very minimal example file format followed by an example python read will make landing on the CSV docs easier to follow for new programmers.
----------
assignee: docs@python
components: Documentation
files: csv_documentation.patch
keywords: patch
messages: 260960
nosy: Alex.LordThorsen, docs@python
priority: normal
severity: normal
status: open
title: CSV documentation doesn't open with an example
versions: Python 3.6
Added file: http://bugs.python.org/file42040/csv_documentation.patch
_______________________________________
Python tracker <report(a)bugs.python.org>
<http://bugs.python.org/issue26451>
_______________________________________
New submission from July Tikhonov:
In documentation of zipfile.ZipFile.write() there is following notice:
"There is no official file name encoding for ZIP files. If you have unicode file names, you must convert them to byte strings in your desired encoding before passing them to write()."
I understand it as that 'arcname' argument to write() shouldn't be of type str, but rather bytes.
But it is str that works, and bytes that does not:
$ ./python
Python 3.5.0a4+ (default:6f6e78931875, May 1 2015, 23:18:40)
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import zipfile
>>> zf = zipfile.ZipFile('foo.zip', 'w')
>>> zf.write('python', 'a')
>>> zf.write('python', b'b')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/july/source/python/Lib/zipfile.py", line 1442, in write
zinfo = ZipInfo(arcname, date_time)
File "/home/july/source/python/Lib/zipfile.py", line 322, in __init__
null_byte = filename.find(chr(0))
TypeError: a bytes-like object is required, not 'str'
(ZipInfo ostensibly attempts to find a zero byte in the filename, but searches instead for a unicode character chr(0). There are several other places in ZipInfo class that assume filename being str rather than bytes.)
I consider this a documentation issue: the notice is misleading. Although maybe there is someone who wants to fix the behavior of ZipInfo to allow bytes filename.
----------
assignee: docs@python
components: Documentation
messages: 242355
nosy: docs@python, july
priority: normal
severity: normal
status: open
title: zipfile.ZipFile.write() does not accept bytes arcname
type: behavior
versions: Python 3.4, Python 3.5, Python 3.6
_______________________________________
Python tracker <report(a)bugs.python.org>
<http://bugs.python.org/issue24110>
_______________________________________
New submission from Alexandre Macabies:
https://docs.python.org/3.5/library/traceback.html#traceback-examples
See second code sample and its sample output. According to the docs, the call:
print(repr(traceback.extract_tb(exc_traceback)))
is supposed to print something that looks like an array with only strings; that is what the doc sample output states:
[('<doctest...>', 10, '<module>', 'lumberjack()'),
But actually, in 3.5+, this call outputs the repr() of a list of FrameSummary instances that do not go further in repr()esenting their state:
[<FrameSummary file <ipython-input-61-3e63d7daea82>, line 10 in <module>>,
By looking at the docs I thought I was able to get a nice string representation of a FrameSummary. I actually have to format it myself. It should be reflected in the doc sample output.
----------
assignee: docs@python
components: Documentation
messages: 254224
nosy: Alexandre Macabies, docs@python
priority: normal
severity: normal
status: open
title: traceback documentation example is lying about FrameSummary repr()
versions: Python 3.5, Python 3.6
_______________________________________
Python tracker <report(a)bugs.python.org>
<http://bugs.python.org/issue25573>
_______________________________________
New submission from awilfox:
In the 3.5 and 3.6a0 documentation for asyncio, "CancelledError" is linked to the concurrent.futures.CancelledError. This led me to try catching that exception and finding that it did not work correctly at all. Only after searching for asyncio example code and seeing how other people caught asyncio.CancelledError did I realise the issue.
The fact asyncio.CancelledError even exists isn't actually documented, and I believe that is why the :exc: reference is linking to the wrong module.
----------
assignee: docs@python
components: Documentation
messages: 261911
nosy: awilfox, docs@python
priority: normal
severity: normal
status: open
title: asyncio documentation links to wrong CancelledError
versions: Python 3.5, Python 3.6
_______________________________________
Python tracker <report(a)bugs.python.org>
<http://bugs.python.org/issue26582>
_______________________________________
New submission from anatoly techtonik <techtonik(a)gmail.com>:
http://docs.python.org/library/__main__.html
"It is this environment in which the idiomatic “conditional script” stanza causes a script to run"
?!?
----------
assignee: docs@python
components: Documentation
messages: 163140
nosy: docs@python, techtonik
priority: normal
severity: normal
status: open
title: abusive language in __name__ description
_______________________________________
Python tracker <report(a)bugs.python.org>
<http://bugs.python.org/issue15104>
_______________________________________
New submission from Eric O. LEBIGOT:
The documentation for a None (empty) format for floats indicates that it is equivalent to the g format. This does not appear to be correct (http://stackoverflow.com/questions/16525924/precise-definition-of-float-str…).
The Python 3.4 documentation (https://docs.python.org/3.4/library/string.html#format-specification-mini-l…) seems to be much closer to what Python 2.7 does.
It would be useful to have a more correct documentation for the effect of a None format for floats in Python 2.7 (maybe by copying the Python 3.4 documentation if it applies).
----------
assignee: docs@python
components: Documentation
messages: 215871
nosy: docs@python, lebigot
priority: normal
severity: normal
status: open
title: None float format: incomplete documentation
type: enhancement
versions: Python 2.7
_______________________________________
Python tracker <report(a)bugs.python.org>
<http://bugs.python.org/issue21195>
_______________________________________
New submission from Ilya Novoselov <ilya.novoselov(a)gmail.com>:
Documentation states that u format unit returns "buffer of 16-bit Unicode (UTF-16) data" while it returns pointer to internal buffer of unicode data, which is either UCS-16 or UCS-32
http://docs.python.org/c-api/arg.html
----------
assignee: docs@python
components: Documentation, Unicode
messages: 147002
nosy: Ilya.Novoselov, docs@python, ezio.melotti
priority: normal
severity: normal
status: open
title: Incorrect documentation for "u" PyArg_Parse format unit
type: behavior
versions: Python 2.7
_______________________________________
Python tracker <report(a)bugs.python.org>
<http://bugs.python.org/issue13341>
_______________________________________
New submission from Дилян Палаузов:
It speaks about pythonX.Y but means python3.${subversion}
diff --git a/README.rst b/README.rst
--- a/README.rst
+++ b/README.rst
@@ -190,7 +190,7 @@ script) you must take care that your primary python executable is not
overwritten by the installation of a different version. All files and
directories installed using ``make altinstall`` contain the major and minor
version and can thus live side-by-side. ``make install`` also creates
-``${prefix}/bin/python3`` which refers to ``${prefix}/bin/pythonX.Y``. If you
+``${prefix}/bin/python3`` which refers to ``${prefix}/bin/python3.X``. If you
intend to install multiple versions using the same prefix you must decide which
version (if any) is your "primary" version. Install that version using ``make
install``. Install all other versions using ``make altinstall``.
----------
assignee: docs@python
components: Documentation
messages: 300205
nosy: dilyan.palauzov, docs@python
priority: normal
severity: normal
status: open
title: README.rst: installing multiple versions: typo
versions: Python 3.7
_______________________________________
Python tracker <report(a)bugs.python.org>
<http://bugs.python.org/issue31189>
_______________________________________
New submission from Mark Summerfield:
In the docs for the array module:
https://docs.python.org/dev/library/array.html#module-array
Note 1 in the table of type codes says that the 'u' type is deprecated and will go in Python 4.0.
Since the array.fromunicode() and array.tounicode() methods depend on type code 'u' shouldn't they also be marked as deprecated?
If people use the 'u' type code maybe it would be helpful to provide an example of how to store unicode chars in an array.array? (Presumably they'd use type code 'L' and use ord() and chr()?)
----------
assignee: docs@python
components: Documentation
messages: 267738
nosy: docs@python, mark
priority: normal
severity: normal
status: open
title: Possible missing deprecation warnings?
type: enhancement
versions: Python 3.6
_______________________________________
Python tracker <report(a)bugs.python.org>
<http://bugs.python.org/issue27259>
_______________________________________