Jelle Zijlstra added the comment:
Thanks! Here are a few more cases I came across with the existing
implementation:
>>> f"{'a\\'b'}"
File "", line 1
SyntaxError: missing '}' in format string expression
I believe this is valid and should produce "a'b&q
Jelle Zijlstra added the comment:
Is this behavior intentional?
>>> str = len
>>> x = 'foo'
>>> f'{x!s}'
'3'
>>> '{!s}'.format(x)
'foo'
Or similarly:
>>> import builtins
>>> del builtins.repr
>>> f'{x!r}'
Traceback (most
Jelle Zijlstra added the comment:
I've started working on implementing this feature in Cython and I'd like to
confirm a few edge cases:
- f'{ {1: 2\N{RIGHT CURLY BRACKET}[1]}' == '2' (string escape rules work even
within the expressions)
- f'{ '''foo''' }' is a syntax error
- f'{ ""
Changes by Jelle Zijlstra <jelle.zijls...@gmail.com>:
--
nosy: +Jelle Zijlstra
status: pending -> open
___
Python tracker <rep...@bugs.python.org>
<http://bugs.pyt
Jelle Zijlstra added the comment:
One more:
- lib/pkgutil.py in _import_imp (amusingly) uses importlib with silenced
warnings to import imp.
--
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
Jelle Zijlstra added the comment:
Since this only comes up with manually created functions (through calling
types.FunctionType), I think it wouldn't be unreasonable to just not handle
this case in the inspect module and close this as wontfix.
Ned, is there a use case for converting
Changes by Jelle Zijlstra <jelle.zijls...@gmail.com>:
--
keywords: +patch
Added file: http://bugs.python.org/file43113/issue25160-2to3.patch
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python
Jelle Zijlstra added the comment:
I couldn't find references in the docs to clarify what version of 3.x 2to3
targets, but it seems reasonable to me that it produces code targeted to the
version of CPython it was bundled with. imp is deprecated and presumably will
be removed later in 3.x, so
Jelle Zijlstra added the comment:
Attached patch fixes the undefined variable and adds additional tests.
--
Added file: http://bugs.python.org/file43201/issue27182-path_type.patch
___
Python tracker <rep...@bugs.python.org>
<http://bugs.p
Jelle Zijlstra added the comment:
Thanks for reviewing. This patch adds tests with a bytes DirEntry.
--
Added file: http://bugs.python.org/file43205/issue27186-DirEntry-fspath.patch
___
Python tracker <rep...@bugs.python.org>
<http://bugs.p
Jelle Zijlstra added the comment:
Sounds like this can be closed?
--
nosy: +Jelle Zijlstra
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
Jelle Zijlstra added the comment:
This patch adds support for fspath to a number of functions in the os module by
augmenting the path_t argument converter.
The tests only cover a subset of the functions that use path_t, because some
(e.g., unlink) have destructive side effects
Jelle Zijlstra added the comment:
Thanks for your comments. Added a patch addressing your comments.
--
Added file: http://bugs.python.org/file43202/issue21916-cr2.patch
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
Jelle Zijlstra added the comment:
I think the patch needs more tests, including:
- Comparing a partial against some other objects
- Comparing two partials with a different function
- Comparing two partials with different args
You also need to check each call to PyObject_RichCompareBool
Jelle Zijlstra added the comment:
Thanks for merging it in. I'll add the additional tests.
--
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
Jelle Zijlstra added the comment:
If we do that, then os.* functions that accept fds would also work on objects
whose __fspath__ method returns an integer. I don't think that is desirable (I
was just writing a test to ensure that fspath returning an integer throws an
error
Jelle Zijlstra added the comment:
This patch exposes the bytecode as a __code__ attribute on pattern objects as a
Unicode string (consistent with the internal representation as Py_UCS4
instances).
--
keywords: +patch
nosy: +Jelle Zijlstra
Added file: http://bugs.python.org/file43218
Jelle Zijlstra added the comment:
In the patch that was just committed, the path_type variables are undefined
(os.py lines 892 and 908). There is also no test for these error cases—we
should test the cases where the path has no __fspath__ or does not return a
bytes or str
Jelle Zijlstra added the comment:
Sure, I'll do that too. Now that os.PathLike and PyOS_FSPath exist, it should
also be possible to add support to os.path.
--
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
Changes by Jelle Zijlstra <jelle.zijls...@gmail.com>:
Added file: http://bugs.python.org/file43219/issue26336.patch
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python
Changes by Jelle Zijlstra <jelle.zijls...@gmail.com>:
Removed file: http://bugs.python.org/file43218/issue26336.patch
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python
Changes by Jelle Zijlstra <jelle.zijls...@gmail.com>:
--
assignee: -> Jelle Zijlstra
___
Python tracker <rep...@bugs.python.org>
<http://bugs.pyt
Jelle Zijlstra added the comment:
Patch tests constructor, repr, equality checks, and pickling on Vec2D.
--
Added file: http://bugs.python.org/file43216/issue21916-more.patch
___
Python tracker <rep...@bugs.python.org>
<http://bugs.p
Changes by Jelle Zijlstra <jelle.zijls...@gmail.com>:
--
keywords: +patch
Added file: http://bugs.python.org/file43217/issue27219.patch
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python
Jelle Zijlstra added the comment:
This new patch makes the inspect module treat .0-type names as positional-only
and renames them to implicit0. Includes a documentation patch too.
I'm not too happy with the wording in the documentation, so suggestions for
better naming are appreciated
Changes by Jelle Zijlstra <jelle.zijls...@gmail.com>:
Added file: http://bugs.python.org/file43128/issue27186-DirEntry-fspath.patch
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python
Jelle Zijlstra added the comment:
Unless I'm missing something, StringIO doesn't exist as a module in Python 3,
as mentioned in
https://docs.python.org/3.0/whatsnew/3.0.html#text-vs-data-instead-of-unicode-vs-8-bit.
If you're trying to unpickle in 3.x an object pickled by 2.7.x, I'm not sure
Jelle Zijlstra added the comment:
This patch adds the C implementation (copied from the PEP).
Some notes:
- I added a new .h file in Include/ because there didn't seem to be an obvious
existing place to put it.
- There was some uncertainty about whether we should Py_INCREF the string or
bytes
Changes by Jelle Zijlstra <jelle.zijls...@gmail.com>:
--
keywords: +patch
Added file: http://bugs.python.org/file43130/issue27038.patch
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python
Jelle Zijlstra added the comment:
This patch makes the Python and C versions of open()/io.open() support the
fspath protocol.
--
keywords: +patch
Added file: http://bugs.python.org/file43156/issue27182-open.patch
___
Python tracker <
Jelle Zijlstra added the comment:
FYI, I'm working on a patch for builtins.open to call PyOS_FSPath.
--
nosy: +Jelle Zijlstra
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
Jelle Zijlstra added the comment:
Yes, I realized this patch is wrong: it excludes the 2.7 release notes from all
make steps, not just `make doctest`.
The attached patch reverts the conf.py change and instead uses directives to
skip most doctests in the 2.7 release notes. The other 2.x
Jelle Zijlstra added the comment:
Thanks for the feedback. This patch instead exposes the code as a tuple of
integers named __pattern_code__. "Bytecode" is technically inaccurate since the
code isn't limited to bytes but can contain larger integers.
--
Added
Changes by Jelle Zijlstra <jelle.zijls...@gmail.com>:
Added file: http://bugs.python.org/file43226/issue27202-revised.patch
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python
Jelle Zijlstra added the comment:
Thanks, this patch addresses your comments.
--
Added file: http://bugs.python.org/file43228/issue21916-more-cr.patch
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
Jelle Zijlstra added the comment:
Updated patch attached.
I don't feel strongly about whether this should be in Python, but it seems
potentially useful at least as a tool to learn more about how re is
implemented. If I have time I may write a tool using __pattern_code__ and the
sre_constants
New submission from Jelle Zijlstra:
I'm going to gather together a patch to fix some of these issues.
--
messages: 267166
nosy: Jelle Zijlstra, brett.cannon
priority: normal
severity: normal
status: open
title: make doctest in CPython has failures
Jelle Zijlstra added the comment:
New patch
--
Added file: http://bugs.python.org/file43236/issue27219-cr.patch
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
Jelle Zijlstra added the comment:
The patch is obsolete because PEP 519 ended up going with a different approach.
I submitted a new patch for the path_t converter in issue27186. That patch
probably fits better here, so I'm resubmitting it.
--
nosy: +Jelle Zijlstra
Added file: http
New submission from Jelle Zijlstra:
It should be added to the C API documentation. I plan on getting to this today.
--
assignee: Jelle Zijlstra
components: Documentation
messages: 267433
nosy: Jelle Zijlstra, ethan.furman
priority: normal
severity: normal
status: open
title: Missing
Jelle Zijlstra added the comment:
Yes, this is intentional. It is documented in
https://docs.python.org/3/reference/expressions.html#expression-lists:
"The trailing comma is required only to create a single tuple"
--
nosy: +Jell
Jelle Zijlstra added the comment:
Patch adds concise documentation
--
keywords: +patch
Added file: http://bugs.python.org/file43242/issue27233.patch
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
Changes by Jelle Zijlstra <jelle.zijls...@gmail.com>:
Removed file: http://bugs.python.org/file43243/issue27233.patch
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python
Jelle Zijlstra added the comment:
The docstrings (at least in 3.6) say subclasses must override __new__ *or*
__init__. However, I think this is wrong too. The following is a correct (if
not very useful) implementation of Sequence:
>>> import collections.abc
>>>
New submission from Jelle Zijlstra:
Various functions in posixpath.py need to accept os.PathLike objects. I will
submit a patch.
--
assignee: Jelle Zijlstra
components: Library (Lib)
messages: 267428
nosy: Jelle Zijlstra, ethan.furman
priority: normal
severity: normal
status: open
Jelle Zijlstra added the comment:
I moved my patch for the path_t converter to issue26027, which already covers
posixmodule.c. I'm creating issue27231 to track adding os.fspath() support to
posixpath.py. With that, I think this issue is done.
--
resolution: -> fixed
status: o
Jelle Zijlstra added the comment:
Yes, I don't think we control this, the layout is generated by sphinx.
--
nosy: +Jelle Zijlstra
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
Jelle Zijlstra added the comment:
This patch adds a number of os.fspath calls to the posixpath.py module. I
didn't duplicate all tests to check PathLike objects in addition str/bytes,
because that seemed excessive. Instead I tried to ensure that each function has
at least one test checking
Changes by Jelle Zijlstra <jelle.zijls...@gmail.com>:
Added file: http://bugs.python.org/file43244/issue27221.patch
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python
New submission from Jelle Zijlstra:
The current implementation of os.fspath() outputs something like this if you
call os.fspath(0):
expected str, bytes or os.PathLike object, not
This patch changes the output to:
expected str, bytes or os.PathLike object, not int
--
components
Changes by Jelle Zijlstra <jelle.zijls...@gmail.com>:
Removed file: http://bugs.python.org/file43239/fspath-exception.patch
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python
Changes by Jelle Zijlstra <jelle.zijls...@gmail.com>:
Added file: http://bugs.python.org/file43240/fspath-exception.patch
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python
Jelle Zijlstra added the comment:
Patch attached. I also checked that this case is tested, and it looks like the
Bunch object in Lib/test/_test_multiprocessing.py uses a method as its target.
--
keywords: +patch
nosy: +Jelle Zijlstra
Added file: http://bugs.python.org/file43243
Jelle Zijlstra added the comment:
This looks fixed.
--
nosy: +Jelle Zijlstra
resolution: -> fixed
status: open -> closed
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python
Jelle Zijlstra added the comment:
I think the current documentation is correct and doesn't need changes. There is
also already an example of a working __prepare__ method.
--
nosy: +Jelle Zijlstra
___
Python tracker <rep...@bugs.python.org>
Jelle Zijlstra added the comment:
This patch documents CancelledError in the asyncio documentation.
--
keywords: +patch
nosy: +Jelle Zijlstra
Added file: http://bugs.python.org/file43246/issue26582.patch
___
Python tracker <rep...@bugs.python.
Jelle Zijlstra added the comment:
This came up as part of a static analysis script that compares sets of method
calls, including calls to methods on super(). The check was giving incorrect
results because identical super() objects were comparing as different.
super() is documented (https
Changes by Jelle Zijlstra <jelle.zijls...@gmail.com>:
--
priority: normal -> low
type: -> enhancement
___
Python tracker <rep...@bugs.python.org>
<http://bugs.
Jelle Zijlstra added the comment:
Thanks for the review and comments. This patch addresses your comments and
changes the __file__-related one to catch Exception.
--
Added file: http://bugs.python.org/file43299/issue27238-cr.patch
___
Python tracker
Jelle Zijlstra added the comment:
Here's what I found reviewing what needs to be done here:
- Neil's What's New patch apparently made it into the 3.5 release notes.
- moigagoo's two patches haven't been committed. The text of both looks ok to
me, but the patches don't apply cleanly.
Other
Jelle Zijlstra added the comment:
This updates reference_calls_syntax_update.diff. The previous patch's grammard
had a mistake; it was missing commas between arguments.
I believe all other patches in this diff are now obsolete.
--
Added file: http://bugs.python.org/file43302
Jelle Zijlstra added the comment:
No, that issue just adds the address to the repr() of types. It is not normal
to use repr for type objects in error messages:
>>> int(None)
Traceback (most recent call last):
File "", line 1, in
TypeError: int() argument must be a s
Jelle Zijlstra added the comment:
This patch removes all usages of "except:" in turtle.py. The tests in
test_turtle.py and turtle.rst still work.
--
keywords: +patch
Added file: http://bugs.python.org/file43258/issue27238.patch
___
Pyth
Jelle Zijlstra added the comment:
I wrote the patch assuming that the error messages would be changed in
accordance with issue27232. Let's put this on hold until that is resolved.
--
dependencies: +os.fspath() should not use repr() on error
Changes by Jelle Zijlstra <jelle.zijls...@gmail.com>:
--
resolution: not a bug ->
status: closed -> open
___
Python tracker <rep...@bugs.python.org>
<http://bugs.
Jelle Zijlstra added the comment:
Thanks for the comments here and in Rietveld. This patch adds versionadded and
an extra space.
--
Added file: http://bugs.python.org/file43260/issue27233-cr.patch
___
Python tracker <rep...@bugs.python.org>
Jelle Zijlstra added the comment:
Brett Cannon added documentation for this function in another issue.
--
resolution: -> fixed
status: open -> closed
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python
Jelle Zijlstra added the comment:
This test asserts that indefinite recursion causes a RecursionError, but such
recursion can instead segfault if the amount of stack space available is less
than Python's recursion limit (sys.getrecursionlimit()).
Are you using any unusual settings
New submission from Jelle Zijlstra:
Patch attached. Added testsetup for the shared A variable and skipped doctests
that rely on the return value of id().
--
files: faqdoctests.patch
keywords: patch
messages: 267197
nosy: Jelle Zijlstra
priority: normal
severity: normal
status: open
New submission from Jelle Zijlstra:
Mostly due to unspecified sorting order. The patch sorts a few tests and skips
others that can't easily be sorted (e.g. most_common and str() output).
--
assignee: docs@python
components: Documentation
files: doctests-collections.patch
keywords
New submission from Jelle Zijlstra:
Patch adds an import.
--
assignee: docs@python
components: Documentation
files: doctests-tutorial.patch
keywords: patch
messages: 267202
nosy: Jelle Zijlstra, docs@python
priority: normal
severity: normal
status: open
title: Failing doctests in Doc
New submission from Jelle Zijlstra:
Patch adds some imports, fixes doctests syntax, and skips Py2-only code.
--
files: doctests-howto.patch
keywords: patch
messages: 267198
nosy: Jelle Zijlstra
priority: normal
severity: normal
status: open
title: Failing doctests in Doc/howto/
Added
New submission from Jelle Zijlstra:
The difflib test fails because "False" is close enough to "apple". The ftplib
and nntplib tests rely on things downloaded from the web that are inherently
variable.
--
assignee: docs@python
components: Documentation
files:
Changes by Jelle Zijlstra <jelle.zijls...@gmail.com>:
--
assignee: docs@python
components: Documentation
files: doctests-email.patch
keywords: patch
nosy: Jelle Zijlstra, docs@python
priority: normal
severity: normal
status: open
title: Failing doctests in Library/email.*.rst
ve
Jelle Zijlstra added the comment:
Patch adding @cpython_only decorators to the tests.
--
Added file: http://bugs.python.org/file43172/issue19611-decorators.patch
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
New submission from Jelle Zijlstra:
Updated to the output of current 3.6.
--
assignee: docs@python
components: Documentation
files: doctests-traceback.patch
keywords: patch
messages: 267205
nosy: Jelle Zijlstra, docs@python
priority: normal
severity: normal
status: open
title: Failing
New submission from Jelle Zijlstra:
Running `make doctest` in the Doc/ repository of master fails on the 2.7
release notes. This patch excludes these files from `make doctest`, because it
doesn't seem worth it to try to get these running in Python 3.
--
assignee: docs@python
New submission from Jelle Zijlstra:
Mostly missing imports, some bad syntax, and a few typos. This patch fixes most
but not all errors.
--
assignee: docs@python
components: Documentation
files: doctests-whatsnew-32.patch
keywords: patch
messages: 267203
nosy: Jelle Zijlstra, docs
Jelle Zijlstra added the comment:
Added a number of more specific issues with patches. I'll add more patches
after the current ones are resolved.
--
dependencies: +Failing doctests due to environmental dependencies in
Lib/*lib.rst, Failing doctests in Doc/faq/programming.rst, Failing
Jelle Zijlstra added the comment:
Yes, I've been attempting to get that make to fully succeed.
--
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
Changes by Jelle Zijlstra <jelle.zijls...@gmail.com>:
Removed file: http://bugs.python.org/file43173/faqdoctests.patch
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python
Jelle Zijlstra added the comment:
Thanks for teaching me about `make suspicious`. The attached patch fixes the
issue.
This doesn't fix all failures in the file but it gets us closer.
--
assignee: -> docs@python
components: +Documentation
nosy: +docs@python
versions: +Python 3.6
Ad
Jelle Zijlstra added the comment:
Could you provide a minimal code sample that demonstrates the problem? I'm
having a hard time seeing why the http.client code is buggy.
--
nosy: +Jelle Zijlstra
___
Python tracker <rep...@bugs.python.org>
Jelle Zijlstra added the comment:
Thanks for writing a better patch. The patch looks good to me and it builds
correctly.
--
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
Jelle Zijlstra added the comment:
I'm interested in implementing this for 3.6, but I'm not sure exactly what the
changes are that were decided upon. Is the following accurate?
1. Nothing changes in os (all the necessary changes were made in 3.5.2 already).
2. On Linux 3.17+ only, we add a new
Jelle Zijlstra added the comment:
Thanks for the Rietveld comments. I have attached a new patch.
--
Added file: http://bugs.python.org/file43350/issue27221-cr.patch
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
New submission from Jelle Zijlstra:
But `turtle.pencolor()` returns a tuple of floats, so calling
`turtle.fillcolor(turtle.pencolor())`. This issue shows up in the doctest at
library/turtle.rst line 936. I can submit a patch with tests once the tests in
issue21916 are in.
--
assignee
Jelle Zijlstra added the comment:
This patch removes the unrelated XML changes and addresses most of the code
review comments.
--
nosy: +Jelle Zijlstra
Added file: http://bugs.python.org/file43199/issue21916-cr.patch
___
Python tracker <
Jelle Zijlstra added the comment:
Patch looks good to me
--
nosy: +Jelle Zijlstra
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
Jelle Zijlstra added the comment:
I would consider this a test of the quality of the documentation, not of the
implementation. It's important that the examples in the documentation are
actually correct. For example, a doctest in Doc/library/datetime.rst passes an
"hours=" keywor
New submission from Jelle Zijlstra:
Will add a patch
--
assignee: Jelle Zijlstra
components: Library (Lib)
messages: 267493
nosy: Jelle Zijlstra, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Bare except: usages in turtle.py
versions: Python 3.6
Jelle Zijlstra added the comment:
Yes, you can get at it with ctypes. I released a small (and virtually untested)
library at https://github.com/JelleZijlstra/regdis that provides dis-like
capabilities.
--
___
Python tracker <rep...@bugs.python.
New submission from Jelle Zijlstra:
>>> class Foo: pass
...
>>> super(Foo) == super(Foo)
False
Will submit a patch later
------
assignee: Jelle Zijlstra
components: Library (Lib)
messages: 267747
nosy: Jelle Zijlstra
priority: normal
severity: normal
status: open
title
Jelle Zijlstra added the comment:
The reason for this behavior is that the trace function is called whenever
execution in the bytecode jumps to a new source line. See ceval.c line 4440 or
so:
/* If the last instruction falls at the start of a line or if
it represents a jump
Jelle Zijlstra added the comment:
This doesn't work in Python 3.6 (current dev version) either. Using Ned's
example, I get (snipping some of the ipython stack trace):
/home/jelle/cpython-dev/cpython/Lib/inspect.py in __init__(self, name, kind,
default, annotation)
2399
Jelle Zijlstra added the comment:
Current status:
- 2to3 replaces reload() calls with imp.reload
- Lib/modulefinder.py imports imp and uses it 10 or so times, mostly for
constants
- Lib/xml/sax/__init__.py uses imp on Jython only
- Python/makeopcodetargets.py falls back to imp if importlib
Jelle Zijlstra added the comment:
Thanks for the comment!
It is fragile in the sense that I think there is a good chance that a fix
(which is going to rely on details of generated bytecode) will have bugs and
break someone's working 2.7 code.
The patch's tests have a bug, which I'll fix
Jelle Zijlstra added the comment:
Fixed patch, added documentation
--
Added file: http://bugs.python.org/file43111/issue19611.patch
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
Jelle Zijlstra added the comment:
This also affects co_consts, which includes constants that are no longer used
by the optimized code:
In [8]: def f():
return (1, 2, 3, 4, 5)
...:
In [9]: f.func_code.co_consts
Out[9]: (None, 1, 2, 3, 4, 5, (1, 2, 3, 4, 5))
In [12]: dis.dis(f)
2
Jelle Zijlstra added the comment:
Thanks for committing all of these patches! I have local patches for some more
tests; I'll try to find some time to upload them.
--
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
1 - 100 of 501 matches
Mail list logo