[issue5465] No edit in IDLE in right click context menu

2009-03-09 Thread Martin v. Löwis

Martin v. Löwis  added the comment:

That's not a bug. When you installed 2.5, you had defined that files are
associated with 2.5. When you uninstalled 2.5, those associations were
removed. In "Add and Remove Programs", find 2.6, and run a "Repair"
installation to get the files associated with 2.6.

--
message_count: 1.0 -> 2.0
nosy: +loewis
nosy_count: 1.0 -> 2.0
resolution:  -> invalid
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2706] datetime: define division timedelta/timedelta

2009-03-09 Thread Fredrik Johansson

Fredrik Johansson  added the comment:

I think datetime division would be a fine application for Fractions.

--
message_count: 18.0 -> 19.0
nosy: +fredrikj
nosy_count: 7.0 -> 8.0

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5370] unpickling vs. __getattr__

2009-03-09 Thread Mike Meyer

Mike Meyer  added the comment:

QAD patch for 2.6 pickle.py to fix this bug. Passes the 2.6 pickle unit
tests.

--
message_count: 5.0 -> 6.0
Added file: http://bugs.python.org/file13290/pp

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5237] Allow auto-numbered replacement fields in str.format() strings

2009-03-09 Thread Senthil

Senthil  added the comment:

Would someone like to point the python-ideas discussion which
rationalizes this request?
And what would be written in the documentation? As much as I
understand this, emptry braces {} for replacement fields is kind of
unseen and leaves much thinking if this can be simplified, just as %
or # or any other character instead of a opening { and closing }.

--
message_count: 18.0 -> 19.0
nosy: +orsenthil
nosy_count: 8.0 -> 9.0

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5370] unpickling vs. __getattr__

2009-03-09 Thread Mike Meyer

Mike Meyer  added the comment:

I don't believe in documenting bugs instead of fixing them. If this bug
is going to stay in the code, I can either fix my install of Python to
have non-broken Pickle modules, or I can fix every third-party libraries
objects I use whose authors didn't worry about pickling them enough to
find this. The fornmer is almost certainly easier, given a little time.
Probably even easier than agreeing on proper document wording.

The __init__ case is different - there isn't a common use case (this one
comes from the standard library) for __init__ that breaks pickling, and
the problems tend to manifest in the resulting pickles, not in the
unpickling process.

--
message_count: 4.0 -> 5.0

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2706] datetime: define division timedelta/timedelta

2009-03-09 Thread Tennessee Leeuwenburg

Changes by Tennessee Leeuwenburg :


--
nosy: +tleeuwenb...@gmail.com
nosy_count: 6.0 -> 7.0

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5465] No edit in IDLE in right click context menu

2009-03-09 Thread Eddie Slimak

Changes by Eddie Slimak :


--
type:  -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5465] No edit in IDLE in right click context menu

2009-03-09 Thread Eddie Slimak

New submission from Eddie Slimak :

I was mucking around attempting to get WConio working and so had an
installation for both python 2.5 and 2.6 at the same time.  After I
uninstalled python 2.5 windows somehow stopped associating .py files
with python.

--
components: IDLE, Windows
message_count: 1.0
messages: 83412
nosy: ESlim
nosy_count: 1.0
severity: normal
status: open
title: No edit in IDLE in right click context menu
versions: Python 2.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5460] Python 3.0 grammar is ambiguous with the addition of star_expr

2009-03-09 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
priority:  -> high

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5464] msgfmt.py does not work with plural form

2009-03-09 Thread Martin v. Löwis

Changes by Martin v. Löwis :


--
assignee:  -> loewis
nosy: +loewis
nosy_count: 1.0 -> 2.0
priority:  -> high

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2009-03-09 Thread Martin v. Löwis

Martin v. Löwis  added the comment:

> I've been far too busy in the new year to keep up with all your updates 
> to this issue, but since Martin wanted some clarification on direction 
> and copyright,

Thanks for the clarification. So I think we should focus on Matthew's
patches first, and come back to yours when you have time to contribute
them.

--
message_count: 68.0 -> 69.0

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5457] ZipFile writes incorrect modification time (second is off-by-one)

2009-03-09 Thread Martin v. Löwis

Changes by Martin v. Löwis :


--
resolution:  -> wont fix
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5428] Pyshell history management error

2009-03-09 Thread Michel Weinachter

Michel Weinachter  added the comment:

Hello,

Ok, you are right I'm currently working using latex and I should have
made a copy from the pdf.

Sorry.

2009/3/5 Georg Brandl :
>
> Georg Brandl  added the comment:
>
> The code you pasted contains a non-ASCII quote (’).
>
> --
> nosy: +georg.brandl
> resolution:  -> invalid
> status: open -> pending
>
> ___
> Python tracker 
> 
> ___
>

--
message_count: 2.0 -> 3.0

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5237] Allow auto-numbered replacement fields in str.format() strings

2009-03-09 Thread Nick Coghlan

Nick Coghlan  added the comment:

Excellent feature - with this, I would actually see some hope for
dropping all of my remaining uses of %-formatting at some point in the
future.

--
message_count: 17.0 -> 18.0
nosy: +ncoghlan
nosy_count: 7.0 -> 8.0

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5445] codecs.StreamWriter.writelines problem when passed generator

2009-03-09 Thread Facundo Batista

Facundo Batista  added the comment:

When fixing this, note that the builtin name "list" should not be
overwritten by the argument name.

--
message_count: 1.0 -> 2.0
nosy: +facundobatista
nosy_count: 1.0 -> 2.0

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5464] msgfmt.py does not work with plural form

2009-03-09 Thread Stephen George

New submission from Stephen George :

It seems that C:\Python26\Tools\i18n\msgfmt.py does not work with PO
files that use plural form. Get the following error.
ERRORTraceback (most recent call last):
  File "C:\Python26\Tools\i18n\msgfmt.py", line 203, in 
main()
  File "C:\Python26\Tools\i18n\msgfmt.py", line 199, in main
make(filename, outfile)
  File "C:\Python26\Tools\i18n\msgfmt.py", line 151, in make
l = eval(l)
  File "", line 1
_plural "%d generations"
  ^
SyntaxError: invalid syntax

--
components: Demos and Tools
files: de.po
message_count: 1.0
messages: 83407
nosy: steve_geo
nosy_count: 1.0
severity: normal
status: open
title: msgfmt.py does not work with plural form
type: behavior
versions: Python 2.6
Added file: http://bugs.python.org/file13289/de.po

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5463] Compiler warning get_ulong is never used 3.x

2009-03-09 Thread Andreas Schawo

New submission from Andreas Schawo :

When compiling the newest 3.x trunk I've got a compiler warning that
get_ulong is defined but never used.

I moved the function near the only place where it is used (disabled code).

Now I have no more warnings.

I don't know if it's of any use.

--
components: Extension Modules
files: get_ulong_patch.diff
keywords: patch
message_count: 1.0
messages: 83406
nosy: andreas.schawo
nosy_count: 1.0
severity: normal
status: open
title: Compiler warning get_ulong is never used 3.x
type: compile error
versions: Python 3.1
Added file: http://bugs.python.org/file13288/get_ulong_patch.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5456] io.StringIO's universal newlines support is broken in 3.0.1

2009-03-09 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Thanks, fixed in r70285.

--
message_count: 1.0 -> 2.0
nosy: +benjamin.peterson
nosy_count: 1.0 -> 2.0
resolution:  -> fixed
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5411] add xz compression support to distutils

2009-03-09 Thread Tarek Ziadé

Tarek Ziadé  added the comment:

> I guess such a test would belong in Lib/distutils/test_dist.py

no, rather in test_bdist_rpm, test_sdist and so on,
but I can do it, it'll just take more time.

--
message_count: 3.0 -> 4.0

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5462] Pythonwin Vista Compatibility

2009-03-09 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Please direct your question to the win32 or Python mailing lists. This
tracker is for reporting bugs in Python, not support.

--
message_count: 1.0 -> 2.0
nosy: +benjamin.peterson
nosy_count: 1.0 -> 2.0
resolution:  -> invalid
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5462] Pythonwin Vista Compatibility

2009-03-09 Thread Julie Earls

New submission from Julie Earls :

Hello-

I am trying to install a version of Python that includes Pythonwin and 
is compatible with a 32-bit Winsows Vista computer.  Can anyone tell me 
which version works?  I have tried several and so far no luck.

Thanks

--
components: Windows
message_count: 1.0
messages: 83402
nosy: jearls
nosy_count: 1.0
severity: normal
status: open
title: Pythonwin Vista Compatibility
versions: Python 2.4, Python 2.5, Python 2.6, Python 2.7, Python 3.0, Python 3.1

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5411] add xz compression support to distutils

2009-03-09 Thread Per Øyvind Karlsen

Per Øyvind Karlsen  added the comment:

hmm, I'm unsure about how this should be done..


I guess such a test would belong in Lib/distutils/test_dist.py, but I'm
uncertain about how it should be done, ie. should it be a test for doing
'bdist', 'bdist_rpm' and 'sdist' for each of the formats supported? I
cannot seem to find any tests for the currently supported formats and
such tests would introduce dependencies on the tools used to compress
with these formats..

--
message_count: 2.0 -> 3.0

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5461] python3 symlink

2009-03-09 Thread David Ripton

New submission from David Ripton :

When Python 2.x is manually installed on Linux, a python2 symlink is
created, like this:

lrwxrwxrwx 1 root root 9 Jan 24 00:03 /usr/bin/python2 -> python2.6

("make install" updates the symlink; "make altinstall" does not).

When Python 3.x is installed, no python3 symlink is created.

For Python 2.x, one had a choice of #!/usr/bin/python,
#!/usr/bin/python2, or #!/usr/bin/python2.6 for shebang line.

For Python 3.x, the middle choice is lost.  This seems like a small
regression.

--
components: Installation
message_count: 1.0
messages: 83400
nosy: dripton
nosy_count: 1.0
severity: normal
status: open
title: python3 symlink
type: feature request
versions: Python 3.0, Python 3.1

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5233] Enhance 2.7 IDLE to exec IDLESTARTUP/PYTHONSTARTUP on restart

2009-03-09 Thread Guilherme Polo

Guilherme Polo  added the comment:

Assigning to kbk since 5234 was assigned to him.

--
assignee:  -> kbk
message_count: 2.0 -> 3.0
nosy: +gpolo, kbk
nosy_count: 1.0 -> 3.0

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5234] Enhance 3.1 IDLE to exec IDLESTARTUP/PYTHONSTARTUP on restart

2009-03-09 Thread Guilherme Polo

Guilherme Polo  added the comment:

Closing in favor of 5233, I see the fix being applied to both 2.7 and
3.1 if accepted.

--
message_count: 3.0 -> 4.0
nosy: +gpolo
nosy_count: 3.0 -> 4.0
resolution:  -> duplicate
status: open -> closed
superseder:  -> Enhance 2.7 IDLE to exec IDLESTARTUP/PYTHONSTARTUP on restart

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5450] test_tcl testLoadTk fails if DISPLAY defined but connect fails, instead of being skipped

2009-03-09 Thread Guilherme Polo

Guilherme Polo  added the comment:

It should be okay to move tk tests to somewhere in
Lib/lib-tk/test/test_tkinter/ (answering the final question). Even the
rest of test_tcl could be relocated to that place.

--
message_count: 4.0 -> 5.0

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5450] test_tcl testLoadTk fails if DISPLAY defined but connect fails, instead of being skipped

2009-03-09 Thread Guilherme Polo

Guilherme Polo  added the comment:

Please use test_support.TestSkipped instead of showing a skip message
using print.

--
message_count: 3.0 -> 4.0
nosy: +gpolo
nosy_count: 1.0 -> 2.0

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5460] Python 3.0 grammar is ambiguous with the addition of star_expr

2009-03-09 Thread Fabio Zadrozny

New submission from Fabio Zadrozny :

Note: A discussion related to this bug was raised on:
http://mail.python.org/pipermail/python-dev/2009-March/086939.html

The following constructs are ambiguous in the Python 3.0 grammar:

arglist: (argument ',')*
(argument [',']
 |'*' test (',' argument)* [',' '**' test]
 |'**' test
 )

argument: test [comp_for]
test: or_test
or_test: and_test
and_test: not_test
not_test: 'not' not_test | comparison
comparison: star_expr
star_expr: ['*'] expr


So, with that construct, having call(arglist) in a format:

call(*test), the grammar would find it to be consumed in the argument
construction (because of the star_expr) and not in the arglist in the
'*' test.

Python seems to be lucky in this because it seems to be getting in the
correct choice, when that's not really possible from the grammar --
maybe it tries the 2nd construct before the 1st and succeeds because of
that? It seems to me that this could actually be a bug in the Python
grammar generator. 

It doesn't seem possible to disambiguate that without semantic actions
later on, but the grammar could be changed to disambiguate that.

I've used the constructs below in a JavaCC grammar successfully (and I
think Python could use the same constructs):

expr_stmt: testlist_star_expr (augassign (yield_expr|testlist) |
 ('=' (yield_expr|testlist_star_expr))*)
 
testlist_star_expr: (test|star_expr) (',' test|star_expr)* [',']

star_expr: '*' expr

--
components: Interpreter Core
message_count: 1.0
messages: 83395
nosy: fabioz
nosy_count: 1.0
severity: normal
status: open
title: Python 3.0 grammar is ambiguous with the addition of star_expr
type: feature request
versions: Python 3.0, Python 3.1

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5237] Allow auto-numbered replacement fields in str.format() strings

2009-03-09 Thread Guido van Rossum

Guido van Rossum  added the comment:

Please go ahead and finish this. I'm glad this is going in!

--
message_count: 16.0 -> 17.0
nosy: +gvanrossum
nosy_count: 6.0 -> 7.0

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5448] Add precision property to decimal.Decimal

2009-03-09 Thread Daniel Lescohier

Daniel Lescohier  added the comment:

I had other code to check scale, but you are right, I should use 
quantize. There is certainly a lot to absorb in the IBM decimal 
specification.  I really appreciate you pointing me to quantize and 
Inexact. I guess I inadvertently used the issue tracker for help on 
the decimal module, I didn't really mean to do that, I really thought 
there was a need for Decimal.precision. The other unrelated issue I 
entered (#5445) should be more of a real issue.

My code constructs a conversion/validation closure for every field in 
the Schema, based on a SchemaField definition for each field. My 
SchemaFieldDecimal class includes precision and scale parameters, and 
now I'm going to add a rounding parameter, with None meaning raise an 
error on Inexact.

So pseudo-code for the fix:

scale = None if scale is None else Decimal((0,(1,),-scale))
traps = (InvalidOperation, Inexact) if rounding is None else 
(InvalidOperation,)
context = Context(prec=precision, rounding=rounding, traps=traps)

doing the conversion/validation:

For case if scale is not None:

try:
with context:
value = Decimal(value).quantize(scale)
except handlers...

For case if scale is None:

try:
   with context:
   value = Decimal(value)+Decimal(0) # will round or raise Inexact
except handlers...

--
message_count: 2.0 -> 3.0

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5450] test_tcl testLoadTk fails if DISPLAY defined but connect fails, instead of being skipped

2009-03-09 Thread R. David Murray

R. David Murray  added the comment:

Patch uploaded as bzr branch to Launchpad at

  bzr+ssh://bazaar.launchpad.net/~rdmurray/python/bug5450-test

--
message_count: 2.0 -> 3.0

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4847] csv fails when file is opened in binary mode

2009-03-09 Thread Skip Montanaro

Skip Montanaro  added the comment:

me> What should be the default?

Scratch that.  If the iterator passed to csv.reader is in a mode which will
cause it to emit bytes instead of unicode objects the caller must give an
encoding.  The csv.reader code will then perform the necessary
bytes-to-unicode conversion.  If bytes are returned by the iterator but no
encoding was given it should raise an exception (something standard?
something new?).

Skip

--
message_count: 20.0 -> 21.0

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5406] asyncore doc issue

2009-03-09 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

You're right, my fault.

--
message_count: 3.0 -> 4.0

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5455] csv module no longer works as expected when file opened in binary mode

2009-03-09 Thread Skip Montanaro

Skip Montanaro  added the comment:

Jervis> So the returned lineobj is a bytes type and then the
Jervis> PyUnicode_Check throws the error.

Right, but given that fact how do you get a Unicode string out of the bytes
without an encoding?  You can't open a file in binary mode and give the
encoding arg.

--
message_count: 4.0 -> 5.0

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5223] infinite recursion in PyErr_WriteUnraisable

2009-03-09 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

python 3.0 does not crash. And it has better code for infinite recursion
(r55850, r66186)
I suggest to backport the py3k code, patch attached.

Martin, your comments are welcome. Are there compatibility issues?

--
keywords: +patch
message_count: 4.0 -> 5.0
nosy: +loewis
nosy_count: 3.0 -> 4.0
Added file: http://bugs.python.org/file13284/recursioncheck.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5237] Allow auto-numbered replacement fields in str.format() strings

2009-03-09 Thread Eric Smith

Eric Smith  added the comment:

Also note that this patch causes a few tests to fail, since they're
trying to ensure that '{}'.format will fail. If we go forward I'll
address that too, of course.

--
message_count: 15.0 -> 16.0

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5237] Allow auto-numbered replacement fields in str.format() strings

2009-03-09 Thread Eric Smith

Eric Smith  added the comment:

I'm attaching a patch that delivers the basic functionality in
str.format. This patch is against trunk, although it will probably work
elsewhere.

DO NOT USE THIS PATCH IN ANY SERIOUS WORK

It doesn't implement all of the needed functionality, it probably has a
memory leak, and it most likely can cause a GP fault. It does, however,
handle the common cases and it will give you a taste of the feature.

In particular, it doesn't handle anything other than empty braces
('{:d}' will fail). I can add this, and I think it should be added, but
I just haven't had the time to finish it up. I wanted to get this posted
so others can play with it and we can reach a decision if we want to add
this functionality. Personally, I think it's a great improvement, and
the more I play with it the more I like it.

If we reach a consensus that the feature should be added, I can probably
get it cleaned up and finished before PyCon.

$ ./python.exe 
Python 2.7a0 (trunk:70244M, Mar  8 2009, 16:54:23) 
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> '{} {} {}'.format(1, 3.4, 'test')
'1 3.4 test'
>>> '{} {1}'.format(1, 2)
Traceback (most recent call last):
  File "", line 1, in 
ValueError: cannot switch from automatic field numbering to manual field
specification
>>>

--
keywords: +patch
message_count: 14.0 -> 15.0
Added file: http://bugs.python.org/file13283/half-baked-not-for-real-use.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4847] csv fails when file is opened in binary mode

2009-03-09 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> I had already read it. I gave it a prize for "least intuitive arg in the
> language".

Please open a bug, then :)

> So you plan to use that, reading "lines" instead of blocks?
> You'll still have to examine which CRs and LFs are embedded and which
> are line terminators. You might just as well use f.read(BLOCKSZ) and
> avoid having to insist that the user explicitly write ", newline=''".

Sorry, but who is "you" in that paragraph?
The csv module currently accepts any iterator yielding lines of text,
not only file objects. Changing this would be a major compatibility
break.

> Excel has no default, because the user has no option -- the defined
> encoding is "cp" + str(codepage_number_derived_from_locale), e.g.
> "cp1252".

Then Excel-generated CSV files all use different encodings? Gasp :-(

--
message_count: 14.0 -> 15.0

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4111] Add DTrace probes

2009-03-09 Thread Dan Villiom Podlaski Christiansen

Changes by Dan Villiom Podlaski Christiansen :


--
nosy: +danchr
nosy_count: 12.0 -> 13.0

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5443] trivial typo in itertools documentation

2009-03-09 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

r70261

--
message_count: 1.0 -> 2.0
nosy: +rhettinger
nosy_count: 2.0 -> 3.0
resolution:  -> fixed
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4847] csv fails when file is opened in binary mode

2009-03-09 Thread John Machin

John Machin  added the comment:

pitrou> Please look at the doc for open() and io.TextIOWrapper. The
`newline` parameter defaults to None, which means universal newlines
with newline translation. Setting to '' (yes, the empty string) enables
universal newlines but disables newline translation ...

I had already read it. I gave it a prize for "least intuitive arg in the
language". So you plan to use that, reading "lines" instead of blocks?
You'll still have to examine which CRs and LFs are embedded and which
are line terminators. You might just as well use f.read(BLOCKSZ) and
avoid having to insist that the user explicitly write ", newline=''".

pitrou> However, I think csv should accept files opened in binary mode
and be able to deal with line endings itself. How am I supposed to know
the encoding of a CSV file? Surely Excel uses a defined, default
encoding when exporting to CSV... that knowledge should be embedded in
the csv module.

Excel has no default, because the user has no option -- the defined
encoding is "cp" + str(codepage_number_derived_from_locale), e.g.
"cp1252". Likewise other software writing delimited data to text files
will use (one of) the local legacy encoding(s).

So: (i) mode='rb' and no encoding => caller gets bytes back and needs to
do own decoding or (ii) mode='rb' and an encoding [which looks rather
daft and is currently not possible] and the the caller gets str objects.
Both of these are ugly -- hence my preference for the mode="rt" variety
of solution. Do we really want the double hassle of both a str csv
implementation and a bytes csv implementation?

--
message_count: 13.0 -> 14.0

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5448] Add precision property to decimal.Decimal

2009-03-09 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

FWIW, there is a public API to get at the same information: 
Decimal.as_tuple().

That being said, I don't see how your len(value._int) test could be
correct.  The exponent will potentially shift the value way
out-of-bounds for a database.  Consider Decimal('999E+10') or
Decimal('999E-10') whose database storage sizes do not fit in a
DECIMAL(7,4) field eventhough their len(value._int) is three.


To see if the fractional part of a decimal number fits in a database,
set the context precision to the database precision and quantize the
decimal to the allowed number of decimal places.  If the Inexact flag
gets set, then it didn't fit.

-1 on extending the API any further from the underlying IBM specification.

--
message_count: 1.0 -> 2.0
nosy: +rhettinger
nosy_count: 1.0 -> 2.0
resolution:  -> rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4847] csv fails when file is opened in binary mode

2009-03-09 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Not good. It should preserve ALL characters in the field.

Please look at the doc for open() and io.TextIOWrapper. The `newline`
parameter defaults to None, which means universal newlines with newline
translation. Setting to '' (yes, the empty string) enables universal
newlines but disables newline translation (that it, it will split lines
on all of ['\n', '\r', '\r\n'], but will leave these newlines intact
rather than convert them to '\n').

However, I think csv should accept files opened in binary mode and be
able to deal with line endings itself. How am I supposed to know the
encoding of a CSV file? Surely Excel uses a defined, default encoding
when exporting to CSV... that knowledge should be embedded in the csv
module.

--
message_count: 12.0 -> 13.0

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5458] threading.Thread.join() documentation: missing 'from version' for RuntimeError exceptions

2009-03-09 Thread Eyal Gordon

New submission from Eyal Gordon :

In threading documentation:
http://www.python.org/doc/current/library/threading.html?highlight=threading#threading.Thread.join

It is not specified from which python version the join() call raises the
RuntimeError exception. In python version 2.4.3 join asserts on such
conditions.

--
assignee: georg.brandl
components: Documentation
message_count: 1.0
messages: 83367
nosy: eyal.gordon, georg.brandl
nosy_count: 2.0
severity: normal
status: open
title: threading.Thread.join() documentation: missing 'from version' for 
RuntimeError exceptions
versions: Python 2.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5457] ZipFile writes incorrect modification time (second is off-by-one)

2009-03-09 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

This appears to be an intrinsic limitation built into a zipfile's
standard file header format.  The header conforms to
http://www.pkware.com/documents/casestudies/APPNOTE.TXT where the date
and time fields are specified to be stored in the MS-DOS standard
date/time format detailed at
http://www.vsft.com/hal/dostime.htm.  In that format, there are only
five bits allocated for seconds.  Accordingly, seconds are stored
without their least significant bit (see the first few lines of
Zipfile.Fileheader where the seconds are encoded with dt[5] // 2).  Upon
decoding, the seconds are scaled back up (see the _RealGetContents()
method where the decoding is (t&0x1F) * 2).

Since zipfiles are supposed to be cross-platform and the file-format is
fixed, I don't see a way to remove this restriction.  Recommending to
close as wont-fix.

--
message_count: 1.0 -> 2.0
nosy: +rhettinger
nosy_count: 1.0 -> 2.0

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2889] curses for windows (alternative patch)

2009-03-09 Thread Zach Hirsch

Zach Hirsch  added the comment:

> * test_curses: I'd be happier to see the 'if' statement as sys.platform
> != 'win32' and (not term or term == 'unknown')  -- easier to read.

OK, fixed.

> * test_curses: does putp() make PDCurses crash, or is it not available?
>  If the latter, I'd prefer to see 'if hasattr(curses, "putp"): '.Same for the tparm() test.

They're stubs in pdcurses that always return an error. I'm not sure
which is better in this case -- make them available through the curses
module but always raise an exception on Windows, or make them
unavailable and have it be an AttributeError if something tries to call
them on Windows.

> * Given that you include term.h and IRIX included term.h, I wonder if we
> should make _cursesmodule.c include term.h on all platforms that have
it, and then fix the resulting breakage claimed by the comment (if any).

Yea, it was actually really easy to resolve the conflicts. I've done
that, and tested the result on Linux and OS X 10.4.

> * Is setupterm() a no-up on Windows?  Maybe the function just shouldn't
> be defined on Windows, then, so that user code can check for the
function's existence.

PDCurses does the same thing for setupterm as it does for putp/tparm
(and a number of other unsupported functions) -- always returns an
error. However, the curses module keeps track of whether it's been
initialized based on whether setupterm has been called, so I think it
makes sense to keep setupterm available but not call PDCurses's
setupterm function on Windows.

--
message_count: 4.0 -> 5.0
Added file: http://bugs.python.org/file13282/python-pdcurses-2.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5457] ZipFile writes incorrect modification time (second is off-by-one)

2009-03-09 Thread Christian Theune

New submission from Christian Theune :

See the attached unit test. On seconds that are > 0 and < 60 the written
second is reduced by 1.

(The test doesn't explicitly prove that this happens during writing, but
we checked this manually. The read function is fine.)

--
components: Library (Lib)
files: zipbug.py
message_count: 1.0
messages: 83364
nosy: ctheune
nosy_count: 1.0
severity: normal
status: open
title: ZipFile writes incorrect modification time (second is off-by-one)
type: behavior
versions: Python 2.4, Python 2.5, Python 2.6, Python 3.0
Added file: http://bugs.python.org/file13281/zipbug.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5447] future unicode literals and r'\u'

2009-03-09 Thread Zach Hirsch

Zach Hirsch  added the comment:

I've hit this, too, and it's annoyed me. So here's a patch against trunk
that should fix it. 

The idea is: whenever unicode_literals are turned on (or the -U command
line flag is passed), to convert r"\u" to "\u005c\u0075" and r"\U" to
"\u005c\u0055" for every string literal in the source file before
passing the string to PyUnicode_DecodeRawUnicodeEscape.

--
keywords: +patch
message_count: 2.0 -> 3.0
nosy: +zhirsch
nosy_count: 2.0 -> 3.0
Added file: http://bugs.python.org/file13280/raw-unicode-literals.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5406] asyncore doc issue

2009-03-09 Thread Josiah Carlson

Josiah Carlson  added the comment:

Well...the loop can also die if an uncaptured exception is raised, but 
I'm not sure that is necessary to spell out explicitly.

--
message_count: 2.0 -> 3.0

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5406] asyncore doc issue

2009-03-09 Thread Josiah Carlson

Josiah Carlson  added the comment:

Actually, that's exactly what it does.  If the count is missing, it 
defaults to None.  The code that is executed is exactly:

if count is None:
while map:
poll_fun(timeout, map)

It will loop until the map is empty.

--
message_count: 1.0 -> 2.0

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com