Eric Smith e...@trueblade.com added the comment:
Adding tim_one as nosy. He'll no doubt have an opinion on rounding. And
hopefully he'll share it!
--
nosy: +tim_one
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7117
Eric Smith e...@trueblade.com added the comment:
Another thing to consider is that in py3k we removed all conversions of
converting 'f' to 'g', such as this, from Objects/unicodeobject.c:
if (type == 'f' fabs(x) = 1e50)
type = 'g';
Should we also do that as part of this exercise
Eric Smith e...@trueblade.com added the comment:
Changed py3k version to use contextlib.closing in r75625.
--
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6882
Changes by Eric Smith e...@trueblade.com:
--
priority: - normal
type: - behavior
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6882
Eric Smith e...@trueblade.com added the comment:
Back ported the try/finally parts to trunk in r75620.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6882
Changes by Eric Smith e...@trueblade.com:
--
assignee: georg.brandl - eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7168
___
___
Python
Eric Smith e...@trueblade.com added the comment:
Proposed patch attached.
--
keywords: +patch
stage: - patch review
Added file: http://bugs.python.org/file15164/issue7168.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org
Eric Smith e...@trueblade.com added the comment:
Updated patch based on Georg's input.
--
Added file: http://bugs.python.org/file15166/issue7168.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7168
Changes by Eric Smith e...@trueblade.com:
Removed file: http://bugs.python.org/file15164/issue7168.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7168
Eric Smith e...@trueblade.com added the comment:
A slightly improved version checked in as r75510.
--
resolution: - accepted
stage: patch review - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http
New submission from Eric Smith e...@trueblade.com:
These functions are unsafe and I'd like to delete them. They've already
been deleted in py3k, per PEP 3100. They are no longer used internally
to the interpreter.
They should be documented as deprecated and as unsafe. They write to a
char
Eric Smith e...@trueblade.com added the comment:
I'm adding 2.7. Since 2.7 and 3.2 share the same code base, I'd rather
add it to both if we're going to do it at all.
--
assignee: - eric.smith
versions: +Python 2.7
___
Python tracker rep
Eric Smith e...@trueblade.com added the comment:
I think they're the same issue, relating to what happens if there's an
alignment specifier supplied along with '0'. I'm planning on working on
this issue this weekend and I'll verify if it's the same problem
Eric Smith e...@trueblade.com added the comment:
That wording is okay with me. Maybe run it by Georg to see if he has any
suggestions? Or just check it in and see if anyone complains.
But I'm okay with it as-is.
Thanks for doing this.
Eric
Eric Smith e...@trueblade.com added the comment:
I obviously hadn't thought of those cases, either. This version looks
good(er) to me.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7051
Eric Smith e...@trueblade.com added the comment:
Mark's really the expert here, so I trust his description. Is his
description layman-speak enough for the docs?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7051
Eric Smith e...@trueblade.com added the comment:
This doesn't crash the interpreter, so I'm changing it to behavior.
The number of items in a range() must fit into a native int.
What are you doing with the range? Could you use xrange instead?
--
nosy: +eric.smith
resolution: - wont
Changes by Eric Smith e...@trueblade.com:
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6958
___
___
Python-bugs-list mailing
Eric Smith e...@trueblade.com added the comment:
The C code looks basically okay to me. I'd probably use strdup() instead
of the malloc/strlen/strcpy calls. And as Thomas said, the cleanup needs
a little bit of work.
--
___
Python tracker rep
Eric Smith e...@trueblade.com added the comment:
I checked in a slightly modified version of Marcin's patch in py3k
(r74907) and release31-maint (r74909). I modified the patch to keep the
same style as the rest of the module.
I'll now work on back-porting all of the try/finally code to trunk
Eric Smith e...@trueblade.com added the comment:
The patch looks okay to me, and solves the issue on my Fedora box.
But perhaps a context manager in a with block would be clearer? I've
attached a patch.
--
Added file: http://bugs.python.org/file14908/issue6882-contextlib.diff
Eric Smith e...@trueblade.com added the comment:
The py3k version of the file already contains 3.x only code, and it's
missing the comment at the top that it should be compatible. But it's
not really a big deal to me.
The py3k version also already has some try/finally logic on some popen
calls
Eric Smith e...@trueblade.com added the comment:
Indeed, the code that introduced this bug was in r68489, so it was
written after Guido went through the module and cleaned it up to use
try/finally. And since r68489 was a merge of r68487, the change was
originally made on the 2.x version (which
Eric Smith e...@trueblade.com added the comment:
Yes, I'll take care of this.
I can't think of any way to add a test that the zombie process doesn't
exist, but if anyone has an idea I'd like to hear about it.
--
___
Python tracker rep
Eric Smith e...@trueblade.com added the comment:
complex will also need to be addressed. The second error message is
misleading, for the same reason the formatting on float and int is
incorrect:
format(3-2j, 030)
Traceback (most recent call last):
File stdin, line 1, in module
ValueError
Changes by Eric Smith e...@trueblade.com:
--
stage: - patch review
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6882
___
___
Python-bugs-list
Changes by Eric Smith e...@trueblade.com:
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6882
___
___
Python-bugs-list mailing
New submission from Eric Smith e...@trueblade.com:
Originally discussed in issue 6871. Even if an alignment of is
specified, = is used if the padding character is 0.
format(2, '020')
'0002'
format(2, '120')
'2111'
This is a problem for at least float
Eric Smith e...@trueblade.com added the comment:
Created issue 6902 to handle #4.
The others will need to be broken out into their own issues if we want
to fix them. I can't keep track of multiple issues in one bug report.
--
___
Python tracker rep
Changes by Eric Smith e...@trueblade.com:
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6872
___
___
Python-bugs-list mailing
Eric Smith e...@trueblade.com added the comment:
For #1 for floats, 2.6 is in error. This has been fixed in 2.7 (trunk).
For #2, I think float is correct. The PEP says the specifier is:
[[fill]align][sign][#][0][minimumwidth][.precision][type]
so '00' is parsed as minimumwidth=0 with zero
Eric Smith e...@trueblade.com added the comment:
Also, see issue 4482 for a discussion of float formatting for nan and inf.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6871
Eric Smith e...@trueblade.com added the comment:
Thanks for the decimal work, Mark. I notice that complex is also left
aligned, by default. I'll take a look at that.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6857
Changes by Eric Smith e...@trueblade.com:
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6713
___
___
Python-bugs-list mailing
Changes by Eric Smith e...@trueblade.com:
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6850
___
___
Python-bugs-list mailing
Eric Smith e...@trueblade.com added the comment:
The test as written will always give an error for None. I think the
better fix is to change it to be:
if format_dict['type'] is None or format_dict['type'] in 'gG':
That fixes this particular exception, but since the format specifier
is invalid
Changes by Eric Smith e...@trueblade.com:
--
components: +Library (Lib)
type: - behavior
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6850
Eric Smith e...@trueblade.com added the comment:
The format string is valid. Sorry for the noise. The fill character of
'a' threw me off.
With my suggested change to decimal.py, line 5595, in py3k:
from decimal import *
format(Decimal(0.12345), a=-7.0)
'0.1'
format(0.12345, a=-7.0
Eric Smith e...@trueblade.com added the comment:
That is interesting. I'd agree that it's a bug in the PEP. Note that
%-formatting right aligns floats by default:
'%7.0g' % 0.12345
'0.1'
I'll raise the issue on python-dev.
Eric.
--
assignee: - eric.smith
Eric Smith e...@trueblade.com added the comment:
I plan to look at this, and if it looks okay, commit it. Let me know if
anyone has any remaining issues.
--
nosy: +eric.smith
versions: +Python 3.2 -Python 3.1
___
Python tracker rep...@bugs.python.org
Changes by Eric Smith e...@trueblade.com:
--
assignee: - eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1578269
___
___
Python-bugs
Eric Smith e...@trueblade.com added the comment:
This is a duplicate of issue 6813, where it has been fixed. I'm closing it.
--
resolution: - duplicate
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6579
Eric Smith e...@trueblade.com added the comment:
2.7 does not support the !a conversion specifier. It's only available in
3.1 and above.
It's because ascii() is a 3.x only builtin.
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http
Eric Smith e...@trueblade.com added the comment:
Never mind, I see that you didn't add the !a docs to trunk.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6813
Changes by Eric Smith e...@trueblade.com:
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6802
___
___
Python-bugs-list mailing
Eric Smith e...@trueblade.com added the comment:
For types where it's possible, the str or repr returns a string that can
be passed to eval:
for i in eval(str(xrange(5))):
... print i
...
0
1
2
3
4
xrange (and list, and tuple, and others) fall into this category.
--
nosy
Eric Smith e...@trueblade.com added the comment:
This isn't the right forum to ask for help. You should try
comp.lang.python, where someone would be happy to explain this to you.
Having said that, here's the explanation:
This is not a bug.
Disregarding side effects, the expression:
a = b or c
Eric Smith e...@trueblade.com added the comment:
What platform is this on? For a ucs4 platform, that is what I'd expect
the result to be. Check sys.maxunicode to see if you have a ucs2 or ucs4
build.
What do you expect as the result?
Remember that memmove takes a count of bytes
Changes by Eric Smith e...@trueblade.com:
--
resolution: - invalid
stage: - committed/rejected
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6714
Eric Smith e...@trueblade.com added the comment:
Good advice from R. David. In addition, you'll find the help command useful:
help(''.strip)
Help on built-in function strip:
strip(...)
S.strip([chars]) - string or unicode
Return a copy of the string S with leading and trailing
Eric Smith e...@trueblade.com added the comment:
I agree with Raymond. I think it should either take a string and flags,
or a compiled regex object.
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6630
Changes by Eric Smith e...@trueblade.com:
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6632
___
___
Python-bugs-list mailing
Eric Smith e...@trueblade.com added the comment:
Fixed in r74269 (trunk). Code copied to py3k, just so the code stays in
sync, in r74271.
--
resolution: - fixed
stage: - committed/rejected
status: open - closed
___
Python tracker rep
Eric Smith e...@trueblade.com added the comment:
In http://docs.python.org/3.1/library/string.html#format-string-syntax,
the auto-numbering is mentioned, in the sentence that starts If the
numerical arg_names in a format string are 0, 1, 2, ... in sequence,
they can all be omitted.
It's true
Eric Smith e...@trueblade.com added the comment:
+1
The standard recommends it, and the other numeric types support it, so
Decimal should as well.
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6595
Eric Smith e...@trueblade.com added the comment:
Since you're calling int() on the result, can't this code:
self._int = str(int((intpart+fracpart).lstrip('0') or '0'))
just be:
self._int = str(int(intpart+fracpart))
?
And here, you already know diag is not None, so do you need the or '0'
part
Changes by Eric Smith e...@trueblade.com:
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6561
___
___
Python-bugs-list mailing
Changes by Eric Smith e...@trueblade.com:
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6567
___
___
Python-bugs-list mailing
Eric Smith e...@trueblade.com added the comment:
I agree that backporting it to 2.6 would be nice, but it would be a huge
change. There's too much risk involved. So this will just be a new
feature in 2.7. It's already in Misc/NEWS, so you're all set there.
I'm closing the issue, marking
Eric Smith e...@trueblade.com added the comment:
-1
The time to change this was 3.0, if it was ever needed. It would break
too much code now. We could develop some strategy using macros, but I
just don't think it's worth it.
And as Amaury points it, the type is known in python as float, so
Eric Smith e...@trueblade.com added the comment:
The patch looks good to me. In particular, removing the test for
using_len looks correct.
The assignment of result = -1 after PyErr_Format isn't needed, but
doesn't hurt (and it was already there, anyway).
--
keywords: -needs review
Eric Smith e...@trueblade.com added the comment:
I agree with Mark: -1.
Do you have any specific use cases where this has caused problems, or is
this academic?
Maybe you can get some support for this on python-ideas, but I suggest
we close it in the meantime
New submission from Eric Smith e...@trueblade.com:
This was reported a few weeks ago by Benjamin Peterson, but I haven't
gotten around to fixing it. This is a reminder to myself to do it.
This is due to a bug in Objects/stringlib/formatter.h. Before I fix it
trunk, I need to backport some 3.1
Changes by Eric Smith e...@trueblade.com:
--
assignee: - eric.smith
components: +Interpreter Core -Extension Modules, Library (Lib)
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6316
Eric Smith e...@trueblade.com added the comment:
This is by design. Where d is a datetime, format(d, format_string)
returns d.strftime(format_string).
d.strftime('30')
'30'
--
resolution: - invalid
status: open - closed
___
Python tracker rep
Eric Smith e...@trueblade.com added the comment:
So is this a cosmetic issue or a functional issue?
It's a cosmetic issue.
Also, even if it could figure that out, how would it know whether
a particular filename stringification with os.path.join() was
intended for display to the user
Eric Smith e...@trueblade.com added the comment:
Tim Golden wrote:
Just for information's sake, the shell APIs usually only accept backslashes.
That's good to know. Do you have any specific examples?
CreateFile and the like, which is where my experience is, take either.
90% of my Windows
Eric Smith e...@trueblade.com added the comment:
It's unfortunate (at least to me, but I know I have a skewed view of
this) that the help string in add_argument uses %-formatting when
formatting the result. I'd much rather it use str.format().
I see a couple of options:
- leave
Eric Smith e...@trueblade.com added the comment:
I'll take a look at it. I've been meaning to use argparse, anyway.
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6247
Eric Smith e...@trueblade.com added the comment:
In r73314, I restored the one test erroneously removed (%#.0f 1.5 - 2.).
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6198
Changes by Eric Smith e...@trueblade.com:
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6198
___
___
Python-bugs-list mailing
Eric Smith e...@trueblade.com added the comment:
I can duplicate this with Visual C++ 9.0 Express Edition on XP.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6198
Eric Smith e...@trueblade.com added the comment:
Yes, this test passes on py3k on my Windows box. That would be a
nightmare if it didn't!
I agree that this is a test problem, not a code problem. I suggest we
just remove the offending line from formatfloat_testcases.txt in trunk.
I can do
Eric Smith e...@trueblade.com added the comment:
I had to remove a bunch of tests. Some were of the form
even-number5, rounded to before the 5. Some were comparing a large
number of digits.
Then there's these:
%#.0g 0 - 0. Got '0.0'
%#.1g 0 - 0. Got '0.0'
%#.2g 0 - 0.0
Eric Smith e...@trueblade.com added the comment:
Checked in to trunk in r73240.
--
assignee: marketdickinson - eric.smith
resolution: - fixed
stage: - committed/rejected
status: open - closed
type: - behavior
___
Python tracker rep
Eric Smith e...@trueblade.com added the comment:
Mark Dickinson wrote:
Out of interest, what does '%#.0f' % 1.5 produce on
Python 2.7/Windows? I'd expect to get '2.' both for
round-half-to-even and round-half-away-from-zero.
Does Windows round this down to '1.' instead?
Windows in trunk
Eric Smith e...@trueblade.com added the comment:
[Mark]
Out of interest, what does '%#.0f' % 1.5 produce on
Python 2.7/Windows? I'd expect to get '2.' both for
round-half-to-even and round-half-away-from-zero.
Does Windows round this down to '1.' instead?
[Eric]
Windows in trunk gives
Changes by Eric Smith e...@trueblade.com:
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1943
___
___
Python-bugs-list mailing
Eric Smith e...@trueblade.com added the comment:
I think this would be useful.
I don't fee terribly strongly about it, but I think I'd like the name
str.format_using_mapping(). When I initially saw this, I thought from
the name it was creating a format object (whatever that would be) from
Eric Smith e...@trueblade.com added the comment:
Fixed in:
trunk: r72848
release26-maint: r72849
py3k: r72850
release30-main: r72851
--
resolution: - fixed
stage: - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
Eric Smith e...@trueblade.com added the comment:
Any character after a ']' other than '.' or '[' triggers this bug:
'{0[0]x}'.format([None])
Assertion failed: (0), function FieldNameIterator_next, file
Objects/stringlib/string_format.h, line 379.
I'll fix it this weekend.
--
assignee
Changes by Eric Smith e...@trueblade.com:
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6081
___
___
Python-bugs-list mailing
Eric Smith e...@trueblade.com added the comment:
It looks good to me.
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5829
Eric Smith e...@trueblade.com added the comment:
I don't see any point in backporting to 3.0 at this point.
While it's definitely a problem in 2.6, it seems like a big change to
make in a bugfix release. I guess I'm +0 on it.
--
___
Python tracker
New submission from Eric Smith e...@trueblade.com:
These 3 functions were deprecated in 2.7 and 3.1, and need to be removed
in 2.8 and 3.2.
This is currently assigned to version 3.2 only because the bug tracker
can't assign issues to 2.8.
--
assignee: eric.smith
components: Interpreter
Eric Smith e...@trueblade.com added the comment:
integer presentation types is still not exactly correct, because there
are presentation types that work across value types. Specifically, 'n'
works on integers and floats. Precision is allowed for floats, but not ints:
format(10.0, '.4n')
'10
Eric Smith e...@trueblade.com added the comment:
I'll look at it. The comma stuff needs to be added for 2.7 and 3.1, too.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5965
Eric Smith e...@trueblade.com added the comment:
PEP 3101 says it's ignored. I chose to be strict. I don't see the
advantage of allowing but ignoring it.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5963
Changes by Eric Smith e...@trueblade.com:
--
assignee: georg.brandl - eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5963
___
___
Python
Eric Smith e...@trueblade.com added the comment:
I updated the docs to say precision is not allowed for integers.
--
resolution: - accepted
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5963
Eric Smith e...@trueblade.com added the comment:
Thanks for looking at this, Mark. If we could only assign issues to
Python 3.2 and 3.3 to change the pending deprecation warning to a real
one, and to remove the function entirely, we'd be all set! I'm always
worried we'll forget these things
Eric Smith e...@trueblade.com added the comment:
Checked in to py3k in 72398. I'm reconsidering whether to make this
change in 2.7. I might make the change there, I'll have to check on the
impacts.
--
___
Python tracker rep...@bugs.python.org
http
Eric Smith e...@trueblade.com added the comment:
This looks okay to me. (The itertools import isn't needed, but easy
enough to fix on checkin.)
I'd still like someone else to look it over, but if no one does before
the beta, I'll check it in.
--
keywords: +needs review
stage: - patch
Eric Smith e...@trueblade.com added the comment:
I've reviewed this and it looks good. I'll check it in to py3k shortly.
Then I'll backport it to 2.7 and fix the user documentation.
--
resolution: - accepted
stage: patch review -
___
Python tracker
New submission from Eric Smith e...@trueblade.com:
I get a bus error in test_lchflags in test_posix.py on my Mac OS X 10.5 box.
I'll try and spend some time later today to debug this, but here's the
backtrace if anyone wants to look at it:
Program received signal EXC_BAD_ACCESS, Could
Eric Smith e...@trueblade.com added the comment:
Fedora Core 6 works okay.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5943
___
___
Python
Eric Smith e...@trueblade.com added the comment:
Yes, that patch fixes the problem for me on Mac OS.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5943
Eric Smith e...@trueblade.com added the comment:
My Fedora Core 6 box still works with the patch.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5943
Eric Smith e...@trueblade.com added the comment:
Committed in py3k r72333 and trunk r72348. I also updated the
documentation. Closing the issue.
--
components: +Interpreter Core
status: open - closed
___
Python tracker rep...@bugs.python.org
http
Eric Smith e...@trueblade.com added the comment:
Looking at Guido's removal of this back in 1999, he says:
* Lib/ntpath.py:
Withdraw the UNC support from splitdrive(). Instead, a new function
splitunc() parses UNC paths. The contributor of the UNC parsing in
splitdrive() doesn't like
501 - 600 of 790 matches
Mail list logo