Changes by Eric V. Smith :
--
assignee: -> eric.smith
___
Python tracker
<http://bugs.python.org/issue23193>
___
___
Python-bugs-list mailing list
Unsubscrib
Eric V. Smith added the comment:
Ignore my review comment on pwd and grp being None. I see that there is a test
for it (at least grp), and they're not available on Windows.
--
___
Python tracker
<http://bugs.python.org/is
Eric V. Smith added the comment:
The example is correct. If you type it into a python interpreter, you get the
results as shown in the example.
The .replace() method does not modify the string s. It returns the new value.
In the example, the new value is displayed, but is not assigned back to
Eric V. Smith added the comment:
Was this file generated by CPython from a .py file? If so, can you share the
.py file?
If not, how was this file generated? As eryksun says, it appears to not be a
valid .pyc file.
--
nosy: +eric.smith
___
Python
Eric V. Smith added the comment:
What's the typo? I'm not seeing it.
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.org/issue23294>
___
___
Eric V. Smith added the comment:
No problem! Thanks for looking at the documentation with an inquisitive eye.
--
stage: -> resolved
___
Python tracker
<http://bugs.python.org/issu
Eric V. Smith added the comment:
flags is supposed to be a string. This is not well documented, like much of the
module.
Try:
flags = r'(\Answered \Seen)'
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.o
Changes by Eric V. Smith :
--
stage: test needed -> patch review
___
Python tracker
<http://bugs.python.org/issue23193>
___
___
Python-bugs-list mailing list
Un
Eric V. Smith added the comment:
I agree with David that this isn't the right venue.
That said, the likely problem is that Python's main() is written in C, not C++,
so some needed runtime support for exceptions is not getting initialized.
--
nosy: +eric.smith
resolution: -&
Eric V. Smith added the comment:
pysnmp is not part of the Python standard library. It looks like you should
report issues or search for help at at pysnmp.sourceforge.net.
--
components: -Build
nosy: +eric.smith
resolution: -> third party
stage: -> resolved
status: open -&g
Eric V. Smith added the comment:
Your question is not appropriate here, and you're unlikely to get an answer.
This tracker is for bugs in python and its standard library. It is not for
asking for help with third party packages. See my other comment for a pointer
to an appropriate venu
Changes by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.org/issue23389>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric V. Smith added the comment:
Can you post a code snippet that used to work, but now does not?
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.org/issue23
Eric V. Smith added the comment:
As David says, the change from:
ValueError: Unknown format code 'f' for object of type 'str'
to:
TypeError: non-empty format string passed to object.__format__
is quite intentional.
Let me address the differences between %-formatting
Changes by Eric V. Smith :
--
resolution: -> not a bug
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue23479>
___
___
Python-bugs-
Eric V. Smith added the comment:
And I just double checked: the entirety of the sentence you quoted is:
The precision is a decimal number indicating how many digits should be
displayed after the decimal point for a floating point value formatted with 'f'
and 'F', or
Eric V. Smith added the comment:
As a rule, we don't put in checks like this. There are an untold number of
places where such checks could be added. I suspect the new typing module will
be a better way to catch these types of errors.
Does the problem not occur with 3.5?
--
Eric V. Smith added the comment:
It's trying to say that "i" is optional, as stated in the footnote. I agree it
would be better written as "s.pop(i)", since square brackets are otherwise used
in that section as indexing operators. But the footnote should stay, explai
Changes by Eric V. Smith :
--
versions: -Python 3.2, Python 3.3
___
Python tracker
<http://bugs.python.org/issue24323>
___
___
Python-bugs-list mailing list
Unsub
Eric V. Smith added the comment:
s.pop(i=-1) doesn't actually work, but I guess it gets the point across.
For 2.7 it's even more confusing, since it includes:
s.index(x[, i[, j]])
and
s.sort([cmp[, key[, reverse]]])
I'd suggest not changi
Eric V. Smith added the comment:
I don't feel particularly strongly about it. It's mildly more confusing in the
3.x docs than 2.7 because it's the only use in that section of an optional
argument.
I disagree that s.pop(i) is wrong, since it agrees with the "Results"
New submission from Eric V. Smith:
The documentation for ssl.wrap_socket()'s ssl_version parameter says
"ssl_version={see docs}". But as far as I can tell, there's no reason not to
document it as PROTOCOL_SSLv23, since that's what it actually is in the code.
My use c
Eric V. Smith added the comment:
It occurs to me that None would also be a fine default, and probably the
smarter choice.
Then wrap_socket could say:
if ssl_version is None:
ssl_version = PROTOCOL_SSLv23
And we could change the default as needed, without being held to the actual
value. And
Eric V. Smith added the comment:
I have a requirement to support 2.7.5, so SSLContext is currently a problem for
me.
I realize that 2.7 could at best get a documentation change.
--
___
Python tracker
<http://bugs.python.org/issue24
Eric V. Smith added the comment:
What are the use cases where json.loads would be called on the return from
json.loads?
It seems to me a better design would be to wrap such calls with a test, instead
of having json.loads do this test. Hiding it in json.loads would mask other
programming
Eric V. Smith added the comment:
This doesn't appear to be a bug with Python, but rather with CrossCDR.
If you can provide more information (such as a stacktrace, or a reproducible
test using just Python's standard library), then please re-open this issue.
--
nosy: +
Changes by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.org/issue24417>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric V. Smith added the comment:
This is not a problem with python, but rather with how bash interprets your
program arguments. Try putting the arguments in single quotes, like:
python validate_json_adj.py -i '$#@%'
--
nosy: +eric.smith
resolution: -> not a bug
stage:
Eric V. Smith added the comment:
I'd definitely be for mo['col']. I can't say I've ever used len(mo.groups()).
I do have lots of code like:
return mo.group('col'), mo.group('row'), mo.group('foo')
Using groupdict there is doable but not g
Eric V. Smith added the comment:
At least for the files in decimaltestdata, I'd be wary about changing them. My
understanding is that these files are from the IBM decimal test library. I
don't think we should stray from upstream here, even for something as simple as
li
Eric V. Smith added the comment:
So let's say your function would be named "safe_format". Then:
"{1} {0}".safe_format('one')
would give: "{1} one".
Then:
"{1} one".safe_format('two')
would be an error, because there's no
Eric V. Smith added the comment:
strings are unaware of any ANSI escape sequences or other structure that is
being ascribed to their contents.
The '\033' escape character is being counted, as are the rest of the characters
in that string. Since the string is already at least 10
Eric V. Smith added the comment:
I would expect the cgi script to receive the unescaped values. Can you point to
some reference that says otherwise?
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.org/issue24
Eric V. Smith added the comment:
You can use os.path.expanduser(). In general we leave decisions such as
expanding user names and environment variables up to the caller, and we don't
build them in to each function.
Although I'm not sure why you'd want to pass a fu
New submission from Eric V. Smith:
The only call to decode_unicode is this:
if (!*bytesmode && !rawmode) {
return decode_unicode(c, s, len, rawmode, c->c_encoding);
}
So rawmode will always be 0. Removing this will delete a call to
PyUnicode_DecodeRawUnicodeEscape in dec
Eric V. Smith added the comment:
That's poor wording on my part: the call to PyUnicode_DecodeRawUnicodeEscape
isn't actually execute if rawmode is false. So it's really just a dead branch
that's being deleted.
--
___
P
Changes by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.org/issue24802>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.org/issue24803>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Eric V. Smith:
Objects/stringlib/unicode_format.h does not belong in stringlib. Back when it
was originally written for 2.x, it used stringlib to provide the str and
unicode versions of str.format, str.__format__, int.__format__, etc.
However, in 3.x, and especially with
Changes by Eric V. Smith :
--
title: Remove unicode_fornat.h from stringlib -> Remove unicode_format.h from
stringlib
___
Python tracker
<http://bugs.python.org/issu
Eric V. Smith added the comment:
Actually, int.__format__, etc. are not in this file. So that's good.
The things that are in this file but are unrelated to unicodeobject.c are the
support routines for implementing string.Formatter. I think I'll move those
elsewhere, as a
New submission from Eric V. Smith:
See PEP 498.
>>> f'New for Python {sys.version.split()[0]}'
'New for Python 3.6.0a0'
--
assignee: eric.smith
components: Interpreter Core
files: pep-498.diff
keywords: patch
messages: 249362
nosy: eric.smith
priority: n
Eric V. Smith added the comment:
One thing I've done in this implementation is to build up a string to pass to
str.format(), instead of using the original string. This new string uses
positional parameters instead of named parameters.
I had originally proposed to add a string.interpolate
Eric V. Smith added the comment:
Fixed validate_exprs bug.
--
Added file: http://bugs.python.org/file40316/pep-498-1.diff
___
Python tracker
<http://bugs.python.org/issue24
Eric V. Smith added the comment:
Make sure f-strings are identified as literals in error messages.
--
Added file: http://bugs.python.org/file40317/pep-498-2.diff
___
Python tracker
<http://bugs.python.org/issue24
Eric V. Smith added the comment:
With both python 2 and 3, what does "ps -efww | fgrep soffice" produce?
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.o
Eric V. Smith added the comment:
I use smtpd.py for testing my code. But it's not such a big deal that I
couldn't live without it. If I have some time to burn, I might convert it to
asyncio so I can continue to use it.
--
nosy: +
Eric V. Smith added the comment:
Isn't Python-ast.c a generated file?
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.org/issue15989>
___
___
Changes by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.org/issue25008>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Eric V. Smith :
--
assignee: -> eric.smith
___
Python tracker
<http://bugs.python.org/issue25034>
___
___
Python-bugs-list mailing list
Unsubscrib
Changes by Eric V. Smith :
Removed file: http://bugs.python.org/file40316/pep-498-1.diff
___
Python tracker
<http://bugs.python.org/issue24965>
___
___
Python-bugs-list m
Changes by Eric V. Smith :
Removed file: http://bugs.python.org/file40317/pep-498-2.diff
___
Python tracker
<http://bugs.python.org/issue24965>
___
___
Python-bugs-list m
Changes by Eric V. Smith :
Removed file: http://bugs.python.org/file40302/pep-498.diff
___
Python tracker
<http://bugs.python.org/issue24965>
___
___
Python-bugs-list m
Eric V. Smith added the comment:
This implements the accepted PEP 498. The only other real change I plan on
making is to do dynamic memory allocation when building the expressions that
make up a JoinedStr AST node. The code has all of the places to do that already
laid out, it's just a m
Eric V. Smith added the comment:
I discussed it with Guido and added 'F' to the PEP.
--
___
Python tracker
<http://bugs.python.org/issue24965>
___
___
Eric V. Smith added the comment:
+1 on the "by default" change.
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.org/issue25059>
___
___
Eric V. Smith added the comment:
This version does dynamic allocation for the expression list, and fixes some
memory leaks and early decrefs.
I think it's complete, but I'll take some more passes through it checking for
leaks.
--
Changes by Eric V. Smith :
Added file: http://bugs.python.org/file40430/pep-498-4.diff
___
Python tracker
<http://bugs.python.org/issue24965>
___
___
Python-bugs-list m
Eric V. Smith added the comment:
The good news is that the performance is pretty good, and finally I have a case
where I can beat %-formatting:
$ ./python.bat -mtimeit -s 'a=2' "'%s' % a"
100 loops, best of 3: 0.883 usec per loop
$ ./python.bat -mtimeit -s
Eric V. Smith added the comment:
Thanks, Martin. I've posted my replies. I'll add some more tests, and work on
the triple quoted string bug.
--
___
Python tracker
<http://bugs.python.o
Eric V. Smith added the comment:
Thanks again, Martin. I've found 4 bugs so far, based on your suggested tests.
The ones I haven't fixed are: 'fur' strings don't work (something in the
lexer), and triple quoted strings don't work correctly. I'm working on
Eric V. Smith added the comment:
It turns out 'fur' strings aren't a thing, because 'ur' strings aren't.
>From tokenizer.c:
/* ur"" and ru"" are not supported */
And the PEP:
https://www.python.org/dev/peps/pep-0414/#exclusion-of-raw-unic
Eric V. Smith added the comment:
After discussing it with Guido, I've removed the ability to combine 'f' with
'u'.
--
___
Python tracker
<http:
Eric V. Smith added the comment:
Yes, Jelle, you are correct in all 3 cases. Remember that the steps are to
extract the string from the source code, decode backslash escapes, and only
then treat it as an f-string.
For the first case, without the 'f' prefix:
'{ {1: 2\N{RIGHT C
Eric V. Smith added the comment:
This one has been fixed:
>>> f"{'a\\'b'}"
"a'b"
This one was a bug that I previously fixed, that Martin pointed out:
>>> f"{x!s!s}"
File "", line 1
SyntaxError: invalid character fo
Eric V. Smith added the comment:
Agreed on checking the error messages better. Especially since even the
simplest of errors (like leaving out a quote) results in a syntax error in
parsing the string, not parsing inside the f-string.
I'll look at it event
Eric V. Smith added the comment:
This patch fixes triple-quoted strings, plus a few bugs. I'm going to commit it
tomorrow, barring any unforeseen issues.
--
Added file: http://bugs.python.org/file40447/pep-498-5.diff
___
Python tracker
Eric V. Smith added the comment:
I'll probably ensure that all of the parsing errors contain "format string" or
"f-string" or similar. That way the regex check is easier, and the user can
search for it more easily.
It remains to be seen how these are referenced in the
Eric V. Smith added the comment:
Both of those are known (to me!) byproducts of the current implementation. If
my crazy idea of adding opcodes to speed up f-strings flies, then this issue
will go away. I consider this a corner case that doesn't need to be addressed
before committing this
Eric V. Smith added the comment:
On 9/13/2015 12:21 AM, Martin Panter wrote:
>>>> f"{'{'}" # Why is this allowed in an outer format expression--
> '{'
>>>> f"{3:{'{'}>10}" # --but not inside a format specifi
Eric V. Smith added the comment:
I rewrote the format_spec parser to recursively call the f-string parser, so
any oddness in what's allowed in a format_spec is gone.
It took way longer than I thought, but the code is better for it.
--
Added file: http://bugs.python.org/file4048
Eric V. Smith added the comment:
Simplified error handling, fixed 2 memory leaks.
All tests now pass with no leaks.
This should be the final version.
--
Added file: http://bugs.python.org/file40484/pep-498-7.diff
___
Python tracker
<h
Eric V. Smith added the comment:
> Martin Panter added the comment:
>
> Another strange error message (though maybe the new test changes you
> mentioned caught this):
>
>>>> f'{3:{10}' # Actually missing a closing bracket '}'
> File "
Eric V. Smith added the comment:
Hopefully the last version.
--
Added file: http://bugs.python.org/file40495/pep-498-8.diff
___
Python tracker
<http://bugs.python.org/issue24
Eric V. Smith added the comment:
Cleaned up the error handling in fstring_expression_compile so it's easier to
verify and more robust in the face of future changes.
Added a test for an un-doubled '}', which is an error in a top-level literal
(and ends a nested expression). Mo
Eric V. Smith added the comment:
I changed the generated code to call:
format(x [, spec])
instead of:
x.__format__(spec)
The reason is that the correct way to call __format__ is actually:
type(x).__format__(x, spec)
That is, the __format__ lookup is done on the type, not the instance. From
New submission from Eric V. Smith:
Issue 24965 add f-strings (see PEP 498). They need to be documented.
--
assignee: docs@python
components: Documentation
messages: 251101
nosy: docs@python, eric.smith
priority: normal
severity: normal
stage: needs patch
status: open
title: PEP 498 f
Eric V. Smith added the comment:
Documentation task added as issue #25179.
Thanks to Martin for the great code reviews.
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/i
New submission from Eric V. Smith:
test_unparse.py occasionally fails if it picks a module that uses f-strings.
--
assignee: eric.smith
keywords: easy
messages: 251106
nosy: eric.smith
priority: normal
severity: normal
stage: needs patch
status: open
title: Tools/parser/unparse.py needs
Eric V. Smith added the comment:
And it always fails with "-u cpu", which the buildbots use.
--
___
Python tracker
<http://bugs.python.org/issue25180>
___
__
Eric V. Smith added the comment:
This task is actually pretty difficult, and is going to require some major
surgery to unparse.py.
Unfortunately, until it's fixed, you can't use f-strings in the stdlib or in
stdlib tests.
Particularly challenging are nested f-strings like:
f
Eric V. Smith added the comment:
That's awesome, thanks! Definitely simpler than where I was going.
I'm not in front of my dev machine right now, so I can't run it. But if it
works, it works.
I suggest adding the test cases to test_unparse.py's UnparseTestCase. That way
Changes by Eric V. Smith :
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue25180>
___
___
Python-bugs-list
Changes by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.org/issue25092>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Eric V. Smith :
--
resolution: -> fixed
stage: -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue24779>
___
Eric V. Smith added the comment:
Thanks for the feedback.
On the
f"{expr3!s}" → format(str(expr3))
issue, I'm trying to show the 1 argument version of format (which is what the
code generator actually calls). Although I realize that's not a great example,
since the
Changes by Eric V. Smith :
--
resolution: -> fixed
stage: -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue25206>
___
Eric V. Smith added the comment:
The problem is definitely that:
format = PyUnicode_EncodeLocale(format_arg, "surrogateescape");
fails on Windows.
Windows is using strftime, not wcsftime. It's not using wcsftime because of
issue 10653.
If I force Windows to use wcsftime,
New submission from Eric V. Smith:
A group of us (all added as nosy) spent part of the day working on issue 25008
(write an smtpd with asyncio).
We came across some code that contained a copy of StreamReader.readline, but it
used b'\r\n' instead of b'\n' for a line
Eric V. Smith added the comment:
Good point. I quick test of our sample code shows that calling regular readline
to read up to '\n' does in fact work correctly. Let me do some more testing,
then I'll likely close this.
Thanks!
--
___
Eric V. Smith added the comment:
I'm closing this as unneeded.
--
resolution: -> rejected
stage: -> resolved
___
Python tracker
<http://bugs.python.
Eric V. Smith added the comment:
Fixed in 3.4, 3.5, and 3.6. Thanks for the bug report and patch! I added you to
the Misc/ACKS file.
--
resolution: -> fixed
stage: -> resolved
status: open -> closed
versions: +Python 3.6
___
Python track
Changes by Eric V. Smith :
--
status: open -> pending
___
Python tracker
<http://bugs.python.org/issue25278>
___
___
Python-bugs-list mailing list
Unsubscrib
Eric V. Smith added the comment:
>From the info in issue 25279, I'd say it's an error in your code.
But to make sure it's not an error in the stdlib, can you show us your code?
Without that, it's not possible to diagnose this any further.
--
nosy: +eric.smith
Eric V. Smith added the comment:
You'll need to reproduce this in a smaller piece of code that demonstrates the
problem. The code you've included is very large, and imports libraries we don't
have access to.
Otherwise, we can't reproduce
Eric V. Smith added the comment:
Thanks for noticing tokenize.py. And thanks for the kind note!
--
assignee: -> eric.smith
___
Python tracker
<http://bugs.python.org/issu
Eric V. Smith added the comment:
+1
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.org/issue25317>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric V. Smith added the comment:
This is not a bug. See: https://docs.python.org/3.5/tutorial/floatingpoint.html
--
nosy: +eric.smith
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<http://bug
Eric V. Smith added the comment:
Yes, both 'fr' and 'rf' need to be supported (and all upper/lower variants).
And in the future, maybe 'fb' (and 'rfb', 'bfr', ...).
Unfortunately, the re
Eric V. Smith added the comment:
I think the best way to approach this is to generate (in code) all of the
places where string prefixes appear. There's StringPrefix, endpats,
triple_quotes, and single_quoted.
With the currently valid combinations of f, b, r, and u, I count 24
combina
2401 - 2500 of 2699 matches
Mail list logo