[issue13018] dictobject.c: refleak

2011-10-24 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
keywords: +needs review, patch
nosy: +petri.lehtinen

___
Python tracker 

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



[issue13017] pyexpat.c: refleak

2011-10-24 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
keywords: +after moratorium, needs review, patch
nosy: +petri.lehtinen

___
Python tracker 

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



[issue13016] selectmodule.c: refleak

2011-10-24 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
keywords: +needs review, patch
nosy: +petri.lehtinen

___
Python tracker 

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



[issue11440] fix_callable should be dropped from lib2to3 / changed

2011-10-24 Thread Florent Xicluna

Changes by Florent Xicluna :


--
nosy: +flox
type:  -> behavior

___
Python tracker 

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



[issue11440] fix_callable should be dropped from lib2to3 / changed

2011-10-24 Thread Florent Xicluna

Florent Xicluna  added the comment:

The decision should be left to the user.
IMHO, we could disable this automatic fixer.

--

___
Python tracker 

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



[issue11440] fix_callable should be dropped from lib2to3 / changed

2011-10-24 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue12501] callable(): remove/amend the deprecation warning in Python 2.7

2011-10-24 Thread Florent Xicluna

Changes by Florent Xicluna :


--
nosy: +flox
type:  -> behavior

___
Python tracker 

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



[issue8828] Atomic function to rename a file

2011-10-24 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> > "The solution? Let's remember that metadata changes are atomic. Rename is 
> > such a case."
> >
> 
> Hmmm.
> Is he referring to the "standard" rename? The blog doesn't evoke a
> specific function, but if it was the case, then why bother at all?

Standard rename (MoveFile) fails when the target exists, and that's
AFAICT the whole problem with it. MoveFileEx allows to overwrite the
target with MOVEFILE_REPLACE_EXISTING.

> By the way:
> """
>  - MoveFileEx() with MOVEFILE_REPLACE_EXISTING and
> MOVEFILE_WRITE_THROUGH flags: not atomic (eg. "If the file is to be
> moved to a different volume, the function simulates the move by using
> the CopyFile and DeleteFile functions."), version >= Windows 2000
> """
> 
> There's exactly the same limitation with the POSIX version (except
> that it'll fail with EXDEV instead of silently doing the copy+unlink).

If you don't specify the MOVEFILE_COPY_ALLOWED flag, MoveFileEx also
fails. I don't understand what Victor was trying to say.

--

___
Python tracker 

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



[issue13254] maildir.items() broken

2011-10-24 Thread marco ghidinelli

New submission from marco ghidinelli :

since python 2.7.2 
maildir.items() doesn't return anything:

>>> from mailbox import Maildir
>>> x = Maildir('test')
>>> x.items()
[]

untils something was written on the maildir.

>>> x.add('bubu')
'1319447613.M259111P6097Q1.deeppurple'
>>> x.items()
[('1319447013.M913187P6096Q1.deeppurple', ), ('1319447613.M259111P6097Q1.deeppurple', )]

--
components: Library (Lib)
messages: 146283
nosy: marco.ghidinelli
priority: normal
severity: normal
status: open
title: maildir.items() broken
type: behavior
versions: Python 2.7, Python 3.2

___
Python tracker 

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



[issue13248] deprecated in 3.2, should be removed in 3.3

2011-10-24 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 221638ba5d2a by Mark Dickinson in branch 'default':
Issue #13248, issue #8540: Remove deprecated Context._clamp attribute from 
Decimal module.
http://hg.python.org/cpython/rev/221638ba5d2a

--
nosy: +python-dev

___
Python tracker 

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



[issue8540] Make Context._clamp public in decimal module

2011-10-24 Thread Mark Dickinson

Mark Dickinson  added the comment:

New changeset 221638ba5d2a by Mark Dickinson in branch 'default':
Issue #13248, issue #8540: Remove deprecated Context._clamp attribute from 
Decimal module.
http://hg.python.org/cpython/rev/221638ba5d2a

--

___
Python tracker 

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



[issue13254] maildir.items() broken

2011-10-24 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +r.david.murray
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



[issue13254] maildir.items() broken

2011-10-24 Thread marco ghidinelli

marco ghidinelli  added the comment:

i verified now, and the 2.7.1 version is ok, the bug is present since the 2.7.2

--

___
Python tracker 

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



[issue13254] maildir.items() broken

2011-10-24 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy: +petri.lehtinen

___
Python tracker 

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



[issue13254] maildir.items() broken

2011-10-24 Thread marco ghidinelli

marco ghidinelli  added the comment:

3.1 is ok
3.2.2 is affected

--

___
Python tracker 

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



[issue13248] deprecated in 3.2, should be removed in 3.3

2011-10-24 Thread Florent Xicluna

Florent Xicluna  added the comment:

I missed these warnings in C modules.


*array*
  "fromstring" and "tostring" methods
*io* (like _pyio)
  argument "max_buffer_size" of BufferedWriter and BufferedRWPair
*sys*
  "sys.getcheckinterval" and "sys.setcheckinterval"


and some complaints from Objects/typeobject.c:

  "object.__init__() takes no parameters"
  "object.__new__() takes no parameters"
  "object.__format__ with a non-empty format string is deprecated"
  "Type %.100s defines tp_reserved (formerly tp_compare) but not "
"tp_richcompare. Comparisons may not behave as intended."

--

___
Python tracker 

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



[issue13248] deprecated in 3.2, should be removed in 3.3

2011-10-24 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> *array*
>   "fromstring" and "tostring" methods

I think these ones (and other well-known 2.x methods) should be kept to ease 
porting to 3.x.

--
nosy: +pitrou

___
Python tracker 

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



[issue13252] new decumulate() function in itertools module

2011-10-24 Thread Nick Coghlan

Nick Coghlan  added the comment:

OK, looking at the code I realised what you're trying to get at is the idea of 
reporting the differences between values in a series, such that:

x = list(accumulate(seq))
assert x == list(accumulate(differences(x)))

I don't think the use cases are there to justify the addition (not every 
iterator we can think of should be a building block in itertools), but if such 
a thing were to be added, "differences" would convey the intention 
significantly better than the invented term "decumulate".

--
nosy: +ncoghlan

___
Python tracker 

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



[issue12296] Minor clarification in devguide

2011-10-24 Thread Ezio Melotti

Ezio Melotti  added the comment:

PEP 387 explains the rules about backward compatibility.  The paragraph could 
just link to that.

--

___
Python tracker 

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



[issue13255] wrong docstring for array.fromunicode

2011-10-24 Thread Florent Xicluna

New submission from Florent Xicluna :

The docstring should say "ustr.encode" instead of "ustr.decode".
The documentation page is correct.

>>> print(array.array.fromunicode.__doc__)
fromunicode(ustr)

Extends this array with data from the unicode string ustr.
The array must be a unicode type array; otherwise a ValueError
is raised.  Use array.frombytes(ustr.decode(...)) to
append Unicode data to an array of some other type.

--
assignee: docs@python
components: Documentation
messages: 146292
nosy: docs@python, flox
priority: normal
severity: normal
stage: needs patch
status: open
title: wrong docstring for array.fromunicode
type: behavior
versions: Python 3.2, Python 3.3

___
Python tracker 

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



[issue13255] wrong docstrings in array module

2011-10-24 Thread Florent Xicluna

Changes by Florent Xicluna :


--
resolution:  -> fixed
stage: needs patch -> committed/rejected
status: open -> closed
title: wrong docstring for array.fromunicode -> wrong docstrings in array module

___
Python tracker 

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



[issue13255] wrong docstring for array.fromunicode

2011-10-24 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 451fa5782145 by Florent Xicluna in branch '3.2':
Issue #13255: wrong docstrings in array module.
http://hg.python.org/cpython/rev/451fa5782145

--
nosy: +python-dev

___
Python tracker 

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



[issue13256] Document and test new socket options

2011-10-24 Thread STINNER Victor

New submission from STINNER Victor :

The commit c64216addd7f for issue #6560 added various socket option, but some 
of them are not well documented or tested.

Authentication:
 * SO_PASSCRED, SO_PEERCRED, LOCAL_PEERCRED
 * SCM_RIGHTS, SCM_CREDENTIALS, SCM_CREDS

SCTP:
 * socket.IPPROTO_SCTP is not mentioned in socket.socket() doc (but it's tested)

etc.

--
messages: 146294
nosy: haypo
priority: normal
severity: normal
status: open
title: Document and test new socket options

___
Python tracker 

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



[issue13256] Document and test new socket options

2011-10-24 Thread STINNER Victor

STINNER Victor  added the comment:

Another issue: the "version added" tag is not used, it's not possible to know 
that socket.SO_PEERCRED was added in Python 3.3.

--

___
Python tracker 

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



[issue12394] packaging: generate scripts from callable (dotted paths)

2011-10-24 Thread Vinay Sajip

Vinay Sajip  added the comment:

FYI: In pythonv, the build_scripts functionality provides identical support for 
dotted callables to what Éric proposed, while preserving existing functionality 
for ordinary script files. Thus:

scripts = demo1
  demo2 = amodule.main
  demo3 = apackage.asubpackage.main gui

copies demo1 (adjusting its shebang) and creates demo2 and demo3 from the 
dotted callables (using the appropriate shebang).

While working on this, I came up against a problem with build_scripts in 
virtual environments: if I install a project into virtual env 1, then scripts 
are built with shebangs pointing to that env. If I then install the same 
project into virtual env 2, then the scripts are not re-created, so they would 
be installed into virtual env 2 with shebangs referencing virtual env 1. One 
solution is to set the force flag for virtual environments, but then if you 
later install into the system Python, then files with wrong shebangs could be 
installed there. I think the force flag should default to True for 
build_scripts; the extra script build time would be negligible except in 
pathological cases. Do you agree?

--

___
Python tracker 

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



[issue13237] subprocess docs should emphasise convenience functions

2011-10-24 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 2184df0e0f89 by Nick Coghlan in branch '2.7':
Issue #13237: Rearrange subprocess module documentation to emphasise the 
convenience functions and commonly needed arguments
http://hg.python.org/cpython/rev/2184df0e0f89

--
nosy: +python-dev

___
Python tracker 

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



[issue12394] packaging: generate scripts from callable (dotted paths)

2011-10-24 Thread Vinay Sajip

Vinay Sajip  added the comment:

Re. the launcher changes, those improvements by Guy Rozendorn are welcome. I 
noticed some differences from the approach taken by Mark Hammond and Curt 
Hagenlocher in the PEP 397 implementation, which I ported to C:

The Ctrl-C is ignored by the PEP 397 launcher. AFAICT it's passed to the child 
process anyway by Windows. The ignoring prevents the default behaviour 
(premature termination of the launcher).

The PEP 397 launcher also duplicates the standard handles before creating the 
child process.

The PEP 397 launcher also associates the launcher and the child together using 
the Job API.

--
nosy: +guyrozendorn

___
Python tracker 

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



[issue13238] Add shell command helpers to shutil module

2011-10-24 Thread Nick Coghlan

Nick Coghlan  added the comment:

Unfortunately, I don't think including implicit shlex.quote() calls is going to 
have the effect I was originally looking for:

>>> subprocess.call("du -hs ../py*", shell=True)
593M../py3k
577M../py3k_pristine
479M../python27
300M../python31
381M../python32
288K../python_swallowed_whole
0

>>> subprocess.call("du -hs {}".format(shlex.quote("../py*")), shell=True)
du: cannot access `../py*': No such file or directory
1

However, tinkering with this did provide some other "feels like using the 
shell" examples:

>>> subprocess.call("du -hs ~/devel", shell=True)
4.5G/home/ncoghlan/devel
0

>>> subprocess.call(["du","-hs","~/devel"])
du: cannot access `~/devel': No such file or directory
1

(I'm using the existing subprocess calls rather than the proposed API, since 
I'm playing with this on the current hg tip without making any changes)

--

___
Python tracker 

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



[issue13237] subprocess docs should emphasise convenience functions

2011-10-24 Thread Nick Coghlan

Nick Coghlan  added the comment:

I'm reasonably happy with the changes I just checked in, but rather than doing 
multiple forward ports, my plan is to let them settle for a while, update them 
based on any feedback I get, then incorporate the final version into the 3.x 
series.

--

___
Python tracker 

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



[issue13254] maildir.items() broken

2011-10-24 Thread R. David Murray

R. David Murray  added the comment:

I'm assigning this to myself so I don't lose it, but if someone wants to work 
on a patch please do.  It'll be a bit before I can look at it.

--
assignee:  -> r.david.murray
priority: normal -> high
stage:  -> needs patch

___
Python tracker 

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



[issue13254] maildir.items() broken

2011-10-24 Thread R. David Murray

R. David Murray  added the comment:

Since this is a regression I'm upping the priority further to release blocker, 
so that we don't put out another release with the regression still in it.

--
nosy: +benjamin.peterson, georg.brandl
priority: high -> release blocker

___
Python tracker 

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



[issue2470] Need fixer for dl (removed) -> ctypes module

2011-10-24 Thread Florent Xicluna

Florent Xicluna  added the comment:

for the RTLD_ constants, refer to issue #13226.

--
nosy: +flox

___
Python tracker 

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



[issue13244] WebSocket schemes in urlparse

2011-10-24 Thread Tobias Oberstein

Tobias Oberstein  added the comment:

ok, there was feedback on Hybi list:

http://www.ietf.org/mail-archive/web/hybi/current/msg09270.html

"""
1. ws://example.com/something#somewhere
2. ws://example.com/something#somewhere/
3. ws://example.com/something#somewhere/foo
4. ws://example.com/something?query=foo#bar

I think all of these are invalid. 
"""
Alexey Melnikov, Co-author of the WS spec.

And Julian Reschke:

http://www.ietf.org/mail-archive/web/hybi/current/msg09277.html

==

Thus, I would upload my comment:

"# must always be escaped, both in path and query components. Fragment 
components are not allowed. Thus, unescaped # can never appear in WS URL. 
Further, it must not be ignored, but the WS handshake failed."

And further: urlparse should raise an exception upon unescaped # within URLs 
from ws/wss schemes.

--

___
Python tracker 

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



[issue13193] test_packaging and test_distutils failures

2011-10-24 Thread Éric Araujo

Éric Araujo  added the comment:

Spamlib-0.1.dist-info is in a directory on sys.path, so the error makes no 
sense to me.  Can you inspect the content of that directory?  (i.e os.listdir 
and file contents)  Also, if you can interrupt the test to get a Python or pdb 
shell, could you try this:

  >>> from packaging.database import Distribution
  >>> d = Distribution('path/to/Spamlib-0.1.dist-info')
  >>> d.metadata
  >>> d.list_distinfo_files()
  >>> d.list_installed_files()

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



[issue12394] packaging: generate scripts from callable (dotted paths)

2011-10-24 Thread Éric Araujo

Éric Araujo  added the comment:

> FYI: In pythonv, the build_scripts functionality provides identical support 
> for dotted
> callables to what Éric proposed, while preserving existing functionality for 
> ordinary script
> files.

My current preference is to use only new-style generated scripts for the 
scripts field in the files section, and to let people use the 
data-files/resources system for old-style file scripts.

We’ll have to think about the shebang munging and decide if we keep it.  I 
think recommending that people use “/usr/bin/env python” (or python3) and not 
doing anything to the shebang may be the best thing.

> While working on this, I came up against a problem with build_scripts in 
> virtual environments:
This is also a bug in current distutils and distutils2 scripts.  Scripts should 
always be regenerated, as they depend on the running Python, not on other files.

--
versions: +3rd party

___
Python tracker 

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



[issue8828] Atomic function to rename a file

2011-10-24 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

I see that Sun/Oracle Java trusts MoveFileEx to do atomic renames:

  290   // atomic case
  291   if (atomicMove) {
  292   try {
  293   MoveFileEx(sourcePath, targetPath, 
MOVEFILE_REPLACE_EXISTING);
  294   } catch (WindowsException x) {
  295   if (x.lastError() == ERROR_NOT_SAME_DEVICE) {
  296   throw new AtomicMoveNotSupportedException(
  297   source.getPathForExceptionMessage(),
  298   target.getPathForExceptionMessage(),
  299   x.errorString());
  300   }
  301   x.rethrowAsIOException(source, target);
  302   }
  303   return;
  304   }

(from http://www.docjar.com/html/api/sun/nio/fs/WindowsFileCopy.java.html )

--

___
Python tracker 

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



[issue10332] Multiprocessing maxtasksperchild results in hang

2011-10-24 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 3465a9b2d25c by Charles-François Natali in branch '2.7':
Issue #10332: multiprocessing: fix a race condition when a Pool is closed
http://hg.python.org/cpython/rev/3465a9b2d25c

New changeset 52c98a729a71 by Charles-François Natali in branch '3.2':
Issue #10332: multiprocessing: fix a race condition when a Pool is closed
http://hg.python.org/cpython/rev/52c98a729a71

New changeset c2cdabc44665 by Charles-François Natali in branch 'default':
Issue #10332: multiprocessing: fix a race condition when a Pool is closed
http://hg.python.org/cpython/rev/c2cdabc44665

--
nosy: +python-dev

___
Python tracker 

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



[issue12618] py_compile cannot create files in current directory

2011-10-24 Thread Sjoerd de Vries

Sjoerd de Vries  added the comment:

Hi Éric,

There you go, adapted from http://effbot.org/librarybook/py-compile.htm :


# File: py-compile-example-1.py

import py_compile

# explicitly compile this module
py_compile.compile("py-compile-example-1.py","py-compile-example-1.pyc")



Also, I tested and this bug is present neither on 3.1 nor on 2.x

cheers
Sjoerd

--

___
Python tracker 

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



[issue13215] multiprocessing Manager.connect() aggressively retries refused connections

2011-10-24 Thread Charles-François Natali

Charles-François Natali  added the comment:

>  While a 20 second timeout may make sense for *unresponsive* servers,
> ECONNREFUSED probably indicates that the server is not listening on this 
> port, so
> hammering it with 1,999 more connection attempts isn't going to help.

That's funny, I noticed this a couple days ago, and it also puzzled me...

> I'm not sure, but I think that would be for the case where you are spawning 
> the
> server yourself and the child process takes time to start up.

That's also what I think.
But that's strange, since:
- this holds for every client/server communication (e.g. why not do
that for smtplib, telnetlib, etc. ?)
- it's against the classical connect() semantics
- some code may prefer failing immediately (instead of "hammering" the
remote host) if the remote server is down, or the address is
incorrect: it can still handle the ECONNREFUSED if it wants to retry,
with a custom retry timeout
I removed the retry code and run test_multiprocessing and
test_concurrent_futures in loop, and didn't see any failure (on
Linux), so I'd say we could probably remove that.
OTOH, I would feel bad if this broke someone's code (even though code
relying on the automatic retries is probably broken).
So I'm +1 on removing the retry logic altogether, unless of course
someone comes up with a good reason to keep it (I digged a little
through the logs to see when this was introduced, but apparently it
was there in the original import).
If we don't remove it, I agree we should at least reduce the timeout
and increase the period (an exponential backoff may be a bit
overkill).

--

___
Python tracker 

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



[issue12394] packaging: generate scripts from callable (dotted paths)

2011-10-24 Thread Vinay Sajip

Vinay Sajip  added the comment:

> We’ll have to think about the shebang munging and decide if we keep it.  I 
> think 

> recommending that people use “/usr/bin/env python” (or python3) and not doing 
> anything to the shebang may be the best thing.

What about Windows support? Of course there is PEP 397 which brings 
shebang-line functionality to Windows, but that PEP has not yet been finalised. 
Without the existing shebang functionality, IMO there will be problems for 
Windows users with the “/usr/bin/env python” approach you suggest.

--

___
Python tracker 

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



[issue10364] Color coding fails after running program.

2011-10-24 Thread Ariel

Ariel  added the comment:

Excuse me for budging in, I was having the same problem (both python 3.2 and 
2.7, on both win XP and 7) without knowing the file extention is the cause.

Why doesn't IDLE editor save files with the .py extention unless specificly 
ordered to? The Save as dialoge window has a "type" drop-down menue. Maybe I'm 
missing some of the logic behind it?

--
nosy: +Ariel

___
Python tracker 

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



[issue13256] Document and test new socket options

2011-10-24 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
assignee:  -> docs@python
components: +Documentation, Tests
nosy: +docs@python
stage:  -> needs patch
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



[issue10332] Multiprocessing maxtasksperchild results in hang

2011-10-24 Thread Charles-François Natali

Charles-François Natali  added the comment:

James, thanks for the report!

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



[issue13018] dictobject.c: refleak

2011-10-24 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 5d7164febff1 by Petri Lehtinen in branch '2.7':
Issue #13018: Fix reference leaks in error paths in dictobject.c.
http://hg.python.org/cpython/rev/5d7164febff1

New changeset df24a8b57148 by Petri Lehtinen in branch '3.2':
Issue #13018: Fix reference leaks in error paths in dictobject.c.
http://hg.python.org/cpython/rev/df24a8b57148

--
nosy: +python-dev

___
Python tracker 

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



[issue13018] dictobject.c: refleak

2011-10-24 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

Thanks for the patch, fixed.

--
keywords:  -needs review
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



[issue13218] test_ssl failures on Ubuntu 11.10

2011-10-24 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

Still investigating, but FTR, this isn't technically an Ubuntu issue as much as 
it is a Debian issue (and thus inherited by Ubuntu).  I can reproduce the 
failure in Python 3.3 on Debian Wheezy.

--

___
Python tracker 

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



[issue13218] test_ssl failures on Debian/Ubuntu

2011-10-24 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


--
title: test_ssl failures on Ubuntu 11.10 -> test_ssl failures on Debian/Ubuntu

___
Python tracker 

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



[issue13257] Move importlib over to PEP 3151 exceptions

2011-10-24 Thread Brett Cannon

New submission from Brett Cannon :

Importlib uses the errno module explicitly for properly checking OSError for 
EEXIST and IOError for EACCES. Thanks to PEP 3151, however, neither check is 
needed since those exceptions correspond to FileExistsError and 
PermissionError, respectively.

As long as posix.mkdir() uses the new exceptions, the entire need for errno 
goes away for the module, eliminating one more module required for 
bootstrapping.

--
assignee: brett.cannon
components: Library (Lib)
keywords: easy
messages: 146317
nosy: brett.cannon
priority: normal
severity: normal
stage: needs patch
status: open
title: Move importlib over to PEP 3151 exceptions
type: behavior
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



[issue13193] test_packaging and test_distutils failures

2011-10-24 Thread Francisco Martín Brugué

Francisco Martín Brugué  added the comment:

Hi Eli,
I cannot find the file/Distro:

find / -name *'dist-info' 2> /dev/null

/home/ci/cpython/Lib/packaging/tests/fake_dists/grammar-1.0a4.dist-info

/home/ci/cpython/Lib/packaging/tests/fake_dists/towel_stuff-0.1.dist-info

/home/ci/cpython/Lib/packaging/tests/fake_dists/babar-0.1.dist-info

/home/ci/cpython/Lib/packaging/tests/fake_dists/choxie-2.0.0.9.dist-info

/home/ci/cpython/.hg/store/data/_lib/packaging/tests/fake__dists/grammar-1.0a4.dist-info

/home/ci/cpython/.hg/store/data/_lib/packaging/tests/fake__dists/babar-0.1.dist-info

/home/ci/cpython/.hg/store/data/_lib/packaging/tests/fake__dists/towel__stuff-0.1.dist-info

/home/ci/cpython/.hg/store/data/_lib/packaging/tests/fake__dists/choxie-2.0.0.9.dist-info

Where should be the distro?

Cheers,

francis

--
nosy: +francismb

___
Python tracker 

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



[issue13193] test_packaging and test_distutils failures

2011-10-24 Thread Francisco Martín Brugué

Francisco Martín Brugué  added the comment:

The changeset was:
$ hg tip
changeset:   73075:d4839fea4a5a
[...]

--

___
Python tracker 

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



[issue13258] replace hasattr(obj, '__call__') with callable(obj)

2011-10-24 Thread Florent Xicluna

New submission from Florent Xicluna :

Now that callable() is back in 3.2, we may replace hasattr(obj, '__call__') 
with callable(obj).

The built-in function is easier to read and gives better performance than 
attribute lookup.


$ ./python -m timeit "hasattr(None, '__call__')"
10 loops, best of 3: 4.09 usec per loop
$ ./python -m timeit "hasattr(str, '__call__')"
100 loops, best of 3: 1.3 usec per loop

$ ./python -m timeit "callable(None)"
100 loops, best of 3: 0.299 usec per loop
$ ./python -m timeit "callable(str)"
100 loops, best of 3: 0.369 usec per loop

--
components: Library (Lib)
messages: 146320
nosy: flox
priority: normal
severity: normal
status: open
title: replace hasattr(obj, '__call__') with callable(obj)
type: performance
versions: Python 3.2, Python 3.3

___
Python tracker 

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



[issue13258] replace hasattr(obj, '__call__') with callable(obj)

2011-10-24 Thread Florent Xicluna

Florent Xicluna  added the comment:

Proposed patch.

--
keywords: +patch
Added file: http://bugs.python.org/file23510/issue13258_callable.diff

___
Python tracker 

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



[issue13247] os.path.abspath returns unicode paths as question marks

2011-10-24 Thread Yuval Greenfield

Yuval Greenfield  added the comment:

An example error with abspath and bytes input:

>>> os.path.abspath('.')
'C:\\Users\\yuv\\Desktop\\YuvDesktop\\\u05d0\u05d1\u05d2\u05d3\u05d4\u05d5'
>>> os.path.abspath(b'.')
b'C:\\Users\\yuv\\Desktop\\YuvDesktop\\??'
>>> os.listdir(os.path.abspath(b'.'))
Traceback (most recent call last):
  File "", line 1, in 
WindowsError: [Error 123] The filename, directory name, or volume label 
syntax is incorrect: 'C:\\Users\\yuv\\Desktop\\YuvDesktop\\??/*.*'
>>>


I couldn't follow the implementation, I got stuck not being able to locate the 
definition for os.getcwdb so I couldn't join you for that part. Here's another 
possible solution:

>>> win32api.GetFullPathName('.')
'C:\\Users\\yuv\\Desktop\\YuvDesktop\\\u05d0\u05d1\u05d2\u05d3\u05d4\u05d5'
>>> win32api.GetShortPathName(win32api.GetFullPathName('.'))
'C:\\Users\\yuv\\Desktop\\YUVDES~1\\5F30~1'

The short path is ascii but the problem is not all windows file systems have 
8.3 filenames [1]. So I think your suggestion is the best solution.

[1] 
http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx#short_vs._long_names

--

___
Python tracker 

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



[issue13258] replace hasattr(obj, '__call__') with callable(obj)

2011-10-24 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

For packaging I'm not sure it's worth complicating backporting.

--
nosy: +eric.araujo, pitrou

___
Python tracker 

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



[issue13258] replace hasattr(obj, '__call__') with callable(obj)

2011-10-24 Thread Florent Xicluna

Florent Xicluna  added the comment:

Updated with a special note for "packaging".

--
Added file: http://bugs.python.org/file23511/issue13258_callable_v2.diff

___
Python tracker 

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



[issue10364] IDLE: make .py default added extension on save

2011-10-24 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

I am guessing that because the extension could be either .py or .pyw, the 
initial save does not add either but forces the user to type one or the other. 
I find this annoying too, so I am thinking about separating the choices and see 
if .py, .pyw, and maybe .txt can be automatically added if not written, while 
avoiding '.py.py', etc. Hence the change of issue title and type. (Note to 
self: make sure this is not a duplicate.)

--
title: Color coding fails after running program. -> IDLE: make .py default 
added extension on save
type:  -> feature request
versions: +Python 3.3 -Python 3.1

___
Python tracker 

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



[issue13258] replace hasattr(obj, '__call__') with callable(obj)

2011-10-24 Thread STINNER Victor

STINNER Victor  added the comment:

callable() is not just faster, it's also "more correct": hasattr(obj, 
"__call__") doesn't call base classes. See callable() of the six module:


def callable(obj):
  return any("__call__" in klass.__dict__ for klass in type(obj).__mro__)

--
nosy: +haypo

___
Python tracker 

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



[issue13258] replace hasattr(obj, '__call__') with callable(obj)

2011-10-24 Thread Florent Xicluna

Florent Xicluna  added the comment:

We have so many alternatives, it's funny ...


def callable(obj):
return hasattr(obj, '__call__') or hasattr(obj, '__bases__')

def callable(obj):
return isinstance(obj, collections.abc.Callable)

def callable(obj):
return hasattr(obj, '__call__') or type(obj) == types.ClassType

def callable(obj):
return any("__call__" in klass.__dict__
   for klass in type(obj).__mro__)

--
stage:  -> patch review

___
Python tracker 

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



[issue8036] Interpreter crashes on invalid arg to spawnl on Windows

2011-10-24 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

This came up on python-list with
os.spawnl (os.P_NOWAIT, r"c:\windows\notepad.exe")
Tim Golden confirmed crash with Win7 on 2.7.?
I did same with 3.2.2 in both interpreter and from IDLE (IDLE hangs and then 
restarts after closing the 'pythonw has stopped' error message box).
Above apparently works in XP, at least with Py2.2.

--
nosy: +loewis, terry.reedy

___
Python tracker 

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



[issue8036] Interpreter crashes on invalid arg to spawnl on Windows

2011-10-24 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue13258] replace hasattr(obj, '__call__') with callable(obj)

2011-10-24 Thread Jesús Cea Avión

Jesús Cea Avión  added the comment:

Is it actually appropiate to commit this to 3.2?. I am neutral to it, just 
asking.

--
nosy: +jcea

___
Python tracker 

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



[issue8036] Interpreter crashes on invalid arg to spawnl on Windows

2011-10-24 Thread STINNER Victor

STINNER Victor  added the comment:

@nvetoshkin: Can you please also write tests (in Lib/test/test_os.py) for your 
patch?

--

___
Python tracker 

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



[issue13258] replace hasattr(obj, '__call__') with callable(obj)

2011-10-24 Thread STINNER Victor

STINNER Victor  added the comment:

> Is it actually appropiate to commit this to 3.2?

If it fixes a bug, the fix should be backported to 3.2.

--

___
Python tracker 

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



[issue13232] Logging: Unicode Error

2011-10-24 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 4bb1dc4e2cec by Vinay Sajip in branch '2.7':
Closes #13232: Handle multiple encodings in exception logging.
http://hg.python.org/cpython/rev/4bb1dc4e2cec

--
nosy: +python-dev
resolution:  -> fixed
stage: test needed -> 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



[issue13193] test_packaging and test_distutils failures

2011-10-24 Thread Nadeem Vawda

Nadeem Vawda  added the comment:

> Spamlib-0.1.dist-info is in a directory on sys.path, so the error makes no 
> sense to me.  Can you inspect the content of that directory?  (i.e os.listdir 
> and file contents)  Also, if you can interrupt the test to get a Python or 
> pdb shell, could you try this:
> 
>   >>> from packaging.database import Distribution
>   >>> d = Distribution('path/to/Spamlib-0.1.dist-info')
>   >>> d.metadata
>   >>> d.list_distinfo_files()
>   >>> d.list_installed_files()

(Pdb) p install_dir
'c:\\users\\nadeem\\appdata\\local\\temp\\tmpe96yhv\\tmp9ga04b'

(Pdb) from packaging.database import Distribution
(Pdb) _d = Distribution(os.path.join(install_dir, "Spamlib-0.1.dist-info"))
(Pdb) p _d


(Pdb) p _d.metadata


(Pdb) p dict(_d.metadata.items())
{'Name': 'Spamlib', 'License': 'UNKNOWN', 'Author': 'UNKNOWN', 
'Metadata-Version': '1.0',
 'Home-page': 'UNKNOWN', 'Summary': 'UNKNOWN', 'Platform': [], 'Version': '0.1',
 'Keywords': [''], 'Author-email': 'UNKNOWN', 'Description': 'UNKNOWN'}

(Pdb) p list(_d.list_distinfo_files())
['c:\\users\\nadeem\\appdata\\local\\temp\\tmpe96yhv\\tmp9ga04b\\Spamlib-0.1.dist-info\\METADATA',
 
'c:\\users\\nadeem\\appdata\\local\\temp\\tmpe96yhv\\tmp9ga04b\\Spamlib-0.1.dist-info\\INSTALLER',
 
'c:\\users\\nadeem\\appdata\\local\\temp\\tmpe96yhv\\tmp9ga04b\\Spamlib-0.1.dist-info\\REQUESTED',
 
'c:\\users\\nadeem\\appdata\\local\\temp\\tmpe96yhv\\tmp9ga04b\\Spamlib-0.1.dist-info\\RESOURCES',
 
'c:\\users\\nadeem\\appdata\\local\\temp\\tmpe96yhv\\tmp9ga04b\\Spamlib-0.1.dist-info\\RECORD']

(Pdb) p list(_d.list_installed_files())
[('c:\\users\\nadeem\\appdata\\local\\temp\\tmpe96yhv\\tmpo8yw3_\\spamd', 
'd13e6156ce78919a981e424b2fdcd974', '15'),
 
('c:\\users\\nadeem\\appdata\\local\\temp\\tmpe96yhv\\tmp9ga04b\\Spamlib-0.1.dist-info\\METADATA',
 '8c9f474663f774563ded42983eb22447', '182'),
 
('c:\\users\\nadeem\\appdata\\local\\temp\\tmpe96yhv\\tmp9ga04b\\Spamlib-0.1.dist-info\\INSTALLER',
 '44e3fde05f3f537ed85831969acf396d', '9'),
 
('c:\\users\\nadeem\\appdata\\local\\temp\\tmpe96yhv\\tmp9ga04b\\Spamlib-0.1.dist-info\\REQUESTED',
 'd41d8cd98f00b204e9800998ecf8427e', '0'),
 
('c:\\users\\nadeem\\appdata\\local\\temp\\tmpe96yhv\\tmp9ga04b\\Spamlib-0.1.dist-info\\RESOURCES',
 '1c5aec043865966e17b1044e20087b9d', '68'),
 
('c:\\users\\nadeem\\appdata\\local\\temp\\tmpe96yhv\\tmp9ga04b\\Spamlib-0.1.dist-info\\RECORD',
 '', '')]

 File contents:

spamd [no EOL]:
# Python script

METADATA:
Metadata-Version: 1.0
Name: Spamlib
Version: 0.1
Summary: UNKNOWN
Description: UNKNOWN
Keywords: 
Home-page: UNKNOWN
Author: UNKNOWN
Author-email: UNKNOWN
License: UNKNOWN

INSTALLER [no EOL]:
distutils

REQUESTED is empty

RESOURCES:
spamd,c:\users\nadeem\appdata\local\temp\tmpe96yhv\tmpo8yw3_\spamd

RECORD:

c:\users\nadeem\appdata\local\temp\tmpe96yhv\tmpo8yw3_\spamd,d13e6156ce78919a981e424b2fdcd974,15

c:\users\nadeem\appdata\local\temp\tmpe96yhv\tmp9ga04b\Spamlib-0.1.dist-info\METADATA,8c9f474663f774563ded42983eb22447,182

c:\users\nadeem\appdata\local\temp\tmpe96yhv\tmp9ga04b\Spamlib-0.1.dist-info\INSTALLER,44e3fde05f3f537ed85831969acf396d,9

c:\users\nadeem\appdata\local\temp\tmpe96yhv\tmp9ga04b\Spamlib-0.1.dist-info\REQUESTED,d41d8cd98f00b204e9800998ecf8427e,0

c:\users\nadeem\appdata\local\temp\tmpe96yhv\tmp9ga04b\Spamlib-0.1.dist-info\RESOURCES,1c5aec043865966e17b1044e20087b9d,68

c:\users\nadeem\appdata\local\temp\tmpe96yhv\tmp9ga04b\Spamlib-0.1.dist-info\RECORD,,



> Where should be the distro?

You won't find it in the hg repository - it gets created by the test, and
then deleted afterwards.

> The changeset was:
> $ hg tip
> changeset:   73075:d4839fea4a5a
> [...]

That's not possible - these failures have been around for over a week now,
and that changeset was only committed yesterday.

>From running the tests locally, it looks like test_resources was failing on
Windows since it was first introduced in 1f3459b08298. This didn't show up so
clearly on the buildbots because the build was broken at the time.

--

___
Python tracker 

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



[issue13237] subprocess docs should emphasise convenience functions

2011-10-24 Thread Nick Coghlan

Changes by Nick Coghlan :


--
assignee: docs@python -> ncoghlan

___
Python tracker 

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



[issue13259] __bytes__ not documented

2011-10-24 Thread Arkadiusz Wahlig

New submission from Arkadiusz Wahlig :

It looks like Python 3 supports the __bytes__ magic method (called by 
bytes(obj)). However, it's not documented anywhere.

Also, I could not find any reference to BDFL accepting it but it looks like it 
got in anyway.

Here are some posts back from 2007 where he argues against it:
http://mail.python.org/pipermail/python-3000/2007-August/009375.html

--
assignee: docs@python
components: Documentation
messages: 146334
nosy: docs@python, yak
priority: normal
severity: normal
status: open
title: __bytes__ not documented
versions: Python 3.1, Python 3.2, Python 3.3, Python 3.4

___
Python tracker 

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



[issue13193] test_packaging and test_distutils failures

2011-10-24 Thread Francisco Martín Brugué

Francisco Martín Brugué  added the comment:

>
>> Where should be the distro?
>
> You won't find it in the hg repository - it gets created by the test, and
> then deleted afterwards.

Thanks for the info

>
>> The changeset was:
>> $ hg tip
>> changeset:   73075:d4839fea4a5a
>> [...]
>
> That's not possible - these failures have been around for over a week now,
> and that changeset was only committed yesterday.
>

Thanks again, next time I'll search the exact start point of failure in 
the repo. I've just put the ref to MY actual tip ;)

--

___
Python tracker 

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



[issue13259] __bytes__ not documented

2011-10-24 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Indeed. I didn't even remember we had that. There are tests, however, in 
Lib/test/test_bytes.py.
This was added in issue #2415, by the way.

--
nosy: +pitrou
stage:  -> needs patch
versions:  -Python 3.1, Python 3.4

___
Python tracker 

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



[issue13218] test_ssl failures on Debian/Ubuntu

2011-10-24 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

TL;DR: Let's rip out the false assumption that an SSLv23 client cannot connect 
to an SSLv3/TLSv1 server.

I now believe this is simply an erroneous assumption on the part of the Python 
test suite, namely that SSLv23 method clients cannot connect to SSLv3 or TLSv1 
servers.  Here is an excerpt from openssl's CHANGES file:


 Changes between 0.9.7g and 0.9.7h  [11 Oct 2005]
...

  *) Change the client implementation for SSLv23_method() and
 SSLv23_client_method() so that is uses the SSL 3.0/TLS 1.0
 Client Hello message format if the SSL_OP_NO_SSLv2 option is set.
 (Previously, the SSL 2.0 backwards compatible Client Hello
 message format would be used even with SSL_OP_NO_SSLv2.)
 [Bodo Moeller]

It looks like it's been this way for a long time too.  What may have changed 
recently on Debian/Ubuntu though is that, as of Ubuntu version 1.0.0d-2ubuntu1 
(in Ubuntu 11.04), we now use the no-ssl configuration option to disable SSLv2. 
 My guess is that "the SSL_OP_NO_SSLv2 option" gets set by this configuration 
option, which is what switches the client hello to use SSLv3/TLSv1 format, thus 
enabling such connections.  I'm not entirely sure which Debian version of the 
package this got changed in, but it certainly works the same way on Wheezy as 
it does in Oneiric.

It's probably too difficult, and not really Python's responsibility, to 
determine whether SSL_OP_NO_SSLv2 is set.  Rather, I think the test is simply 
bogus and should be disabled or removed.  Antoine implies as such in 

http://bugs.python.org/issue13218#msg145912

A couple of other things: it is not true that Ubuntu (or Debian for that 
matter) is changing the semantics of a library here.  It's simply using a 
supported upstream configuration option to disable SSLv2, and the openssl 
library itself changes the semantics of client/server connection success based 
on that.

Also, I think @skip_if_broken_ubuntu_ssl is both a misnomer (since all that 
behavior is inherited from Debian) and besides, it's useless now since on 
Debian/Ubuntu, ssl.PROTOCOL_SSLv2 will never be defined, at least with 
modernish versions of both OS's.  But I guess ripping that out is a task for a 
different bug.

--

___
Python tracker 

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



[issue13234] os.listdir breaks with literal paths

2011-10-24 Thread Santoso Wijaya

Santoso Wijaya  added the comment:

I'd also like to point out that Unicode path is handled correctly in both 2.7.x
and 3.x:

Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] 
on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.listdir(u'?\\D:\\Temp\\tempdir')
[u'sub1', u'test1.txt']
>>> os.listdir('?\\D:\\Temp\\tempdir')
Traceback (most recent call last):
  File "", line 1, in 
WindowsError: [Error 123] The filename, directory name, or volume label 
syntax i
s incorrect: '?\\D:\\Temp\\tempdir/*.*'

Python 3.2 (r32:88445, Feb 20 2011, 21:30:00) [MSC v.1500 64 bit (AMD64)] 
on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.listdir('?\\D:\\Temp\\tempdir')
['sub1', 'test1.txt']
>>> os.listdir(b'?\\D:\\Temp\\tempdir')
Traceback (most recent call last):
  File "", line 1, in 
WindowsError: [Error 123] The filename, directory name, or volume label 
syntax i
s incorrect: '?\\D:\\Temp\\tempdir/*.*'

The problem only lies in the code handling narrow string paths. If you look at
(py33) posixmodule.c:2545-6, the bare path is appended with L"\\*.*". Whereas
in the narrow string case, posixmodule.c:2625-6, the bare path is appended with
"/*.*", instead.

To be consistent, we should use '\\'.

--
Added file: http://bugs.python.org/file23512/issue13234_py33.patch

___
Python tracker 

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



[issue13234] os.listdir breaks with literal paths

2011-10-24 Thread Santoso Wijaya

Santoso Wijaya  added the comment:

There are also several other edge cases to be taken care of:

Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] 
on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.listdir(r'\\?\C:\Python27/')
Traceback (most recent call last):
  File "", line 1, in 
WindowsError: [Error 123] The filename, directory name, or volume label 
syntax i
s incorrect: '?\\C:\\Python27/*.*'
>>> os.listdir(r'\\?\C:/Python27\Lib')
Traceback (most recent call last):
  File "", line 1, in 
WindowsError: [Error 3] The system cannot find the path specified: 
'?\\C:/Py
thon27\\Lib/*.*'

--
Added file: http://bugs.python.org/file23513/issue13234_py33_v2.patch

___
Python tracker 

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



[issue13260] distutils and cross-compiling the extensions

2011-10-24 Thread Alexander Myodov

New submission from Alexander Myodov :

I was recently trying to cross-compile several extensions (host: Linux, target: 
Win32) using mingw-gcc, and noticed that there is quite a little amount of 
changes needed to distutils code to at least make proper win32-compabible 
modules.

Some of them require pretty noticeable functionality changes to distutils 
(like, adding a new option) thus they are unlikely a target for 2.7 anymore 
(though with some luck, any person who wants to follow my way and do 
cross-compilation, may just subclass the existing code). But some others are 
obvious bugs, and their fixes may still be useful for users stuck at 2.7.

1. (This is dubious but still is related to the problem, and was required to 
build some of the modules). "--include-dirs" and "--library-dirs" options to 
build_ext command support multiple paths separated by os.pathsep. For some 
reason (which I may be unaware of) "--libraries" option doesn't. A tiny fix 
just adds this support.

2. (more obvious issue) get_msvcr() function in distutils/cygwincompiler.py 
tries to guess the C runtime library which the target extension should link to. 
To do that, it tests the Python where the setup.py is *running* for what 
library it was linked to. But when the compilation target is Win32 but the 
compilation host is Linux, the hosts's Python won't contain such information. 
In this case, this function will return None. The result then gets assigned to 
self.dll_libraries (in an instance of CygwinCCompiler or Mingw32CCompiler), and 
gets used in a context which implies it is always an iterable 
(libraries.extend(self.dll_libraries)).

These changes, together with altering or subclassing Mingw32CCompiler to use a 
different compiler name (like, "i586-mingw32msvc-gcc" instead of "gcc"), make 
it possible to cross-compile a number of extensions which were non-compileable 
before.

--
assignee: tarek
components: Distutils
files: distutils.patch
keywords: patch
messages: 146340
nosy: amyodov, eric.araujo, tarek
priority: normal
severity: normal
status: open
title: distutils and cross-compiling the extensions
versions: Python 2.7
Added file: http://bugs.python.org/file23514/distutils.patch

___
Python tracker 

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



[issue13234] os.listdir breaks with literal paths

2011-10-24 Thread Santoso Wijaya

Santoso Wijaya  added the comment:

Additionally, there might be issues in other APIs when handling with extended 
path lengths:

D:\Temp\tempdir>dir
 Volume in drive D is Data
 Volume Serial Number is 7E3D-EC81

 Directory of D:\Temp\tempdir

10/24/2011  04:22 PM  .
10/24/2011  04:22 PM  ..
10/24/2011  04:28 PM  A


AA
10/24/2011  01:31 PM  sub1
10/24/2011  03:39 PM   262 test1.txt
   1 File(s)262 bytes
   4 Dir(s)  244,483,321,856 bytes free

D:\Temp\tempdir>cd A


AA

D:\Temp\tempdir\


AAA>dir
 Volume in drive D is Data
 Volume Serial Number is 7E3D-EC81

 Directory of D:\Temp\tempdir\AA


A

10/24/2011  04:28 PM  .
10/24/2011  04:28 PM  ..
10/24/2011  04:14 PM 0 1234567.txt
10/24/2011  04:28 PM  B
   1 File(s)  0 bytes
   3 Dir(s)  244,483,321,856 bytes free

Python 3.2 (r32:88445, Feb 20 2011, 21:30:00) [MSC v.1500 64 bit (AMD64)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> subdir = 'B'*13
>>> os.path.isdir(subdir)
False
>>> os.getcwd()
'D:\\Temp\\tempdir\\


AAA'
>>> subdir_abs = os.path.join(os.getcwd(), subdir)
>>> os.path.isdir(subdir)
False
>>> subdir_ext = r'\\?\%s' % subdir_abs
>>> os.path.isdir(subdir_ext)
True

In the above example, perhaps a ValueError('path too long') is better than 
returning False?

--

___
Python tracker 

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



[issue13259] __bytes__ not documented

2011-10-24 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 199d9e3fe0ce by Benjamin Peterson in branch '3.2':
document __bytes__ special method (closes #13259)
http://hg.python.org/cpython/rev/199d9e3fe0ce

New changeset 4128de054937 by Benjamin Peterson in branch 'default':
merge 3.2 (#13259)
http://hg.python.org/cpython/rev/4128de054937

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



[issue3982] support .format for bytes

2011-10-24 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue13251] Update string description in datamodel.rst

2011-10-24 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 11d18ebb2dd1 by Ezio Melotti in branch 'default':
#13251: update string description in datamodel.rst.
http://hg.python.org/cpython/rev/11d18ebb2dd1

--
nosy: +python-dev

___
Python tracker 

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



[issue13251] Update string description in datamodel.rst

2011-10-24 Thread Ezio Melotti

Changes by Ezio Melotti :


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



[issue13248] deprecated in 3.2, should be removed in 3.3

2011-10-24 Thread Ezio Melotti

Ezio Melotti  added the comment:

Maybe a 2to3 fixer to convert the names should be added?

--

___
Python tracker 

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