Eric Smith added the comment:
> Perhaps the path of least resistance is to change PyObject_Hash to be
> yet another place where PyType_Ready will be called implicitly if it
> hasn't been called already?
I think that's the best thing to do. It would bring PyObjec
Changes by Eric Smith :
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.org/issue4285>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Eric Smith :
--
assignee: brett.cannon -> eric.smith
___
Python tracker
<http://bugs.python.org/issue4285>
___
___
Python-bugs-list mailing list
Un
Eric Smith added the comment:
The doc string for sys includes:
version_info -- version information as a tuple
I'm not sure changing this to "... as a structseq" makes it any more
useful, but it's more correct. Does anyone have a preference? I'd use
the same wording
Eric Smith added the comment:
"... as a named tuple" works for me. I'll go with that. Thanks!
___
Python tracker
<http://bugs.python.org/issue4285>
___
___
Eric Smith added the comment:
Committed in r69331 (trunk) and r69346 (py3k).
--
resolution: -> accepted
status: open -> closed
___
Python tracker
<http://bugs.python.org/
Changes by Eric Smith :
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.org/issue5122>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric Smith added the comment:
Yes, I have these installed:
tcl-8.4.13-3.fc6
tcl-devel-8.4.13-3.fc6
tk-8.4.13-3.fc6
tk-devel-8.4.13-3.fc6
When I run "./python Lib/test/regrtest.py test_tcl test_ttk_guionly", it
hangs.
___
Python trac
Eric Smith added the comment:
The patch does solve the problem for me. It no longer hangs when running
either:
./python Lib/test/regrtest.py test_tcl test_ttk_guionly
or:
./python Lib/test/regrtest.py
-
...
test_traceback
test_transformer
test_ttk_guionly
test_ttk_guionly skipped
Eric Smith added the comment:
The second patch (checking_for_failed_tk_load.diff) also works for me.
___
Python tracker
<http://bugs.python.org/issue5122>
___
___
Pytho
Eric Smith added the comment:
With the second patch installed, your code snippet does indeed hang for me.
With the third patch installed, I get:
[trunk]$ ./python
Python 2.7a0 (trunk:69369M, Feb 6 2009, 14:59:32)
[GCC 4.1.2 20070626 (Red Hat 4.1.2-13)] on linux2
Type "help",
Eric Smith added the comment:
protect_tk_loading.diff works for me.
___
Python tracker
<http://bugs.python.org/issue5122>
___
___
Python-bugs-list mailing list
Unsub
Eric Smith added the comment:
The current patch (protect_tk_loading.diff) looks reasonable to me, and
it solves my problem with the tests hanging. So I'd suggest you commit
the patch, insofar it improves on the current situation.
I'm not an expert in tk, however. So if you'
Eric Smith added the comment:
It's easy enough to implement. Although the 'all-or-nothing' aspect is a
little tough, I'll have to give it some thought.
Maybe the best way to do this is to first create a string.Formatter
subclass that implements it. I'll play with it an
Eric Smith added the comment:
How is:
'{d}{s}{f}'.format(3, 'foo', 3.14)
more unclear than:
'%d%s%f' % (3, 'foo', 3.14)
?
But the more I think about it, the more I think it would have to be:
'{:d}{:s}{:f}'.format(3, 'foo', 3.14)
Sin
Eric Smith added the comment:
The attached file is a mostly working version that inherits from
string.Formatter. It has the following shortcomings, which would all be
addressed if we go forward:
- Doesn't handle escaping '{' or '}'
- Doesn't handle conversion sp
Eric Smith added the comment:
Right. The colon would be required if there's a format specifier. Or an
exclamation if there's just a conversion specifier:
"{!r}{:f}{!s:^10}".format('foo', 3, 10)
would give:
"'foo'3.0010"
I've
Eric Smith added the comment:
Terry J. Reedy wrote:
> Terry J. Reedy added the comment:
>
> All I am requesting is that
> '{} {} {}'.format(3, 'pi', 3.14) work as
>
>>>> '%s %s %s' % (3, 'pi', 3.14)
> '3 pi 3.14'
Eric Smith added the comment:
I agree. I'm not sure on backporting this.
I'll work on a patch.
___
Python tracker
<http://bugs.python.org/issue5247>
___
___
Changes by Eric Smith :
--
assignee: -> eric.smith
___
Python tracker
<http://bugs.python.org/issue5247>
___
___
Python-bugs-list mailing list
Unsubscri
Changes by Eric Smith :
--
assignee: -> eric.smith
___
Python tracker
<http://bugs.python.org/issue5237>
___
___
Python-bugs-list mailing list
Unsubscri
Eric Smith added the comment:
auto_number_formatter_2.py lets you experiment with this with a syntax
more similar to what ''.format() looks like:
$ ./python
Python 2.7a0 (trunk:69608, Feb 14 2009, 04:51:18)
[GCC 4.1.2 20070626 (Red Hat 4.1.2-13)] on linux2
Type "help", &
Eric Smith added the comment:
Okay, one last version. This one lets you use object access within the
replacement string:
>>> from auto_number_formatter_3 import formatter as _
>>> _('{} {} {}').format(3, 'pi', 3.14)
'3 pi 3.14'
>>> _(
Eric Smith added the comment:
I've gone back and read PEP 3101. To use its terminology, I think the
error message should be something like:
Unknown presentation type %c for type %s.
I'm not sure where I got the original wording "conversion type". It's
true that it&
Eric Smith added the comment:
The attached patch (against trunk) changes the message.
However, it has at least one unintended consequence. If you have an
object with no __format__, it gets converted to a string, which is then
formatted. So you get:
>>> '{0:^10}'
Eric Smith added the comment:
With this patch, I changed it to "format code", and made it more in line
with Antoine's original suggested message.
I'm okay with "format code" or "formatting code", but if we do use
either of those wordings, we should cha
Eric Smith 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", s
Eric Smith 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 revi
Eric Smith 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 it a
Changes by Eric Smith :
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.org/issue6561>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Eric Smith :
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.org/issue6567>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric Smith 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
<http://bugs.python.org/issue6
Eric Smith 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
Eric Smith 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
<http://bug
Eric Smith 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'
Eric Smith 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
<http://bugs.python.org/issue6
Changes by Eric Smith :
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.org/issue6632>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric Smith 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
Eric Smith 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, not a character
Changes by Eric Smith :
--
resolution: -> invalid
stage: -> committed/rejected
___
Python tracker
<http://bugs.python.org/issue6714>
___
___
Python-bugs-
Eric Smith 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
is e
Eric Smith 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.sm
Changes by Eric Smith :
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.org/issue6802>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric Smith 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
<http://bugs.python.
Eric Smith added the comment:
Never mind, I see that you didn't add the !a docs to trunk.
--
___
Python tracker
<http://bugs.python.org/issue6813>
___
___
Eric Smith 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
<http://bugs.python.org/issue1578
Changes by Eric Smith :
--
assignee: -> eric.smith
___
Python tracker
<http://bugs.python.org/issue1578269>
___
___
Python-bugs-list mailing list
Unsubscri
Eric Smith 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
<http://bugs.python
Changes by Eric Smith :
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.org/issue6713>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Eric Smith :
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.org/issue6850>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric Smith 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
Changes by Eric Smith :
--
components: +Library (Lib)
type: -> behavior
___
Python tracker
<http://bugs.python.org/issue6850>
___
___
Python-bugs-list mai
Eric Smith 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")
Eric Smith 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 Smith 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
<http://bugs.python.org/i
Eric Smith 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-padding
Eric Smith added the comment:
Also, see issue 4482 for a discussion of float formatting for nan and inf.
--
___
Python tracker
<http://bugs.python.org/issue6
Changes by Eric Smith :
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.org/issue6872>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Eric Smith :
--
stage: -> patch review
___
Python tracker
<http://bugs.python.org/issue6882>
___
___
Python-bugs-list mailing list
Unsubscri
Changes by Eric Smith :
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.org/issue6882>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric Smith added the comment:
The '0' fill character is forcing '=' alignment (per the PEP). This
looks like a bug to me, since it should use the specified alignment.
This is not a float-only problem, it applies to the other built-in types
as well:
>>> format(2,
New submission from Eric Smith :
Originally discussed in issue 6871. Even if an alignment of "<" is
specified, "=" is used if the padding character is "0".
>>> format(2, '0<20')
'0002'
>>> format(2
Eric Smith 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
Eric Smith 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, "0<30")
Traceback (most recent call last):
File "", line 1, in
Va
Eric Smith 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-
Eric Smith 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 that
Eric Smith 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 doesn't us
Eric Smith 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
<http://bu
Eric Smith 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. That
inc
Changes by Eric Smith :
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.org/issue6958>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric Smith 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
<http://bugs.py
Eric Smith 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: ->
Eric Smith added the comment:
What OS, processor, and Python version are you running this code on?
>From your example, it's Python 3.x. 3.1 has a completely rewritten
float->decimal conversion system, and I get different results.
>>> print(.1)
0.1
>>> print((.1,))
Changes by Eric Smith :
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.org/issue7019>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Eric Smith :
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.org/issue7020>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric Smith 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
<http://bugs.python.org/i
Eric Smith 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 v
Eric Smith 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.
--
___
Python tr
Eric Smith added the comment:
I obviously hadn't thought of those cases, either. This version looks
good(er) to me.
--
___
Python tracker
<http://bugs.python.org/i
Eric Smith 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
<h
New submission from Eric Smith :
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* parameter,
Changes by Eric Smith :
--
assignee: georg.brandl -> eric.smith
___
Python tracker
<http://bugs.python.org/issue7168>
___
___
Python-bugs-list mailing list
Un
Eric Smith added the comment:
Proposed patch attached.
--
keywords: +patch
stage: -> patch review
Added file: http://bugs.python.org/file15164/issue7168.patch
___
Python tracker
<http://bugs.python.org/iss
Eric Smith added the comment:
Updated patch based on Georg's input.
--
Added file: http://bugs.python.org/file15166/issue7168.patch
___
Python tracker
<http://bugs.python.org/i
Changes by Eric Smith :
Removed file: http://bugs.python.org/file15164/issue7168.patch
___
Python tracker
<http://bugs.python.org/issue7168>
___
___
Python-bugs-list m
Eric Smith added the comment:
A slightly improved version checked in as r75510.
--
resolution: -> accepted
stage: patch review -> committed/rejected
status: open -> closed
___
Python tracker
<http://bugs.python.o
Eric Smith added the comment:
Back ported the try/finally parts to trunk in r75620.
--
___
Python tracker
<http://bugs.python.org/issue6882>
___
___
Python-bug
Eric Smith added the comment:
Changed py3k version to use contextlib.closing in r75625.
--
status: open -> closed
___
Python tracker
<http://bugs.python.org/iss
Changes by Eric Smith :
--
priority: -> normal
type: -> behavior
___
Python tracker
<http://bugs.python.org/issue6882>
___
___
Python-bugs-list
Eric Smith added the comment:
I think the next step on my side is to remove _PyOS_double_to_string,
and make all of the internal code call PyOS_double_to_string. The
distinction is that _PyOS_double_to_string gets passed a buffer and
length, but PyOS_double_to_string returns allocated memory
Eric Smith 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
<http://bugs.python.
Eric Smith 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 als
Eric Smith added the comment:
r75743: Fix cPickle.c to use PyOS_string_to_double.
--
___
Python tracker
<http://bugs.python.org/issue7117>
___
___
Python-bug
Eric Smith added the comment:
r75745: Fix stropmodule.c to use PyOS_string_to_double.
--
___
Python tracker
<http://bugs.python.org/issue7117>
___
___
Python-bug
Eric Smith added the comment:
r75824: Fix ast.c to use PyOS_string_to_double.
--
___
Python tracker
<http://bugs.python.org/issue7117>
___
___
Python-bugs-list m
Eric Smith added the comment:
r75846: Fix marshal.c to use PyOS_string_to_double.
--
___
Python tracker
<http://bugs.python.org/issue7117>
___
___
Python-bug
Eric Smith added the comment:
r75913: Fix _json.c to use PyOS_string_to_double. Change made after
consulting with Bob Ippolito.
This completes the removal of calls to PyOS_ascii_strtod.
--
___
Python tracker
<http://bugs.python.org/issue7
Changes by Eric Smith :
--
resolution: -> invalid
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue7234>
___
___
Python-bugs-list
Changes by Eric Smith :
--
resolution: -> invalid
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue7236>
___
___
Python-bugs-list
Eric Smith added the comment:
The patch (http://bugs.python.org/file15228/kevent.patch) works for me
under OS X 10.5.8 Intel.
All tests pass, except test_telnetlib which fails intermittently with
and without the patch.
Python 3.2a0 (py3k:75951, Oct 29 2009, 11:38:58)
[GCC 4.0.1 (Apple Inc
401 - 500 of 805 matches
Mail list logo