Changes by Eric V. Smith e...@trueblade.com:
--
stage: - resolved
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21979
___
___
Python-bugs-list
Eric V. Smith added the comment:
To be more clear: the parser takes the longest token that could be valid. Since
n can't be part of a hex number, parsing stops there, returning 0xaa as the
first token.
So:
0xaaif 1 else 0
170
hex(0xaaif 1 else 0)
'0xaa
Eric V. Smith added the comment:
Please respond to the other bug. No need to open a new bug when responding to
an existing issue. Thanks.
--
nosy: +eric.smith
resolution: - not a bug
stage: - resolved
status: open - closed
___
Python tracker rep
Eric V. Smith added the comment:
Looks fine to me. Normally I'd define the class being returned before the
function returning it, but it doesn't really make a difference.
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http
Eric V. Smith added the comment:
I agree that Decimal is wrong here. PEP 3101 says the result should include the
trailing '%'.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22090
Changes by Eric V. Smith e...@trueblade.com:
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2
___
___
Python-bugs-list
Eric V. Smith added the comment:
I think this would need to be implemented by adding bytes.__format__. I can't
think of a way to make it work on bytes-like objects in general.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org
Eric V. Smith added the comment:
I'm not particularly wild about the .precision syntax either, but I think the
feature is generally useful.
Adding bytes.__format__ is exactly what special output for bytes _is_, as far
as format() is concerned.
Another option would be to invent a new format
Eric V. Smith added the comment:
Can you explain why you want to subclass them?
--
nosy: +eric.smith
type: - enhancement
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22387
Eric V. Smith added the comment:
Changing to 3.5 only, as this is an API addition so it can only be added there.
I think that raising an exception instead of retuning None for a multicast
address would be a better API.
Any chance you can write some tests?
Thanks!
--
nosy
Eric V. Smith added the comment:
Where did you download the installer from?
How are you running the installer?
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22466
Eric V. Smith added the comment:
Is there some particular problem you're trying to solve, which this would make
easier?
Without a use case, I'm -1.
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22515
Changes by Eric V. Smith e...@trueblade.com:
--
resolution: - not a bug
stage: - resolved
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22532
Eric V. Smith added the comment:
No need to explain it. It sounds like it's not generally useful, so I'm still
-1.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22515
Eric V. Smith added the comment:
Where are you seeing this?
On an Ubuntu 13.10 x86 box, I see:
complex(-0.0)
(-0+0j)
This is with 2.7.5+, 3.3.2+ (from Ubuntu distro), and with 3.5.0a0 and
3.4.2rc1+ built locally.
--
___
Python tracker rep
Eric V. Smith added the comment:
No problem!
For completeness, I also see the correct behavior on cygwin 32-bit 2.7.3 and
3.2.3. I don't have access to a straight Windows version.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org
Changes by Eric V. Smith e...@trueblade.com:
--
nosy: +eric.smith, mark.dickinson
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22546
Eric V. Smith added the comment:
I think this is a result of changing the precision of str() to match repr().
2.7 prints:
'3.14159265359'
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22546
Eric V. Smith added the comment:
You've identified the main problem: would None go first or last? Modify your
key function to make the decision appropriate for you, returning either a very
small or very large value for None, as appropriate.
If you really want to see this behavior changed, you
Changes by Eric V. Smith e...@trueblade.com:
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22557
___
___
Python-bugs-list
Eric V. Smith added the comment:
You might want to check out https://bitbucket.org/ctismer/namelesstuple, which
uses a similar approach.
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22562
Eric V. Smith added the comment:
This is a duplicate of issue 1467929.
--
nosy: +eric.smith
resolution: - duplicate
stage: - resolved
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22597
Eric V. Smith added the comment:
You should discuss this on the python-ideas mailing list. Then if there's
traction there, we'll re-open this issue. Please reference this issue number
when starting the discussion on python-ideas so we can find it later.
--
nosy: +eric.smith
status
Eric V. Smith added the comment:
hash() is not defined to be unique, so you're always going to have collisions.
The behavior of hash() for int that you're seeing is not a bug.
There's some background here:
http://stackoverflow.com/questions/10130454/why-do-1-and-2-both-hash-to-2-in-python
Eric V. Smith added the comment:
I'm not sure this should be documented. It follows from int and bool
equivalence. Plus, I consider it an anti-pattern.
We don't want to document everywhere you can pass a bool where an int is called
for. That's thousands of places.
--
nosy
Changes by Eric V. Smith e...@trueblade.com:
--
stage: - resolved
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23083
___
___
Python-bugs-list
Eric V. Smith added the comment:
This works fine for me, too, using the Windows version of 3.4.2 downloaded from
python.org.
2 questions:
- where did you download Python?
- which shell are you using?
--
nosy: +eric.smith
___
Python tracker rep
Eric V. Smith added the comment:
I'm glad you found it!
--
resolution: fixed - not a bug
stage: - resolved
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23141
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 rep...@bugs.python.org
http://bugs.python.org
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 - closed
type
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 venue
Changes by Eric V. Smith e...@trueblade.com:
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23389
___
___
Python-bugs-list
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 rep...@bugs.python.org
http://bugs.python.org/issue23294
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
Eric V. Smith added the comment:
No problem! Thanks for looking at the documentation with an inquisitive eye.
--
stage: - resolved
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23294
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 and __format__-based
Changes by Eric V. Smith e...@trueblade.com:
--
resolution: - not a bug
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23479
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 rep...@bugs.python.org
http://bugs.python.org/issue23473
Changes by Eric V. Smith e...@trueblade.com:
--
stage: test needed - patch review
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23193
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: - not a bug
Eric V. Smith added the comment:
Good point on contextlib.closing not being needed. I usually use this pattern
on things that aren't files!
On second thought, the with statement will close sys.stdin, so this isn't a
valid pattern here. Sorry for the noise
Eric V. Smith added the comment:
Not that I think it's worth changing for this case, but I find code like this
better written as:
if some_test:
fl = contextlib.closing(open(sys.argv[1]))
else:
fl = sys.stdin
with fl as fl:
do_stuff(fl)
This way you don't need another test
Eric V. Smith added the comment:
I think Michael is asking if the proposed change would ever be accepted. If the
answer is no, not even if you write the tests and update the documentation,
then there's no sense putting the work into this. That seems like a reasonable
question to me.
I think
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 rep...@bugs.python.org
http://bugs.python.org
Changes by Eric V. Smith e...@trueblade.com:
--
assignee: - eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23193
___
___
Python-bugs
Eric V. Smith added the comment:
I don't think we want to encourage the type of coupling that arises from
subclassing, especially when when overriding an undocumented method. I'm +1 on
the change. I'll review the patch. Michael: can you write the tests, and
hopefully docs?
--
stage
Eric V. Smith added the comment:
I agree with David: It's unfortunate, but too late to change.
FWIW, since the goal is to replace just str.center, I'd write this as:
def my_center(s, width):
return format(s, '^' + str(width))
As soon as you're mixing in other formatting, then str.center
Changes by Eric V. Smith e...@trueblade.com:
--
components: +email -Windows
nosy: +barry, r.david.murray
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23727
Eric V. Smith added the comment:
I agree it would be nice to be consistent, and that str.__format__'s approach
is likely the desirable one.
But is it worth the breakage? Surely someone cares about the current behavior.
Does this cause any practical, real-world problem
Eric V. Smith added the comment:
I'm not sure it needs fixing: it follows from the definition of using
Decimal(num) / Decimal(denom). Plus, it's controllable with a decimal context:
from decimal import localcontext
with localcontext() as ctx:
... ctx.prec = 100
... format(F(1, 3), '.30f
Eric V. Smith added the comment:
By using %s, you're asking the formatting code to first convert the parameter
to a string. Then, by using .10, you're asking it to truncate the value.
It's essentially equivalent to:
str(-7.7176718e-05)
'-7.7176718e-05'
str(-7.7176718e-05)[:10]
'-7.7176718
Changes by Eric V. Smith e...@trueblade.com:
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23624
___
___
Python-bugs-list
Changes by Eric V. Smith e...@trueblade.com:
--
stage: - test needed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23779
___
___
Python-bugs-list
Changes by Eric V. Smith e...@trueblade.com:
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23779
___
___
Python-bugs-list
Eric V. Smith added the comment:
I agree this isn't a bug, due to per-drive current directories on Windows.
--
nosy: +eric.smith
resolution: - not a bug
stage: - resolved
status: open - closed
___
Python tracker rep...@bugs.python.org
http
Eric V. Smith added the comment:
I added numeric_owner to the self.chown() call when adding directories. I'm
reasonably sure this is correct.
I added tests for dirs, although they need some cleaning up to be simpler and
cleaner. I'll do that cleanup shortly, but I want to check this in before
Eric V. Smith added the comment:
Other than Misc/NEWS, I think this is the final version of this patch.
--
Added file:
http://bugs.python.org/file38981/tarfile-numeric-owner-with-tests-3.diff
___
Python tracker rep...@bugs.python.org
http
Eric V. Smith added the comment:
As this is an enhancement request, I've changed the versions.
I'm opposed to this change. If I pass an encoding along with a type for which
it makes no sense, I'd prefer an error instead of silently ignoring the
encoding.
I think your helper function
Eric V. Smith added the comment:
I agree with deprecating (in the documentation) but never removing the encoding
argument to str() in Python 3. .decode() is the better way to convert a
bytes-like object to a str.
Every change proposed here would be an enhancement in 2.7, and we
Eric V. Smith added the comment:
I think David meant the else clause on a for statement:
https://docs.python.org/2/reference/compound_stmts.html#the-for-statement
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org
Changes by Eric V. Smith e...@trueblade.com:
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24192
___
___
Python-bugs-list
Eric V. Smith added the comment:
Thanks for your review, Berker. I've updated the code with most of your
suggestions, although some of them were mooted by some restructuring I did.
A couple of questions/issues:
- I'm not sure where we stand on keyword-only arguments. I certainly agree
Eric V. Smith added the comment:
Thanks everyone for their help, especially Michael for the original patch.
--
resolution: - fixed
stage: patch review - resolved
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org
Eric V. Smith added the comment:
I think removing the word way would be a better improvement.
--
nosy: +eric.smith
versions: -Python 3.2, Python 3.3, Python 3.6
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23929
Changes by Eric V. Smith e...@trueblade.com:
--
keywords: +easy
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23929
___
___
Python-bugs-list
Eric V. Smith added the comment:
This is the expected behavior:
https://docs.python.org/2/faq/programming.html#why-does-22-10-return-3
--
nosy: +eric.smith
resolution: - not a bug
stage: - resolved
status: open - closed
___
Python tracker rep
Eric V. Smith added the comment:
Updated patch with a few minor doc tweaks.
The one substantive change I did make was to add numeric_owner to the call to
self.chown() when setting directory owners. I believe this is correct, but I
need to convince myself and to write a test.
--
Added
Eric V. Smith added the comment:
Note that this change will break code that subclasses TarFile and overrides
chown(), as suggested in msg233915. I'm not too concerned about that, since
chown() is not documented. Ideally it would be renamed to _chown(), but that's
probably a separate issue
Eric V. Smith added the comment:
What's the motivating use case for this?
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23910
Eric V. Smith added the comment:
Have you thought of just exposing Object/structseq.c?
Before you put much time into this, I'd get Raymond's acceptance of whatever
approach you want to take. It might be best to raise it on python-ideas
Eric V. Smith added the comment:
I haven't seen thought it through, just that it seems very similar to a C
namedtuple.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23910
Eric V. Smith added the comment:
Looks good to me.
I realize it's trivial, but is it worth putting this on PyPI for older 3.x's?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23893
Changes by Eric V. Smith e...@trueblade.com:
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16991
___
___
Python-bugs-list
Eric V. Smith added the comment:
I think Serhiy is saying that you don't need to implement future_builtins in
3.x, if your 2.7 and 3.x compatible code catches the ImportError.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org
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:
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 rep...@bugs.python.org
http://bugs.python.org
Changes by Eric V. Smith e...@trueblade.com:
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24417
___
___
Python-bugs-list
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
line endings
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: - resolved
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 great. But:
return mo['col'], mo['row'], mo['foo']
would
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, explaining
what happens if you omit
Changes by Eric V. Smith e...@trueblade.com:
--
versions: -Python 3.2, Python 3.3
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24323
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 changing the 2.7 docs
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 column.
But I agree it's
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?
--
nosy
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 characters
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 index 1 in the args tuple.
I can't imagine how you'd implement this function
Eric V. Smith added the comment:
Just to clarify:
If not specified, the default presentation type for floats is g. Since you
didn't specify f in your example, it's using g. For presentation type g,
the precision (3 in your case) is the total number of significant digits. So
12.34 first
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 before and after
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 decode_unicode
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.
--
___
Python tracker rep
Changes by Eric V. Smith e...@trueblade.com:
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24802
___
___
Python-bugs-list
Changes by Eric V. Smith e...@trueblade.com:
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24803
___
___
Python-bugs-list
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 full path name
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 rep...@bugs.python.org
http://bugs.python.org/issue24661
Eric V. Smith added the comment:
Saksham: Also, it would be best to take this discussion of how to produce a
patch to the python-committers mailing list:
https://mail.python.org/mailman/listinfo/python-committers
--
___
Python tracker <
Eric V. Smith added the comment:
Saksham: First we need our "experts" to decide what, if any, change is needed.
If we decide that a change is needed, at that point we'd look at a patch.
--
___
Python tracker <rep...@bugs.pyth
Eric V. Smith added the comment:
> Berker Peksag added the comment:
>
>> Also, it would be best to take this discussion of how to produce a patch to
>> the python-committers mailing list:
>
> or the core-mentorship list:
> https://mail.python.org/mailman/listin
Eric V. Smith added the comment:
There's a typo here in 'executable':
+ '`{} -m venv`'.format(exeutable), file=sys.stderr)
And this could now be:
print('WARNING: the pyenv script is deprecated in favour of '
f'`{executable} -m venv`', file=sys.stderr)
!
And since
401 - 500 of 2689 matches
Mail list logo