[issue14278] email.utils.localtime throws exception if time.daylight is False

2012-03-15 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
assignee:  - r.david.murray
resolution:  - fixed
stage:  - committed/rejected
type:  - behavior

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



[issue14278] email.utils.localtime throws exception if time.daylight is False

2012-03-15 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

Fixed in the email6 feature branch.  Thanks Brian.

--
status: open - closed

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



[issue4199] add shorthand global and nonlocal statements

2012-03-15 Thread Raymond Hettinger

Raymond Hettinger raymond.hettin...@gmail.com added the comment:

+1 on the feature as described in the PEP.

--
nosy: +rhettinger

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



[issue14309] Deprecate time.clock()

2012-03-15 Thread Marc-Andre Lemburg

Marc-Andre Lemburg m...@egenix.com added the comment:

STINNER Victor wrote:
 
 New submission from STINNER Victor victor.stin...@gmail.com:
 
 Python 3.3 has 3 functions to get time:
 
  - time.clock()
  - time.steady()
  - time.time()
 
 Antoine Pitrou suggested to deprecated time.clock() in msg120149 (issue 
 #10278).
 
 The problem is time.clock(), since it does two wildly different things
 depending on the OS. I would suggest to deprecate time.clock() at the same 
 time as we add time.wallclock(). For the Unix-specific definition of 
 time.clock(), there is already os.times() (which gives even richer 
 information).
 
 (time.wallclock was the old name of time.steady)

Strong -1 on this idea.

time.clock() has been in use for ages in many many scripts. We don't
want to carelessly break all those.

--
nosy: +lemburg

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



[issue12758] time.time() returns local time instead of UTC

2012-03-15 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 1559a82a3529 by R David Murray in branch '2.7':
#12758: removing confusing mention of UTC from time.time description
http://hg.python.org/cpython/rev/1559a82a3529

New changeset 5615d6b91b53 by R David Murray in branch '3.2':
#12758: removing confusing mention of UTC from time.time description
http://hg.python.org/cpython/rev/5615d6b91b53

New changeset f18767bb66ba by R David Murray in branch 'default':
Merge #12758: removing confusing mention of UTC from time.time description
http://hg.python.org/cpython/rev/f18767bb66ba

--
nosy: +python-dev

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



[issue14127] add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds

2012-03-15 Thread Larry Hastings

Larry Hastings la...@hastings.org added the comment:

My revised patch, incorporating changes suggested by Antoine and Guido.

--
Added file: http://bugs.python.org/file24859/larry.st_mtime_ns.patch.2.txt

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



[issue12758] time.time() returns local time instead of UTC

2012-03-15 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

Thanks, Dylan.

--
nosy: +r.david.murray
resolution:  - fixed
stage: needs patch - committed/rejected
status: open - closed
type:  - behavior

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



[issue14312] Convert PEP 7 to reStructuredText for readability purposes

2012-03-15 Thread Georg Brandl

New submission from Georg Brandl ge...@python.org:

Yes, who not.  Applied in 5d6ae5e01df6.

--
nosy: +georg.brandl
resolution:  - fixed
status: open - closed

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



[issue14312] Convert PEP 7 to reStructuredText for readability purposes

2012-03-15 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

Yes, why not. Applied in c1fd4a5af1c5.

--

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



[issue14312] Convert PEP 7 to reStructuredText for readability purposes

2012-03-15 Thread Georg Brandl

Changes by Georg Brandl ge...@python.org:


--
Removed message: http://bugs.python.org/msg155870

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



[issue14313] zipfile does not unpack files from archive (files extracted have zero length)

2012-03-15 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

This ZIP file uses a compression method unsupported by Python:
 z.getinfo('19A7B5A4.PKT').compress_type
6
which corresponds to Imploded. Only Stored and Deflated are supported.

Note that previous versions don't work either: they just happen to return the 
compressed data.

--
nosy: +amaury.forgeotdarc
stage:  - needs patch

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



[issue14309] Deprecate time.clock()

2012-03-15 Thread STINNER Victor

STINNER Victor victor.stin...@gmail.com added the comment:

 time.clock() has been in use for ages in many many scripts.
 We don't want to carelessly break all those.

I don't want to remove the function, just mark it as deprecated to
avoid confusion. It will only be removed from the next major Python.

--

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



[issue14307] Make subclassing SocketServer simpler for non-blocking frameworks

2012-03-15 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' g.rod...@gmail.com:


--
nosy: +giampaolo.rodola

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



[issue14309] Deprecate time.clock()

2012-03-15 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' g.rod...@gmail.com:


--
nosy: +giampaolo.rodola

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



[issue14295] PEP 417: adding mock module

2012-03-15 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' g.rod...@gmail.com:


--
nosy: +giampaolo.rodola

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



[issue14310] Socket duplication for windows

2012-03-15 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' g.rod...@gmail.com:


--
nosy: +giampaolo.rodola

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



[issue14315] zipfile.ZipFile() unable to open zip File

2012-03-15 Thread pleed

New submission from pleed felix.maten...@rwth-aachen.de:

zipfile.ZipFile(bla.apk) crashes, but should not since other tools work 
perfectly with this file.

Python 2.7.2+ (default, Oct  4 2011, 20:06:09) 
[GCC 4.6.1] on linux2
Type help, copyright, credits or license for more information.
 import zipfile
 zipfile.ZipFile(bla.apk)
Traceback (most recent call last):
  File stdin, line 1, in module
  File /usr/lib/python2.7/zipfile.py, line 710, in __init__
self._GetContents()
  File /usr/lib/python2.7/zipfile.py, line 744, in _GetContents
self._RealGetContents()
  File /usr/lib/python2.7/zipfile.py, line 803, in _RealGetContents
x._decodeExtra()
  File /usr/lib/python2.7/zipfile.py, line 369, in _decodeExtra
tp, ln = unpack('HH', extra[:4])
struct.error: unpack requires a string argument of length 4

--
components: None
files: bla.apk
messages: 155874
nosy: pleed
priority: normal
severity: normal
status: open
title: zipfile.ZipFile() unable to open zip File
type: crash
versions: Python 2.7
Added file: http://bugs.python.org/file24860/bla.apk

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



[issue14255] tempfile.gettempdir() didn't return the path with correct case.

2012-03-15 Thread Jeff McNeil

Jeff McNeil j...@jmcneil.net added the comment:

Here's a tiny patch that just changes normcase-normpath.  This fixes the 
casing issue at the 'gettempdir' level, though it doesn't address the 
'normcase' function itself.

Note that *both* macpath.py and ntpath.py use s.lower, which obviously won't 
fly on case-sensitive mounts. If someone more experienced than I has a 
suggestion on how to handle that -- or whether its worthwhile to even touch -- 
I'll gladly implement.

--
keywords: +patch
Added file: http://bugs.python.org/file24861/tempfile_normpath.patch

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



[issue14308] '_DummyThread' object has no attribute '_Thread__block'

2012-03-15 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
stage: test needed - patch review

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



[issue14307] Make subclassing SocketServer simpler for non-blocking frameworks

2012-03-15 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

As discussed on python-dev, I'm against this change. Furthermore, removing the 
explicit select() call also removes the opportunity to use a wake-up fd instead 
of the current polling mechanism.

--
nosy: +pitrou

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



[issue14314] logging smtp handler (and test) timeout issue

2012-03-15 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 4b3f81720809 by Vinay Sajip in branch 'default':
Fixes #14314: Improved SMTP timeout handling.
http://hg.python.org/cpython/rev/4b3f81720809

--
nosy: +python-dev

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



[issue14314] logging smtp handler (and test) timeout issue

2012-03-15 Thread Vinay Sajip

Vinay Sajip vinay_sa...@yahoo.co.uk added the comment:

I've added changes to the test code and a timeout to SMTPHandler (docs still to 
be updated), and I'll let it run on the buildbots for a bit before looking at 
timeouts for 3.2/2.7. Marking as pending to remind me.

--
assignee:  - vinay.sajip
resolution:  - fixed
status: open - pending

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



[issue1641] asyncore delayed calls feature

2012-03-15 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 59f0e6de54b3 by Giampaolo Rodola' in branch 'default':
(sched) when run() is invoked with blocking=False return the deadline of the 
next scheduled call in the scheduler; this use case was suggested in 
http://bugs.python.org/issue1641#msg149453
http://hg.python.org/cpython/rev/59f0e6de54b3

--
nosy: +python-dev

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



[issue14310] Socket duplication for windows

2012-03-15 Thread sbt

sbt shibt...@gmail.com added the comment:

It appears that the 4th argument of the socket constructor is undocumented, so 
presumably one is expected to use fromfd() instead.

Maybe you could have a frominfo(info) function (to match fromfd(fd,...)) and a 
dupinfo(pid) method.

(It appears that multiprocessing uses DuplicateHandle() instead of 
WSADuplicateSocket() for duplicating socket handles on Windows.  That should be 
fixed.)

--
nosy: +sbt

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



[issue11959] smtpd cannot be used without affecting global state

2012-03-15 Thread Vinay Sajip

Vinay Sajip vinay_sa...@yahoo.co.uk added the comment:

 I notice that your logging test code doesn't override create_socket.  Is that 
 no longer needed?

I removed that code from test_logging, but the code in the BitBucket repo shows 
how I'd like smtpd to be changed.

I would of course prefer to avoid copying stuff from SMTPChannel, as the 
docstring for TestSMTPChannel indicates. If you could take a look at the 
suggested changes in

https://bitbucket.org/vinay.sajip/cpython-smtpd/compare/default..mirror/cpython

and let me have your comments, that'd be great. The code in that repo does 
redefine create_socket.

--

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



[issue14308] '_DummyThread' object has no attribute '_Thread__block'

2012-03-15 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

I don't understand how that can happen, since _Thread__block is initialized in 
Thread.__init__, which is called by _DummyThread.__init__. Did you somehow 
monkeypatch the threading module?

--
nosy: +pitrou

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



[issue11826] Leak in atexitmodule

2012-03-15 Thread Stefan Krah

Stefan Krah stefan-use...@bytereef.org added the comment:

Antoine Pitrou rep...@bugs.python.org wrote:
 Well, if it doesn't crash, it's probably ok ;)
 Perhaps check modstate-atexit_callbacks for non-NULL?
 Or do we trust free() to do the right thing?

I was initially surprised by this, but the docs state that it's safe:

http://docs.python.org/dev/c-api/memory.html?highlight=pymem_free#PyMem_Free

The I searched a bit and it appears that free() crashing on NULL is
a pre-ANSI thing.

--

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



[issue11085] expose _abcoll as collections.abc

2012-03-15 Thread Laurent Mazuel

Changes by Laurent Mazuel laurent.maz...@gmail.com:


--
nosy: +Laurent.Mazuel

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



[issue14308] '_DummyThread' object has no attribute '_Thread__block'

2012-03-15 Thread Dustin Kirkland

Dustin Kirkland dustin.kirkl...@gmail.com added the comment:

/usr/lib/python2.7/threading.pyc is stock from my distribution, Ubuntu 12.04 
LTS, which has python-2.7.3~rc1-1ubuntu2.

I did manually apply the patch I've attached here to 
/usr/lib/python2.7/threading.py, and it *seemed* to silence those errors.

However, on checking my logs again this morning, I have a few hundred more of 
the same error, so that was not effective.

First time contributor here...what would be the proper way to test this?

Thanks for your patience.

--

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



[issue829370] math.signum(int)

2012-03-15 Thread Frank

Frank frank.breitl...@gmx.de added the comment:

Here an example where the signum function provides an elegant way to calculate 
the Julian date:

def julian_date(YY,MM,DD,HR,Min,Sec,UTcor):
 return 367*YY - (7*(YY+((MM+9)/12))/4) + (275*MM/9)+ DD + 1721013.5 + 
UTcor/24 - 0.5*sign((100*YY)+MM-190002.5) + 0.5 + HR/24.0 + Min/(60.0*24.0) + 
Sec/(3600.0*24.0)

http://aa.usno.navy.mil/faq/docs/JD_Formula.php
http://www.krioma.net/blog/2011/09/python_julian_date.php

By the way Julian date should be part of the time or datetime module.

--

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



[issue14308] '_DummyThread' object has no attribute '_Thread__block'

2012-03-15 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 However, on checking my logs again this morning, I have a few hundred
 more of the same error, so that was not effective.

Did you restart your server?

In your patch, you could use the traceback module (e.g. 
http://docs.python.org/dev/library/traceback.html#traceback.print_stack ) to 
figure out in which situation the error occurs.

--

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



[issue14316] Broken link in grammar.html

2012-03-15 Thread Berker Peksag

New submission from Berker Peksag berker.pek...@gmail.com:

In the rationale section: http://docs.python.org/devguide/grammar.html#rationale

This link is not working: 
http://docs.python.org/devguide/HowtoChangePython%27sGrammar

--
components: Devguide
messages: 155888
nosy: berker.peksag, ezio.melotti
priority: normal
severity: normal
status: open
title: Broken link in grammar.html

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



[issue14308] '_DummyThread' object has no attribute '_Thread__block'

2012-03-15 Thread sbt

sbt shibt...@gmail.com added the comment:

_DummyThread.__init__() explicitly deletes self._Thread__block:

def __init__(self):
Thread.__init__(self, name=_newname(Dummy-%d))

# Thread.__block consumes an OS-level locking primitive, which
# can never be used by a _DummyThread.  Since a _DummyThread
# instance is immortal, that's bad, so release this resource.
del self._Thread__block
^^^

--
nosy: +sbt

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



[issue14308] '_DummyThread' object has no attribute '_Thread__block'

2012-03-15 Thread sbt

sbt shibt...@gmail.com added the comment:

Ignore my last message...

--

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



[issue14316] Broken link in grammar.rst

2012-03-15 Thread Berker Peksag

Changes by Berker Peksag berker.pek...@gmail.com:


--
title: Broken link in grammar.html - Broken link in grammar.rst

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



[issue829370] math.signum(int)

2012-03-15 Thread Merlijn van Deen

Merlijn van Deen valhall...@gmail.com added the comment:

I'm not quite sure why that formula would be elegant in the first place, and 
I most certainly don't understand why

0.5*sign((100*YY)+MM-190002.5) + 0.5

is more elegant than

((100*YY)+MM  190002.5)

or

(((YY = 1900) and (MM  2.5)) or (YY  1900))

or rather: implementing leap years correctly in the first place, so the formula 
also works outside of the 1800-2099 range.


And, in general, I don't understand the problem. Everyone who does scientific 
computing has numpy *anyway*, so there is no gain for them.

As a last note, the C math.h also doesn't have a sign() function, and only a 
copysign() function: http://en.wikipedia.org/wiki/C_mathematical_functions

--

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



[issue829370] math.signum(int)

2012-03-15 Thread Merlijn van Deen

Merlijn van Deen valhall...@gmail.com added the comment:

Although there is one use case which I now realise due to your post: easier 
1-on-1 implementation of existing algorithms.

Another possible reason to implement it is that it's not that hard to implement 
the sign() function wrongly, if it also has to work with nans. This 
implementation:

def signum(x):
return (x  0) - (x  0)

returns 0 for nan, which is wrong (it should return nan). Another naive 
implementation

def signum(x):
return math.copysign(1, x)

also fails for nan, and gives a result for +/- 0 that could be right or wrong, 
depending on context.

--

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



[issue14255] tempfile.gettempdir() didn't return the path with correct case.

2012-03-15 Thread 勇刚 罗

勇刚 罗 luoyongg...@gmail.com added the comment:

It's possible to getting actual file name under Windows.
http://stackoverflow.com/questions/74451/getting-actual-file-name-with-proper-casing-on-windows

--

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



[issue14317] index.simple module licking in distutils2

2012-03-15 Thread Pierre Lecointre

New submission from Pierre Lecointre pi.lecoin...@gmail.com:

Got an error, in debian squeeze (python 2.6) and Ubuntu 11.10 (python 2.7) :

plec@cezoffsrv04:~$ python
Python 2.6.6 (r266:84292, Dec 27 2010, 00:02:40)
[GCC 4.4.5] on linux2
Type help, copyright, credits or license for more information.
 from distutils2.index.simple import Crawler
Traceback (most recent call last):
  File stdin, line 1, in module
ImportError: No module named index.simple


--
assignee: eric.araujo
components: Distutils2
messages: 155893
nosy: Pierre.Lecointre, alexis, eric.araujo, tarek
priority: normal
severity: normal
status: open
title: index.simple module licking in distutils2
type: behavior

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



[issue14317] index.simple module lacking in distutils2

2012-03-15 Thread Pierre Lecointre

Changes by Pierre Lecointre pi.lecoin...@gmail.com:


--
title: index.simple module licking in distutils2 - index.simple module lacking 
in distutils2
versions: +Python 2.6

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



[issue14230] Delegating generator is not always visible to debugging tools such as inspect pdb

2012-03-15 Thread Benjamin Peterson

Benjamin Peterson benja...@python.org added the comment:

I would appreciate the patch could be regenerated against the latest default.

--

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



[issue2377] Replace __import__ w/ importlib.__import__

2012-03-15 Thread Brett Cannon

Brett Cannon br...@python.org added the comment:

Yes, that's the important bit. Thomas has given it a once over at this point so 
you should be able to see his review comments as well to prevent duplicate work.

--

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



[issue14318] clarify http://docs.python.org/dev/library/time.html#time.steady

2012-03-15 Thread Jim Jewett

Changes by Jim Jewett jimjjew...@gmail.com:


--
assignee: docs@python
components: Documentation
nosy: Jim.Jewett, docs@python
priority: normal
severity: normal
status: open
title: clarify http://docs.python.org/dev/library/time.html#time.steady
type: enhancement
versions: Python 3.3

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



[issue829370] math.signum(int)

2012-03-15 Thread Frank Breitling

Frank Breitling frank.breitl...@gmx.de added the comment:

Because its short.

Because the former is a proper mathematical expression, while the latter 
is python jargon with limited use elsewhere.

Exactly, why is there no correct implementation of Julian date in python 
time or datetime?
For most practical purposes I can understand why most people would 
consider the above formula most useful and most elegant.

Then what's the math module good for?

So what? Is this the law of Moses? Or should we fall back to Assebmly?
Python is supposed to be a high-level language not a stone age tool.

However, I am glad you found at least another reason convincing to have 
this function.

Cheers!

--

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



[issue829370] math.signum(int)

2012-03-15 Thread Frank Breitling

Frank Breitling frank.breitl...@gmx.de added the comment:

Unfortunately my reply to the list lost all quotes, so I try to answer again 
through the web interface:
---

 I'm not quite sure why that formula would be elegant in the first place,

Because its short.

 and I most certainly don't understand why 0.5*sign((100*YY)+MM-190002.5) + 
 0.5 is more elegant ...

Because the former is a proper mathematical expression, while the latter is 
python jargon with limited use elsewhere.

 or rather: implementing leap years correctly in the first place, so the 
 formula also works outside of the 1800-2099 range.

Exactly, why is there no correct implementation of Julian date in python time 
or datetime?
For most practical purposes I can understand why most people would consider the 
above formula most useful and most elegant.

 And, in general, I don't understand the problem. Everyone who does scientific 
 computing has numpy *anyway*, so there is no gain for them.

Then what's the math module good for?

 As a last note, the C math.h also doesn't have a sign() function, and only a 
 copysign() function: http://en.wikipedia.org/wiki/C_mathematical_functions

So what? Is this the law of Moses? Or should we fall back to Assebmly?
Python is supposed to be a high-level language not a stone age tool.

However, I am glad you found at least another reason convincing to have this 
function.

Cheers!

--

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



[issue14317] index.simple module lacking in distutils2

2012-03-15 Thread Alexis Metaireau

Changes by Alexis Metaireau ale...@notmyidea.org:


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

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



[issue14200] Idle shell crash on printing non-BMP unicode character

2012-03-15 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

 On Windows Vista, I do see that print() behaves differently than
 evaluating the expression. An exception is raised for:
 print('\N{GOTHIC LETTER AHSA}')

As is for most other characters not supported in your OEM code
page, e.g. (likely) '\N{GREEK SMALL LETTER ALPHA}'

 On Linux, I see the character print as ? in xterm and as a '?' when
 evaluated. In gnome-terminal (Ubuntu Mono font) it prints as a box
 containing the code point in hex. No exception is raised.

That's because your terminal output encoding is UTF-8. If you change
your locale to C, or any other locale that doesn't cover full Unicode
(e.g. de_DE.ISO-8859-1, if supported on your Linux installation),
you get the same behavior on Linux as you do on Windows.

 Given that Windows and Linux (Ubuntu) behave differently

That's not a given, see above.

--

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



[issue14317] index.simple module lacking in distutils2

2012-03-15 Thread Alexis Metaireau

Alexis Metaireau ale...@notmyidea.org added the comment:

The APIs of distutils2 have changed. the index module is now named pypi.

So, doing something like::

 from distutils2.pypi.simple import Crawler

should work.

--

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



[issue11880] add a {dist-info} category to distutils2

2012-03-15 Thread Alexis Metaireau

Alexis Metaireau ale...@notmyidea.org added the comment:

Hey, is there any news on this bug? Berker?

--

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



[issue14294] Requirements are not properly copied into metatdata of dist-info

2012-03-15 Thread Alexis Metaireau

Alexis Metaireau ale...@notmyidea.org added the comment:

Thanks for reporting this Preston, 

Could you be a bit more precise on this one? What is the input you are giving 
(in the dist-info) and what is not being done? (what's the expected output and 
what's what you have as a result of running util.egginfo_to_distinfo)

Éric, I'm not sure #11880 is a dependency of this one, could you expand on this?

--

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



[issue5302] Allow package_data specs/globs to match directories

2012-03-15 Thread Alexis Metaireau

Alexis Metaireau ale...@notmyidea.org added the comment:

Agreed on this one. That would avoid to have a new syntax for this 
case, which seems to be very common.

--

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



[issue14319] cleanup index switching mechanism on packaging.pypi

2012-03-15 Thread Alexis Metaireau

New submission from Alexis Metaireau ale...@notmyidea.org:

I need to do some general cleanup on packaging/d2, and especially on this bit. 
Currently, the implementation is way too complicated for what it does.

--
assignee: alexis
components: Distutils2
messages: 155903
nosy: alexis, tarek
priority: normal
severity: normal
status: open
title: cleanup index switching mechanism on packaging.pypi
type: enhancement

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



[issue12684] profile does not dump stats on exception like cProfile does

2012-03-15 Thread Matt Joiner

Matt Joiner anacro...@gmail.com added the comment:

Jim the code was lifted verbatim from Lib/cProfile.py, line 47.

That code in cProfile.py has not changed since 2006 when it was committed by 
Armin Rigo.

I can modernize it if it's a requirement to get it committed, but I'm also okay 
with my conservative patch as is.

--
nosy: +arigo, mwh

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



[issue14279] packaging.pypi should support flat directories of distributions

2012-03-15 Thread Alexis Metaireau

Alexis Metaireau ale...@notmyidea.org added the comment:

It is supposed to work already, but I'm not sure this is tested or complete. 
I'll have a closer look on this. +1 on the general idea.

--
assignee: eric.araujo - alexis

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



[issue14280] packaging.pypi should not require checksums

2012-03-15 Thread Alexis Metaireau

Alexis Metaireau ale...@notmyidea.org added the comment:

If no MD5 checksum is present on the crawled simple index, then we don't have 
to check them. This means we introduce a potential security hole here (md5 
checksums were added for a reason).

What could be done is to explicitely don't check them if asked so. For instance 
using a --no-checksum flag when running pysetup, or passing a no_checksum 
argument when using the crawler.

Would that work for you?

Éric, this is a different issue than the one you pointed out in the sence that 
one is for local files and the other is for remote indexes. (Of course, local 
files, will not need checksums as well).

--

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



[issue14318] clarify may not in time.steady docs

2012-03-15 Thread Jim Jewett

New submission from Jim Jewett jimjjew...@gmail.com:

http://docs.python.org/dev/library/time.html#time.steady

Current:
Return the current time as a floating point number expressed in seconds. 
This clock advances at a steady rate relative to real time and it may not be 
adjusted. The reference point of the returned value is undefined so only the 
difference of consecutive calls is valid.

If available, a monotonic clock is used. By default, if strict is False, the 
function falls back to another clock if the monotonic clock failed or is not 
available. If strict is True, raise an OSError on error or NotImplementedError 
if no monotonic clock is available.

Does may not mean that the user isn't allowed to adjust it, or that they 
system won't always have adjusted it?  Assuming that this really means it won't 
jump around for daylight savings time or manual time resets, it could be 
reworded as:



Return elapsed seconds as a floating point number.  The start time is 
undefined, so only differences between calls are meaningful.  steady() is the 
best clock for profiling response time, as opposed to CPU usage.

This function prefers to rely upon a high-precision counter that is not 
affected by resetting the system time.  If no such monotonic clock is 
available, steady() will substitute another clock, but steady(strict=true) will 
raise either NotImplementedError or OSError.  

--
title: clarify http://docs.python.org/dev/library/time.html#time.steady - 
clarify may not in time.steady docs

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



[issue14275] pysetup create doesn't handle install requirements

2012-03-15 Thread Alexis Metaireau

Changes by Alexis Metaireau ale...@notmyidea.org:


--
dependencies: +Requirements are not properly copied into metatdata of dist-info

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



[issue3871] cross and native build of python for mingw32 with packaging

2012-03-15 Thread Matthias Klose

Changes by Matthias Klose d...@debian.org:


--
components: +Cross-Build -Build, Distutils2

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



[issue14275] pysetup create doesn't handle install requirements

2012-03-15 Thread Alexis Metaireau

Changes by Alexis Metaireau ale...@notmyidea.org:


--
dependencies:  -Requirements are not properly copied into metatdata of dist-info

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



[issue14275] pysetup create doesn't handle install requirements

2012-03-15 Thread Alexis Metaireau

Alexis Metaireau ale...@notmyidea.org added the comment:

Thanks for reporting this, Jan-Jaap, 

I've marked this issue as easy, it's mostly a matter of looking at the passed 
parameter and outputing the list in the generated file, respecting the PEP 345 
format (http://www.python.org/dev/peps/pep-0345/#requires-dist-multiple-use)

Do you want to work on this one?

--
keywords: +easy

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



[issue14320] set.add can return boolean indicate newly added item

2012-03-15 Thread Matt Joiner

New submission from Matt Joiner anacro...@gmail.com:

set.add can return True to indicate a newly added item to the set, or False if 
the item was already present.

The C function PySet_Add returns -1 on error, and 0 on success currently. This 
is extended to return 1 if the item is newly added, and 0 if it was already 
present. Precedents exist for PySet_Contains and PySet_Discard with the same 
semantics. There are only 3 calls that need to be patched in the entire core, 
these are included in the patch.

The Python function set.add currently returns None. This is extended to return 
True if if the item is new to the set, and False otherwise. No object overhead 
is introduced as set.add is already currently executing Py_RETURN_NONE.

Benchmarks indicate that set.add if the item isn't already present (returning 
True in the patched instance) reduces time by 5-9%. set.add if the item already 
exists increases time by 1-3%. I'm happy to put these down to effects of 
touching True and False instead of None on return from set.add.

Patch and primitive performance test attached.

--
components: Interpreter Core
files: set-add-return-bool.patch
keywords: patch
messages: 155909
nosy: anacrolix, eric.araujo, gvanrossum, petri.lehtinen
priority: normal
severity: normal
status: open
title: set.add can return boolean indicate newly added item
type: enhancement
versions: Python 3.3
Added file: http://bugs.python.org/file24862/set-add-return-bool.patch

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



[issue14320] set.add can return boolean indicate newly added item

2012-03-15 Thread Matt Joiner

Changes by Matt Joiner anacro...@gmail.com:


Added file: http://bugs.python.org/file24863/bench_set_add.py

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



[issue14320] set.add can return boolean indicate newly added item

2012-03-15 Thread Raymond Hettinger

Changes by Raymond Hettinger raymond.hettin...@gmail.com:


--
assignee:  - rhettinger
nosy: +rhettinger

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



[issue14321] Do not run pgen during the build if files are up to date

2012-03-15 Thread Matthias Klose

New submission from Matthias Klose d...@debian.org:

For a cross build, make tries to run pgen built for the host machine, not the 
build machine. However it is not necessary to run pgen at all if all the files 
are up to date. This change implements it.

The release script (if something like this exists) should make sure that the 
time stamps are correct, and then pgen isn't even built for a native build.

reviewed by MvL

--
assignee: doko
components: Build
files: pgen.diff
keywords: patch
messages: 155910
nosy: doko
priority: normal
severity: normal
status: open
title: Do not run pgen during the build if files are up to date
versions: Python 3.3
Added file: http://bugs.python.org/file24864/pgen.diff

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



[issue13872] socket.detach doesn't mark socket._closed

2012-03-15 Thread Matt Joiner

Matt Joiner anacro...@gmail.com added the comment:

Yes it should.

A cursory glance shows that __repr__ returns incorrect if _closed is not 
marked, and an unnecessary mop-up call to socket.close is avoided.

--
nosy: +giampaolo.rodola, haypo, stutzbach

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



[issue14321] Do not run pgen during the build if files are up to date

2012-03-15 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 52597f888e7a by Matthias Klose in branch 'default':
- Issue #14321: Do not run pgen during the build if files are up to date.
http://hg.python.org/cpython/rev/52597f888e7a

--
nosy: +python-dev

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



[issue14321] Do not run pgen during the build if files are up to date

2012-03-15 Thread Matthias Klose

Changes by Matthias Klose d...@debian.org:


--
status: open - closed

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



[issue14322] More test coverage for hmac.py

2012-03-15 Thread Brian Landers

New submission from Brian Landers br...@packetslave.com:

Adding some tests to non-default code paths in hmac.py to get to 100% coverage.

--
components: Tests
files: test_hmac.patch
keywords: patch
messages: 155913
nosy: packetslave
priority: normal
severity: normal
status: open
title: More test coverage for hmac.py
type: enhancement
versions: Python 2.7, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file24865/test_hmac.patch

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



[issue14294] Requirements are not properly copied into metatdata of dist-info

2012-03-15 Thread Preston Holmes

Preston Holmes pres...@ptone.com added the comment:

fixed in http://hg.python.org/distutils2/rev/f453054a7d8b

I worked on this fix with Tarek at the pycon sprints - still a bit unfamiliar 
with this tracker and how to best cross ref revs with ticket numbers

This ticket can't be closed until the question of the dependency is resolved.

--
resolution:  - fixed

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



[issue13694] asynchronous connect in asyncore.dispatcher does not set addr

2012-03-15 Thread Matt Joiner

Matt Joiner anacro...@gmail.com added the comment:

I should mention that this failure to set addr is unusual seeing as most socket 
instances are wrapping AF_INET* domain sockets, and aren't likely to connect 
without blocking. This is quite likely a reason nobody has observed it until 
now.

It *is* desirable to save addr at this point, as mentioned in previous comments.

Additionally addr is public API insofar as asyncore.sockets are concerned.

--
nosy: +akuchling

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



[issue14323] Normalize math precision in RGB/YIQ conversion

2012-03-15 Thread Brian Landers

New submission from Brian Landers br...@packetslave.com:

There doesn't seem to be a standard definition for the constants to use when 
doing the matrix calculations to convert RGB to YIQ or vise versa.  

Also, the current colorsys library uses two digits of precision for RGB-YIQ but 
six digits for YIQ-RGB.

The attached patch standardizes both functions to use the same constants as 
Matlab, using the same 3 digits of precision.  This makes a roundtrip of 
RGB-YIQ-RGB return the original values (for 3 digits of precision).

Also added tests, which brings colorsys.py to 100% coverage.

--
components: Library (Lib)
files: colorlib.patch
keywords: patch
messages: 155915
nosy: packetslave
priority: normal
severity: normal
status: open
title: Normalize math precision in RGB/YIQ conversion
type: enhancement
versions: Python 2.7, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file24866/colorlib.patch

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



[issue14323] Normalize math precision in RGB/YIQ conversion

2012-03-15 Thread Brian Landers

Changes by Brian Landers br...@packetslave.com:


Added file: http://bugs.python.org/file24867/acks.patch

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



[issue14324] Do not rely on AC_RUN_IFELSE tests in the configury

2012-03-15 Thread Matthias Klose

New submission from Matthias Klose d...@debian.org:

AC_RUN_IFELSE tests can't be used in cross builds, and have to fall back to 
some default in the case of a cross build.  This is a meta issue to collect 
changes for the conversion of such tests.

--
assignee: doko
components: Cross-Build
keywords: patch
messages: 155918
nosy: doko
priority: normal
severity: normal
status: open
title: Do not rely on AC_RUN_IFELSE tests in the configury
versions: Python 3.3

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



[issue14127] add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds

2012-03-15 Thread Guido van Rossum

Guido van Rossum gu...@python.org added the comment:

Somehow patch #2 doesn't show up in Rietveld. :-(

Anyway, I'll leave completion of the review to Antoine, who's more competent in 
this area. :-)

--

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



[issue14114] 2.7.3rc1 chm gives JS error

2012-03-15 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 11a11e5cac0f by Ezio Melotti in branch '2.7':
#14114: don't include copybutton.js in the htmlhelp output.
http://hg.python.org/cpython/rev/11a11e5cac0f

New changeset 36ec90b6b5e5 by Ezio Melotti in branch '2.7':
#14114: don't include copybutton.js in the htmlhelp output.
http://hg.python.org/cpython/rev/36ec90b6b5e5

--

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



[issue14200] Idle shell crash on printing non-BMP unicode character

2012-03-15 Thread Roger Serwy

Roger Serwy roger.se...@gmail.com added the comment:

I stand corrected. Thank you for the information.

The behavior of the console depends on its locale. IDLE has no facility for 
changing the locale of the PyShell window. Should this option be included 
somewhere?

--

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



[issue14234] CVE-2012-0876 (hash table collisions CPU usage DoS) for embedded copy of expat

2012-03-15 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 04ff6e206b98 by Gregory P. Smith in branch '2.7':
Fixes Issue #14234: CVE-2012-0876: Randomize hashes of xml attributes
http://hg.python.org/cpython/rev/04ff6e206b98

New changeset ada6bfbeceb8 by Gregory P. Smith in branch '2.7':
Fixes Issue 14234: fix for the previous commit, keep compilation when
http://hg.python.org/cpython/rev/ada6bfbeceb8

--

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



[issue14156] argparse.FileType for '-' doesn't work for a mode of 'rb'

2012-03-15 Thread Matt Joiner

Matt Joiner anacro...@gmail.com added the comment:

Steven, patch attached. I lost steam in the unittests with all the meta, 
suffice it that the names match the file descriptors of the stream sources. 
i.e. FileType('rb') would give a file with name=0, and so forth. My chosen 
method also allows other mode flags as well as custom bufsizes.

--
keywords: +patch
Added file: http://bugs.python.org/file24868/argparse-filetype-stdio-modes.patch

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



[issue14279] packaging.pypi should support flat directories of distributions

2012-03-15 Thread Jim Fulton

Jim Fulton j...@zope.com added the comment:

Note that ala a directory of files wasn't meant to imply local files.
It could be a directory of files served via a HTTP (or sftp) server.

--

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



[issue14280] packaging.pypi should not require checksums

2012-03-15 Thread Jim Fulton

Jim Fulton j...@zope.com added the comment:

I just clarified that 14279 doesn't imply local files.

I'd be fine with a warning about lack of checksums for downloads.

--

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



[issue14325] Stop using the garbage collector to manage the lifetime of the getargs.c freelist

2012-03-15 Thread Jean-Paul Calderone

New submission from Jean-Paul Calderone invalid@example.invalid:

Allocating a Python list and a bunch of Capsules for each PyArg_ParseTuple call 
is expensive and unnecessarily complicated.

The freelist never escapes getargs.c (if it ever did, it would be a bug).  The 
same job can be accomplished with a normal C array.

--
assignee: exarkun
messages: 155926
nosy: exarkun
priority: normal
severity: normal
status: open
title: Stop using the garbage collector to manage the lifetime of the getargs.c 
freelist
type: enhancement

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



[issue14200] Idle shell crash on printing non-BMP unicode character

2012-03-15 Thread Andrew Svetlov

Andrew Svetlov andrew.svet...@gmail.com added the comment:

I think that doesn't make sense.

--

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



[issue14324] Do not rely on AC_RUN_IFELSE tests in the configury

2012-03-15 Thread Matthias Klose

Matthias Klose d...@debian.org added the comment:

when using gcc, use a compilation test for the cross build check for long long 
format.

--
Added file: http://bugs.python.org/file24869/long-long-format.diff

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



[issue14320] set.add can return boolean indicate newly added item

2012-03-15 Thread Raymond Hettinger

Raymond Hettinger raymond.hettin...@gmail.com added the comment:

The part of the patch for PySet_Add() is a reasonable improvement to the C API 
if it doesn't conflict with Martin's stable ABI effort.

The question of whether to change the Python API requires much more thought and 
I'll do some research and evaluate it more thoroughly over the next few weeks.  
Here are some of the considerations:

* The set API currently has a near zero learning curve.  We want to keep it 
that way.  I'm teaching classes over the next few weeks and will try out the 
proposal on my students.

* For collections that are commonplace in other languages, I look to their 
experience and design for inspiration.  I'll look at was done in Smalltalk, 
Java, and ObjectiveC (with dynamic languages being a better model than 
statically compiled languages).  In particular, I look to SETL when evaluating 
the utility of proposed changes to the set API (a little like looking to Matlab 
when thinking about designing a matrix API).

* I'm concerned about the intuitiveness of the polarity of the proposed method 
and will try it out on other programmers to see whether if s.add(e): ... gets 
interpreted as true if e is already added or true if the adding a new item. 
 The sense of set.add() is the opposite of set.__contains__, so we should be 
careful about making a API change with an ambiguous or error-prone 
interpretation.

* As written, the proposal seems to be about efficiency rather than clarity.  
I'll run my own timings to see if they make any difference in typical 
applications of set.add().  In addition, I'll consult the Jython folks to see 
if it makes a difference in their world (I suspect it won't -- they use native 
Java objects and the Java JIT handily optimizes away the traditional calling 
pattern).  Also, I'll consult the PyPy folks to see whether they can provide 
the optimization automatically rather than via an API change.

* The suggested API also needs to be viewed in the context of what other Python 
APIs do.  For the most part, the language has an aversion to combining tests 
and assignments.  For example, Python doesn't do while (buf = 
f.read(bufsize)): ... eventhough that is traditionally supported in statically 
compiled languages.  There is a precedent with dict.setdefault(); however, that 
is often regarded as one of the least beautiful parts of the API in Python's 
basic collection objects.

* I also want to look back a previous discussions on this topic.  The set API 
had a slow and careful evolution starting with a PEP, being exposed as a pure 
python module, and being coded in C as a builtin type.   The API was built 
by Alex Martelli, Guido, Tim Peters, Greg Wilson and myself with substantial 
input from the community.  None of the designers sought to include this 
functionality and it wasn't because it hadn't occurred to the them or that they 
were unaware of typical use cases.  In addition, having set.add() return a 
boolean was discussed and rejected on python-dev (I've forgotten whether it was 
last year or the year before).  Some care should be taken before dismissing the 
judgment of the designers who've previously spent time thinking this out.

* Lastly, we need to look at code examples to see whether they read better or 
whether clarity is being lost in the name of efficiency.  We should look at 
both sophisticated examples (i.e. sets are part of multistep logic) and minimal 
examples (i.e. where the set logic is dominant).  Here is a before-and-after 
for the minimal case:

def dedup_before(iterable):
'''Order preserving elimination of duplicates'''
seen = set()
for i in iterable:
if i not in seen:
seen.add(i)
yield i

def dedup_after(iterable):
'''Order preserving elimination of duplicates'''
seen = Set()
for i in iterable:
if seen.add(i):
yield i


As you can see, there is more to API design than just spotting an opportunity 
to fold two steps into one.

--
priority: normal - low
type: enhancement - performance

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



[issue14200] Idle shell crash on printing non-BMP unicode character

2012-03-15 Thread Roger Serwy

Roger Serwy roger.se...@gmail.com added the comment:

The Tkinter Text widget is the output for the IDLE shell and it has the 
limitation imposed by Tcl/Tk of not handling non-BMP unicode characters. 

Is the following reasonable: The IDLE shell console has a locale of non-BMP 
utf8?

If so, would it be reasonable to add a menu item to switch locales for the 
shell? This amounts to adding some extra code to OutputWindow's write() to 
raise encoding errors if the string contains unsupported characters, and 
possibly replacing characters to work around Tcl/Tk's non-BMP limitation.

--

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



[issue14200] Idle shell crash on printing non-BMP unicode character

2012-03-15 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

 The behavior of the console depends on its locale. IDLE has no
 facility for changing the locale of the PyShell window. Should this
 option be included somewhere?

It may be remotely desirable to be able to set the terminal encoding
in IDLE for debuggging purposes. But it's unrelated to the issue at
hand.

--

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



[issue14230] Delegating generator is not always visible to debugging tools such as inspect pdb

2012-03-15 Thread Mark Shannon

Mark Shannon m...@hotpy.org added the comment:

Updated Patch

--
Added file: http://bugs.python.org/file24870/yieldfrom.patch

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



[issue14230] Delegating generator is not always visible to debugging tools such as inspect pdb

2012-03-15 Thread Mark Shannon

Changes by Mark Shannon m...@hotpy.org:


Removed file: http://bugs.python.org/file24759/yieldfrom.patch

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



[issue14200] Idle shell crash on printing non-BMP unicode character

2012-03-15 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

 Is the following reasonable: The IDLE shell console has a locale of
 non-BMP utf8?

[BMP utf8]
That's indeed the approach that Andrew and I were discussing. 
Unfortunately, there is no codec for it yet. We were discussing
to add a utf8bom encoding to Python. This is a medium-sized
project, though (and again out of scope for this issue).

 If so, would it be reasonable to add a menu item to switch locales
 for the shell? This amounts to adding some extra code to
 OutputWindow's write() to raise encoding errors if the string
 contains unsupported characters, and possibly replacing characters to
 work around Tcl/Tk's non-BMP limitation.

Please open a separate issue for this.

--

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



[issue14324] Do not rely on AC_RUN_IFELSE tests in the configury

2012-03-15 Thread Matthias Klose

Matthias Klose d...@debian.org added the comment:

when configured --with(out)-computed-gotos for a cross, use this value instead 
of defaulting to no.

--
Added file: http://bugs.python.org/file24871/computed-gotos.diff

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



[issue14324] Do not rely on AC_RUN_IFELSE tests in the configury

2012-03-15 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset fbbf9c187662 by Matthias Klose in branch 'default':
- Issue #14324: Fix configure tests for cross builds.
http://hg.python.org/cpython/rev/fbbf9c187662

New changeset 29ee48f843ec by Matthias Klose in branch 'default':
- Issue #14324: Fix configure tests for cross builds.
http://hg.python.org/cpython/rev/29ee48f843ec

--
nosy: +python-dev

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



[issue14230] Delegating generator is not always visible to debugging tools such as inspect pdb

2012-03-15 Thread Benjamin Peterson

Benjamin Peterson benja...@python.org added the comment:

Mercurial complains when trying to apply the patch:

applying yieldfrom.patch
patching file Lib/test/test_pep380.py
Hunk #2 succeeded at 921 with fuzz 2 (offset 72 lines).
abort: bad hunk #1 @@ -20,7 +20,6 @@
 (7 7 7 6)

--

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



[issue14230] Delegating generator is not always visible to debugging tools such as inspect pdb

2012-03-15 Thread Mark Shannon

Mark Shannon m...@hotpy.org added the comment:

Could you try this new patch (with white space changes included)?

--
Added file: http://bugs.python.org/file24872/yieldfrom.patch

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



[issue14325] Stop using the garbage collector to manage the lifetime of the getargs.c freelist

2012-03-15 Thread Jean-Paul Calderone

Changes by Jean-Paul Calderone invalid@example.invalid:


--
keywords: +patch
Added file: http://bugs.python.org/file24873/getargs.patch

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



[issue14127] add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds

2012-03-15 Thread Larry Hastings

Larry Hastings la...@hastings.org added the comment:

Attached is a second patch that adds keyword-only argument support to 
PyArg_ParseTupleAndKeywords.  This was developed in isolation.

The magic character is '$'; I would have used '*', but we already use '*' in 
the format string as a modifier to 'U' and 's' etc.  If someone has a better 
idea for the format I'd be interested.  Martin suggested using '|' a second 
time but I am unsure.

(Re: no reitveld link: my repo must have drifted too far and the patch didn't 
align cleanly.  I've freshened and am rerunning the regression test; once that 
runs clean I'll upload a fresh patch.)

--
Added file: http://bugs.python.org/file24874/larry.parsekwonly.diff.1.txt

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



[issue14326] IDLE - allow shell to support different locales

2012-03-15 Thread Roger Serwy

New submission from Roger Serwy roger.se...@gmail.com:

Per Martin's request, this issue has been separated from Issue14200. 

The IDLE shell presently has an effective locale of BMP UTF8 due to a 
limitation in Tkinter, described in Issue12342. 

IDLE should support different output codecs, like ascii and utf8. In order 
to work around Tkinter's limitations, unsupported characters would be replaced 
(this is related to #14304).

This amounts to adding some extra code to OutputWindow's write() to raise 
encoding errors if the string contains unsupported characters.

--
components: IDLE
messages: 155939
nosy: serwy
priority: normal
severity: normal
status: open
title: IDLE - allow shell to support different locales
type: enhancement
versions: Python 3.3

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



[issue14127] add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds

2012-03-15 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 Attached is a second patch that adds keyword-only argument support to
 PyArg_ParseTupleAndKeywords.  This was developed in isolation.

Please post that on a dedicated issue :)

--

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



[issue14127] add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds

2012-03-15 Thread Larry Hastings

Larry Hastings la...@hastings.org added the comment:

Do you insist?  It's a small patch, and I need it as a precondition to posting 
the... *third* patch in this series, which adds the ns= parameter to utime and 
its brothers.  (Most of the patch is test and doc; it really only adds about 
twenty lines of C.)

--

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



[issue14127] add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds

2012-03-15 Thread Larry Hastings

Larry Hastings la...@hastings.org added the comment:

A fresh patch for adding st_mtime_ns etc to os.stat output.  This is the same 
as last night's patch but with fresh line numbers.  (Generated against 
44eba26951f6.)

--
Added file: http://bugs.python.org/file24875/larry.st_mtime_ns.patch.3.txt

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



[issue14200] Idle shell crash on printing non-BMP unicode character

2012-03-15 Thread Roger Serwy

Roger Serwy roger.se...@gmail.com added the comment:

Martin, you are right. I created a separate issue #14326.

Let me know what I can do to help.

--

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



  1   2   >