Eric Smith e...@trueblade.com added the comment:
Hi.
Please don't use the bug tracker to ask Python questions. You've already been
asked twice to refer to
http://www.python.org/about/help/#got-a-python-problem-or-question . Please
read and follow those instructions. Your questions have
Changes by Eric Smith e...@trueblade.com:
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8304
___
___
Python-bugs-list mailing
Changes by Eric Smith e...@trueblade.com:
--
nosy: +eric.smith
type: performance - behavior
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8309
Eric Smith e...@trueblade.com added the comment:
Committed in trunk in r79596. I'll leave this open until I port to py3k, check
the old tests for this usage, and create the issue to make it a
DeprecationWarning.
--
stage: patch review - committed/rejected
Changes by Eric Smith e...@trueblade.com:
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8293
___
___
Python-bugs-list mailing
Changes by Eric Smith e...@trueblade.com:
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8278
___
___
Python-bugs-list mailing
Eric Smith e...@trueblade.com added the comment:
cStringIO.StringIO is a factory function, so those messages are correct. This
is mentioned in http://docs.python.org/library/stringio.html#module-cStringIO .
--
nosy: +eric.smith
resolution: - rejected
status: open - closed
Eric Smith e...@trueblade.com added the comment:
Meador: Your patch (-3) looks identical to mine (-2), unless I'm making some
mistake. Could you check? I'd like to get this applied in the next few days,
before 2.7b1.
Thanks!
--
___
Python tracker
Eric Smith e...@trueblade.com added the comment:
I had some style issues at one point, but I haven't looked at it closely
recently. I won't have time to look at this before next week, so proceed
without me.
--
___
Python tracker rep
Changes by Eric Smith e...@trueblade.com:
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8252
___
___
Python-bugs-list mailing
Changes by Eric Smith e...@trueblade.com:
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8257
___
___
Python-bugs-list mailing
Eric Smith e...@trueblade.com added the comment:
Good point. So that makes the implementation more like:
import traceback
import syslog
import sys
def syslog_exception(etype, evalue, etb):
# The result of traceback.format_exception might contain
# embedded newlines, so we have
Eric Smith e...@trueblade.com added the comment:
Once it's moved into syslog, maybe syslog_exception named
syslog.log_exception.
That's should be named, of course. Although on second thought maybe
syslog.syslog_exception really is the right name, to mirror syslog.syslog.
In that case, how
Eric Smith e...@trueblade.com added the comment:
Ah, I see. Yes, logexceptions needs a better name. Maybe
enable_exception_logging.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8214
Eric Smith e...@trueblade.com added the comment:
Here's a version that would be more analogous to what the C implementation
would look like. It uses a class instead of a closure to capture the chain
value. The 2 exposed functions syslog_exception and enable_exception_logging
are the new APIs
Eric Smith e...@trueblade.com added the comment:
I agree with David that this is a Windows problem. I copied xcopy.exe into a
local directory as xcopy.exe and xcopy.a.exe. When running this VBScript, the
first line runs, the second gives me an error 0x8007002, The system could not
find
Eric Smith e...@trueblade.com added the comment:
It occurs to me that Raymond's use case could be satisfied using existing
Python, by slightly changing the format string. After all, str.format()
supports mapping lookup already:
$ ./python.exe
Python 2.6.5+ (release26-maint:79421, Mar 25 2010
Changes by Eric Smith e...@trueblade.com:
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8219
___
___
Python-bugs-list mailing
Changes by Eric Smith e...@trueblade.com:
--
nosy: +vinay.sajip
priority: - normal
versions: +Python 2.6, Python 2.7, Python 3.1, Python 3.2
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8219
Eric Smith e...@trueblade.com added the comment:
It still doesn't say that the LOG_ constants are defined on SysLogHandler. Or
is the intention that the user just use the strings?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org
Eric Smith e...@trueblade.com added the comment:
Vinay Sajip vinay_sa...@yahoo.co.uk added the comment:
Whoops, now fixed (I think).
Looks good. Thanks!
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8219
New submission from Eric Smith e...@trueblade.com:
Sean Reifschneider proposed [1] adding the ability to log an exception using
the syslog module.
My proposed implementation is along the lines of:
def logexceptions(chain=True):
import sys
import traceback
import syslog
Changes by Eric Smith e...@trueblade.com:
--
components: +Extension Modules
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8214
___
___
Python-bugs
Eric Smith e...@trueblade.com added the comment:
I'm not sure I'm wild about the *args parameter. Calling Fred the 0-th
parameter here seems non-intuitive:
My name is {0}.format_using_mapping({}, 'Fred')
If you're going to have *args, why not **kwargs and then merge/update the
dicts? I'm
Changes by Eric Smith e...@trueblade.com:
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8188
___
___
Python-bugs-list mailing
Eric Smith e...@trueblade.com added the comment:
I believe this patch fixes the issue. Tests and documentation are still needed,
of course.
--
Added file: http://bugs.python.org/file16585/issue6081.diff
___
Python tracker rep...@bugs.python.org
http
Eric Smith e...@trueblade.com added the comment:
Added a comment to explain the change.
--
Added file: http://bugs.python.org/file16586/issue6081.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6081
Changes by Eric Smith e...@trueblade.com:
Removed file: http://bugs.python.org/file16585/issue6081.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6081
Eric Smith e...@trueblade.com added the comment:
http://docs.python.org/library/stdtypes.html#str.format, for starters. This is
in Doc/library/stdtypes.rst.
For tests, probably in Lib/test/test_unicode.py.
I'm not sure if we should add this to 2.7 (or even 3.2, for that matter), but
if so
Eric Smith e...@trueblade.com added the comment:
I agree with David.
Although it's not clear to my why the code doesn't just work with the addition
of do_string_format_using_mapping and without the other code. It's possible the
existing code is too dict-specific and should be calling a more
Changes by Eric Smith e...@trueblade.com:
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8155
___
___
Python-bugs-list mailing
Changes by Eric Smith e...@trueblade.com:
--
assignee: - eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6081
___
___
Python-bugs-list
Changes by Eric Smith e...@trueblade.com:
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8128
___
___
Python-bugs-list mailing
Eric Smith e...@trueblade.com added the comment:
str.format() does not take a mapping object. You want:
{0[foo]}.format(d)
'0'
--
resolution: - invalid
stage: test needed - committed/rejected
status: open - closed
___
Python tracker rep
Eric Smith e...@trueblade.com added the comment:
See also issue 6081.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8134
___
___
Python-bugs
Eric Smith e...@trueblade.com added the comment:
I'm not sure I'm wild about doing the work twice, once as string and once as
unicode if need be. But I'll consider it, especially since this is only a 2.7
issue.
There could be side effects of evaluating the replacement strings, but I'm
Eric Smith e...@trueblade.com added the comment:
There's definitely some weirdness going on with handling mapping keys. I'll
look at it.
--
assignee: - eric.smith
keywords: +easy
nosy: +eric.smith
priority: - normal
stage: - needs patch
Eric Smith e...@trueblade.com added the comment:
This would be a new feature, so it can't be added to 2.6 or 3.2. It's an
interesting idea, though.
--
assignee: - eric.smith
nosy: +mark.dickinson
___
Python tracker rep...@bugs.python.org
http
Eric Smith e...@trueblade.com added the comment:
Please read http://docs.python.org/tutorial/floatingpoint.html
--
nosy: +eric.smith
resolution: - invalid
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org
Eric Smith e...@trueblade.com added the comment:
For what it's worth, these are properly called Conditional Expressions. See
PEP 308 for the gory details, including figuring out what the precedence is. It
was news to me that the allowed syntax is slightly different in 2.x and 3.x
Changes by Eric Smith e...@trueblade.com:
--
components: +Library (Lib) -Regular Expressions
type: crash - behavior
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8050
Eric Smith e...@trueblade.com added the comment:
I think the better design is to have 2 distinct APIs: Popen_shell and
Popen_exec. I'm not wild about the name Popen_exec, suggestions welcome.
Neither of these would accept a shell parameter.
For starters these could be convenience APIs
Eric Smith e...@trueblade.com added the comment:
I haven't looked at the patch, but:
Thanks for the the additional tests. Missing unicode was definitely a mistake.
str(w[0].message) is an improvement.
The PEP is out of date in many respects. I think it's best to note that in the
PEP
Eric Smith e...@trueblade.com added the comment:
Checked in.
trunk: r78440
release26-maint: r78441
py3k: r78442
release31-maint: r78443
--
resolution: - accepted
stage: patch review - committed/rejected
status: open - closed
___
Python tracker rep
Eric Smith e...@trueblade.com added the comment:
Checked in.
trunk: r78444
release26-maint: r78445
py3k: r78446
release31-maint: r78447
--
resolution: - accepted
stage: patch review - committed/rejected
status: open - closed
___
Python tracker rep
Eric Smith e...@trueblade.com added the comment:
I think the only remaining issue here is that 's' isn't documented. The
exceptions are now more meaningful, and commas have been documented.
--
versions: +Python 3.2 -Python 3.0
___
Python tracker rep
Eric Smith e...@trueblade.com added the comment:
Here's my proposed changes. Please review.
I put the string type 's' into its own table. That's probably overkill, but I
think it gets lost if it's just mentioned in the text. Feel free to change
that, though.
Also, I'm not wild about my
Eric Smith e...@trueblade.com added the comment:
A much better solution would IMHO be to forbid setting the encoding,
object and reason attributes to objects of the wrong type in the first
place. Unfortunately this would require an extension to PyMemberDef for
the T_OBJECT and T_OBJECT_EX
Eric Smith e...@trueblade.com added the comment:
I'm working on a similar issue for int.__format__('c'). What's not clear to me
is why this doesn't work the same as chr(i). That is, shouldn't chr(i) ==
('%c' % i) hold for i in range(256)? And if that's so, why not just copy chr's
Eric Smith e...@trueblade.com added the comment:
That looks good. I tweaked it a little and fixed a few other problems with the
patch. New patch attached.
--
Added file: http://bugs.python.org/file16360/issue5965-1.diff
___
Python tracker rep
Eric Smith e...@trueblade.com added the comment:
Of course. Sorry about that.
But then why not copy unichr()? It calls PyUnicode_FromOrdinal.
I guess my real question is:
Should '%c' % i be identical to chr(i) and should u'%c' % i be identical
to unichr(i)?
And by identical I mean return
Eric Smith e...@trueblade.com added the comment:
The patch looks good to me, in that it implements your desired functionality
well.
I haven't been following the issue closely enough to know whether or not this
new functionality is the right way to go. (I'm not saying it's not, just that I
Eric Smith e...@trueblade.com added the comment:
This version of the patch adds support for classic classes and adds tests.
Documentation still needs to be written.
Again, this diff is against trunk.
If anyone wants to review this, in particular the tests that exercise
Eric Smith e...@trueblade.com added the comment:
With 10.6's stock python, I've had this test either work or crash Python.
On trunk, I get it to either work or give the same error as the original report.
Unfortunately I've been unable to get it to crash again in a debugger so I can
get
Eric Smith e...@trueblade.com added the comment:
Oops, sorry for not specifying that. It's:
Python 2.6.4 (r264:75706, Jan 27 2010, 12:09:19)
[GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] on darwin
--
___
Python tracker rep...@bugs.python.org
http
Eric Smith e...@trueblade.com added the comment:
I'm not exactly sure what wording to use here.
element_index: `integer` | `identifier`
is not exactly correct, because it can be a non-identifier (as the example that
eddy quotes points out. It's really any sequence of characters except
Eric Smith e...@trueblade.com added the comment:
Proposed patch attached. The rest of the documentation in the following 2
paragraphs looks correct. It refers to __getitem__, which is how either strings
or integers is looked up.
--
keywords: +patch
stage: - patch review
Added file
Eric Smith e...@trueblade.com added the comment:
These were originally deprecated in issue 5835.
Removed them from py3k in r78306.
--
resolution: - accepted
stage: - committed/rejected
status: open - closed
superseder: - Deprecate PyOS_ascii_formatd
Eric Smith e...@trueblade.com added the comment:
I closed this even though the functions remain in 2.7. They would not be
removed until 2.8, and since 2.8 seems unlikely I'll close this. Even if there
is a 2.8, then these functions will still be present but do no harm
Eric Smith e...@trueblade.com added the comment:
I just tried it again under gdb on MacOS 10.6, the supplied python 2.6.4 and
got this backtrace:
Program received signal SIGTRAP, Trace/breakpoint trap.
[Switching to process 61133]
0x7fff87a4b790 in __CFInitialize ()
(gdb) bt
#0
Eric Smith e...@trueblade.com added the comment:
Checked in:
trunk r78329
py3k r78333
release31-maint r78334
--
priority: - low
resolution: - accepted
stage: - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http
Eric Smith e...@trueblade.com added the comment:
With the fixes for complex in issue 7988, I believe this issue is completed.
--
priority: - normal
resolution: - accepted
stage: - committed/rejected
status: open - closed
type: - behavior
Eric Smith e...@trueblade.com added the comment:
I think there are no remaining issues here that don't have their own issue. I'm
going to close this unless one of you think otherwise.
--
assignee: - eric.smith
resolution: - out of date
status: open - pending
type: - behavior
Eric Smith e...@trueblade.com added the comment:
[If the status is pending, any comment turns it back to open, by design.]
I'd rather float.__format__ agree with %-formatting for floats than with
anything else.
'%+08.4f' % float('nan')
'+nan'
%00f % float('123')
'123.00'
(Not sure
New submission from Eric Smith e...@trueblade.com:
Background:
format(obj, fmt) eventually calls object.__format__(obj, fmt) if obj (or one of
its bases) does not implement __format__. The behavior of object.__format__ is
basically:
def __format__(self, fmt):
return str(self).__format__
Eric Smith e...@trueblade.com added the comment:
The root of this problem is an interaction with ',' formatting that was
introduced in 2.7 and 3.1. I'm still trying to figure out how to implement it.
I'm changing the priority to low because I can't imagine this is a problem in
practice
Eric Smith e...@trueblade.com added the comment:
Could you add a comment on why you're calling PyUnicode_FromString and then
throwing away the result? I believe it's so you'll get the same error checking
as PyUnicode_FromString, but it's sufficiently tricky that I think it deserves
a comment
Eric Smith e...@trueblade.com added the comment:
Isn't it true that after regenerating configure that you need to check it back
in? Or is that so obvious to everyone except me that it's not worth mentioning?
--
nosy: +eric.smith
___
Python tracker
Eric Smith e...@trueblade.com added the comment:
If you want to generate some more discussion, I suggest you close this issue
and reopen the other one, since that has more people on the nosy list.
--
___
Python tracker rep...@bugs.python.org
http
Eric Smith e...@trueblade.com added the comment:
At the language summit we okay'd using ctypes in the tests for standard lib
modules, specifically for this issue.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1578269
Eric Smith e...@trueblade.com added the comment:
This was just discussed in issue 6760.
--
nosy: +eric.smith
resolution: - duplicate
stage: - committed/rejected
status: open - closed
superseder: - patch to subprocess docs to better explain Popen's 'args'
argument
New submission from Eric Smith e...@trueblade.com:
It surprised me that this doesn't work:
{0[-1]}.format('fox')
Traceback (most recent call last):
File stdin, line 1, in module
TypeError: string indices must be integers
I was expecting it to be equivalent to:
{0[2]}.format('fox')
'x'
I
Eric Smith e...@trueblade.com added the comment:
I agree that backporting the various parts needed to get this working would be
risky and shouldn't be done.
As for Solaris sure, I'm not sure. You might ask on python-dev. I get the
impression that few (if any) core developers have access
Eric Smith e...@trueblade.com added the comment:
str-float conversions have been reworked in 2.7 and 3.1. The 'D' exponent will
not on any platform starting with those versions.
So, this would be a non-platform specific feature request.
--
assignee: ronaldoussoren -
components
Eric Smith e...@trueblade.com added the comment:
That was supposed to say:
The 'D' exponent will not work on any platform starting with those versions.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7919
Eric Smith e...@trueblade.com added the comment:
Unless and until we implement 'd' exponents, we should add a test to make sure
they don't work. That they ever worked on any platform was a surprise.
--
Eric.
--
title: reading scientific notation using d instead of e on max osx
Eric Smith e...@trueblade.com added the comment:
I'm -1 on this, too. Closing.
--
resolution: - rejected
stage: - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7919
Changes by Eric Smith e...@trueblade.com:
--
nosy: +eric.smith, mark.dickinson
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7906
___
___
Python
Eric Smith e...@trueblade.com added the comment:
I think this is an improvement to the existing docs, and should be committed.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6760
Eric Smith e...@trueblade.com added the comment:
When merging to py3k, don't forget to modify the print statement to be a
function.
--
status: pending - open
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6760
Changes by Eric Smith e...@trueblade.com:
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7844
___
___
Python-bugs-list mailing
Eric Smith e...@trueblade.com added the comment:
- When run with patch 20 as non-admin on Windows 7, I get the same test_tarfile
errors that Brian gets. I do not get these errors with an unpatched py3k build.
- When run with patch 20 as an admin on Windows 7, I do not get the errors
Eric Smith e...@trueblade.com added the comment:
From David's patch:
Note in particular that options and their arguments go in separate list
elements, while arguments that need quoting when used in the shell
(such as filenames containing spaces or the python command shown
above
Eric Smith e...@trueblade.com added the comment:
Now you need to put the import of subprocess back in!
Otherwise it looks good to me.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6760
Changes by Eric Smith e...@trueblade.com:
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7839
___
___
Python-bugs-list mailing
Eric Smith e...@trueblade.com added the comment:
The more I think about this, the more concerned I am about changing the number
of elements in the tuple. That's the change that broke platform.py. Maybe we
should add a parameter named something like level, defaulting to 0.
0 = existing
Eric Smith e...@trueblade.com added the comment:
Great idea, Marc-Andre. I agree that's the better approach.
It looks like PyStructSequence supports this, by setting n_in_sequence to a
value smaller then the number of PyStructSequence_Fields. A quick look doesn't
show any uses
Eric Smith e...@trueblade.com added the comment:
Here's a patch that implement's Marc-Andre's suggestion. The docstring and
documentation need work. I still need to verify that this isn't a misuse of
PyStructSequence, but the tests pass on Windows. I need to verify a few other
platforms
Eric Smith e...@trueblade.com added the comment:
I can confirm the most recent patch (ex2) doesn't break anything on MacOS or
Linux.
It's clear that structseq.c is designed to be used this way, with more named
members than unnamed members (and vice-versa, actually). See n_members vs
Eric Smith e...@trueblade.com added the comment:
datetime.datetime passes its format string to strftime:
import datetime
x = datetime.datetime(2001, 1, 2, 3, 4)
x.strftime('%Y-%m-%d')
'2001-01-02'
'{0:%Y-%m-%d}'.format(x)
'2001-01-02'
I'll check to make sure this is documented
Eric Smith e...@trueblade.com added the comment:
I don't think this is documented (that I can find, at least), so I'll assign it
to Georg.
I think the correct thing to do is something like this, in the datetime, date,
and time object descriptions:
date.__format__(fmt)
For a date d
Eric Smith e...@trueblade.com added the comment:
The documentation for this belongs in the mini-language specification, since
that just address built-in types. Each type can define its own format
specification language.
So I think adding documentation of __format__ to each non-builtin type
Eric Smith e...@trueblade.com added the comment:
Eric Smith wrote:
The documentation for this belongs in the mini-language specification, ...
Oops. does NOT belong in the mini-language specification.
--
___
Python tracker rep...@bugs.python.org
Eric Smith e...@trueblade.com added the comment:
Here's the final version of the patch. After some testing on various platforms
I'll commit it.
--
Added file: http://bugs.python.org/file16020/winver_as_structseq_ex4.diff
___
Python tracker rep
Eric Smith e...@trueblade.com added the comment:
Committed in trunk r77763, in py3k r77765.
--
assignee: - eric.smith
resolution: - accepted
stage: patch review - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
Changes by Eric Smith e...@trueblade.com:
--
assignee: eric.smith - georg.brandl
nosy: +georg.brandl
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7789
Eric Smith e...@trueblade.com added the comment:
Here's an updated patch. I fixed some docstrings, modified it to work with the
most recent assertIsInstance changes, and added #ifdef for Windows.
There are a number of test failures still, I think all of them relating to
errors in platform.py
Eric Smith e...@trueblade.com added the comment:
I like this. I've visually reviewed the patch, but haven't tested it yet. I'm
willing to commit this.
Could you add to the tests to assert that .major is equal to [0], etc.?
Also, the documentation says that element [4] is text, but you've
Eric Smith e...@trueblade.com added the comment:
This is a duplicate of issue 7455.
--
components: +Extension Modules -None
nosy: +eric.smith
resolution: out of date - duplicate
superseder: - cPickle: stack underflow in load_pop()
___
Python tracker
Changes by Eric Smith e...@trueblade.com:
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7743
___
___
Python-bugs-list mailing
301 - 400 of 790 matches
Mail list logo