[issue25024] Allow passing "delete=False" to TemporaryDirectory

2015-09-07 Thread Antony Lee
New submission from Antony Lee: I would like to suggest allowing passing "delete=False" to the TemporaryDirectory constructor, with the effect that the directory is not deleted when the TemporaryDirectory context manager exits, or when the TemporaryDirectory object is deleted. I re

[issue25293] Hooking Thread/Process instantiation in concurrent.futures.

2015-10-01 Thread Antony Lee
New submission from Antony Lee: http://bugs.python.org/issue21423 and http://bugs.python.org/issue24980 suggest adding an initializer/on_new_thread argument to {Thread,Process}PoolExecutor. I would like to suggest a more unified API, that would allow not only handling initialization, but

[issue25330] Two issues with pkgutil.get_data

2015-10-06 Thread Antony Lee
New submission from Antony Lee: The docs of pkgutil.get_data say "The resource argument should be in the form of a relative filename, using / as the path separator. The parent directory name .. is not allowed, and nor is a rooted name (starting with a /)." In fact (on Python 3.

[issue25417] Minor typo in Path.samefile docstring

2015-10-15 Thread Antony Lee
New submission from Antony Lee: The output of pydoc for Path.samefile currently reads pathlib.Path.samefile = samefile(self, other_path) Return whether `other_file` is the same or not as this file. (as returned by os.path.samefile(file, other_file)). It should arguably be something

[issue25417] Minor typo in Path.samefile docstring

2015-10-21 Thread Antony Lee
Antony Lee added the comment: Actually there's also an extra dot at the end of the first line of the docstring (redundant with the one on the second line). -- ___ Python tracker <http://bugs.python.org/is

[issue25477] text mode for pkgutil.get_data

2015-10-25 Thread Antony Lee
New submission from Antony Lee: Initially suggested in #25330: it would be helpful to provide text mode support (returning unicode, and handling universal newlines) for pkgutil.get_data (either as a keyword argument, or as a separate function). -- components: Library (Lib) messages

[issue25527] Invalid (... and confusing) warning raised by 2to3 regarding repeat

2015-11-01 Thread Antony Lee
New submission from Antony Lee: $ echo 'from numpy import repeat\nrepeat(2, 3)' | 2to3 - RefactoringTool: Skipping optional fixer: buffer RefactoringTool: Skipping optional fixer: idioms RefactoringTool: Skipping optional fixer: set_literal RefactoringTool: Skipping optional fixer

[issue25632] Document BUILD_*_UNPACK opcodes

2015-11-15 Thread Antony Lee
New submission from Antony Lee: The additional unpack generalizations provided by Python3.5 rely on a new set of opcodes, BUILD_{TUPLE,LIST,DICT,SET}_UNPACK, that are not documented in the docs for the dis module. -- assignee: docs@python components: Documentation messages: 254715

[issue25912] Use __spec__.__name__ instead of __name__ in the docs where appropriate

2015-12-19 Thread Antony Lee
New submission from Antony Lee: There are a couple of places in the docs where it would be appropriate to replace __name__ by __spec__.__name__ in order to support the case where the module is executed as the __main__ module: - logging.getLogger should certainly use __spec__.__name__ so that

[issue26051] Non-data descriptors in pydoc

2016-01-08 Thread Antony Lee
New submission from Antony Lee: Consider the following minimal example: class readonlyprop: __init__ = lambda self, func: None __get__ = lambda self, inst, cls=None: None class C: def bar(self): pass @readonlyprop def foo(self

[issue26052] pydoc for __init__ with not docstring

2016-01-08 Thread Antony Lee
New submission from Antony Lee: For a class whose __init__ has no docstring, e.g. class C: def __init__(self, arg): pass pydoc outputs <... cropped ...> class C(builtins.object) | Methods defined here: | | __init__(sel

[issue26072] pdb fails to access variables closed over

2016-01-09 Thread Antony Lee
New submission from Antony Lee: Consider the following example: def f(x=1): def g(): y = 2 raise Exception g() f() $ python -mpdb -ccontinue example.py <... traceback ...> > /tmp/example.py(4)g() -> raise Exception (Pdb) p x #

[issue26120] pydoc: move __future__ imports out of the DATA block

2016-01-14 Thread Antony Lee
New submission from Antony Lee: Currently, for a module that uses __future__ imports, the DATA section of `pydoc foo` contains these imports interspersed with the "real" data from the module. Even though it is fully-featured _Feature objects that are imported, it probably makes sen

[issue26127] Broken link in docs for tokenize

2016-01-15 Thread Antony Lee
New submission from Antony Lee: The docs for `tokenize.detect_encoding` state `Use open() to open Python source files: it uses detect_encoding() to detect the file encoding.` Unfortunately, clicking on `open` redirects to the builtin `open` function, not to `tokenize.open` as it should

[issue26240] Docstring of the subprocess module should be cleaned up

2016-01-29 Thread Antony Lee
New submission from Antony Lee: subprocess.__doc__ currently contains copies for the docstrings of a bunch of functions in the module (... but not subprocess.run). The docs for the Popen class should be moved into that class' docstring. The module's docstring also mentions the li

[issue26453] SystemError on invalid numpy.ndarray / Path operation

2016-02-27 Thread Antony Lee
New submission from Antony Lee: Running ``` from pathlib import Path import numpy as np np.arange(30) / Path("foo") ``` raises ``` TypeError: argument should be a path or str object, not During handling of the above exception, another exception occurred: SystemError: returne

[issue26535] Minor typo in the docs for struct.unpack

2016-03-10 Thread Antony Lee
New submission from Antony Lee: The docstring of struct.unpack currently reads Unpack from the buffer buffer (presumably packed by pack(fmt, ...)) according to the format string fmt. The result is a tuple even if it contains exactly one item. The buffer must contain exactly the amount of data

[issue26535] Minor typo in the docs for struct.unpack

2016-03-10 Thread Antony Lee
Antony Lee added the comment: I think mentioning calcsize is still helpful, so perhaps something like "The buffer must contain exactly as many bytes (I think this is clearer than "the amount of data") as required by the format (this number can be obtained as `struct.calcsize

[issue20012] Re: Allow Path.relative_to() to accept non-ancestor paths

2016-03-23 Thread Antony Lee
Antony Lee added the comment: Kindly bumping the issue. I'd suggest overriding `PurePath.relative_to` in the `Path` class, to something like `PurePath.relative_to(self, other, *, allow_ancestor=False): ...`, which would resolve each ancestor of `self` successively to check whether it is

[issue26792] docstrings of runpy.run_{module,path} are rather sparse

2016-04-17 Thread Antony Lee
New submission from Antony Lee: $ pydoc runpy run_module(mod_name, init_globals=None, run_name=None, alter_sys=False) Execute a module's code without importing it Returns the resulting top level namespace dictionary run_path(path_name, init_globals

[issue23596] gzip argparse interface

2015-03-05 Thread Antony Lee
New submission from Antony Lee: The attached patch reimplements gzip's already existing command-line interface using argparse, both to provide command-line help and to avoid manual argument parsing. -- components: Library (Lib) files: gzip-argparse-cli.patch keywords: patch mes

[issue23871] turning itertools.{repeat, count} into indexable iterables

2015-04-04 Thread Antony Lee
New submission from Antony Lee: itertools.repeat and itertools.count could be made into indexable iterables (rather than iterators), rather than iterators, like range is right now. -- components: Library (Lib) messages: 240096 nosy: Antony.Lee priority: normal severity: normal status

[issue23991] ZipFile sanity checks

2015-04-17 Thread Antony Lee
New submission from Antony Lee: ZipFile.{open,read} could raise IsADirectoryError when called on a directory entry, rather than return an empty bytes. ZipFile.writestr could fail writing non-empty bytes to a directory entry. Use case for open and read: I was trying to write a zip merger

[issue24111] Valgrind suppression file should be updated

2015-05-02 Thread Antony Lee
New submission from Antony Lee: Since PEP445, the suppressions should target _PyObject_{Free,Realloc} instead of PyObject_{Free,Realloc}. -- messages: 242382 nosy: Antony.Lee priority: normal severity: normal status: open title: Valgrind suppression file should be updated versions

[issue24253] pydoc for namespace packages indicates FILE as built-in

2015-05-20 Thread Antony Lee
New submission from Antony Lee: All's in the title: the output of "pydoc foo" where foo is a namespace package (... e.g. any directory in the cwd) says that the package is defined as a builtin (under the FILE entry) -- which is certainly incorrect. -- component

[issue26240] Docstring of the subprocess module should be cleaned up

2016-10-17 Thread Antony Lee
Changes by Antony Lee : -- nosy: -Antony.Lee ___ Python tracker <http://bugs.python.org/issue26240> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue24459] Mention PYTHONFAULTHANDLER in the man page

2016-11-13 Thread Antony Lee
Changes by Antony Lee : -- nosy: -Antony.Lee ___ Python tracker <http://bugs.python.org/issue24459> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue26072] pdb fails to access variables closed over

2016-11-15 Thread Antony Lee
Changes by Antony Lee : -- nosy: -Antony.Lee ___ Python tracker <http://bugs.python.org/issue26072> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue24459] Mention PYTHONFAULTHANDLER in the man page

2016-11-19 Thread Antony Lee
Antony Lee added the comment: PYTHONUSERBASE is also missing. -- nosy: +Antony.Lee ___ Python tracker <http://bugs.python.org/issue24459> ___ ___ Python-bug

[issue24459] Mention PYTHONFAULTHANDLER in the man page

2016-11-19 Thread Antony Lee
Changes by Antony Lee : -- nosy: -Antony.Lee ___ Python tracker <http://bugs.python.org/issue24459> ___ ___ Python-bugs-list mailing list Unsubscribe:

<    1   2   3