[issue37973] improve docstrings of sys.float_info

2019-08-29 Thread Mark Dickinson
Mark Dickinson added the comment: @nanjekyejoannah I'm not seeing how that issue is related to this one (except that they're both about docstrings). Can you elaborate? -- ___ Python tracker

[issue37973] improve docstrings of sys.float_info

2019-08-29 Thread Joannah Nanjekye
Joannah Nanjekye added the comment: I just referenced another area that may need help updating/improving doc strings. -- ___ Python tracker ___ __

[issue37980] regression when passing numpy bools to sorted(..., reverse=r)

2019-08-29 Thread Mark Dickinson
Mark Dickinson added the comment: Closely related: #37427. I'm not sure why that issue was closed. My naive expectation would be that in most cases where an API specifies a flag, an arbitrary Python object can be used for that flag (and is then interpreted in boolean context). That's the nat

[issue37976] zip() shadows TypeError raised in __iter__() of source iterable

2019-08-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: > I am not even sure this is a bug. It really isn't :-) But it is okay to want to improve the traceback. Using _PyErr_FormatFromCause() is plausible, but the resulting traceback is messy. Since there isn't much value in reporting which iterable number h

[issue37427] sorted, list.sort reject non-boolean objects with __bool__() as `reverse` parameter

2019-08-29 Thread Mark Dickinson
Mark Dickinson added the comment: See also #37980. I'd support a change to have the `reversed` argument to `sort` and `sorted` be automatically interpreted in boolean context. -- ___ Python tracker

[issue37961] Tracemalloc traces do not include original stack trace length

2019-08-29 Thread STINNER Victor
STINNER Victor added the comment: > However, if the number of frames is truncated, there's no way to know the > original length of the stack traces. PR 15545 makes each trace 4 bytes (sizeof int) larger. Would it be enough for you to only know if the traceback is truncated? tracemalloc is a

[issue37976] zip() shadows TypeError raised in __iter__() of source iterable

2019-08-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Agree. This is an improvement of UX. The initial code was added in 8572b4fedf7e6ee4cd350680d53cd0a21574b083. Other option is to check ahead if the argument is an iterable. if (!item->ob_type->tp_iter && !PySequence_Check(item)) { // Raise speci

[issue15125] argparse: positional arguments containing - in name not handled well

2019-08-29 Thread hai shi
hai shi added the comment: How about: 1. Adding documentation as steven said. 2. If user use '-' of positional arguments in latest cpython, we cloud remind user that `the '-' of positional arguments be replaced by '_' since cpython 4.0` 3.Applying Simon Law's patch. -- nosy: +shihai19

[issue37976] zip() shadows TypeError raised in __iter__() of source iterable

2019-08-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: > Other option is to check ahead if the argument is an iterable. The other tools that consume iterators don't go down this path and it doesn't seem to have been a problem in practice. So, I recommend that we not invent new problems that we didn't already

[issue30988] Exception parsing invalid email address headers starting or ending with dot

2019-08-29 Thread tsufeki
Change by tsufeki : -- keywords: +patch pull_requests: +15276 stage: -> patch review pull_request: https://github.com/python/cpython/pull/15600 ___ Python tracker ___

[issue37961] Tracemalloc traces do not include original stack trace length

2019-08-29 Thread Julien Danjou
Julien Danjou added the comment: That's a good question. Considering that Py_DEFAULT_RECURSION_LIMIT is 1000, we could probably settle on 2 bytes by using an uint16_t which ought to be enough unless people regularly trace Python stack traces bigger that are bigger than 2^16. -- ___

[issue37834] readlink on Windows cannot read app exec links

2019-08-29 Thread Łukasz Langa
Łukasz Langa added the comment: There's a bug on macOS that is blocking the release regarding `stat.FILE_ATTRIBUTE_REPARSE_POINT` being used to check whether `os.stat_result` objects have the `st_file_attributes` attribute. -- nosy: +lukasz.langa resolution: fixed -> stage: resolved

[issue37834] readlink on Windows cannot read app exec links

2019-08-29 Thread Łukasz Langa
Łukasz Langa added the comment: Unit tests didn't catch it since it fails on older macOS releases. -- ___ Python tracker ___ ___ Pyt

[issue37982] Add a --minify argument to json.tool

2019-08-29 Thread Brad Solomon
New submission from Brad Solomon : I propose adding a command line `--minify` flag to the json/tool.py module. This flag, if specified, uses `indent=None` and `separators=(',', ':')` to eliminate indent and separator whitespace in the output. Minifying JSON (as is also done frequently with J

[issue37982] Add a --minify argument to json.tool

2019-08-29 Thread Brad Solomon
Change by Brad Solomon : -- keywords: +patch pull_requests: +15277 stage: -> patch review pull_request: https://github.com/python/cpython/pull/15601 ___ Python tracker ___ ___

[issue37834] readlink on Windows cannot read app exec links

2019-08-29 Thread Ned Deily
Ned Deily added the comment: One problem seems to be that the code added for this issue assumes that the documentation is correct in implying that the stat.FILE_ATTRIBUTE_* constants (like stat.FILE_ATTRIBUTE_REPARSE_POINT) are only present on Windows. But besides being conditionally create

[issue37982] Add a --minify argument to json.tool

2019-08-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: -0 ISTM that minifying isn't something one usually does with a command-line tool. Instead, it is part of the program generating JSON in the first place. IOW, minification is useful in the standard library but not a part of json.tool which normally used

[issue37945] test_locale failing

2019-08-29 Thread Eryk Sun
Eryk Sun added the comment: Here's some additional background information for work on this issue. A Unix locale identifier has the following form: "language[_territory][.codeset][@modifier]" | "POSIX" | "C" | "" | NULL (X/Open Portability Guide, Issue 4, 1

[issue37982] Add a --minify argument to json.tool

2019-08-29 Thread Brad Solomon
Brad Solomon added the comment: Since, as you point out, json.tool is made for convenience, I see the reverse of pretty-printing (minifying) being just as convenient: $ cat > expanded.json < { > "foo": "bar", > "json": "obj" > } > EOF $ ./python.exe -m json.tool --minify expanded.json

[issue37945] test_locale failing

2019-08-29 Thread Eryk Sun
Eryk Sun added the comment: If normalize() is implemented for Windows, then the tests should be split out into POSIX and Windows versions. Currently, most of the tests in NormalizeTest are not checking a result that's properly normalized for ucrt. A useful implementation of locale.normalize

[issue37983] macOS: os.lchmod() incorrectly removed by 2.7.16

2019-08-29 Thread Keith F. Kelly
New submission from Keith F. Kelly : Apparently the fix for https://bugs.python.org/issue34652 was incorrect, or got incorrectly backported to, the 2.7 tree, because as of 2.7.16, the os.lchmod() built-in API is unexpectedly missing on MacOS, which is breaking our existing code. -- c

[issue37983] macOS: os.lchmod() incorrectly removed by 2.7.16

2019-08-29 Thread Zachary Ware
Change by Zachary Ware : -- nosy: +benjamin.peterson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://

[issue37834] readlink on Windows cannot read app exec links

2019-08-29 Thread Ned Deily
Ned Deily added the comment: ... and the other important difference is that older versions of macOS do not support fd functions so _use_fd_functions is false and the alternate path is taken in shutil.rmtree, the path that calls _rm_tree_islink which fails. >>> shutil.rmtree('a') Traceback (m

[issue37980] regression when passing numpy bools to sorted(..., reverse=r)

2019-08-29 Thread Sebastian Berg
Change by Sebastian Berg : -- nosy: +seberg ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue37834] readlink on Windows cannot read app exec links

2019-08-29 Thread Steve Dower
Steve Dower added the comment: Huh, didn't realise those were always defined in stat.py. Changing the test to "hasattr(... "st_file_attributes")" should be fine. I can get to it in a couple of hours if nobody else gets there first. -- ___ Python t

[issue37983] macOS: os.lchmod() incorrectly removed by 2.7.16

2019-08-29 Thread Ned Deily
Ned Deily added the comment: lchmod is one of a number of os functions that is not available on older versions of macOS. Chances are you are using a Python binary (possibly one supplied by a python.org installer) that was built to be used on a range of macOS versions and the oldest version d

[issue37980] regression when passing numpy bools to sorted(..., reverse=r)

2019-08-29 Thread Thomas Caswell
Change by Thomas Caswell : -- components: +Library (Lib) versions: +Python 3.9 ___ Python tracker ___ ___ Python-bugs-list mailing l

[issue37968] Add a turtle module function to draw a circle centered at the turtle

2019-08-29 Thread Nick Timkovich
Nick Timkovich added the comment: To clarify, there is an "ARC" command in Logo that draws a circle/circle segment *centered on* the turtle. Reference: http://fmslogo.sourceforge.net/manual/command-arc.html Examples: https://personal.utdallas.edu/~veerasam/logo/ That command is not/has not b

[issue37918] What about an enum for open() modes?

2019-08-29 Thread Marco Sulla
Marco Sulla added the comment: Excuse me, but this is not a bug report, but a feature request. Indeed there's the possibility to submit also enhancements, not only bugs, as in all bug reporting board worthy of respect. You see the Type select with "Enhancement" option selected? -- r

[issue37834] readlink on Windows cannot read app exec links

2019-08-29 Thread Ned Deily
Change by Ned Deily : -- pull_requests: +15279 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/15602 ___ Python tracker ___

[issue37968] Add a turtle module function to draw a circle centered at the turtle

2019-08-29 Thread Eric V. Smith
Eric V. Smith added the comment: It's turtle.circle: https://docs.python.org/3.5/library/turtle.html#turtle.circle @Yehuda: this isn't the appropriate place for help on how the turtle module works. Please consider the python-tutor list. See https://mail.python.org/mailman/listinfo/tutor -

[issue37968] Add a turtle module function to draw a circle centered at the turtle

2019-08-29 Thread Yehuda Katz
Yehuda Katz added the comment: Nick, thank you. What you linked here is Logo, with different logic & syntax than Python. The hand analogy is interesting, thank you. I rest my case and have good night from Israel. Yehuda On Thu, Aug 29, 2019 at 11:40 PM Nick Timkovich wrote: > > Nick Timkovi

[issue37834] readlink on Windows cannot read app exec links

2019-08-29 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset 7fcc2088a50a4ecb80e5644cd195bee209c9f979 by Łukasz Langa (Ned Deily) in branch 'master': bpo-37834: Prevent shutil.rmtree exception (GH-15602) https://github.com/python/cpython/commit/7fcc2088a50a4ecb80e5644cd195bee209c9f979 -- _

[issue37834] readlink on Windows cannot read app exec links

2019-08-29 Thread Łukasz Langa
Change by Łukasz Langa : -- pull_requests: +15280 pull_request: https://github.com/python/cpython/pull/15603 ___ Python tracker ___ _

[issue37976] zip() shadows TypeError raised in __iter__() of source iterable

2019-08-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I am fine with simplifying the code as Raymond suggested. map() does not have anything special. -- ___ Python tracker ___

[issue37982] Add a --minify argument to json.tool

2019-08-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: json.tool produces more readable representation. Your option is opposite to this purpose. -- nosy: +serhiy.storchaka ___ Python tracker __

[issue37834] readlink on Windows cannot read app exec links

2019-08-29 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset 25a044ee6ce50a9172478cc61d914644778455f6 by Łukasz Langa in branch '3.8': [3.8] bpo-37834: Prevent shutil.rmtree exception (GH-15602) (#15603) https://github.com/python/cpython/commit/25a044ee6ce50a9172478cc61d914644778455f6 -- _

[issue37982] Add a --minify argument to json.tool

2019-08-29 Thread Brad Solomon
Brad Solomon added the comment: > json.tool produces more readable representation. Your option is opposite to > this purpose. That is correct, though I'm not sure what point you're trying to make. The purpose of minifying isn't to make the input more readable; it's to condense it in the in

[issue37984] Unable parse csv on latin iso or binary mode

2019-08-29 Thread Yhojann Aguilera
New submission from Yhojann Aguilera : Unable parse a csv with latin iso charset. with open('./exported.csv', newline='') as csvFileHandler: csvHandler = csv.reader(csvFileHandler, delimiter=';', quotechar='"') for line in csvHandler: UnicodeDecodeError: 'utf-8' codec

[issue37982] Add a --minify argument to json.tool

2019-08-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: Brad, thank you for the suggestion, but our goals for this tool are somewhat limited, so I'm going to close this as being out of scope for the intended purpose of json.tool. If some other core developer wants to champion this, feel free to re-open. -

[issue37984] Unable parse csv on latin iso or binary mode

2019-08-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: Try passing an "encoding" argument to open(): with open('./exported.csv', newline='', encoding='latin-1') as csvFileHandler: ... -- nosy: +rhettinger ___ Python tracker _

[issue37984] Unable parse csv on latin iso or binary mode

2019-08-29 Thread Yhojann Aguilera
Yhojann Aguilera added the comment: Thanks, works fine, but anyway why not give the option to work binary? the delimiters can be represented with binary values. In python it is difficult to autodetect the encoding of characters in a file. -- ___ P

[issue37984] Unable parse csv on latin iso or binary mode

2019-08-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: There is an option to work with binary: with open(filename, 'rb') as f: bin_data = f.read() str_data = bin_data.decode('latin-1') -- resolution: -> not a bug stage: -> resolved status: open -> closed

[issue37985] WFERR_UNMARSHALLABLE breaks recursion limit

2019-08-29 Thread Davis Herring
New submission from Davis Herring : Most of the "p->depth--;" lines associated with "p->error = WFERR_UNMARSHALLABLE;" are spurious, and can crash the interpreter if enough of them prevent reaching MAX_MARSHAL_STACK_DEPTH. (The only exceptions are in 2.7, where some of them are followed by a

[issue37985] WFERR_UNMARSHALLABLE breaks recursion limit

2019-08-29 Thread Davis Herring
Davis Herring added the comment: I can easily make a patch or pull request, but against which version(s) should I do so? (Will such a trivial change require a CLA?) -- ___ Python tracker __

[issue33125] Windows 10 ARM64 platform support

2019-08-29 Thread Dan
Dan added the comment: Hi, I've just noticed this but a couple of months ago I managed to compile Python 2.7 on win32 ARM64 including the said ssl, tk, ctypes modules. You can download from here and test - https://mega.nz/#F!PclhDIRB!-yhBZ6UM7S596ijNU3dx0A You will need to install the MSVC 201

[issue37980] regression when passing numpy bools to sorted(..., reverse=r)

2019-08-29 Thread Terry J. Reedy
Terry J. Reedy added the comment: PR-11952 was written by Serhiy and reviewed by Victor (and Mark). They are better qualified to comment on its intended side effects than I am. In the case of sorting, the exception for, say, "reverse='a'", says the flag must be an 'integer' since at least 2

[issue37980] regression when passing numpy bools to sorted(..., reverse=r)

2019-08-29 Thread Ammar Askar
Ammar Askar added the comment: Thanks for the insight Terry. I think the functions that accept ints as bools are kind of a red herring: Booleans were only formally introduced in Python 2.3 [1], thus any functions that existed before that accepted ints and continued to accept ints for backwa

[issue29553] Argparser does not display closing parentheses in nested mutex groups

2019-08-29 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: bethard -> rhettinger nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list maili

[issue9625] argparse: Problem with defaults for variable nargs when using choices

2019-08-29 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: bethard -> rhettinger nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailin

[issue9399] Provide a 'print' action for argparse

2019-08-29 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: bethard -> rhettinger nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailin

[issue18943] argparse: default args in mutually exclusive groups

2019-08-29 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: bethard -> rhettinger nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list maili

[issue25061] Add native enum support for argparse

2019-08-29 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: bethard -> rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscrib

[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2019-08-29 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: bethard -> rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe

[issue29030] argparse: choices override metavar

2019-08-29 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: bethard -> rhettinger nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list maili

[issue9849] Argparse needs better error handling for nargs

2019-08-29 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: bethard -> rhettinger nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailin

[issue13966] Add disable_interspersed_args() to argparse.ArgumentParser

2019-08-29 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: bethard -> rhettinger nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list maili

[issue10190] Can argparse._AttributeHolder._get_kwargs become a public API?

2019-08-29 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: bethard -> rhettinger nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list maili

[issue37976] zip() shadows TypeError raised in __iter__() of source iterable

2019-08-29 Thread Sergey Fedoseev
Sergey Fedoseev added the comment: > map() does not have anything special. Just for the reference, in Python 2.7 map() has the same behavior and it caused many problems for me and other people working with/developing Django. -- ___ Python tracker

[issue37976] zip() shadows TypeError raised in __iter__() of source iterable

2019-08-29 Thread Josh Rosenberg
Josh Rosenberg added the comment: Raymond: "Since there isn't much value in reporting which iterable number has failed" Isn't there though? If the error just points to the line with the zip, and the zip is zipping multiple similar things (especially things which won't have a traceable line

[issue37976] zip() shadows TypeError raised in __iter__() of source iterable

2019-08-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: IMO, the index number was never actually helpful. Also, the new error message takes you straight to the heart of the problem without a useless distractor: >>> zip('abc', Iterable('one'), 'def') Traceback (most recent call last): File "", line 1, in F

[issue29553] Argparser does not display closing parentheses in nested mutex groups

2019-08-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: Is this resolved or this there still more to do? -- ___ Python tracker ___ ___ Python-bugs-lis

[issue37976] zip() shadows TypeError raised in __iter__() of source iterable

2019-08-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset 6a650aaf7735e30636db2721247f317064c2cfd4 by Raymond Hettinger (Sergey Fedoseev) in branch 'master': bpo-37976: Prevent shadowing of TypeError in zip() (GH-15592) https://github.com/python/cpython/commit/6a650aaf7735e30636db2721247f317064c2cfd

[issue37976] zip() shadows TypeError raised in __iter__() of source iterable

2019-08-29 Thread miss-islington
Change by miss-islington : -- pull_requests: +15281 pull_request: https://github.com/python/cpython/pull/15607 ___ Python tracker ___ __

[issue37976] zip() shadows TypeError raised in __iter__() of source iterable

2019-08-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thanks Sergey. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.8 ___ Python tracker __

[issue37984] Unable parse csv on latin iso or binary mode

2019-08-29 Thread Yhojann Aguilera
Yhojann Aguilera added the comment: For big files (like as >= 1gb) can not load the all string on memory, need use a file stream using open(). -- ___ Python tracker ___ _

[issue37976] zip() shadows TypeError raised in __iter__() of source iterable

2019-08-29 Thread miss-islington
Change by miss-islington : -- pull_requests: +15282 pull_request: https://github.com/python/cpython/pull/15608 ___ Python tracker ___ __

[issue37975] Typo in the documentation by C-API DateTime Objects¶

2019-08-29 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Incorrect C Function name for timedelta ___ Python tracker

[issue25061] Add native enum support for argparse

2019-08-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: Depending on how you want to expose enums to end-users, some reasonable options already exist: import argparse from enum import Enum class Shake(Enum): VANILLA = 7 CHOCOLATE = 4 COOKIES = 9 MINT = 3 # Optio

[issue10190] Can argparse._AttributeHolder._get_kwargs become a public API?

2019-08-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: Marking this as out-of-date. It seems that the desired functionality has already been added in types.SimpleNamespace: # Capabilities of _AttributeHolder >>> ah = _AttributeHolder() >>> ah AttributeHolder() >>> ah.raymond='Red' >>>

[issue25061] Add native enum support for argparse

2019-08-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: Even with the proposed converter class, I don't see a straight-forward way to meet the OP's goal of just specifying type=EnumConverter(MyEnum) to get all of: * display all possible values in help * display them in lowercase * accept them in lowercase * and

[issue37976] zip() shadows TypeError raised in __iter__() of source iterable

2019-08-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset 27f418640cf39c035114f29cc2d628775b43c0f9 by Raymond Hettinger (Miss Islington (bot)) in branch '3.8': bpo-37976: Prevent shadowing of TypeError in zip() (GH-15592) (GH-15608) https://github.com/python/cpython/commit/27f418640cf39c035114f29cc2

[issue9625] argparse: Problem with defaults for variable nargs when using choices

2019-08-29 Thread Raymond Hettinger
Change by Raymond Hettinger : -- priority: high -> normal versions: +Python 3.9 -Python 2.7, Python 3.5, Python 3.6 ___ Python tracker ___ __

<    1   2