[issue26362] Approved API for creating a temporary file path

2021-03-12 Thread Ben Finney
Ben Finney added the comment: > tempfile.mktemp() still exists and works without raising a deprecation > warning. Of course it's still marked as deprecated in the docs. Right. So, the issue is not resolved: Functionality to create a temporary file path is maintained in the standard l

[issue23297] Clarify error when ‘tokenize.detect_encoding’ receives text

2019-04-28 Thread Ben Finney
Ben Finney added the comment: On 28-Apr-2019, Berker Peksag wrote: > The original problem has already been solved by making > tokenize.generate_tokens() public in issue 12486. I don't understand how that would affect the resolution of this issue. Isn't the correct resolution here

[issue33130] functools.reduce signature uses `iterable`, documentation should use the same term

2018-11-30 Thread Ben Finney
Ben Finney added the comment: Hah, sorry to use a local-filesystem URL. (Hooray for locally-installed developer documentation!) The same section is online at https://docs.python.org/3/library/functools.html#functools.reduce . -- ___ Python

[issue33130] functools.reduce signature uses `iterable`, documentation should use the same term

2018-11-30 Thread Ben Finney
Ben Finney added the comment: The library documentation (e.g. file:///usr/share/doc/python3/html/library/functools.html#functools.reduce ) also has this dissonance: > functools.reduce(`function`, `iterable` [, `initializer` ]) > >Apply function of two arguments cum

[issue14102] argparse: add ability to create a man page

2018-06-14 Thread Ben Finney
Ben Finney added the comment: On Thu, 2018-06-14 23:46 +, Aaron Meurer wrote: > Couldn't such a tool exist outside the standard library. I've tried writing such a tool. It would ideally re-use as much as feasible of the functionality that assembles the usage mess

[issue14102] argparse: add ability to create a man page

2018-06-14 Thread Ben Finney
Ben Finney added the comment: On Thu, 2018-06-14 20:02 +, Pablo Galindo Salgado wrote: > The (possible) confusion is the existence of a manpage only available > though argparse (`./python foo.py --manpage`) This report isn't asking for that. (I see only one person pro

[issue14102] argparse: add ability to create a man page

2018-06-14 Thread Ben Finney
Ben Finney added the comment: On 14-Jun-2018, Pablo Galindo Salgado wrote: > I think this should be something that is not included in argparse > itself. I can imagine a scenario in which the manpage is accessible > through `./python foo.py --manpage` but the manpage is not

[issue21720] "TypeError: Item in ``from list'' not a string" message

2017-10-24 Thread Ben Finney
Ben Finney <ben+pyt...@benfinney.id.au> added the comment: On 23-Oct-2017, Serhiy Storchaka wrote: > Is it all with this issue? I accept Nick's reasoning: > As a general principle, we don't give value information in type > errors, since the error is structural rather t

[issue30181] Correct the parsing of a test case docstring.

2017-05-15 Thread Ben Finney
Ben Finney added the comment: > I have already created such a pull requests. It is bidirectionally linked to > this ticket. I hope the PSF can start accepting contributions without that laundering, but until then: thank you for

[issue30181] Correct the parsing of a test case docstring.

2017-05-12 Thread Ben Finney
Ben Finney added the comment: > if you upload a patch generated from your branch here, someone else will > create the github PR so we can get it processed. The branch has several commits. I have generated the patches, and am now uploading them as a tarball. It may be easier to simply

[issue30181] Correct the parsing of a test case docstring.

2017-05-11 Thread Ben Finney
Ben Finney added the comment: > No, your contribution will not be rejected by "you don't maintain the repo on > GitHub", everyone can send the patch (PR) to python/cpython. I am glad to know that. I won't be maintaining a GitHub account because I disagree with the terms of

[issue30181] Correct the parsing of a test case docstring.

2017-05-11 Thread Ben Finney
Ben Finney added the comment: Apparently there is some consternation about my bugs.python.org identity. This is Ben Finney of WSP Digital, in Melbourne, Australia. A GitHub account is wholly irrelevant to this account. A GitHub account is wholly irrelevant to accepting the PSF CLA

[issue26362] Approved API for creating a temporary file path

2017-05-01 Thread Ben Finney
Ben Finney added the comment: On 01-May-2017, Serhiy Storchaka wrote: > tempfile.mktemp() is not much more useful that just a function that > generates some names which unlikely matches the names of existing > files the directory. Yes. That is already useful enough to be in the

[issue26362] Approved API for creating a temporary file path

2017-05-01 Thread Ben Finney
Ben Finney added the comment: On 01-May-2017, R. David Murray wrote: > You are depending on a non-portable feature of os.rename there What's the non-portable dependency? If you mean the expectation that ‘os.rename’ will be atomic on success: the documentation promises “If success

[issue30181] Correct the parsing of a test case docstring.

2017-05-01 Thread Ben Finney
Ben Finney added the comment: On 2017-05-01 17:45, Louie Lu wrote: > Ben, the process of submitting PR was migrated to GitHub Thank you. I'll re-base my branch onto the master branch found at the GitHub repository. > you will need to use a GitHub account to do it I don't ma

[issue30181] Correct the parsing of a test case docstring.

2017-05-01 Thread Ben Finney
Ben Finney added the comment: Howdy R. David, Okay, I have put together a series of commits to address this bug. The changes are in my personal fork of the ‘cpython’ repository, so this is a pull request from ‘wip/issue/issue30181_parse-docstring-using-pydoc’ in that repository. The following

[issue30181] Incorrect parsing of test case docstring

2017-04-27 Thread Ben Finney
Ben Finney added the comment: > This is because unittest.TestCase method `shortDescription()` will only > return the first line of docstring Yes, that is the “docstring synopsis” I referred to. PEP 257 has a section specifically about how tools should parse a docstring:

[issue30181] Incorrect parsing of test case docstring

2017-04-26 Thread Ben Finney
New submission from Ben Finney: The docstring of a test case is not correctly parsed for display. The attached ‘test_foo.py’ module contains two test case functions. Both docstrings conform to PEP 257 <https://www.python.org/dev/peps/pep-0257/>: they have a single-line synopsis and some

[issue21720] "TypeError: Item in ``from list'' not a string" message

2016-10-16 Thread Ben Finney
Ben Finney added the comment: On 16-Oct-2016, Roundup Robot wrote: > New changeset 7dd0910e8fbf by Berker Peksag in branch '2.7': > Issue #21720: Improve exception message when the type of fromlist is unicode > https://hg.python.org/cpython/rev/7dd0910e8fbf This is an improvement, but

[issue21720] "TypeError: Item in ``from list'' not a string" message

2016-10-12 Thread Ben Finney
Ben Finney added the comment: On 12-Oct-2016, Nick Coghlan wrote: > In this case, I think just reporting the first failing item is fine, > and mentioning the type of that item in the error message is the > most useful additional information we can provide to make things > easier to

[issue12916] Add inspect.splitdoc

2016-08-15 Thread Ben Finney
Ben Finney added the comment: Am I right that this: > pydoc doesn't have public API other than its CLI and the help() function. > […] On the other hand, there are already functions related to splitdoc() > in the inspect module […]. > There is no rush to make splitdoc() public. We

[issue15660] Clarify 0 prefix for width specifier in str.format doc,

2016-08-15 Thread Ben Finney
Ben Finney added the comment: Terry Reedy wrote: > If the spec string is still available, it could be searched and the message > adjusted if '=' is not present. That proposal should be a new issue if > someone wants to push it. Done now, see Issue 27772. -- nosy:

[issue27772] Refer to actual format string when creating “zero padding” error message

2016-08-15 Thread Ben Finney
New submission from Ben Finney: When using a format specifier with leading zero, the format spec mini-language (as documented at https://docs.python.org/3/library/string.html#format-specification-mini-language>) says: > '=' […] becomes the default when ‘0’ immediately precedes the

[issue27043] Describe what ‘inspect.cleandoc’ does to synopsis line.

2016-05-27 Thread Ben Finney
Ben Finney added the comment: On 27-May-2016, Nathan Harold wrote: > > Split version (cleandoc2.patch): > >Clean up indentation from docstrings that are indented to line up >with blocks of code. > >All leading whitespace is removed from the first l

[issue27043] Describe what ‘inspect.cleandoc’ does to synopsis line.

2016-05-26 Thread Ben Finney
Ben Finney added the comment: On Fri, May 27, 2016, at 02:58, Nathan Harold wrote: > Here's my shot at a revision (corresponding patch attached): Thanks for that. The only improvement I'd ask for is to more clearly separate the description into two paragraphs: overall description of the eff

[issue27043] Describe what ‘inspect.cleandoc’ does to synopsis line.

2016-05-16 Thread Ben Finney
New submission from Ben Finney: The library documentation for ‘inspect.cleandoc’ describes the transformation that occurs to “the second line onwards”, but makes no mention of what processing occurs to the synopsis (first) line. Please update the library documentation for this function

[issue14102] argparse: add ability to create a man page

2016-03-08 Thread Ben Finney
Changes by Ben Finney <ben+pyt...@benfinney.id.au>: -- versions: +Python 3.6 -Python 2.7 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue14102] argparse: add ability to create a man page

2016-03-08 Thread Ben Finney
Ben Finney added the comment: Oz Tiram wrote: > I doubt if the correct place for formatting a man page should be in > argparse.py itself. My solution is an extension of Andial's brecht solution Thank you for that, Oz. I see an easy seam to refactor this work into separate co

[issue26490] Leading “0” allowed, only for decimal zero

2016-03-05 Thread Ben Finney
Ben Finney added the comment: > rationale unknown That's quite a pity. The inconsistency catches people out, and the docs do not make clear why an exception is made. > but any number of zeroes is still unambiguously zero. Of course. But the same is true for “0003 is unambiguously three

[issue26490] Leading “0” allowed, only for decimal zero

2016-03-05 Thread Ben Finney
New submission from Ben Finney: The language reference carves out a special case for decimal zero literals: they may have leading “0” digits. Non-zero decimal literals may not. This is apparently deliberate: Note that leading zeros in a non-zero decimal number are not allowed

[issue26362] Approved API for creating a temporary file path

2016-02-29 Thread Ben Finney
Ben Finney added the comment: Serhiy Storchaka > mktemp is deprecated, and I think we will get rid of it when 2.7 will be out > of use. That's fine. This is not a request to retain ‘tempfile.mktemp’. I confused matters in my initial message, so your confusion is understandable on this

[issue26362] Approved API for creating a temporary file path

2016-02-29 Thread Ben Finney
Ben Finney added the comment: > I have read the thread on Python-list Thank you, and thanks for linking to that discussion. > and still don't understand the purpose of your idea. The purpose is to get a public API for making temporary filesystem paths with the same properties as are pr

[issue26362] Approved API for creating a temporary file path

2016-02-15 Thread Ben Finney
Ben Finney added the comment: An example:: import io import tempfile names = tempfile._get_candidate_names() def test_frobnicates_configured_spungfile(): """ ‘foo’ should frobnicate the configured spungfile. """ fake_file_path = os

[issue26362] Approved API for creating a temporary file path

2016-02-15 Thread Ben Finney
Ben Finney added the comment: It has been pointed out that `tempfile.mktemp` does in fact access the filesystem, to query whether the entry exists. So this request would be best met by exposing a simple “get a new return value from the `tempfile._RandomNameSequence` instance” function

[issue26362] Approved API for creating a temporary file path

2016-02-14 Thread Ben Finney
New submission from Ben Finney: The security issues of `tempfile.mktemp` are clear when the return value is used to create a filesystem entry. The documentation and docstrings (and even some comments on past issues) are correct o deprecate its use for that purpose. The function has a use

[issue25392] setup.py --quiet doesn't silence "no previously-included directories" warnings from MANIFEST.in

2015-10-13 Thread Ben Finney
Changes by Ben Finney <ben+pyt...@benfinney.id.au>: -- nosy: +bignose ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25392> ___ _

[issue24651] Mock.assert* API is in user namespace

2015-07-21 Thread Ben Finney
Changes by Ben Finney ben+pyt...@benfinney.id.au: -- nosy: +bignose ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24651 ___ ___ Python-bugs-list

[issue23297] ‘tokenize.detect_encoding’ is confused between text and bytes: no ‘startswith’ method on a byte string

2015-01-21 Thread Ben Finney
New submission from Ben Finney: In `tokenize.detect_encoding` is the following code:: first = read_or_stop() if first.startswith(BOM_UTF8): # … The `read_or_stop` function is defined as:: def read_or_stop(): try: return readline() except

[issue23296] ‘tokenize.detect_encoding’ is confused between text and bytes: no ‘startswith’ method on a byte string

2015-01-21 Thread Ben Finney
New submission from Ben Finney: In `tokenize.detect_encoding` is the following code:: first = read_or_stop() if first.startswith(BOM_UTF8): # … The `read_or_stop` function is defined as:: def read_or_stop(): try: return readline() except

[issue23297] ‘tokenize.detect_encoding’ is confused between text and bytes: no ‘startswith’ method on a byte string

2015-01-21 Thread Ben Finney
Ben Finney added the comment: Possibly related to issue9969. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23297 ___ ___ Python-bugs-list

[issue21720] TypeError: Item in ``from list'' not a string message

2014-12-15 Thread Ben Finney
Ben Finney added the comment: Is there room for a better resolution: fix the API so that Unicode objects are accepted in the ‘fromlist’ items? -- nosy: +bignose ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21720

[issue21720] TypeError: Item in ``from list'' not a string message

2014-12-15 Thread Ben Finney
Changes by Ben Finney ben+pyt...@benfinney.id.au: ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21720 ___ ___ Python-bugs-list mailing list Unsubscribe

[issue22843] doc error: 6.2.4. Match Objects

2014-11-12 Thread Ben Finney
Ben Finney added the comment: The current wording of the passage “Match objects always have a boolean value of True” implies that the value compares equal to the ‘True’ constant. That implication is incorrect. I disagree with R. David Murray; if we want to say that a value is considered true

[issue12916] Add inspect.splitdoc

2013-09-08 Thread Ben Finney
Changes by Ben Finney ben+pyt...@benfinney.id.au: -- nosy: +bignose ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12916 ___ ___ Python-bugs-list

[issue18956] Document useful functions in ‘pydoc’ module

2013-09-06 Thread Ben Finney
New submission from Ben Finney: The library documentation for ‘pydoc’ expects that the ‘pydoc’ module will only ever be run as a command-line program. This ignores the general usefulness of several of the functions in that module when imported from the library. The documentation should

[issue12645] test.support. import_fresh_module - incorrect doc

2013-08-04 Thread Ben Finney
Ben Finney added the comment: On 01-Aug-2013, Eli Bendersky wrote: Ben, would you like to provide an updated patch? Unfortunately, contributions are not accepted under the Apache Software Foundation License (as I had thought), but also require assigning extra privileges to the Python Software

[issue12645] test.support. import_fresh_module - incorrect doc

2013-07-08 Thread Ben Finney
Ben Finney added the comment: I'm reading the existing `test.support.import_fresh_module` docstring, and have re-formatted it for PEP 257 compliance and for reading clarity. -- keywords: +patch nosy: +bignose Added file: http://bugs.python.org/file30857/issue12645.reformat_docstring

[issue12645] test.support. import_fresh_module - incorrect doc

2013-07-08 Thread Ben Finney
Ben Finney added the comment: import_fresh_module raises an ImportError if *name* can't be imported, or returns None if the fresh module is not found. The implementation doesn't seem to raise ImportError when a module import fails. Instead, from what I can tell, it captures any ImportError

[issue15731] Mechanism for inheriting docstrings and signatures

2012-08-20 Thread Ben Finney
Ben Finney added the comment: Attached is a patch which is more comprehensive (covering the additional locations pointed out to me by ncoghlan), and also consolidating the details into the library documentation so they're not verbosely repeated in so many places. I agree with Nick's position

[issue15731] Mechanism for inheriting docstrings and signatures

2012-08-20 Thread Ben Finney
Ben Finney added the comment: Apologies, my previous comment and patch was sent to the wrong issue (should have gone to #8810). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15731

[issue8810] TZ offset description is unclear in docs

2012-08-20 Thread Ben Finney
Ben Finney added the comment: Attached is a patch which is more comprehensive (covering the additional locations pointed out to me by ncoghlan), and also consolidating the details into the library documentation so they're not verbosely repeated in so many places. I agree with Nick's position

[issue8810] TZ offset description is unclear in docs

2012-08-19 Thread Ben Finney
Ben Finney added the comment: Here is an updated patch. I examined the implementation in the code for UTC offset and DST handling, and updated the code comments, the docstrings, and the library documentation. -- keywords: +patch nosy: +bignose, ncoghlan Added file: http

[issue12750] datetime.datetime timezone problems

2011-08-16 Thread Ben Finney
Changes by Ben Finney ben+pyt...@benfinney.id.au: -- nosy: +bignose ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12750 ___ ___ Python-bugs-list

[issue12756] datetime.datetime.utcnow should return a UTC timestamp

2011-08-16 Thread Ben Finney
New submission from Ben Finney ben+pyt...@benfinney.id.au: = $ date -u +'%F %T %s %z' 2011-08-16 06:42:12 1313476932 + $ python -c 'import sys, datetime; now = datetime.datetime.utcnow(); sys.stdout.write(now.strftime(%F %T %s %z))' 2011-08-16 06:42:12 1313440932