Anthony Sottile added the comment:
I agree -- probably safer to not backport to 3.7 in case someone is relying on
this behaviour.
--
___
Python tracker
<https://bugs.python.org/issue16
New submission from Anthony Sottile :
Noticing this in pyflakes
https://github.com/PyCQA/pyflakes/pull/408
--
messages: 333579
nosy: Anthony Sottile
priority: normal
severity: normal
status: open
title: isinstance(ast.Constant(value=True), ast.Num) should be False
versions: Python 3.8
Change by Anthony Sottile :
--
keywords: +patch, patch
pull_requests: +11165, 11166
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issu
Change by Anthony Sottile :
--
keywords: +patch, patch, patch
pull_requests: +11165, 11166, 11167
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issu
Change by Anthony Sottile :
--
keywords: +patch
pull_requests: +11165
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue35733>
___
_
Anthony Sottile added the comment:
yes, please do
--
___
Python tracker
<https://bugs.python.org/issue35507>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Anthony Sottile :
--
nosy: +Anthony Sottile
___
Python tracker
<https://bugs.python.org/issue35766>
___
___
Python-bugs-list mailing list
Unsubscribe:
Anthony Sottile added the comment:
Seems also related to https://bugs.python.org/issue24119
with python2 / python3.5 (hopefully) rapidly falling off in usage I would
assume the specialized treatment of `# type: ...` comments would become less
and less necessary
Though I guess there's
Anthony Sottile added the comment:
Can you provide a reproducer? I'm having difficulty reproducing with this
script:
import argparse
p = argparse.ArgumentParser()
p.add_argument('--foo', nargs=None)
args = p.parse_args()
$ python3.7 --version
Python 3.7.2
$ python3.7 t
Anthony Sottile added the comment:
> You’d be surprised how tenacious old versions are.
heh that's true, at my last job we finally got rid of python2.6 in 2016 :'(
anyway -- I don't mean to discourage this, definitely seems valuable to the
m
New submission from Anthony Sottile :
Unless I'm reading incorrectly:
https://github.com/python/cpython/blob/7a2368063f25746d4008a74aca0dc0b82f86ff7b/Modules/clinic/posixmodule.c.h#L30-L31
https://github.com/python/cpython/blob/7a2368063f25746d4008a74aca0dc0b82f86ff7b/Modules/c
Anthony Sottile added the comment:
looks true for os.chmod as well:
https://github.com/python/cpython/blob/7a2368063f25746d4008a74aca0dc0b82f86ff7b/Modules/clinic/posixmodule.c.h#L327-L328
--
___
Python tracker
<https://bugs.python.org/issue35
Change by Anthony Sottile :
--
keywords: +patch, patch
pull_requests: +11422, 11423
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issu
Change by Anthony Sottile :
--
keywords: +patch
pull_requests: +11422
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue35802>
___
_
New submission from Anthony Sottile :
This appears to be true in 3.6+ -- I'd like to add a test and documentation
ensuring that going forward.
Related: https://github.com/python/typeshed/issues/2749
--
assignee: docs@python
components: Documentation, Tests
messages: 334188
Change by Anthony Sottile :
--
keywords: +patch
pull_requests: +11424
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue35803>
___
_
Change by Anthony Sottile :
--
keywords: +patch, patch, patch
pull_requests: +11424, 11425, 11426
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issu
Change by Anthony Sottile :
--
keywords: +patch, patch
pull_requests: +11424, 11425
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issu
Anthony Sottile added the comment:
yep! did my due diligence there, you can check my work on
https://github.com/python/cpython/pull/11643
all platforms have these functions since `posixmodule.c` is always compiled and
the functions in question are not guarded by preprocessor directives in
New submission from Anthony Sottile :
For instance:
# `a` is an empty directory, a PEP 420 namespace package
>>> import importlib.util
>>> importlib.util.find_spec('a')
ModuleSpec(name='a', loader=None, origin='namespace',
submodule_search
Anthony Sottile added the comment:
Hmmm, it appears this was changed in python3.7 to have `None` for the origin
instead of `'namespace'` -- however the `submodule_search_locations` is still
not indexable:
>>> importlib.util.find_spec('a')
Mod
Change by Anthony Sottile :
--
keywords: +patch, patch, patch
pull_requests: +11529, 11530, 11531
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issu
Change by Anthony Sottile :
--
keywords: +patch
pull_requests: +11529
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue35843>
___
_
Change by Anthony Sottile :
--
keywords: +patch, patch
pull_requests: +11529, 11530
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issu
Anthony Sottile added the comment:
I believe this also closes https://bugs.python.org/issue31940 and
https://bugs.python.org/issue28627
--
nosy: +Anthony Sottile
___
Python tracker
<https://bugs.python.org/issue34
New submission from Anthony Sottile :
doctest `:skipif:` was added in https://github.com/sphinx-doc/sphinx/issues/5273
Used here:
https://github.com/python/cpython/blame/36433221f06d649dbd7e13f5fec948be8ffb90af/Doc/library/turtle.rst#L252-L253
Sphinx minimum version configured here:
https
Change by Anthony Sottile :
--
keywords: +patch
pull_requests: +11917
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue36007>
___
_
New submission from anthony shaw:
This is related to issue26188,
Using await in a simple statement (outside of an async def method) raises
SyntaxError with the unhelpful message "invalid syntax".
It seems obvious once you've read PEP492 in detail, but I think that as more
and
anthony shaw added the comment:
yey! I figured it out!!
--
___
Python tracker
<http://bugs.python.org/issue30029>
___
___
Python-bugs-list mailing list
Unsub
Changes by anthony shaw :
--
pull_requests: +1215
___
Python tracker
<http://bugs.python.org/issue30029>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by anthony shaw :
--
stage: -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue30029>
___
___
Python-bugs-list
New submission from Anthony Tuininga:
Right now there is no documented way to create a datetime instance with a
tzinfo instance. The documented macros all hard code the value Py_None for the
tzinfo parameter. Using the PyObject_Call() method instead of the macro for
creating a datetime
New submission from Anthony Flury:
There is a level of drag and drop support within the tkinter package - namely
the tkinter.dnd module. However there is no documentation at this time about
drag and drop either on docs.python.org or on the tkinter reference manual.
The only documentation
New submission from Anthony Sottile:
Originally seen here: https://github.com/Microsoft/vscode/issues/26227
```
$ LC_ALL=en_US python -c 'import io; io.open("/dev/null")'
Traceback (most recent call last):
File "", line 1, in
LookupError: unknown encoding:
Change by Anthony Sottile :
--
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue35802>
___
___
Pyth
New submission from Anthony Sottile :
Here's the simplest example I could come up with -- hit this while debugging
pytest (which uses attrs which uses similar code to this to make classes)
import pdb; pdb.Pdb(skip=['django.*']).set_trace()
eval(compile("1", &
Change by Anthony Sottile :
--
keywords: +patch
pull_requests: +12088
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue36130>
___
_
Anthony Sottile added the comment:
> contain features we all want to get rid of
I don't think even this is unanimous. Things like registering codecs,
instrumenting coverage in subprocesses, etc. all seem like legitimate uses of
the arbitrary code execution
Anthony Sottile added the comment:
> What I think Anthony is looking for are ways to register “start up functions”
> that get executed automatically when the Python interpreter starts up
yes, this is what I want to still exist :)
my hope is that there's a clear standards-track
Anthony Sottile added the comment:
I don't have time to look through the data today but I wrote a script to
collect the usages of `.pth` from pypi. I realized after I ran it that I
skipped source distributions with `.zip` extension but otherwise it's pretty
complete:
https://
New submission from Anthony Zeeman :
The scrollbars in both tkinter and Tkinter don't have the 'state' option and
cannot be disabled.
--
components: Tkinter
messages: 337041
nosy: azeeman
priority: normal
severity: normal
status: open
title: tkinter scrollbar missing
Anthony Zeeman added the comment:
Cheryl, here is the option listing from the ttk scrollbar configure method:
TTK Scrollbar options: {'command': ('command', 'command', 'Command', '',
'140274415153928offsetChanged'), 'orient
Anthony Zeeman added the comment:
Cheryl, thank you for your help.
On Sunday, March 3, 2019, 7:02:47 p.m. EST, Cheryl Sabella
wrote:
Cheryl Sabella added the comment:
That's because state isn't an option. :-)
I should have included the link to the ttk scrollbar manp
Anthony Sottile added the comment:
I did my best to classify those on pypi that were using `.pth` files. My
initial search had quite a few false positives (and now that I look at it,
completely missed `.zip`-based source distributions so there's likely some
false negatives as well)
H
Anthony Sottile added the comment:
> > There was a single .pth file that I deemed "malicious" since it
completely breaks the `subprocess` module (`subprocess-run`)
>
> It only seems to set an attribute. What's wrong with that? Does the early
import of subprocess
Anthony Sottile added the comment:
> Doesn’t that kind of prove my point? :)
It's not any worse than gevent ~breaking~ monkeypatching almost the entire
standard library. And to be fair to the author, it was created well before
(2013-06-21) python3.5's `run` api existed (2015
Anthony Sottile added the comment:
I think nearly all of the use cases in the packages are valid (except
module-layout) -- or at least if this feature were removed without having a
startup-time site-packages code execution feature there would be no possible
replacement. I'll elabor
Anthony Sottile added the comment:
> What I'm dismissing is that "pip install some-package" can define a global
> startup task for your interpreter. I shouldn't get debugging or code coverage
> enabled every time I run "python" just because I installed
Anthony Sottile added the comment:
>>> I should have to start that package somehow.
>>
>> `pip install` is a pretty good opt-in already imo
>
> Except that it conflates responsibilities. I may not want to opt into
> coverage even being loaded in my application b
New submission from Anthony Sottile :
The current code for `os.path.expanduser` in `ntpath` uses `HOME` in preference
to `USERPROFILE` / `HOMEDRIVE\\HOMEPATH`
I can't find any documentation of `HOME` being relevant on windows (only on
posix). For example, wikipedia only men
Change by Anthony Sottile :
--
keywords: +patch
pull_requests: +12262
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue36264>
___
_
Anthony Sottile added the comment:
> Modifying this value could have a real impact on the rest of the process, so
> we should be very careful to undo it regardless of test result. (Modifying
> HOME is not a as big a deal since, as you point out, it's not "real" ;) )
New submission from anthony shaw :
If for whatever reason, Py_Initialize() has not been run or failed to run, any
call to Py_CompileStringFlags will call PyUnicode_DecodeFSDefault and the
reference to interp will be NULL.
There is currently no null reference check in
anthony shaw added the comment:
This applies to PyUnicode_EncodeFSDefault as well, it has the same issue
--
___
Python tracker
<https://bugs.python.org/issue36
anthony shaw added the comment:
I'm expecting a "this is not a bug, why would the interpreter not be
initialized", but it would be nice to get a friendly error message since this
is a public API.
IF so, am also happy to submit
anthony shaw added the comment:
This is because PyUnicode_DecodeFSDefaultAndSize calls
_PyInterpreterState_GET_UNSAFE(), which already documents the potential NULL
return value.
/* Get the current interpreter state.
The macro is unsafe: it does not check for error and it can return
New submission from anthony shaw :
The f_trace_opcodes flag for sys.settrace in 3.7 are proving tricky.
I must be missing something but it's not clear how it helps in tracing the
opcode about to be executed because it runs before opcode and oparg variables
are set by NEXTOPARG(), s
Change by anthony shaw :
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue36420>
___
___
anthony shaw added the comment:
Took a while, but I worked out a solution:
import sys
import dis
import traceback
import io
def t(frame, event, args):
frame.f_trace_opcodes=True
stack = traceback.extract_stack(frame)
pad = " "*len(stack) + "|"
if event ==
New submission from Anthony Sottile :
While building python 3.5.7 for https://github.com/deadsnakes
../Modules/_pickle.c: In function 'PyMemoTable_Copy':
../Modules/_pickle.c:677:5: error: 'for' loop initial declarations are only
allowed in C99 mode
for (si
Change by Anthony Sottile :
--
keywords: +patch
pull_requests: +12556
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue36478>
___
_
New submission from anthony shaw :
Now that pgen is written in Python, it'd be useful for Windows users to be able
to rebuild grammar and tokens into the parser table.
The current hook (make regen-grammar) is built into the Makefile.
Add support for VS2017+ vcxproj files to call the s
Change by anthony shaw :
--
keywords: +patch
pull_requests: +12583
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue36500>
___
___
Py
Change by anthony shaw :
--
nosy: +brett.cannon, steve.dower
___
Python tracker
<https://bugs.python.org/issue36500>
___
___
Python-bugs-list mailing list
Unsub
anthony shaw added the comment:
Project now also does:
regen-symbol (regenerate Lib/symbol.py)
and regen-keyword (regenerate Lib/keyword.py)
--
___
Python tracker
<https://bugs.python.org/issue36
Change by anthony shaw :
--
nosy: +pablogsal
___
Python tracker
<https://bugs.python.org/issue36500>
___
___
Python-bugs-list mailing list
Unsubscribe:
Anthony Sottile added the comment:
Here's an example in the wild which still reproduces with python3.8a3:
https://github.com/SecureAuthCorp/impacket/blob/194b22ed2fc85c4f241375fb7ebe4e0d89626c8c/impacket/examples/remcomsvc.py#L1669
This was reported as a bug on flake8:
https://gitla
New submission from anthony shaw :
List comprehensions currently create a series of opcodes inside a code object,
the first of which is BUILD_LIST with an oparg of 0, effectively creating a
zero-length list with a preallocated size of 0.
If you're doing a simple list comprehension
Change by anthony shaw :
--
keywords: +patch
pull_requests: +12644
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue36551>
___
___
Py
New submission from anthony shaw :
When calculating length of range() objects that have an r->length >
PY_SIZE_MAX, the underlying PyLong_AsSsize_t() function will raise an
OverflowError:
>>> a = list(range(2**256))
Traceback (most recent call last):
File "",
Change by anthony shaw :
--
keywords: +patch
pull_requests: +12646
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue36552>
___
___
Py
Change by anthony shaw :
--
type: -> enhancement
___
Python tracker
<https://bugs.python.org/issue36551>
___
___
Python-bugs-list mailing list
Unsubscrib
anthony shaw added the comment:
The opcode would not solely apply to this specific use case.
I could seek another way of implementing the same behaviour without an
additional opcode?
--
___
Python tracker
<https://bugs.python.org/issue36
Change by anthony shaw :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
anthony shaw added the comment:
> How about converting `[x for x in it]` to `[*it]` in AST?
I should have been more explicit, this patch improves the performance of all
list comprehensions that don’t have an if clause.
Not just
[x for x in y]
but:
d = {} # some sort of dictionary
[f
anthony shaw added the comment:
> This might cause a MemoryError when the __length_hint__ of the source returns
> a too large value, even when the actual size of the comprehension is smaller,
> e.g.:
The current implementation of list comprehensions raise neither a memoryerror
or
anthony shaw added the comment:
> This patch makes it slow for small iterators
That is a one-off cost for the __length_hint__ of the range object specifically.
Objects with a known length (lists, sets, tuples) would not have that overhead.
I can run a more useful set of benchmarks agai
anthony shaw added the comment:
> In such case, current behavior works. And your patch will raise
> OverflowError.
Try
[x for x in range(2**1000)]
in a REPL. It doesn’t raise anything, it tries to create a list that will
eventually exceed PY_SIZE_MAX, but it only crashes once it r
anthony shaw added the comment:
> If your patch uses __length_hint__, it is bug.
iterator will return 2**1000 for __length_hint__, but produce no item
on iteration.
It raises an OverflowError because of the goto
https://github.com/python/cpython/pull/12718/files#d
anthony shaw added the comment:
> If your patch uses __length_hint__, it is bug.
I’m not sure I understand this comment,
PEP424 says “This is useful for presizing containers when building from an
iterable.“
This patch uses __length_hint__ to presize the list container for a l
Anthony Sottile added the comment:
It's a rather oldish gcc in this case. (4.8.4 + whatever ubuntu patches).
Here's a full (successful) build log (including the combinations of flags)
after patching:
https://launchpadlibrarian.net/416985438/buildlog_ubuntu-trusty-amd64.python3
anthony shaw added the comment:
Have just optimized some of the code and pushed another change as 69dce1c552.
ran both master and 69dce1c552 using pyperformance with PGO:
➜ ~ python3.8 -m perf compare_to master.json 69dce1c552.json --table
anthony shaw added the comment:
>I am -1 for this optimization because it affects only one particular case
>(neither other kinds of comprehensions, nor generator expressions, nor list
>comprehensions with
conditions) and even in this case it is small. It is possible to add a lot
Anthony Sottile added the comment:
Should this also produce warnings for `list` / `dict` / `set` literals?
```
$ python3.8
Python 3.8.0a3 (default, Mar 27 2019, 03:46:44)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more
anthony shaw added the comment:
Reserving this issue (in mentored sprint)
--
nosy: +anthony shaw
___
Python tracker
<https://bugs.python.org/issue36782>
___
___
Change by anthony shaw :
--
nosy: +edison.abahurire
___
Python tracker
<https://bugs.python.org/issue36782>
___
___
Python-bugs-list mailing list
Unsubscribe:
anthony shaw added the comment:
stackdepth_walk no longer exists in Python 3, this is a 2.7 specific issue.
opcode_stack_effect in compile.c will have the expected stack effect. If there
is a mismatch between the Opcodes compiled with the distribution and the ones
in the compile.c
anthony shaw added the comment:
I agree with Jerome, that handling recursion errors is a part of a 3rd party
package and not a bug with CPython.
--
nosy: +anthony shaw
___
Python tracker
<https://bugs.python.org/issue34
anthony shaw added the comment:
Please review the PR again, some of the code no longer applies as it targets
master and the PR is quite old.
--
nosy: +anthony shaw
___
Python tracker
<https://bugs.python.org/issue31
anthony shaw added the comment:
PR GH-5062 is still open in GitHub, is this PR still required?
--
nosy: +anthony shaw
___
Python tracker
<https://bugs.python.org/issue32
anthony shaw added the comment:
This issue has been open for some time and the PR references an upstream branch
that no longer exists.
Can this request be closed, or has the conversation yet to be resolved?
--
nosy: +anthony shaw
___
Python
anthony shaw added the comment:
This discussion is inconclusive and targets an old version of CPython, can this
issue be closed?
--
nosy: +anthony shaw
___
Python tracker
<https://bugs.python.org/issue15
anthony shaw added the comment:
Closing issue, PR branch has since been removed and targets Python 3.4
--
nosy: +anthonypjshaw
resolution: -> out of date
stage: test needed -> resolved
status: open -> closed
___
Python tracke
anthony shaw added the comment:
The original PR refers to a branch that no longer exists, but the behaviour
documented still applies to master. There were some changes to the test loader,
but none that fixed this issue.
--
nosy: +anthonypjshaw
anthony shaw added the comment:
There is not enough information to triage this issue and since the last request
there has been no reply. Closing issue.
--
nosy: +anthonypjshaw
stage: -> resolved
status: open -> closed
___
Python tracker
anthony shaw added the comment:
I believe the issue is caused by the issue referenced in the last comment.
Closing issue
--
nosy: +anthonypjshaw
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracke
anthony shaw added the comment:
This issue has been open for some time, looking at the install_lib in master,
there have been no changes to call 'build_clib' so the issue documented here
would still apply.
--
nosy: +anthonypjshaw
anthony shaw added the comment:
this issue would be good for pycon sprints
--
nosy: +Mariatta, anthonypjshaw
___
Python tracker
<https://bugs.python.org/issue26
Change by anthony shaw :
--
assignee: docs@python -> Mariatta
___
Python tracker
<https://bugs.python.org/issue26303>
___
___
Python-bugs-list mailing list
Un
anthony shaw added the comment:
Francisco, I recommend converting the patch into a GitHub pull request to make
it easier to code review.
Mark, Raymond, please could you re-review this patch.
--
nosy: +anthonypjshaw, rhettinger
___
Python tracker
401 - 500 of 738 matches
Mail list logo