New submission from Anthony Sottile :
expanding on https://bugs.python.org/issue36983
the docs are also a bit out of date in places
I'm not sure how to document something that appeared in two versions, but I'll
leave that part to review.
Using data generated / collected in
https
Anthony Sottile added the comment:
using the same heuristic as the test uses, here's what's been missing from
__all__ historically
(note: I _manually_ skipped `Final` for 3.5.0-3)
===(3, 5, 0)===
+FrozenSet
+SupportsBytes
Change by Anthony Sottile :
--
keywords: +patch
pull_requests: +13365
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue36983>
___
_
New submission from Anthony Sottile :
notably it is missing ForwardRef, OrderedDict, ChainMap in python3.8
it is missing others in other versions
I'm going to attempt to write a test which should classify things that should
belong there
--
components: Library (Lib)
messages: 342975
Anthony Sottile added the comment:
there's other optional fields in the ast, type ignores don't seem essential to
the `Module`, could those be made optional as well?
--
nosy: +Anthony Sottile
___
Python tracker
<https://bugs.python.org/issue35
Anthony Sottile added the comment:
still not able to answer the why, but at least I can answer the what here:
https://github.com/python/cpython/blob/f665b96e92a6a6943e312e2c606f348db95939ab/Parser/tokenizer.c#L984-L987
cpython adds a newline during tokenization if the file does not end
Change by Anthony Sottile :
--
keywords: +patch
pull_requests: +13312
stage: needs patch -> patch review
___
Python tracker
<https://bugs.python.org/iss
Anthony Sottile added the comment:
> You can not use the same implementation of the visitor for Num, Str,
> NameConstant and Ellipsis, because all these classes use different attribute
> for saving the value
ah yes, this is true -- maybe the better change would be to just add `
Anthony Sottile added the comment:
The simplest case is just the addition of an `isinstance` check:
https://github.com/asottile/dead/blob/85f5edbb84b5e118beab4be3346a630e41418a02/dead.py#L165-L170
class V(ast.NodeVisitor):
def visit_Str(self, node):
...
def visit_Constant
Anthony Sottile added the comment:
spent some more time thinking about this and I think we should strongly
consider reverting. simplification in the core interpreter should not be
weighed lightly against complexity and breaking changes for users.
the change is also unfortunate because
Anthony Sottile added the comment:
There would still be a breakage for that if someone was defining py36+
`visit_Constant` (which would clobber the `ast.NodeVisitor.visit_Constant` if
we were to add it)
--
___
Python tracker
<ht
Anthony Sottile added the comment:
hitting this in https://bugs.python.org/issue36917?
Is the simplification here really worth the breaking change to consumers?
I now have to write something that's essentially this to work around this which
feels more like the complexity has just been
Anthony Sottile added the comment:
wrong bpo, this is the right one: https://bugs.python.org/issue32892
--
___
Python tracker
<https://bugs.python.org/issue36
New submission from Anthony Sottile :
More fallout from the Constant change in https://bugs.python.org/issue32892
minimal reproduction:
import ast
class V(ast.NodeVisitor):
def visit_Str(self, node):
print(node.s)
def main():
V().visit(ast.parse('x = "hi"'))
i
anthony shaw added the comment:
If you can write a test similar to the AnotherLeak.test_callback test case, and
commit that first.
It will show in the CI/CD log as failed and verify the issue (incase it comes
up in PR review)
Then add another commit with the patch itself and we should see
anthony shaw added the comment:
Thanks Eryk that saved a lot of debugging.
dgelessus - if you want to write a patch for CPython am happy to take you
through this and get it over the line.
Else: am Happy to write a test against the gc counter and a patch
anthony shaw added the comment:
In the stack it's calling none_dealloc() which should never happen.
Assume this is being triggered by ctypes PyCFuncPtr_call.
The stacktrace I'm getting comes after the double decref so it's not showing
the root cause. Someone who knows ctypes better might
anthony shaw added the comment:
Full trace for reference:
(lldb) bt all
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
* frame #0: 0x7fff5984f2c6 libsystem_kernel.dylib`__pthread_kill + 10
frame #1: 0x7fff59904bf1 libsystem_pthread.dylib`pthread_kill
anthony shaw added the comment:
>From lldb
(lldb) run ~/cpython/test_gc_ctypes.py
Process 20059 launched: '/Users/anthonyshaw/CLionProjects/cpython/python.exe'
(x86_64)
Fatal Python error: deallocating None
Current thread 0x0001005c85c0 (most recent call first):
File &quo
anthony shaw added the comment:
The documentation says:
>>
Note Make sure you keep references to CFUNCTYPE() objects as long as they are
used from C code. ctypes doesn’t, and if you don’t, they may be garbage
collected, crashing your program when a callback is made.
Also
anthony shaw added the comment:
Thanks, I'll check this out
--
assignee: -> anthonypjshaw
nosy: +anthonypjshaw
___
Python tracker
<https://bugs.python.org/issu
anthony shaw added the comment:
"When the C library is called in ctypes to return the c_char_p type, the
problem that only the string before \0 can be obtained when the string contains
\\0"
This function is specifically for null-terminated strings (\0), please could
you be mor
anthony shaw added the comment:
Closing as duplicate of 36882
--
nosy: +anthonypjshaw
___
Python tracker
<https://bugs.python.org/issue36883>
___
___
Python-bug
Change by anthony shaw :
--
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue36883>
___
___
Python-bugs-list
anthony shaw added the comment:
The existing tests in place add the null-termination bytes in the test string:
def testLinuxAbstractNamespace(self):
address = b"\x00python-test-hello\x00\xff"
with socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) as s1:
Change by anthony shaw :
--
versions: +Python 3.8 -Python 2.7, Python 3.4, Python 3.7
___
Python tracker
<https://bugs.python.org/issue25541>
___
___
Python-bug
anthony shaw added the comment:
thanks, your code example zero-pads the socket address, and looking at the
socketmodule.c code it does some padding under certain circumstances.
https://github.com/python/cpython/blob/master/Modules/socketmodule.c#L1318-L1330
The Unix man page specify the same
Change by anthony shaw :
--
resolution: -> rejected
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Change by anthony shaw :
--
nosy: +anthonypjshaw
___
Python tracker
<https://bugs.python.org/issue35668>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by anthony shaw :
--
assignee: -> anthonypjshaw
nosy: +anthonypjshaw
___
Python tracker
<https://bugs.python.org/issue36500>
___
___
Python-bugs-lis
Change by anthony shaw :
--
assignee: -> anthonypjshaw
nosy: +anthonypjshaw
___
Python tracker
<https://bugs.python.org/issue36551>
___
___
Python-bugs-lis
Change by anthony shaw :
--
assignee: -> anthonypjshaw
nosy: +anthonypjshaw
___
Python tracker
<https://bugs.python.org/issue36552>
___
___
Python-bugs-lis
Change by anthony shaw :
--
nosy: +steve.dower
stage: patch review ->
___
Python tracker
<https://bugs.python.org/issue36862>
___
___
Python-bugs-list mai
Change by anthony shaw :
--
keywords: +patch
pull_requests: +13126
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue36862>
___
___
Py
New submission from anthony shaw :
The PCBuild tool should support VS2019 but default to 2017 as per documentation.
PR to follow.
--
assignee: anthonypjshaw
components: Build
messages: 341963
nosy: anthonypjshaw
priority: normal
severity: normal
status: open
title: Add Visual Studio
anthony shaw added the comment:
thanks, will wait for a review from Serhiy, Rbcollins or ezio
--
___
Python tracker
<https://bugs.python.org/issue24263>
___
___
anthony shaw added the comment:
Hi,
This discussion came to a stop, but it doesn't seem conclusive.
PEP discussions are now in GitHub on https://github.com/python/peps/issues so
I'm going to close this BPO issue.
There is no additional section in PEP 7 for this level of detail
Anthony Sottile added the comment:
seems intentional => closing
--
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Anthony Sottile added the comment:
+vstinner
Hmmm, actually the relevant commit appears to be
6c44fde3e03079e0c69f823dafbe04af50b5bd0d and intentional
(I ran a git bisect to find this!)
https://github.com/python/cpython/pull/12931
Does PEP 3149 require an update with this change, it still
New submission from Anthony Sottile :
This appears to be a regression between 3.8a3 and 3.8a4 -- though it may be
intentional and I'm missing something?
I noticed this while packaging 3.8 for deadsnakes
https://github.com/deadsnakes/python3.8
I've created a minimal reproduction:
$ git
anthony shaw added the comment:
After patch:
Python 3.8.0a3+ (heads/31968-dirty:c664b342a4, May 6 2019, 18:06:21)
[Clang 10.0.1 (clang-1001.0.46.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
anthony shaw added the comment:
Issue is in parse_file_actions
parse_file_actions(PyObject *file_actions,
posix_spawn_file_actions_t *file_actionsp,
PyObject *temp_buffer)
{
PyObject *seq;
PyObject *file_action = NULL;
PyObject *tag_obj
anthony shaw added the comment:
Raised a fix in GH-13144
--
stage: patch review ->
___
Python tracker
<https://bugs.python.org/issue36814>
___
___
Python-
Change by anthony shaw :
--
keywords: +patch
pull_requests: +13057
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue36814>
___
___
Py
anthony shaw added the comment:
Verified on master
Python 3.8.0a3+ (heads/bpo-28367:373c7aa098, May 6 2019, 17:34:39)
[Clang 10.0.1 (clang-1001.0.46.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
anthony shaw added the comment:
Easily reproduced on master, thanks
(lldb) run encode_crash.py
Process 14743 launched: '/Users/anthonyshaw/repo/cpython/python.exe' (x86_64)
Objects/unicodeobject.c:448: _PyUnicode_CheckConsistency: Assertion
"((PyObject*)(op))->ob_type))->tp_fl
anthony shaw added the comment:
This could be a good issue for the PyCon sprints, otherwise I'm happy to
implement it
--
___
Python tracker
<https://bugs.python.org/issue36
New submission from anthony shaw :
I noticed that the termios.c module is largely untested.
There is some coverage via test_pty, test_ioctl and test_getpass, but there is
nothing to cover regression and the behaviours in the module functions.
Tests are required for:
- termios.tcgetattr
anthony shaw added the comment:
Converted the original patch as a PR GH-13142 this seems like a good idea and
an easy change
--
nosy: +anthonypjshaw
___
Python tracker
<https://bugs.python.org/issue28
Change by anthony shaw :
--
pull_requests: +13055
___
Python tracker
<https://bugs.python.org/issue28367>
___
___
Python-bugs-list mailing list
Unsubscribe:
anthony shaw added the comment:
It would be great for this issue to be revisited, there has been some further
interest from users.
--
nosy: +anthonypjshaw
___
Python tracker
<https://bugs.python.org/issue27
anthony shaw added the comment:
Closing as 3rd party feature for setuptools
--
nosy: +anthonypjshaw
resolution: -> third party
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
anthony shaw added the comment:
Hi Nofar are you still interested on working on this request?
--
nosy: +anthonypjshaw
___
Python tracker
<https://bugs.python.org/issue28
anthony shaw added the comment:
Added a PR for the documentation clarification.
--
nosy: +anthonypjshaw
___
Python tracker
<https://bugs.python.org/issue31
Change by anthony shaw :
--
pull_requests: +13053
___
Python tracker
<https://bugs.python.org/issue31968>
___
___
Python-bugs-list mailing list
Unsubscribe:
anthony shaw added the comment:
The code is mostly:
FieldNameIterator * related functions
FormatterIterator * related functions
MarkupIterator * related functions
There are a few other utility methods in there as well
--
___
Python tracker
Change by anthony shaw :
--
nosy: +giampaolo.rodola
___
Python tracker
<https://bugs.python.org/issue34368>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by anthony shaw :
--
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue32971>
___
___
Pyth
Change by anthony shaw :
--
pull_requests: -9605
___
Python tracker
<https://bugs.python.org/issue32971>
___
___
Python-bugs-list mailing list
Unsubscribe:
anthony shaw added the comment:
hi, which version of Python were you using to do this? Please could you provide
the full code snippet to reproduce the issue.
The following example binds to the correct namespace
from socket import *
sock = socket(AF_UNIX, SOCK_STREAM)
sock.bind(&qu
anthony shaw added the comment:
NB: This issue would be good for PyCon sprints
--
nosy: +anthonypjshaw
___
Python tracker
<https://bugs.python.org/issue33
Change by anthony shaw :
--
assignee: docs@python -> Mariatta
nosy: +Mariatta
___
Python tracker
<https://bugs.python.org/issue33971>
___
___
Python-bugs-lis
anthony shaw added the comment:
> The things that are in this file but are unrelated to unicodeobject.c
are the support routines for implementing string.Formatter.
I'm not sure which functions that relates to, if you could let me know I'd be
happy to add those to the
Change by anthony shaw :
--
keywords: +patch
pull_requests: +13050
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue24939>
___
___
Py
anthony shaw added the comment:
Eric, there have been further changes to Objects/stringlib/unicode_format.h
since this original note, I've raised a PR with the intent of your note from
2015.
There also hasn't been any change to the situation, unicode_format.h is only
used
anthony shaw added the comment:
The assertions in the attached test still fail on master (3.8a3), so this still
applies.
Michael, are you able to look at this, the code hasn't changed since the
original PEP417 implementation, which doesn't specify if this behaviour should
be supported
anthony shaw added the comment:
Revisiting this issue as it's still open. The original patch was for 3.3a0,
there have been many changes to both IDLE and the Windows build since,
including the recent IDLE entry point in the new Windows installer.
Steve, Terry, please could you review
anthony shaw added the comment:
This issue was never responded to, are you still having this issue? Which
version of CPython are you using and can you please provide steps to reproduce
the problem.
--
nosy: +anthonypjshaw
___
Python tracker
anthony shaw added the comment:
Hi Peter, this proposal would be easier to review as a GitHub Pull Request.
--
nosy: +anthonypjshaw
___
Python tracker
<https://bugs.python.org/issue28
anthony shaw added the comment:
Submitted PR to add the deprecation warning, since this initial discussion,
some other functions also raise DeprecationWarning's in code.
--
nosy: +anthonypjshaw
___
Python tracker
<https://bugs.python.
Change by anthony shaw :
--
keywords: +patch
pull_requests: +13040
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue34946>
___
___
Py
anthony shaw added the comment:
The discussion on python-ideas has some unresolved questions. Wren, did you get
a definitive answer on this idea?
--
nosy: +anthonypjshaw
___
Python tracker
<https://bugs.python.org/issue31
Change by anthony shaw :
--
nosy: +dstufft, ncoghlan
___
Python tracker
<https://bugs.python.org/issue5243>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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:
this issue would be good for pycon sprints
--
nosy: +Mariatta, anthonypjshaw
___
Python tracker
<https://bugs.python.org/issue26
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
___
Python
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:
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:
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:
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:
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:
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:
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:
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:
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:
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
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:
Reserving this issue (in mentored sprint)
--
nosy: +anthony shaw
___
Python tracker
<https://bugs.python.org/issue36782>
___
___
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 m
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 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 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.5_3.5.7-1
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 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:
> 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:
> 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:
> 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:
> 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
Change by anthony shaw :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
301 - 400 of 734 matches
Mail list logo