[issue44493] Missing terminated NUL in the length of sockaddr_un

2022-03-23 Thread Aaron Gallagher
Aaron Gallagher <_...@habnab.it> added the comment: sigh.. adding myself to nosy here too in the hope that this gets any traction -- nosy: +habnabit ___ Python tracker <https://bugs.python.org/i

[issue46166] Get "self" args or non-null co_varnames from frame object with C-API

2022-02-07 Thread Aaron Gokaslan
Aaron Gokaslan added the comment: The frame object I am referring to was: PyFrameObject *frame = PyThreadState_GetFrame(PyThreadState_Get()); This frame can not be used with PyObject_GetAttrString. Is there anyway to get the PyObject* associated with a PyFrameObject*? It seems weird

[issue46166] Get "self" args or non-null co_varnames from frame object with C-API

2022-02-04 Thread Aaron Gokaslan
Aaron Gokaslan added the comment: I saw the latest Python 3.11 5A release notes on the frame API changes. Do the notes mean the only officially supported way of accessing co_varnames is now through the Python interface and the inspect module? By using PyObject_GetAttrString? Also

[issue46166] Get "self" args or non-null co_varnames from frame object with C-API

2022-01-31 Thread Aaron Gokaslan
Aaron Gokaslan added the comment: `PyCodeObject_GetVariableName()` and `PyCodeObject_GetVariableKind()` work? - Some public-gettters such as these functions would be ideal. OOI, how do you cope with non-local self? - We only care about checking self to prevent an infinite recursion in our

[issue46166] Get "self" args or non-null co_varnames from frame object with C-API

2022-01-31 Thread Aaron Gokaslan
Aaron Gokaslan added the comment: We didn't want to read colocalsplus directly because we were worried about the stability of that approach and the code complexity / readability. Also, I wasn't aware that colocalsplus would work or if that was lazily populated as well. The functions used

[issue46223] asyncio cause infinite loop during debug

2022-01-13 Thread aaron
aaron added the comment: '@reprlib.recursive_repr' decorator to 'events.Handle.__repr__()' could you tell me which file should I change? and why? -- ___ Python tracker <https://bugs.python.org/issue46

[issue46223] asyncio cause infinite loop during debug

2022-01-13 Thread aaron
aaron added the comment: "When running code in debug mode" means we're debug the code. We have used both vscode and pycharm. Same result. -- ___ Python tracker <https://bugs.python.o

[issue46223] asyncio cause infinite loop during debug

2022-01-01 Thread aaron
New submission from aaron : When running code in debug mode, asyncio sometimes enter into infinite loop, shows as the following: ``` Current thread 0x7f1c15fc5180 (most recent call first): File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/events.py", line 58 in __rep

[issue46166] Get "self" args or non-null co_varnames from frame object with C-API

2021-12-23 Thread Aaron Gokaslan
New submission from Aaron Gokaslan : Hello, I am a maintainer with the PyBind11 project. We have been following the 3.11 development branch and have noticed an issue we are encountering with changes to the C-API. Particularly, we have an edge case in our overloading dispatch mechanism

[issue14965] super() and property inheritance behavior

2021-12-08 Thread Aaron Gallagher
Aaron Gallagher <_...@habnab.it> added the comment: I will note, Raymond, that I’ve wanted this for years before discovering this bpo issue, and I found it because you linked it on Twitter. ;) On Wed, Dec 8, 2021 at 19:08 Raymond Hettinger wrote: > > Raymond Hettinger added

[issue42109] Use hypothesis for testing the standard library, falling back to stubs

2021-11-08 Thread Aaron Meurer
Change by Aaron Meurer : -- nosy: +asmeurer ___ Python tracker <https://bugs.python.org/issue42109> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45473] Enum add "from_name" and "from_value" class methods

2021-10-14 Thread Aaron Koch
Aaron Koch added the comment: Are there any other names that you would contemplate besides `from_name` and `from_value`? My reading of your response indicates that you are fundamentally opposed to the addition of class methods, since they would limit the space of possible instance methods

[issue45473] Enum add "from_name" and "from_value" class methods

2021-10-14 Thread Aaron Koch
New submission from Aaron Koch : Documentation: https://docs.python.org/3/library/enum.html#creating-an-enum Current behavior: SomeEnum[name] is used to construct an enum by name SomeEnum(value) is used to construct an enum by value Problem: As a user of enums, it is difficult to remember

[issue17792] Unhelpful UnboundLocalError due to del'ing of exception target

2021-09-30 Thread Aaron Smith
Aaron Smith added the comment: I encountered the similar behavior unexpectedly when dealing with LEGB scope of names. Take the following example run under Python 3.9.2: def doSomething(): x = 10 del x print(x) x = 5 doSomething() This produces a UnboundLocalError at print(x

[issue43306] Error in multiprocessing.Pool's initializer doesn't stop execution

2021-08-23 Thread Aaron
Aaron added the comment: What should the behavior be if an exception is raised in a pool worker during bootstrapping / initialization function execution? I think an exception should be raised in the process owning the Pool, and in the fix I'm tinkering around with I just raise

[issue43306] Error in multiprocessing.Pool's initializer doesn't stop execution

2021-08-23 Thread Aaron
Aaron added the comment: I ran into this bug answering this question on Stack Overflow: https://stackoverflow.com/questions/68890437/cannot-use-result-from-multiprocess-pool-directly I have minimized the code required to replicate the behavior, but it boils down to: when using "

[issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit()

2021-07-14 Thread Aaron Meurer
Aaron Meurer added the comment: When talking about making exit only work when typed at the interpreter, something to consider is the confusion that it can cause when there is a mismatch between the interactive interpreter and noninteractive execution, especially for novice users. I've seen

[issue16959] rlcompleter doesn't work if __main__ can't be imported

2021-06-18 Thread Aaron Meurer
Aaron Meurer added the comment: A quick glance at the source shows that it still imports __main__ at the top-level. I have no idea how legitimate it is that the App Engine (used to?) makes it so that __main__ can't be imported. -- nosy: +asmeurer

[issue44455] compileall should exit nonzero for nonexistent directories

2021-06-18 Thread Aaron Meurer
New submission from Aaron Meurer : $ ./python.exe -m compileall doesntexist Listing 'doesntexist'... Can't list 'doesntexist' $ echo $? 0 It's standard for a command line tool that processes files to exit nonzero when given a directory that doesn't exist. -- messages: 396087 nosy

[issue40199] Invalid escape sequence DeprecationWarnings don't trigger by default

2021-06-02 Thread Aaron Gallagher
Aaron Gallagher <_...@habnab.it> added the comment: This is definitely not windows-specific. On macos: $ python3.9 Python 3.9.4 (default, Apr 5 2021, 01:47:16) [Clang 11.0.0 (clang-1100.0.33.17)] on darwin Type "help", "copyright", "credits" or "lic

[issue14965] super() and property inheritance behavior

2021-05-28 Thread Aaron Gallagher
Aaron Gallagher <_...@habnab.it> added the comment: @daniel.urban would you kindly resubmit your patch as a PR to the cpython repo? I've learned out-of-band from someone else that putting patches on bpo is considered obsolete. you can use the PR I've submitted (https://github.com/

[issue14965] super() and property inheritance behavior

2021-05-17 Thread Aaron Gallagher
Aaron Gallagher <_...@habnab.it> added the comment: @daniel.urban I'm attempting to move this patch along, but since the contributing process has changed in the years since your patch, you'll need to sign the CLA. Are you interested in picking this back up at all? I haven't been giv

[issue14965] super() and property inheritance behavior

2021-05-17 Thread Aaron Gallagher
Change by Aaron Gallagher : -- nosy: +Aaron Gallagher nosy_count: 20.0 -> 21.0 pull_requests: +24811 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/26194 ___ Python tracker <https://bugs.p

[issue43420] Optimize rational arithmetics

2021-03-07 Thread Aaron Meurer
Aaron Meurer added the comment: I'm surprised to hear that the "typical use-case" of Fraction is fractions converted from floats. Do you have evidence in the wild to support that? I would expect any application that uses fractions "generically" to run into the same sor

[issue43420] Optimize rational arithmetics

2021-03-06 Thread Aaron Meurer
Change by Aaron Meurer : -- nosy: +asmeurer ___ Python tracker <https://bugs.python.org/issue43420> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39820] Bracketed paste mode for REPL: don't execute pasted command before ENTER is pressed explicitly

2021-02-17 Thread Aaron Meurer
Aaron Meurer added the comment: To reiterate some points I made in the closed issues https://bugs.python.org/issue42819 and https://bugs.python.org/issue32019. A simple "fix" would be to emulate the non-bracketed paste buffering. That is, accept the input using bracketed paste,

[issue42819] readline 8.1 enables the bracketed paste mode by default

2021-02-15 Thread Aaron Meurer
Aaron Meurer added the comment: Instead of enabling it by default, why not just keep it but emulate the old behavior by splitting and buffering the input lines? That way you still get some of the benefits of bracketed paste, i.e., faster pasting, but without the hard work of fixing the REPL

[issue21821] The function cygwinccompiler.is_cygwingcc leads to FileNotFoundError under Windows 7

2021-02-03 Thread Aaron Meurer
Aaron Meurer added the comment: Is find_executable() going to be extracted from distutils to somewhere else? It's one of those functions that is useful outside of packaging, and indeed, I've seen it imported in quite a few codes that aren't related to packaging. If so, the patch I mentioned

[issue30384] traceback.TracebackException.format shouldn't format_exc_only() when __traceback__ is None

2020-11-04 Thread Aaron Meurer
Aaron Meurer added the comment: Neither of those things preclude the possibility of the traceback module doing a better job of printing tracebacks for exceptions where __traceback__ = None. -- ___ Python tracker <https://bugs.python.

[issue30384] traceback.TracebackException.format shouldn't format_exc_only() when __traceback__ is None

2020-11-04 Thread Aaron Meurer
Aaron Meurer added the comment: I don't think it's helpful to make such a literalistic interpretation. Just because the variable is called "traceback" doesn't mean it should apply only to the things that are *technically* a traceback (and I don't agree anyway that the line

[issue30384] traceback.TracebackException.format shouldn't format_exc_only() when __traceback__ is None

2020-11-04 Thread Aaron Meurer
Aaron Meurer added the comment: I think I found another way to achieve what I was trying to do, which is why I never pursued this. But I still think it's a bug. __traceback__ = None isn't documented anywhere that I could find, so I was only able to deduce how it should work from reading

[issue30384] traceback.TracebackException.format shouldn't format_exc_only() when __traceback__ is None

2020-11-04 Thread Aaron Meurer
Aaron Meurer added the comment: > It's not entirely clear to me what you are trying to do (what is the output > you are hoping to get?) but this looks more like a question than a bug > report, so I am closing this issue. If this is still relevant, I'd suggest > you ask on the

[issue35212] Expressions with format specifiers in f-strings give wrong code position in AST

2020-08-31 Thread Aaron Meurer
Aaron Meurer added the comment: The same thing occurs with specifiers like {a!r}. -- nosy: +asmeurer ___ Python tracker <https://bugs.python.org/issue35

[issue41506] Inclusion or documentation of extended with syntax in 3.9

2020-08-07 Thread Aaron Meurer
New submission from Aaron Meurer : This discussion started at https://github.com/python/cpython/pull/19503 (actually on Twitter https://twitter.com/asmeurer/status/1289304407696261120), but Guido asked me to move it bpo. Alongside the implementation of Python 3.9's new PEG parser, a new

[issue41502] Option for Colored Logging in http.server Module

2020-08-07 Thread Aaron Lichtman
New submission from Aaron Lichtman : It would be useful if the http.server module had an option for colored logging to help users visually parse the HTTP traffic logs. $ python3 -m http.server 80 --color is along the lines of what I'm thinking. -- components: Library (Lib) messages

[issue32958] socket module calls with long host names can fail with idna codec error

2020-07-24 Thread Aaron Black
Aaron Black added the comment: joseph.hackman I don't think that the 63 character limit on a label is the problem specifically, merely it's application. The crux of my issue was that credentials passed with the url in a basic-authy fashion (as some services require) count against

[issue39820] Bracketed paste mode for REPL

2020-05-18 Thread Aaron Meurer
Aaron Meurer added the comment: Related issue https://bugs.python.org/issue32019 -- nosy: +asmeurer ___ Python tracker <https://bugs.python.org/issue39

[issue39854] f-strings with format specifiers have wrong col_offset

2020-03-04 Thread Aaron Meurer
New submission from Aaron Meurer : This is tested in CPython master. The issue also occurs in older versions of Python. >>> ast.dump(ast.parse('f"{x}"')) "Module(body=[Expr(value=JoinedStr(values=[FormattedValue(value=Name(id='x', ctx=Load()), convers

[issue36144] Dictionary addition. (PEP 584)

2019-12-12 Thread Aaron Hall
Aaron Hall added the comment: Another obvious way to do it, but I'm +1 on it. A small side point however - PEP 584 reads: > To create a new dict containing the merged items of two (or more) dicts, one > can currently write: > {**d1, **d2} > but this is neither obviou

[issue38719] Surprising and possibly incorrect passing of InitVar to __post_init__ method of data classes

2019-11-06 Thread Aaron Ecay
New submission from Aaron Ecay : I have discovered that InitVar's are passed in a surprising way to the __post_init__ method of python dataclasses. The following program illustrates the problem: = from dataclasses import InitVar, dataclass @dataclass class Foo: bar: InitVar[str

[issue32912] Raise non-silent warning for invalid escape sequences

2019-08-09 Thread Aaron Meurer
Aaron Meurer added the comment: Are there issues tracking the things I mentioned, which should IMO happen before this becomes a hard error (making the warnings reproduce even if the file has already been compiled, and making warning message point to the correct line in multiline strings

[issue37433] syntax error in multiline f-string produces ~40k spaces output

2019-08-02 Thread Aaron Meurer
Aaron Meurer added the comment: This seems related. It's also possible I'm misunderstanding what is supposed to happen here. If you create test.py with just the 2 lines: """ a and run python test.py from CPython master, you get $./python.exe test.py File "/Users/a

[issue32912] Raise non-silent warning for invalid escape sequences

2019-07-23 Thread Aaron Meurer
Aaron Meurer added the comment: Well paradoxically, the bugs that this prevents are the ones it doesn't warn about. If someone writes '\tan(x)' thinking it is a string representing a LaTeX formula for the tangent of x, they won't realize that they actually created a string with a tab plus

[issue32912] Raise non-silent warning for invalid escape sequences

2019-07-23 Thread Aaron Meurer
Aaron Meurer added the comment: Raymond, are you in agreement that these warnings should at some point eventually become syntax errors? -- ___ Python tracker <https://bugs.python.org/issue32

[issue37433] syntax error in f-string in multiline string produces ~40k spaces of output

2019-06-27 Thread Aaron Meurer
Aaron Meurer added the comment: This looks like the same issue I mentioned here https://bugs.python.org/msg344764 -- nosy: +asmeurer ___ Python tracker <https://bugs.python.org/issue37

[issue32912] Raise non-silent warning for invalid escape sequences

2019-06-14 Thread Aaron Meurer
Aaron Meurer added the comment: I agree. Please someone else do that. I don't know what already has issues and I unfortunately don't have time right now to help out with any of this. I simply mentioned all these things as arguments why Python should not (yet) make these warnings errors

[issue35586] Open pyexpat compilation, Make shows error(missing separator)

2019-06-10 Thread Aaron Hurst
Aaron Hurst added the comment: I believe this bug can be closed now that the following have landed: New changeset 408a2ef1aceff1f4270c44552fa39ef93d9283e3 by Benjamin Peterson (aaronpaulhurst) in branch 'master': closes bpo-35184: Fix XML_POOR_ENTROPY option that breaks makesetup parsing

[issue32912] Raise non-silent warning for invalid escape sequences

2019-06-05 Thread Aaron Meurer
Aaron Meurer added the comment: I agree with Raymond that third party libraries are not ready for this. My biggest issue is that the way Python warns about this makes it very difficult for library authors to fix this. Most won't even notice. The problem is the warnings are only shown once

[issue36927] traceback docstrings should explicitly state return values instead of referring to other functions

2019-05-15 Thread Aaron Hall
New submission from Aaron Hall : I've written three (or more) answers on Stack Overflow about how to use the functions in the traceback module, and I code Python all day long. Embarrassing confession: I just recommended the wrong traceback function in email to fix the incorrect usage

[issue34648] Confirm the types of parameters of traceback.format_list and traceback.StackSummary.from_list post-3.5

2019-05-15 Thread Aaron Hall
Change by Aaron Hall : -- nosy: +Aaron Hall ___ Python tracker <https://bugs.python.org/issue34648> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35184] Makefile is not correctly generated when compiling pyextat with DXML_POOR_ENTROPY=1

2019-05-02 Thread Aaron Hurst
Aaron Hurst added the comment: Hi Ned, Thanks for testing this. I also observe that macOS compiles "without error"... but it's still broken... and silently. This is because the pyexpat line isn't being turned into the expected set of source compilation rules, but it is ins

[issue35184] Makefile is not correctly generated when compiling pyextat with DXML_POOR_ENTROPY=1

2019-05-02 Thread Aaron Hurst
Aaron Hurst added the comment: Hi Ned, >From a fresh checkout of master on Ubuntu 18.04, I uncomment the pyexpat line >in Modules/Setup and run: cpython$ ./configure ... cpython$ make Makefile:273: *** missing separator. Stop. Here is the offending section of the resulting Makefile

[issue35184] Makefile is not correctly generated when compiling pyextat with DXML_POOR_ENTROPY=1

2019-05-02 Thread Aaron Hurst
Aaron Hurst added the comment: Sorry for my misunderstanding of the process, and thanks for explaining. I resubmitted the PR against the master branch. -- ___ Python tracker <https://bugs.python.org/issue35

[issue35184] Makefile is not correctly generated when compiling pyextat with DXML_POOR_ENTROPY=1

2019-05-02 Thread Aaron Hurst
Change by Aaron Hurst : -- pull_requests: +12981 ___ Python tracker <https://bugs.python.org/issue35184> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35586] Open pyexpat compilation, Make shows error(missing separator)

2019-04-21 Thread Aaron Hurst
Aaron Hurst added the comment: This is the same issue as https://bugs.python.org/issue35184 I can reproduce this issue by uncommenting the pyexpat line in Setup.dist and compiling. The issue is with -DXML_POOR_ENTROPY=1. The equals character causes the line to be incorrectly interpreted

[issue35184] Makefile is not correctly generated when compiling pyextat with DXML_POOR_ENTROPY=1

2019-04-21 Thread Aaron Hurst
Aaron Hurst added the comment: I can reproduce this issue by uncommenting the pyexpat line in Setup.dist and compiling. The issue is with -DXML_POOR_ENTROPY=1. The equals character causes the line to be incorrectly interpreted as a macro definition by makesetup. This results

[issue35184] Makefile is not correctly generated when compiling pyextat with DXML_POOR_ENTROPY=1

2019-04-21 Thread Aaron Hurst
Change by Aaron Hurst : -- keywords: +patch pull_requests: +12827 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue35184> ___ ___ Py

[issue36551] Optimize list comprehensions with preallocate size and protect against overflow

2019-04-07 Thread Aaron Hall
Change by Aaron Hall : -- nosy: +Aaron Hall ___ Python tracker <https://bugs.python.org/issue36551> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35625] Comprehension doc doesn't mention buggy class scope behavior

2019-04-03 Thread Aaron Hall
Change by Aaron Hall : -- nosy: +Aaron Hall ___ Python tracker <https://bugs.python.org/issue35625> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue31753] Unnecessary closure in ast.literal_eval

2019-03-20 Thread Aaron Hall
Aaron Hall added the comment: No need to keep this open, I agree with the core developers this shouldn't be changed. -- status: open -> closed ___ Python tracker <https://bugs.python.org/issu

[issue26103] Contradiction in definition of "data descriptor" between (dotted lookup behavior/datamodel documentation) and (inspect lib/descriptor how-to)

2019-03-20 Thread Aaron Hall
Change by Aaron Hall : -- stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue26103> ___ ___ Pyth

[issue36370] "Fatal Python error: Cannot recover from stack overflow" from SymPy tests

2019-03-19 Thread Aaron Meurer
New submission from Aaron Meurer : I am getting a Fatal Python error: Cannot recover from stack overflow. running the SymPy tests on a branch of mine where the tests fail. I have reproduced this in Python 3.6.7, as well as CPython master (fc96e5474a7bda1c5dec66420e4467fc9f7ca968). Here

[issue16482] pdb.set_trace() clobbering traceback on error

2018-12-04 Thread Aaron Meurer
Aaron Meurer added the comment: You can download the branch for a pull request even if the repo is deleted using this https://stackoverflow.com/a/28622034/161801. That will let you keep the original commits intact. -- nosy: +asmeurer ___ Python

[issue33899] Tokenize module does not mirror "end-of-input" is newline behavior

2018-11-21 Thread Aaron Meurer
Aaron Meurer added the comment: Is it expected behavior that comments produce NEWLINE if they don't have a newline and don't produce NEWLINE if they do (that is, '# comment' produces NEWLINE but '# comment\n' does not)? -- nosy: +asmeurer

[issue35059] Convert Py_INCREF() and PyObject_INIT() to inlined functions

2018-10-24 Thread Aaron Hall
Change by Aaron Hall : -- nosy: +Aaron Hall ___ Python tracker <https://bugs.python.org/issue35059> ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2018-06-14 Thread Aaron Meurer
Aaron Meurer added the comment: I see. I haven't dug much into the argoarse source, so I don't have a good feel for how feasible such a tool would be to write. Such refactoring would also be useful for generating HTML or RST for the help. I've previously used help2man and man2html

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

2018-06-14 Thread Aaron Meurer
Aaron Meurer added the comment: Couldn't such a tool exist outside the standard library. I'm thinking a function that you would import and wrap the parser object, similar to how argcomplete works (https://argcomplete.readthedocs.io/en/latest/index.html). The downside is that developers

[issue24622] tokenize.py: missing EXACT_TOKEN_TYPES

2018-06-06 Thread Aaron Meurer
Aaron Meurer added the comment: I would suggest adding this to the what's new document https://docs.python.org/3.7/whatsnew/3.7.html. The change affects user-facing code (the exact_type attribute of TokenInfo is OP for ... and -> tokens prior to this patch). I would also point

[issue12154] PyDoc Partial Functions

2018-05-28 Thread Aaron Hall
Aaron Hall added the comment: Should pydoc treat a partial object like a function? Should a partial be an instance of a function? Should we be able to add all the nice things that functions have to it? If we want that, should we simply instantiate a function the normal way, with a new

[issue30129] functools.partialmethod should look more like what it's impersonating.

2018-05-28 Thread Aaron Hall
Change by Aaron Hall : -- nosy: +Aaron Hall ___ Python tracker <https://bugs.python.org/issue30129> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue32400] inspect.isdatadescriptor false negative

2018-05-22 Thread Aaron Hall
Change by Aaron Hall <aaronch...@yahoo.com>: -- nosy: +Aaron Hall ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue32400> ___ _

[issue25457] json dump fails for mixed-type keys when sort_keys is specified

2018-05-21 Thread Aaron Hall
Aaron Hall <aaronch...@yahoo.com> added the comment: >From a design standpoint, I'm fairly certain the sort_keys argument was >created due to Python's dicts being arbitrarily ordered. Coercing to strings before sorting is unsatisfactory because, e.g. numbers sort lexicographic

[issue25457] json dump fails for mixed-type keys when sort_keys is specified

2018-05-20 Thread Aaron Hall
Aaron Hall <aaronch...@yahoo.com> added the comment: Now that dicts are sortable, does that make the sort_keys argument redundant? Should this bug be changed to "won't fix"? ------ nosy: +Aaron Hall ___ Python tracker <rep...@bugs

[issue33498] pathlib.Path wants an rmtree method

2018-05-15 Thread Aaron Hall
Aaron Hall <aaronch...@yahoo.com> added the comment: > What is wrong with just using shutil.rmtree()? 0. It's awkward to import just for demonstrations. 1. It's harder for new pythonists to discover. 2. A method provides discoverability in an object's namespace. 3. rmtree is a method

[issue33498] pathlib.Path wants an rmtree method

2018-05-14 Thread Aaron Hall
New submission from Aaron Hall <aaronch...@yahoo.com>: pathlib.Path wants the rmtree method from shutil I think we need this method for a couple of reasons. 1. in shell, rm has the -r flag - In Python, we use shutil.rmtree as a best practice for this. 2. I prefer to teach my students

[issue11594] 2to3 does not preserve line endings

2018-04-15 Thread Aaron Ang
Aaron Ang <awz@gmail.com> added the comment: @Jason R. Coombs You are right. I managed to reproduce the problem with a test. It only occurs when a fix is applied. Also, I figured out that the refactoring reads in the file using `open(file, 'r')`, which basically transforms al

[issue11594] 2to3 does not preserve line endings

2018-04-15 Thread Aaron Ang
Change by Aaron Ang <awz@gmail.com>: -- keywords: +patch pull_requests: +6181 stage: test needed -> patch review ___ Python tracker <rep...@bugs.python.org> <https://bugs.pyt

[issue11594] 2to3 does not preserve line endings

2018-04-15 Thread Aaron Ang
Aaron Ang <awz@gmail.com> added the comment: I couldn't reproduce this issue. I tried reproducing this problem by extending the TestRefactoringTool class and creating two files: one file with LF line-endings and one file with CRLF line-endings. The changes that I made can be foun

[issue31201] make test: module test that failed doesn't exist

2018-04-08 Thread Aaron Ang
Change by Aaron Ang <awz@gmail.com>: -- keywords: +patch pull_requests: +6119 stage: needs patch -> patch review ___ Python tracker <rep...@bugs.python.org> <https://bugs.pyt

[issue28677] difficult to parse sentence structure in "When an instance attribute is referenced that isn't a data attribute"

2018-03-24 Thread Aaron Ang
Change by Aaron Ang <awz@gmail.com>: -- keywords: +patch pull_requests: +5952 stage: needs patch -> patch review ___ Python tracker <rep...@bugs.python.org> <https://bugs.pyt

[issue32958] socket module calls with long host names can fail with idna codec error

2018-03-02 Thread Aaron Black
Aaron Black <aaron.bl...@jpl.nasa.gov> added the comment: Just to be clear, I don't know if the socket needs to support 64 character long host name sections, so here's an example url that is at the root of my problem that I'm pretty sure it should support: >>> impo

[issue32977] added acts_like decorator to dataclasses module

2018-03-01 Thread Aaron Christianson
New submission from Aaron Christianson <ninjaa...@gmail.com>: I'm always writting these wrapper classes where I want to selectively want to expose the interface of some of the methods of certain attributes to co the containing object. This can mean I spend a lot of time implementing w

[issue32958] Urllib proxy_bypass crashes for urls containing long basic auth strings

2018-02-26 Thread Aaron Black
New submission from Aaron Black <aaron.bl...@jpl.nasa.gov>: While working on a custom conda channel with authentication, I ran into the following UnicodeError: Traceback (most recent call last): File "/Users/ablack/miniconda3/lib/python3.6/site-packages/conda/core/repodata.py&

[issue32300] print(os.environ.keys()) should only print the keys

2017-12-14 Thread Aaron Meurer
Aaron Meurer <asmeu...@gmail.com> added the comment: Can't third party code write their own proxies? Why do we have to do that? -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python

[issue32300] print(os.environ.keys()) should only print the keys

2017-12-14 Thread Aaron Meurer
Aaron Meurer <asmeu...@gmail.com> added the comment: Serhiy, isn't option 4? 4. Make KeysView.__repr__ show list(self). Add a custom wrapper for Shelf's KeysView so that it doesn't do this. This seems to be what Victor is suggesting. It makes the most sense to me for the commo

[issue32313] Wrong inspect.getsource for datetime

2017-12-13 Thread Aaron Meurer
New submission from Aaron Meurer <asmeu...@gmail.com>: inspect.getsource(datetime) shows the Python source code for datetime, even when it is the C extension. This is very confusing. I believe it's because _datetime is used to override everything in datetime at the end of the file

[issue32300] print(os.environ.keys()) should only print the keys

2017-12-13 Thread Aaron Meurer
Aaron Meurer <asmeu...@gmail.com> added the comment: So the best fix is to just override keys() in the _Environ class, so that it returns an EnvironKeysView class that overrides __repr__? -- ___ Python tracker <rep...@bugs.python.or

[issue32300] print(os.environ.keys()) should only print the keys

2017-12-13 Thread Aaron Meurer
New submission from Aaron Meurer <asmeu...@gmail.com>: Take the following scenario which happened to me recently. I am trying to debug an issue on Travis CI involving environment variables. Basically, I am not sure if an environment variable is being set correctly. So in my code, I put

[issue24294] DeprecationWarnings should be visible by default in the interactive REPL

2017-11-13 Thread Aaron Meurer
Aaron Meurer <asmeu...@gmail.com> added the comment: If it's of any interest to this discussion, for SymPy (for some time) we have used a custom subclass of DeprecationWarning that we enable by default https://github.com/sympy/sympy/blob/master/sympy/utilities/exceptions.py. I don'

[issue32019] Interactive shell doesn't work with readline bracketed paste

2017-11-13 Thread Aaron Meurer
New submission from Aaron Meurer <asmeu...@gmail.com>: Here are the steps to reproduce this: - Compile and link Python against readline version 7.0 or higher. - Add set enable-bracketed-paste on to your ~/.inputrc - Start python and paste the following two lines. Make sure to use a te

[issue30670] pprint for dict in sorted order or insert order?

2017-11-02 Thread Aaron Hall
Aaron Hall <aaronch...@yahoo.com> added the comment: If/when order is guaranteed (3.7?) we should have a pprint that respects current order, -or- we should get an improved pprint (maybe named pp or print?) that understands mappings and other abstract data types. I had a conversation

[issue31753] Unnecessary closure in ast.literal_eval

2017-10-17 Thread Aaron Hall
Aaron Hall <aaronch...@yahoo.com> added the comment: New information: I think I have pinpointed at least a contributor to the difference - closure lookups seem to be currently slightly slower (by a few percent) than global lookups (see https://stackoverflow.com/a/46798876/541136). And

[issue31753] Unnecessary closure in ast.literal_eval

2017-10-17 Thread Aaron Hall
Aaron Hall <aaronch...@yahoo.com> added the comment: Static analysis: My mental model currently says the rebuilt function every outer call is an expense with no offsetting benefit. It seems that a function shouldn't build a closure on every call if the closure doesn't close over an

[issue31742] Default to emitting FutureWarning for provisional APIs

2017-10-13 Thread Aaron Gallagher
Aaron Gallagher <_...@habnab.it> added the comment: >Storing the marker attribute in __main__ [...] Can I request please not using __main__ for this? setuptools console_scripts are very common, which is a case where __main__ will be a generated (i.e. not user-controllable) fil

[issue31753] Unnecessary closure in ast.literal_eval

2017-10-11 Thread Aaron Hall
Aaron Hall <aaronch...@yahoo.com> added the comment: So... moving the closure (which may be called recursively) to the global scope actually does improve performance (for small cases, about 10% - larger cases amortize the cost of the closure being built, but in a 100 item dictionary,

[issue31753] Unnecessary closure in ast.literal_eval

2017-10-10 Thread Aaron Hall
Aaron Hall <aaronch...@yahoo.com> added the comment: Rejecting and withdrawing with apologies. -- resolution: -> rejected stage: -> resolved status: open -> closed ___ Python tracker <rep...@bugs.python.org> <https://bu

[issue31753] Unnecessary closure in ast.literal_eval

2017-10-10 Thread Aaron Hall
New submission from Aaron Hall <aaronch...@yahoo.com>: Removing the closure seems to make the function about 10% faster. Original source code at: https://github.com/python/cpython/blob/3.6/Lib/ast.py#L40 Empirical evidence: astle.py import timeit from ast import litera

[issue31684] Scientific formatting of decimal 0 different from float 0

2017-10-04 Thread Aaron Meurer
Aaron Meurer <asmeu...@gmail.com> added the comment: I meant that format() destroys information in a decimal in general. Obviously if you have n digits of precision and format with m < n, then you lose information. I also can't help but feel that we're mixing up "traili

[issue31684] Scientific formatting of decimal 0 different from float 0

2017-10-04 Thread Aaron Meurer
Aaron Meurer <asmeu...@gmail.com> added the comment: I guess I would expect that to be captured by the number of zeros printed (and obviously doing a string format operation with a set number of digits destroys that information). -- ___

[issue31684] Scientific formatting of decimal 0 different from float 0

2017-10-03 Thread Aaron Meurer
New submission from Aaron Meurer <asmeu...@gmail.com>: >>> '{:+.19e}'.format(0.) '+0.000e+00' >>> import decimal >>> '{:+.19e}'.format(decimal.Decimal(0)) '+0.000e+19' Note the decimal uses e+19 instead of e+00. Obviously i

  1   2   3   4   >