[issue13972] set and frozenset constructors don't accept multiple iterables

2012-02-09 Thread Petri Lehtinen

New submission from Petri Lehtinen :

set.update() and friends accept multiple iterables. IMHO, set and frozenset 
constructors should, too.

--
components: Interpreter Core
messages: 152931
nosy: petri.lehtinen
priority: normal
severity: normal
status: open
title: set and frozenset constructors don't accept multiple iterables
type: enhancement
versions: Python 3.3

___
Python tracker 

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



[issue13973] urllib.parse is imported twice in xmlrpc.client

2012-02-09 Thread Tshepang Lekhonkhobe

New submission from Tshepang Lekhonkhobe :

urllib.parse is imported twice in xmlrpc.client, and it also breaks pep8

--
components: Library (Lib)
files: duplicate-imports.patch
keywords: patch
messages: 152932
nosy: tshepang
priority: normal
severity: normal
status: open
title: urllib.parse is imported twice in xmlrpc.client
versions: Python 3.3
Added file: http://bugs.python.org/file24462/duplicate-imports.patch

___
Python tracker 

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



[issue13974] packaging: test for set_platform()

2012-02-09 Thread Tshepang Lekhonkhobe

New submission from Tshepang Lekhonkhobe :

slightly increases test coverage

--
assignee: tarek
components: Distutils2
files: test-set-platform.patch
keywords: patch
messages: 152933
nosy: alexis, eric.araujo, tarek, tshepang
priority: normal
severity: normal
status: open
title: packaging: test for set_platform()
versions: Python 3.3
Added file: http://bugs.python.org/file24463/test-set-platform.patch

___
Python tracker 

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



[issue13975] packaging: change_root() test for os2

2012-02-09 Thread Tshepang Lekhonkhobe

New submission from Tshepang Lekhonkhobe :

increases coverage a bit

--
assignee: tarek
components: Distutils2
files: test-change_root-in-os2.patch
keywords: patch
messages: 152934
nosy: alexis, eric.araujo, tarek, tshepang
priority: normal
severity: normal
status: open
title: packaging: change_root() test for os2
versions: Python 3.3
Added file: http://bugs.python.org/file24464/test-change_root-in-os2.patch

___
Python tracker 

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



[issue13972] set and frozenset constructors don't accept multiple iterables

2012-02-09 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


--
nosy: +giampaolo.rodola

___
Python tracker 

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



[issue6005] Bug in socket example

2012-02-09 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset aa6415d1e160 by Senthil Kumaran in branch '2.7':
Fix Issue #6005: Examples in the socket library documentation use sendall,
http://hg.python.org/cpython/rev/aa6415d1e160

--
nosy: +python-dev

___
Python tracker 

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



[issue6005] Bug in socket example

2012-02-09 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 2aae44aa041a by Senthil Kumaran in branch '3.2':
Fix Issue #6005: Examples in the socket library documentation use sendall,
http://hg.python.org/cpython/rev/2aae44aa041a

New changeset e9c3df45920e by Senthil Kumaran in branch 'default':
merged from 3.2
http://hg.python.org/cpython/rev/e9c3df45920e

--

___
Python tracker 

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



[issue6005] Bug in socket example

2012-02-09 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

Thanks for patches. This is fixed.

--
nosy: +orsenthil
resolution:  -> fixed
stage:  -> committed/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



[issue9021] no copy.copy problem description

2012-02-09 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 0e050b38e92b by Senthil Kumaran in branch '2.7':
Issue #9021: Add an introduction to the copy module. Doc changes suggested by 
Terry Reedy.
http://hg.python.org/cpython/rev/0e050b38e92b

--
nosy: +python-dev

___
Python tracker 

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



[issue9021] no copy.copy problem description

2012-02-09 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset a352e24b9907 by Senthil Kumaran in branch '3.2':
Issue #9021 - Introduce copy module better. Doc changes suggested by Terry
http://hg.python.org/cpython/rev/a352e24b9907

New changeset bf6f306ad5cf by Senthil Kumaran in branch 'default':
merge from 3.2
http://hg.python.org/cpython/rev/bf6f306ad5cf

--

___
Python tracker 

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



[issue9021] no copy.copy problem description

2012-02-09 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

Added suggested changes to the documentation. Thanks.

--
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed
type:  -> behavior

___
Python tracker 

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



[issue9021] no copy.copy problem description

2012-02-09 Thread anatoly techtonik

anatoly techtonik  added the comment:

Perfectionist in me says that now copy.copy theory should be diluted with 
examples for those who can't grasp the concept of "binding of variables", but 
the patch perfectly covers the original user story. Thanks.

--

___
Python tracker 

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



[issue13903] New shared-keys dictionary implementation

2012-02-09 Thread Mark Shannon

Changes by Mark Shannon :


Added file: http://bugs.python.org/file24465/e50db1b7ad7b.diff

___
Python tracker 

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



[issue13903] New shared-keys dictionary implementation

2012-02-09 Thread Mark Shannon

Changes by Mark Shannon :


Removed file: http://bugs.python.org/file24456/20702d1acf17.diff

___
Python tracker 

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



[issue13590] extension module builds fail with python.org OS X installers on OS X 10.7 and 10.6 with Xcode 4.2

2012-02-09 Thread Ronald Oussoren

Ronald Oussoren  added the comment:

distutils would not only have to check for gcc-4.2 vs. clang, but also needs to 
strip "-arch ppc" from the compiler flags when it is present and it cannot use 
gcc-4.2.   Otherwise you cannot build extensions for the 32-bit python 
installer on OSX 10.7 with Xcode 4.2.

It is sadly enough not possible to create a binary installer that creates a 
working installation including building of extensions on all supported versions 
of OSX without adding special-case code to distutils/packaging.

Note that there already is some special-case code to support the universal 
binary builds on OSX 10.3.9 (which does not have a compiler that can build 
universal binaries).


W.r.t. the patch: is it really necessary to use a subshell to look for the 
compiler? I'd either walk os.environ['PATH'] myself or use xcodebuild to locate 
binaries.

--

___
Python tracker 

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



[issue13968] Support recursive globs

2012-02-09 Thread Nick Coghlan

Nick Coghlan  added the comment:

This discussion (particularly my final globtree recipe) made me realise that 
the exact same approach would greatly improve the usability of the all_paths, 
file_paths and dir_paths iterators in walkdir [1]. Accordingly, walkdir 0.4 
will let you write a recursive grep for ReST and Python source files as:

file_paths(top, included_files="*.py *.rst".split())

Scanning multiple directories will be as simple as:

file_paths(dir1, dir2, included_files="*.py *.rst".split())

[1] https://bitbucket.org/ncoghlan/walkdir/issue/15

--

___
Python tracker 

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



[issue10287] NNTP authentication should check capabilities

2012-02-09 Thread Hynek Schlawack

Hynek Schlawack  added the comment:

I think I've fixed it to do as described. Alas, I have no Easynews account to 
test it (I mailed their support about that so maybe that'll change).

Would someone with an account mind to test, if it works? Nathan?

--
Added file: http://bugs.python.org/file24466/nntp-retry-capas-after-login.diff

___
Python tracker 

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



[issue13968] Support recursive globs

2012-02-09 Thread Yuval Greenfield

Yuval Greenfield  added the comment:

Thanks for the bug find Antoine, I worked surprisingly hard trying to make this 
right in more edge cases and while fixing it I noticed rglob/globtree has 3 
options:

* Behave like a glob for every subdirectory. Meaning that every relative path 
gets a '*/' prepended to it. Eg rglob('c/d') started from the directory 'a' 
will yield 'a/b/c/d'.

* Behave like a glob for every subdirectory of the directory in the filter 
string. Meaning rglob('c/d') from dir 'a' won't yield 'a/b/c/d'. It would try 
to walk from 'a/c' and yield nothing if the directory 'c' doesn't exist in 'a'. 
Note that if the directory 'c' does exist then '/a/c/f/d' would be yielded. 
That seems kind of quirky to me.

* Behave like a filtered walk. Meaning that in order to yield files nested in 
subdirectories a wildcard must be introduced. Eg rglob('c/d') started from the 
directory 'a' won't yield 'a/b/c/d'. For that to occur you would need to use 
rglob('*c/d') or rglob('*/c/d'). What's more unfortunate is that rglob('d') 
doesn't yield 'a/b/c/d' which seems wrong. So I think for this we should 
special case paths that don't have path separators and prepend the "*/". Though 
some may argue it's wrong that rglob('d') yields 'a/b/c/d' even though 
rglob('c/d') won't yield it, I think that's the correct choice for this route.

Note that absolute paths with/without wildcards don't have this ambiguity. In 
both rel/abs wildcards should match directories and files alike.

Which option do you guys think would be best? I already have a fixed patch for 
option 1 and 3 but I'd rather hear your thoughts before I introduce either.



P.s. another slight issue I ran into is the fact that fnmatch doesn't ignore 
os.curdir:

>>> fnmatch.fnmatch('./a', 'a')
False

--

___
Python tracker 

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



[issue13968] Support recursive globs

2012-02-09 Thread R. David Murray

R. David Murray  added the comment:

I have to say that the non-obvious subtleties you point out in your rglob make 
me think I personally would probably opt to use Nick's module directly instead, 
so that I was sure what I was getting.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue13976] threading.local doesn't support super()

2012-02-09 Thread Dima Tisnek

New submission from Dima Tisnek :

import threading
import pprint


class A:
def __init__(self, **kw):
pprint.pprint("a")
super(A, self).__init__()


class B(threading.local, A):
def __init__(self, **kw):
pprint.pprint("b")
super(B, self).__init__()

if __name__ == "__main__":
B()



breaks (prints only b) in python 2. tested 2.7.2

works (prints b, a) in python 3, tested 3.2.2

threading.local is before A on purpose, to have different A attribute in 
different threads, not shown in the example.

caveat implementor: it may be impossible to support both super().__init__ and 
explicit threading.local.__init__ at the same time; explicit initialization is 
used far and wide in legacy code.

--
components: None
messages: 152947
nosy: Dima.Tisnek, pitrou
priority: normal
severity: normal
status: open
title: threading.local doesn't support super()
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue13976] threading.local doesn't support super()

2012-02-09 Thread Dima Tisnek

Dima Tisnek  added the comment:

ah feeling stupid only minutes later.
A has to inherit from object() and then it works fine.

--
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



[issue13968] Support recursive globs

2012-02-09 Thread Eli Bendersky

Eli Bendersky  added the comment:

> I have to say that the non-obvious subtleties you point out in your rglob 
> make me think I personally would probably opt to use Nick's module directly 
> instead, so that I was sure what I was getting.
>
> --

+1

--

___
Python tracker 

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



[issue13968] Support recursive globs

2012-02-09 Thread Yuval Greenfield

Yuval Greenfield  added the comment:

> I have to say that the non-obvious subtleties you point out in your rglob 
> make me think I personally would probably opt to use Nick's module directly 
> instead, so that I was sure what I was getting.

I didn't notice these corner cases initially because of their distance from the 
main use case. The main use-case is to glob the current directory or an 
absolute path tree using a wildcard, esp for finding all files of a given type. 
This leaves no ambiguity.

I'd like the edge cases of relative paths to behave in a documented and 
sensible way, but they pale in comparison to the usefulness of the proposal 
imho.

I believe we should decide what's the most useful and sensible behavior and 
have a shortcut for that.

--

___
Python tracker 

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



[issue13968] Support recursive globs

2012-02-09 Thread R. David Murray

R. David Murray  added the comment:

Hmm.  Just to make it clear where I'm coming from, though, I should also point 
out that I use rdiff-backup, which uses the **/yadayada syntax, and I hate it 
any time I have to try to figure out what such a glob is going to actually 
match.

--

___
Python tracker 

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



[issue13968] Support recursive globs

2012-02-09 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> * Behave like a glob for every subdirectory. Meaning that every
> relative path gets a '*/' prepended to it. Eg rglob('c/d') started
> from the directory 'a' will yield 'a/b/c/d'.

That's what I would expect. That way, rglob('__init__.py') would find
all files named __init__.py beneath the current directory.

> P.s. another slight issue I ran into is the fact that fnmatch doesn't
> ignore os.curdir:
> 
> >>> fnmatch.fnmatch('./a', 'a')
> False

Sounds ok. fnmatch is a low-level lexical thing.

--

___
Python tracker 

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



[issue13968] Support recursive globs

2012-02-09 Thread Yuval Greenfield

Yuval Greenfield  added the comment:

>> * Behave like a glob for every subdirectory. Meaning that every
>> relative path gets a '*/' prepended to it. Eg rglob('c/d') started
>> from the directory 'a' will yield 'a/b/c/d'.

> That's what I would expect. That way, rglob('__init__.py') would
> find all files named __init__.py beneath the current directory.

Perhaps we should make a single exemption for double dots eg 
rglob('../../__init__.py') starts the walk 2 folders out of the curdir and 
looks for '*/__init__.py'.

--

___
Python tracker 

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



[issue13958] Comment _PyUnicode_FromId

2012-02-09 Thread Jim Jewett

Jim Jewett  added the comment:

After clarification, the original change was backed out.

These are C Identifiers, and nothing beyond ASCII is guaranteed, but other 
characters are in practice possible.

--
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



[issue13968] Support recursive globs

2012-02-09 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> >> * Behave like a glob for every subdirectory. Meaning that every
> >> relative path gets a '*/' prepended to it. Eg rglob('c/d') started
> >> from the directory 'a' will yield 'a/b/c/d'.
> 
> > That's what I would expect. That way, rglob('__init__.py') would
> > find all files named __init__.py beneath the current directory.
> 
> Perhaps we should make a single exemption for double dots eg
> rglob('../../__init__.py') starts the walk 2 folders out of the curdir
> and looks for '*/__init__.py'.

This would be quirky. I don't think '..' should be treated specially.
(there's also the symlinks problem)

--

___
Python tracker 

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



[issue1559549] ImportError needs attributes for module and file name

2012-02-09 Thread Brett Cannon

Brett Cannon  added the comment:

On Thu, Feb 9, 2012 at 00:03, Brian Curtin  wrote:

>
> Brian Curtin  added the comment:
>
> Yep, I just need to actually make use of the feature. I'll generate a new
> patch shortly.
>

If you can generate it before 17:30 EST today I can review it or at least
help use it in the codebase.

--

___
Python tracker 

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



[issue13968] Support recursive globs

2012-02-09 Thread Yuval Greenfield

Yuval Greenfield  added the comment:

> This would be quirky. I don't think '..' should be treated specially.
> (there's also the symlinks problem)

Again with 'a/b/c/d' and let's add a file 'a/b/png'.

If the curdir is 'c' and you use rglob('../pn*') you won won't find '../png' as 
you would be walking only in the curdir. I think that route would mean we 
should document double dots aren't supported.

--

___
Python tracker 

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



[issue13968] Support recursive globs

2012-02-09 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Again with 'a/b/c/d' and let's add a file 'a/b/png'.
> 
> If the curdir is 'c' and you use rglob('../pn*') you won won't find
> '../png' as you would be walking only in the curdir.

That depends how you implement it. If you detect that ".." exists and
glob for "pn*" inside it, you will probably find "../png".

--

___
Python tracker 

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



[issue13968] Support recursive globs

2012-02-09 Thread Yuval Greenfield

Yuval Greenfield  added the comment:

> That depends how you implement it. If you detect that ".." exists and
glob for "pn*" inside it, you will probably find "../png".

Yes, that's what I meant by a "single exemption for double dots". The solution 
should start the walk from wherever the double dots lead it to.

I believe we agree.

--

___
Python tracker 

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



[issue13968] Support recursive globs

2012-02-09 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Yes, that's what I meant by a "single exemption for double dots". The
> solution should start the walk from wherever the double dots lead it
> to.

I don't think that's a single exemption; you should use the same
algorithm for all globs (e.g. "a/*.py"), shouldn't you?

--

___
Python tracker 

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



[issue13175] packaging uses wrong line endings in RECORD files on Windows

2012-02-09 Thread Paul Moore

Paul Moore  added the comment:

Any progress on this one?

I tried to reproduce using distutils2, but don't know how distutils2 works - 
there's no pysetup and python -m distutils2.run doesn't work the same as python 
-m packaging.run.

Can we at least get packaging working in time for 3.3, even if it leaves an 
issue with distutils2 to sort out?

--

___
Python tracker 

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



[issue13189] New bdist_simple binary distribution format for packaging

2012-02-09 Thread Paul Moore

Paul Moore  added the comment:

We're running a bit lower on time now. Any progress? The whole discussion on 
python-dev around binary formats petered out with no real conclusions :-(

--

___
Python tracker 

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



[issue13968] Support recursive globs

2012-02-09 Thread Yuval Greenfield

Yuval Greenfield  added the comment:

> you should use the same algorithm for all globs (e.g. "a/*.py"), shouldn't 
> you?

That specific string would start the walk from the current directory IIUC.

--

___
Python tracker 

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



[issue13123] bdist_wininst uninstaller does not remove pycache directories

2012-02-09 Thread Paul Moore

Paul Moore  added the comment:

Have you had a chance to look at this yet?

--

___
Python tracker 

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



[issue13968] Support recursive globs

2012-02-09 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> > you should use the same algorithm for all globs (e.g. "a/*.py"), shouldn't 
> > you?
> 
> That specific string would start the walk from the current directory IIUC.

Yes but would it match b/a/setup.py?

--

___
Python tracker 

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



[issue13968] Support recursive globs

2012-02-09 Thread R. David Murray

R. David Murray  added the comment:

How about having separate starting path and glob arguments, where the glob 
cannot contain any directory?

I'm -1 on this function as it stands.  My vote could change if the final 
semantics are intuitive and unambiguous.  (It's OK if getting the correct 
intuition requires understanding a brief explanation.)

--

___
Python tracker 

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



[issue4356] Add "key" argument to "bisect" module functions

2012-02-09 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

On python-ideas, thread "Optional key to `bisect`'s functions?" Guido wrote 
"Bingo. That clinches it. We need to add key=." 'That' being the fact that 
values that have keys may not be comparable themselves (in py3), so that 
comparing (key,value) pairs may raise TypeError. This follows a reply by him 
yesterday saying that he has wanted this feature occasionally. I am re-opening 
this rather than a new issue because there is already a patch with tests.

--
components: +Library (Lib) -Documentation
nosy: +gvanrossum
priority: low -> normal
resolution: fixed -> 
stage:  -> patch review
status: closed -> open
versions: +Python 3.3 -Python 2.7, Python 3.0

___
Python tracker 

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



[issue13968] Support recursive globs

2012-02-09 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> My vote could change if the final semantics are intuitive and unambiguous.

How about "match the given glob from this directory and any
sub-directory"?
That sounds quite intuitive and unambiguous to me.

--

___
Python tracker 

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



[issue4356] Add "key" argument to "bisect" module functions

2012-02-09 Thread Guido van Rossum

Guido van Rossum  added the comment:

I'm +1 on adding this feature. See discussion in python-ideas.

PS. It should also be added to heapq.

--

___
Python tracker 

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



[issue13977] importlib simplification

2012-02-09 Thread Jim Jewett

New submission from Jim Jewett :

http://hg.python.org/cpython/file/aba513307f78/Lib/importlib/_bootstrap.py#l974


  974 # The hell that is fromlist ...
  975 if not fromlist:
  976 # Return up to the first dot in 'name'. This is
complicated by the fact
  977 # that 'name' may be relative.
  978 if level == 0:
  979 return sys.modules[name.partition('.')[0]]
  980 elif not name:
  981 return module
  982 else:
  983 cut_off = len(name) - len(name.partition('.')[0])
  984 return sys.modules[module.__name__[:-cut_off]]

If level is 0, should name == module.__name__?

Yes.
 

If so, then I think that simplifies to

   if not name:
   return module
   genericname=module.__name__.rpartition(".")[0]
   return sys.modules[genericname]

Seems right. Can you file a bug and assign it to me?

--
messages: 152970
nosy: Jim.Jewett, brett.cannon
priority: normal
severity: normal
status: open
title: importlib simplification

___
Python tracker 

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



[issue13977] importlib simplification

2012-02-09 Thread Ezio Melotti

Changes by Ezio Melotti :


--
assignee:  -> brett.cannon
stage:  -> needs patch
type:  -> enhancement
versions: +Python 3.3

___
Python tracker 

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



[issue13968] Support recursive globs

2012-02-09 Thread R. David Murray

R. David Murray  added the comment:

So given

  /home/a
  /home/a/k.py
  /home/a/c/j.py
  /home/b/z.py
  /home/b/c/f.py

and a current directory of /home/a, we'd have:

   pattern   matches
   ---   ---
   *.py  k.py, c/j.py
   c/*.pyc/j.py
   c*c   [?]
   ../*.py   ?
   ../c/*.py ?

Thinking about those .. cases makes my brain hurt :)  What does it mean to 
match '../*.py' when I'm recursing into the c subdirectory?  What does it mean 
in the current directory, for that matter?

As you can see, your short explanation has left me with one case where I have a 
question, and one set of cases where my intuition completely fails.

--David

--

___
Python tracker 

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



[issue13978] OSError exception in multiprocessing module when using os.remove() on NFS

2012-02-09 Thread Javier Jardón

New submission from Javier Jardón :

I have this little test case:

import multiprocessing
 
manager = multiprocessing.Manager()
del manager

and I get this:

Traceback (most recent call last):
  File "/usr/lib/python2.7/multiprocessing/util.py", line 261, in 
_run_finalizers
finalizer()
  File "/usr/lib/python2.7/multiprocessing/util.py", line 200, in __call__
res = self._callback(*self._args, **self._kwargs)
  File "/usr/lib/python2.7/shutil.py", line 249, in rmtree
onerror(os.remove, fullname, sys.exc_info())
  File "/usr/lib/python2.7/shutil.py", line 247, in rmtree
os.remove(fullname)
OSError: [Errno 16] Device or resource busy: 
'/nfs/tmp/pymp-f7R9S6/.nfse039692f0236'

(the TMDIR directory is in a nfs server)

--
components: Extension Modules
messages: 152972
nosy: jjardon
priority: normal
severity: normal
status: open
title: OSError exception in multiprocessing module when using os.remove() on NFS
type: crash
versions: Python 3.2

___
Python tracker 

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



[issue8184] multiprocessing.managers will not fail if listening ocket already in use

2012-02-09 Thread Charles-François Natali

Charles-François Natali  added the comment:

Committed to default.
I won't backport it to other branches, since it's more of a feature request 
than a bug fix.

--
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed
versions: +Python 3.3 -Python 2.6

___
Python tracker 

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



[issue1559549] ImportError needs attributes for module and file name

2012-02-09 Thread Brian Curtin

Brian Curtin  added the comment:

Here's an updated patch which creates two convenience functions, 
PyErr_SetFromImportErrorWithName and PyErr_SetFromImportErrorWithNameAndPath. I 
figure the two common cases are that you'll want to set just a name or you'll 
want a name and a path.

*WithName is all that I've applied for now, and I've only done it in import.c 
to allow Brett to continue with his work. I'll come back and make changes 
elsewhere in the code, and I'll apply the *WithNameAndPath function where I 
need it for #10854.

All tests pass and some IRL testing works nicely.

Note: I'm a little rushed at the moment so I have not included docs but I will 
surely update them. I just want to get Brett what he needs by this afternoon.

--
Added file: http://bugs.python.org/file24467/issue1559549_v2.diff

___
Python tracker 

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



[issue13921] sqlite3: OptimizedUnicode obsolete in Py3k

2012-02-09 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 0fc10a33eb4c by Petri Lehtinen in branch 'default':
Undocument and clean up sqlite3.OptimizedUnicode
http://hg.python.org/cpython/rev/0fc10a33eb4c

--
nosy: +python-dev
resolution:  -> fixed
stage: patch review -> committed/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



[issue13921] sqlite3: OptimizedUnicode obsolete in Py3k

2012-02-09 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

Committed the patch after moving the documentation note to a source code 
comment instead. Thanks for reviews.

--
keywords:  -needs review

___
Python tracker 

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



[issue1559549] ImportError needs attributes for module and file name

2012-02-09 Thread Brett Cannon

Brett Cannon  added the comment:

Thanks, Brian! I'll do a review tonight on the drive home (and maybe even write 
the docs up).

--

___
Python tracker 

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



[issue13961] Have importlib use os.replace()

2012-02-09 Thread Charles-François Natali

Changes by Charles-François Natali :


--
keywords: +needs review, patch
stage:  -> patch review
Added file: http://bugs.python.org/file24468/importlib_replace.diff

___
Python tracker 

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



[issue1559549] ImportError needs attributes for module and file name

2012-02-09 Thread R. David Murray

R. David Murray  added the comment:

On the drive home...are you borrowing one of Google's self driving cars? :)

--

___
Python tracker 

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



[issue13491] Fixes for sqlite3 doc

2012-02-09 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

Attaching an updated patch with the following changes:

- Updated to apply on current default branch

- No examples included in the documentation now require createdb.py to be run. 
There were only three examples that required it, but these were refactored a 
bit. In the Doc/includes/sqlite3 directory there are still some scripts that 
require the createdb.py, so I didn't nuke the file.

- I also removed the strange "The arguments to :meth:`executescript` must be 
:func:`bytes` objects" sentence from the patch. I assume it was a mistake, as 
it's wrong.

--
Added file: http://bugs.python.org/file24469/sqlite_code_update_v3.patch

___
Python tracker 

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



[issue13491] Fixes for sqlite3 doc

2012-02-09 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

Ah, and I added a working example of a custom text_factory function to 
Doc/includes/sqlite3/text_factory.py, too.

--

___
Python tracker 

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



[issue13965] Windows 64-bit installer actually installing a 32-bit version

2012-02-09 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Martin, thanks for the explanation.

Hopefully, this tracker entry will serve to permanently document why Python2 on 
Windows behaves as it does.

--

___
Python tracker 

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



[issue13968] Support recursive globs

2012-02-09 Thread Yuval Greenfield

Yuval Greenfield  added the comment:

Given

  /home/a
  /home/a/k.py
  /home/a/c/j.py
  /home/b/z.py
  /home/b/c/f.py

and a current directory of /home/a, we'd have:

   pattern matches
   --- ---
   *.pyk.py, c/j.py
   c/*.py  c/j.py
   c*  c
   ../*.py ../a/k.py, ../a/c/j.py, ../b/z.py, ../b/c/f.py
   ../c/*.py   ../b/c/f.py, ../a/c/j.py

For relative paths the double dots decide where to start walking and from then 
on you can imagine a glob on every subdir. In the last 2 examples the glob 
would have been '*.py' and 'c/*.py' respectively.

--

___
Python tracker 

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



[issue4356] Add "key" argument to "bisect" module functions

2012-02-09 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Already on tracker as
#13742 Add a key parameter (like sorted) to heapq.merge

--

___
Python tracker 

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



[issue13742] Add a key parameter (like sorted) to heapq.merge

2012-02-09 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

FWIW, Guido approves of the idea, msg152969 in #4356

--
nosy: +terry.reedy

___
Python tracker 

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



[issue11620] winsound.PlaySound() with SND_MEMORY should accept bytes instead of strings

2012-02-09 Thread Tim Lesher

Tim Lesher  added the comment:

This patch should both correct the incorrect acceptance of strings and the 
incorrect rejection of buffer objects when using SND_MEMORY.

--
keywords: +patch
Added file: http://bugs.python.org/file24470/11620-PlaySound.patch

___
Python tracker 

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



[issue11620] winsound.PlaySound() with SND_MEMORY should accept bytes instead of strings

2012-02-09 Thread Brian Curtin

Changes by Brian Curtin :


--
assignee:  -> brian.curtin
keywords: +needs review
stage: needs patch -> patch review

___
Python tracker 

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



[issue13968] Support recursive globs

2012-02-09 Thread R. David Murray

R. David Murray  added the comment:

Well, in that case I would expect that the argument 'c/*.py' would start 
walking in the c directory, but I definitely did not get that impression from 
Antoine's explanation of how the function works.

I again advocate separating the starting path specification from the glob 
specification, with the latter not allowing directories.  A two argument 
function.

--

___
Python tracker 

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



[issue13953] Get rid of doctests in packaging.tests.test_version

2012-02-09 Thread Francisco Martín Brugué

Francisco Martín Brugué  added the comment:

I've done some cleanups

--
Added file: http://bugs.python.org/file24471/issue13953_bf6f306ad5cf.patch

___
Python tracker 

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



[issue13979] Automatic *libc.so loading behaviour

2012-02-09 Thread David Goulet

New submission from David Goulet :

I'm working with the LTTng (Linux Tracing) team and we came across a problem 
with our user-space tracer and Python default behaviour. We provide a libc 
wrapper that instrument free() and malloc() and is usable with a simple 
LD_PRELOAD.

This lib *was* named "liblttng-ust-libc.so" and we came across python software 
registering to our trace registry daemon (meaning that somehow the python 
binary is using our in-process library). We dig a bit and found this:

Lib/ctypes/utils.py:

def _findLib_ldconfig(name):
   # XXX assuming GLIBC's ldconfig (with option -p)
   expr = r'/[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name)
   res = re.search(expr,
   os.popen('/sbin/ldconfig -p 2>/dev/null').read())

and, at least, also found in _findLib_gcc(name) and _findSoname_ldconfig(name).

This cause Python to use any library ending with "libc.so" to be loaded

I don't know the reasons behind this but we are concerned about "future issues" 
with this kind of behaviour.

Thanks

--
components: ctypes
messages: 152988
nosy: dgoulet
priority: normal
severity: normal
status: open
title: Automatic *libc.so loading behaviour
type: behavior
versions: Python 2.6, Python 2.7

___
Python tracker 

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



[issue13782] xml.etree.ElementTree: Element.append doesn't type-check its argument

2012-02-09 Thread Florent Xicluna

Florent Xicluna  added the comment:

Actuallly, the assertions were commented in the upstream repository.

https://bitbucket.org/effbot/et-2009-provolone/src/9e9e7f2710aa/elementtree/CHANGES#cl-46

> (1.3a6 released)
> - Removed most assert statements from the Element and ElementTree code.


It looks more useful to me to have a consistent behavior between C and Python 
version.

--

___
Python tracker 

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



[issue13979] Automatic *libc.so loading behaviour

2012-02-09 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +meador.inge
stage:  -> needs patch
versions: +Python 3.2, Python 3.3 -Python 2.6

___
Python tracker 

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



[issue1528593] Printing: No print dialog or page setup

2012-02-09 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
nosy: +terry.reedy

___
Python tracker 

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



[issue13980] getcwd problem

2012-02-09 Thread fif0

New submission from fif0 :

Please take a look at the detached file.

At the first call of the methode foo(), path and the second getcwd are the 
same. After the directory change, the default value path is not the the current 
working directory.

--
components: Interpreter Core
files: maybe_a_bug.py
messages: 152991
nosy: fif0
priority: normal
severity: normal
status: open
title: getcwd problem
versions: Python 2.7
Added file: http://bugs.python.org/file24472/maybe_a_bug.py

___
Python tracker 

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



[issue13968] Support recursive globs

2012-02-09 Thread Nick Coghlan

Nick Coghlan  added the comment:

Given the complexities proposed for the dir matching, I'm shifting back to a 
solid -1 on this. Trying to match multi-part directories with globs is a 
nightmare and I currently don't allow it at all in walkdir. Instead, dir 
filtering and file filtering are expressed separately.

In 0.4, walkdir will allow the following to search the current directory for 
all Python source files in subdirectories named 'c':

walk_files(included_files=["*.py"], included_dirs="c")

This discussion does mean I plan to add path filtering though, that works on 
the "dirpath" value directly (and *will* allow multi-part matches). So the 
"Python source files in subdirectories named 'd' of directories named 'c'" will 
be written something like:

walk_files(included_files=["*.py"], included_paths="*/c/d")

I also plan to explore options to make the pattern matching function 
configurable (i.e. so you can pass in something like "match=re.search")

--

___
Python tracker 

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



[issue13980] getcwd problem does not return cwd

2012-02-09 Thread fif0

Changes by fif0 :


--
title: getcwd problem -> getcwd problem does not return cwd

___
Python tracker 

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



[issue7433] MemoryView memory_getbuf causes segfaults, double call to tp_releasebuffer

2012-02-09 Thread Stefan Krah

Stefan Krah  added the comment:

Closing, since it's fixed in #10181.

--
dependencies:  -Problems with Py_buffer management in memoryobject.c (and 
elsewhere?)
resolution:  -> duplicate
stage: needs patch -> committed/rejected
status: open -> closed
superseder:  -> Problems with Py_buffer management in memoryobject.c (and 
elsewhere?)

___
Python tracker 

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



[issue8305] memoview[0] creates an invalid view if ndim != 1

2012-02-09 Thread Stefan Krah

Stefan Krah  added the comment:

Fixed in #10181.

--
dependencies:  -Problems with Py_buffer management in memoryobject.c (and 
elsewhere?)
resolution:  -> duplicate
stage: needs patch -> committed/rejected
status: open -> closed
superseder:  -> Problems with Py_buffer management in memoryobject.c (and 
elsewhere?)

___
Python tracker 

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



[issue13968] Support recursive globs

2012-02-09 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> This discussion does mean I plan to add path filtering though, that
> works on the "dirpath" value directly (and *will* allow multi-part
> matches). So the "Python source files in subdirectories named 'd' of
> directories named 'c'" will be written something like:
> 
> walk_files(included_files=["*.py"], included_paths="*/c/d")

That's not different from rglobbing "*/c/d/*.py", is it? :)

--

___
Python tracker 

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



[issue13980] getcwd problem does not return cwd

2012-02-09 Thread R. David Murray

R. David Murray  added the comment:

That's just how function definitions in Python work.  The prototype is 
evaluated when the function is defined, not when it is run, so the default 
value of path will always be the value of getcwd at the time the function 
*defintion* is done (which will generally be the CWD when python starts, unless 
you are defining functions at runtime).

--
nosy: +r.david.murray
resolution:  -> invalid
stage:  -> committed/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



[issue9990] PyMemoryView_FromObject alters the Py_buffer after calling PyObject_GetBuffer when ndim 1

2012-02-09 Thread Stefan Krah

Stefan Krah  added the comment:

I ran the demo in the pep-3118 repo, and it is fixed (see #10181):

$ ./bufrel 
Accessing buffer directly...
Accessing buffer through a memory view...
Done.

--
dependencies:  -Problems with Py_buffer management in memoryobject.c (and 
elsewhere?)
resolution:  -> duplicate
stage: patch review -> committed/rejected
status: open -> closed
superseder:  -> Problems with Py_buffer management in memoryobject.c (and 
elsewhere?)

___
Python tracker 

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



[issue10211] BufferObject doesn't support new buffer interface

2012-02-09 Thread Stefan Krah

Changes by Stefan Krah :


--
nosy: +skrah

___
Python tracker 

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



[issue8754] quote bad module name in ImportError-like messages

2012-02-09 Thread Brett Cannon

Brett Cannon  added the comment:

With issue1559549 adding a 'name' argument, I'm going to push to have it gain a 
reasonable default __str__ if 'name' is set but nothing else. That patch also 
contains some helper functions which should simplify Eric's patch.

--
dependencies: +ImportError needs attributes for module and file name

___
Python tracker 

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



[issue13968] Support recursive globs

2012-02-09 Thread R. David Murray

R. David Murray  added the comment:

I don't know, is it?  From what has been said so far I'd expect */c/d/*.py to 
look for *.py files in all c/d subdirectories of direct subdirectories of the 
current directory, and subdirectories of those c/d directories.  But I wouldn't 
expect the c/d matching to go any deeper than that one level.  Whereas with 
Nick's formulation, I would.  And I know at a glance, without reading any 
documentation, what Nick's formulation does, whereas I very much don't with 
rglob.

--

___
Python tracker 

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



[issue13968] Support recursive globs

2012-02-09 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> I don't know, is it?  From what has been said so far I'd expect
> */c/d/*.py to look for *.py files in all c/d subdirectories of direct
> subdirectories of the current directory, and subdirectories of those
> c/d directories.  But I wouldn't expect the c/d matching to go any
> deeper than that one level.

That would be a normal glob, not a recursive glob. We already have
glob.glob().

--

___
Python tracker 

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



[issue13981] time.sleep() should use nanosleep() if available

2012-02-09 Thread STINNER Victor

Changes by STINNER Victor :


--
dependencies: +PEP 410: Use decimal.Decimal type for timestamps

___
Python tracker 

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



[issue13981] time.sleep() should use nanosleep() if available

2012-02-09 Thread STINNER Victor

New submission from STINNER Victor :

With the PEP 410, it is possible to store timestamps with a resolution of 1 
nanosecond. Python should use nanosleep() if the function is available for 
time.sleep().

This issue depends on issue #13882.

--
components: Library (Lib)
messages: 153000
nosy: haypo
priority: normal
severity: normal
status: open
title: time.sleep() should use nanosleep() if available
versions: Python 3.3

___
Python tracker 

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



[issue13968] Support recursive globs

2012-02-09 Thread Yuval Greenfield

Yuval Greenfield  added the comment:

As R. David Murray has suggested I think there may be a middle ground.

def rglob(fn_filter, root='.'):

That would mean the default use case is still easy to remember as rglob('*.py') 
and also there aren't any explanations needed for how this function works.

Though I'm not sure which of these API's I like better.

--

___
Python tracker 

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



[issue13968] Support recursive globs

2012-02-09 Thread R. David Murray

R. David Murray  added the comment:

@antoine: no, my description involves recursion.  It assumes that the path 
portion of the glob specifies the directories to *start* from, but that the 
filename glob portion then applies recursively to any of those start 
directories.

The alternative interpretation of the pattern, that it is fully matched against 
the CWD, takes you back to having to explain what '..' means when matched 
against a given location in the recursion, starting with the CWD.  I clearly 
don't have a good intuition about that.

--

___
Python tracker 

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



[issue13968] Support recursive globs

2012-02-09 Thread R. David Murray

R. David Murray  added the comment:

Oh, yeah, and there's still the question of whether or not directories are 
matched by the terminal glob pattern, which I would naively expect they would 
be, in either interpretation, but I wouldn't be sure.

--

___
Python tracker 

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



[issue13968] Support recursive globs

2012-02-09 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> The alternative interpretation of the pattern, that it is fully
> matched against the CWD, takes you back to having to explain what '..'
> means when matched against a given location in the recursion, starting
> with the CWD.  I clearly don't have a good intuition about that.

My alternative interpretation is that the pattern is being matched
against whatever subdir of the current dir (and the current dir itself).
The matching is not different from glob()'s.

--

___
Python tracker 

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



[issue13968] Support recursive globs

2012-02-09 Thread R. David Murray

R. David Murray  added the comment:

Ah, OK, so what you are saying is that rglob returns the concatenation of the 
results of running ls with the argument glob in each subdirectory of a walk 
starting with the current directory, except that the returned names have paths 
anchored in the current directory?

--

___
Python tracker 

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



[issue13968] Support recursive globs

2012-02-09 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Ah, OK, so what you are saying is that rglob returns the concatenation
> of the results of running ls with the argument glob in each
> subdirectory of a walk starting with the current directory, except
> that the returned names have paths anchored in the current directory?

Yup.

--

___
Python tracker 

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



[issue13882] PEP 410: Use decimal.Decimal type for timestamps

2012-02-09 Thread STINNER Victor

STINNER Victor  added the comment:

Patch version 14:

 - rewrite the conversion from float to _PyTime_t: use base 2 with high 
precision and then simplify the fraction. The conversion from decimal.Decimal 
uses base 10 and do also simplify the fraction.
 - write tests on functions converting _PyTime_t using _testcapi
 - add timestamp argument to signal.getitimer(), signal.setitimer(), 
resource.getrusage()
 - signal.sigtimedwait() uses _PyTime_t and now expects a number and no more a 
tuple (function added to Python 3.3, so no backward compatibility issue). See 
also the issue #13964
 - time.sleep() uses _PyTime_t. See also the issue #13981 (use nanosleep())
 - datetime.datetime.now() and datetime.datetime.utcnow() uses _PyTime_t
 - catch integer overflow on _PyTime_AsTimeval(), _PyTime_AsTimespec() and more

This patch gives you an overview of the whole PEP 410 implementation, but it 
should not be applied in one shot. It would be better to commit it step by step:

 - add _PyTime_t API
 - use _PyTime_t for the time module
 - use _PyTime_t for the os module
 - use _PyTime_t for the more modules
 - etc.

We can start by adding the API and use it in the time module, and then 
rediscuss changes on other modules.

--
Added file: http://bugs.python.org/file24473/time_decimal-14.patch

___
Python tracker 

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



[issue13882] PEP 410: Use decimal.Decimal type for timestamps

2012-02-09 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file24461/time_decimal-13.patch

___
Python tracker 

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



[issue13782] xml.etree.ElementTree: Element.append doesn't type-check its argument

2012-02-09 Thread Eli Bendersky

Eli Bendersky  added the comment:

>> It looks more useful to me to have a consistent behavior between C and 
>> Python version.

I agree, especially is we now consider to expose the C API by default, leaving 
the Python API as a fallback.

--

___
Python tracker 

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



[issue13123] bdist_wininst uninstaller does not remove pycache directories

2012-02-09 Thread Éric Araujo

Éric Araujo  added the comment:

No, I worked on other things in my Python time.  I did get a Windows image, but 
failed to configure the VM*.  I’ve found some doc and will try again, or go 
back to the idea of giving you a patch to test.

  * (It gives a BSOD at boot, so one could argue that it counts as “working”
  for Windows :)

--
assignee: tarek -> eric.araujo

___
Python tracker 

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



[issue13981] time.sleep() should use nanosleep() if available

2012-02-09 Thread Ross Lagerwall

Changes by Ross Lagerwall :


--
nosy: +rosslagerwall

___
Python tracker 

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



[issue13189] New bdist_simple binary distribution format for packaging

2012-02-09 Thread Éric Araujo

Éric Araujo  added the comment:

I initially had a lot of things to reply to but then though it would be 
unpractical to reply, then the usual life/work/time thing got in the way and I 
busied myself with easier issues.

As Nick said on python-ideas, I should write a PEP, which would probably be a 
better support to summarize the requirements, issues and choices.

The feature deadline is June, so there’s still a bit of time to work on that 
bdist format, decide if we agree on one of 
bdist_wininst/bdist_msi/new-shiny-bdist-for-windows-by-jkloth, and in parallel 
to that packaging could also be documented as experimental (the solution 
suggested by Guido when ruling on the __preview__ package PEP).  And in the 
worst case a PyPI-relased bdist_simple would be dead-easy to install and 
register with packaging (we don’t have auto-discovery of commands, but easy 
registration is here).

--

___
Python tracker 

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



[issue13175] packaging uses wrong line endings in RECORD files on Windows

2012-02-09 Thread Éric Araujo

Éric Araujo  added the comment:

> I tried to reproduce using distutils2, but don't know how distutils2
> works - there's no pysetup and python -m distutils2.run doesn't work
> the same as python -m packaging.run.

Maybe you’re using the old PyPI release or Tarek’s outdated Bitbucket 
repository.  http://hg.python.org/distutils is current, contains pysetup and 
supports -m distutils2.run.

I’ll port your patch to d2 this week.

--

___
Python tracker 

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



[issue13198] Remove duplicate definition of write_record_file

2012-02-09 Thread Éric Araujo

Éric Araujo  added the comment:

Mike, if you don’t have the time to finish this shortly, I will do it, as I 
need this fixed for another bug.  Just let me know if you’d like to do it.

--

___
Python tracker 

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



[issue13968] Support recursive globs

2012-02-09 Thread Éric Araujo

Éric Araujo  added the comment:

FTR, packaging has an extended glob function (not my code) which supports sets 
(with { , }) and recursivity (**).

--

___
Python tracker 

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



[issue13975] packaging: change_root() test for os2

2012-02-09 Thread Éric Araujo

Éric Araujo  added the comment:

OS/2 is not supported by 3.3; someone said on python-dev they wanted to take 
over maintenance but they wanted to use a different compiler toolchain, which 
would effectively change the platform definition, so it’s not clear at this 
point that OS/2 support will continue.  In this light, I’m rejecting your patch 
(with thanks for your work nonetheless), and will reopen if the situation 
change.

(I’ll remove the now-obsolete comment later.)

--
assignee: tarek -> eric.araujo
priority: normal -> 
resolution:  -> invalid
stage:  -> committed/rejected
status: open -> closed
versions: +3rd party

___
Python tracker 

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



[issue13974] packaging: test for set_platform()

2012-02-09 Thread Éric Araujo

Éric Araujo  added the comment:

Is the effect of the set_platform call permanent?  If yes, there needs to be a 
line like self.addCleanup(util.set_platform, util.get_platform()) to make sure 
the test restores its environment.

--
assignee: tarek -> eric.araujo
versions: +3rd party

___
Python tracker 

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



[issue9442] Update sys.version doc

2012-02-09 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 0cc1fbbb473d by Éric Araujo in branch 'default':
Use sys.version_info instead of sys.version.
http://hg.python.org/distutils2/rev/0cc1fbbb473d

--

___
Python tracker 

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



[issue13462] Improve code and tests for Mixin2to3

2012-02-09 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset b024621a1be6 by Éric Araujo in branch 'default':
Start improving 2to3 code (#13462).
http://hg.python.org/distutils2/rev/b024621a1be6

New changeset cc0f4d208193 by Éric Araujo in branch 'python3':
Merge fixes for #13462 and others from default
http://hg.python.org/distutils2/rev/cc0f4d208193

--
nosy: +python-dev

___
Python tracker 

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



  1   2   >