[issue10408] Denser dicts and linear probing

2011-08-24 Thread John O'Connor

Changes by John O'Connor tehj...@gmail.com:


--
nosy: +jcon

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



[issue12729] Python lib re cannot handle Unicode properly due to narrow/wide bug

2011-08-24 Thread Glenn Linderman

Glenn Linderman v+pyt...@g.nevcal.com added the comment:

In msg142098  Ezio said:
 Keep in mind that we should be able to access and use lone surrogates too, 
 therefore:
 s = '\ud800'  # should be valid
 len(s)  # should this raise an error? (or return 0.5 ;)?

I say:
For streams and data types in which lone surrogates are permitted, a lone 
surrogate should be treated as and counted as a character (codepoint).

For streams and data types in which lone surrogates are not permitted, the 
assigned should be invalid, and raise an error; len would then never see it, 
and has no quandary.

--
nosy: +v+python

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



[issue6584] gzip module has no custom exception

2011-08-24 Thread Michele Orrù

Changes by Michele Orrù maker...@gmail.com:


--
nosy: +ezio.melotti

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



[issue6669] TarFile.getmembers fails at struct.unpack: unpack requires a string argument of length 4

2011-08-24 Thread Michele Orrù

Changes by Michele Orrù maker...@gmail.com:


--
nosy: +ezio.melotti

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



[issue12388] cannot specify recursive extra_files in packaging setup.cfg

2011-08-24 Thread trevor

Changes by trevor tre...@well.com:


--
nosy: +trevor

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



[issue12386] packaging fails in install_distinfo when writing RESOURCES

2011-08-24 Thread trevor

Changes by trevor tre...@well.com:


--
nosy: +trevor

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



[issue12830] --install-data doesn't effect resources destination

2011-08-24 Thread trevor

New submission from trevor tre...@well.com:

attempting to point the relative destination with --install-data does not 
seem to have an effect. the specified directory is created, but resources are 
still installed relative to the present working directory.

setup.cfg:

[files]
resources =
externalfiles/tobemoved.txt = support


% pysetup3 run install_dist --install-data /tmp/example


/tmp/example is created with no files, ./support/tobemoved.txt is created

--
assignee: tarek
components: Distutils2
messages: 142878
nosy: alexis, eric.araujo, tarek, trevor
priority: normal
severity: normal
status: open
title: --install-data doesn't effect resources destination
type: behavior
versions: Python 3.3

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



[issue12831] 2to3 and integer division

2011-08-24 Thread Alexander Rødseth

New submission from Alexander Rødseth rods...@gmail.com:

Hi,

2to3 is a great tool, but I think I found one case it doesn't catch, which is 
this change:

-half = self.maxstars / 2
+half = self.maxstars // 2

/ 2 is an integer division, so it should be // 3 in Python 3.

Thanks.

--
components: 2to3 (2.x to 3.0 conversion tool)
messages: 142879
nosy: alexander256
priority: normal
severity: normal
status: open
title: 2to3 and integer division
type: behavior
versions: Python 3.2

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



[issue1666318] shutil.copytree doesn't give control over directory permissions

2011-08-24 Thread Ugra Dániel

Changes by Ugra Dániel daniel.u...@gmail.com:


--
nosy: +daniel.ugra

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



[issue12832] The documentation for the print function should explain/point to how to control the sys.stdout encoding

2011-08-24 Thread R. David Murray

New submission from R. David Murray rdmur...@bitdance.com:

A common problem encountered when using python3 is writing non-ascii to stdout. 
 This will work fine if stdout is a terminal and the terminal encoding handles 
the characters, but will fail if stdout is later redirected to a pipe.  The 
docs for sys.stdout and for print should contain or point to an explanation of 
why, and how to solve the problem (ie: how to set the encoding for 
sys.stdout/sys.stderr).

Note that IMO it makes more sense for sys.stdout to default to the LOCALE 
encoding, but that should be a separate issue.

--
assignee: docs@python
components: Documentation
messages: 142880
nosy: docs@python, r.david.murray
priority: normal
severity: normal
status: open
title: The documentation for the print function should explain/point to how to 
control the sys.stdout encoding
versions: Python 2.7, Python 3.2, Python 3.3

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



[issue12832] The documentation for the print function should explain/point to how to control the sys.stdout encoding

2011-08-24 Thread R. David Murray

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

Victor says it defaults to LOCALE in 3.3.  The documentation should still be 
expanded to mention this even in 3.3, though.

--

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



[issue12807] Optimizations for {bytearray,bytes,unicode}.strip()

2011-08-24 Thread Antoine Pitrou

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

+if (len == 0) {
+if (PyByteArray_CheckExact(self)) {
+Py_INCREF(self);
+return (PyObject *)self;
+}
+return PyByteArray_FromStringAndSize(NULL, 0);
+}

This looks like a dubious micro-optimization. If len == 0,
all loops will exit early anyway (same for similar snippets in bytesobject.c 
and unicodeobject.c).

+if (i == 0  j == len  PyByteArray_CheckExact(self)) {
+Py_INCREF(self);
+return (PyObject *)self;
+}

bytearray objects are mutable, so you can't return the same object without 
breaking expected semantics. e.g.:

 a = bytearray()
 b = a.strip()
 b.append(49)
 a
bytearray(b'')
 b
bytearray(b'1')

 diff -r b5ccdf7c032a Python/bltinmodule.c
 Binary file Python/bltinmodule.c has changed

Uh, what's this? bltinmodule.c shouldn't be considered a binary file.
It probably means you added a NUL byte in it by mistake.

 Looking at just how similar these 3 implementations are I feel that we 
 could also unify/generalize them into one generic helper implementation 
 and leave the object marshaling up to the type specific methods.

You could put it in Objects/stringlib.

--

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



[issue12832] The documentation for the print function should explain/point to how to control the sys.stdout encoding

2011-08-24 Thread R. David Murray

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

Ah, this was actually fixed in 3.2, so it is only 2.7 where there is the 
different (and long standing) problem of output of unicode to a pipe.

So, the doc issue boils down to mentioning how the encoding for stdout/stderr 
is derived (LOCALE, overridden by PYTHONIOENCODING if set, as far as I can 
tell).

--

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



[issue12803] SSLContext.load_cert_chain() should accept a password argument

2011-08-24 Thread Antoine Pitrou

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

Thanks for the patch. This is a generally useful functionality and the patch 
looks mostly good.
I have a couple comments:

- in _pwinfo_set(), you need to decref password_bytes when you're finished
- you check the password size in _password_callback() but not in _pwinfo_set(), 
is it expected? is the size limit only meaningful with a callback rather than a 
predefined password?

--

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



[issue3244] multipart/form-data encoding

2011-08-24 Thread Conley Owens

Changes by Conley Owens xcc...@gmail.com:


--
nosy: +cco3

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



[issue6560] socket sendmsg(), recvmsg() methods

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

Charles-François Natali neolo...@free.fr added the comment:

Here's a patch skipping testFDPassSeparate and
testFDPassSeparateMinSpace on OS X  10.5, due to known kernel bugs
(see http://developer.apple.com/library/mac/#qa/qa1541/_index.html).
For InterruptedSendTimeoutTest and testInterruptedSendmsgTimeout, it
also looks like a kernel bug.
There could be another explanation, though: if, for some reason, other
threads are running at that time, the signal might be delivered to
another thread, and our main thread remains stuck on sendto/sendmsg
once the socket buffer is full. I'm however not sure why this would
only affect OS X (since FreeBSD behaves in the same way when it comes
to signals, contrarily to Linux). Also, I'm not sure why this would
not affect recv/recvmsg.

--
Added file: http://bugs.python.org/file23027/pass_fds_osx.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6560
___diff -r 1696e2789d91 Lib/test/test_socket.py
--- a/Lib/test/test_socket.py   Wed Aug 24 02:15:25 2011 +0200
+++ b/Lib/test/test_socket.py   Wed Aug 24 18:36:22 2011 +0200
@@ -2090,7 +2090,9 @@
 def _testFDPassCMSG_LEN(self):
 self.createAndSendFDs(1)
 
+# Passing multiple FDs at once isn't reliable on OS X  10.5.
 @requireAttrs(socket, CMSG_SPACE)
+@support.requires_mac_ver(10, 5)
 def testFDPassSeparate(self):
 # Pass two FDs in two separate arrays.  Arrays may be combined
 # into a single control message by the OS.
@@ -2111,6 +2113,7 @@
 len(MSG))
 
 @requireAttrs(socket, CMSG_SPACE)
+@support.requires_mac_ver(10, 5)
 def testFDPassSeparateMinSpace(self):
 # Pass two FDs in two separate arrays, receiving them into the
 # minimum space for two arrays.
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12333] test_packaging failures under Solaris

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

Charles-François Natali neolo...@free.fr added the comment:

More occurrences:
http://www.python.org/dev/buildbot/all/builders/sparc solaris10 gcc 
3.x/builds/3555/steps/test/logs/stdio


==
ERROR: test_record_extensions (distutils.tests.test_install.InstallTestCase)
--
Traceback (most recent call last):
  File 
/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/tests/support.py, 
line 63, in tearDown
shutil.rmtree(d, os.name in ('nt', 'cygwin'))
  File /home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py, line 280, in 
rmtree
rmtree(fullname, ignore_errors, onerror)
  File /home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py, line 289, in 
rmtree
onerror(os.rmdir, path, sys.exc_info())
  File /home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py, line 287, in 
rmtree
os.rmdir(path)
OSError: [Errno 22] Invalid argument: '/tmp/tmp2horib/foo'


--
nosy: +neologix
resolution: fixed - 
status: closed - open

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



[issue12833] raw_input misbehaves when readline is imported

2011-08-24 Thread Idan Kamara

New submission from Idan Kamara idank...@gmail.com:

import sys, readline

sys.stdout.write('foo ')
raw_input()

When trying the above on Debian, 2.6.6 using gnome-terminal, typing a character 
then hitting backspace deletes foo  as well.

I'm not sure if this is a bug or the expected behavior when writing to stdout 
directly rather than passing the string to raw_input() (for my particular use 
case that's not an option though).

One possible workaround seems to be to delete the trailing space from write() 
and move it to raw_input:

sys.stdout.write('foo')
raw_input(' ')

Then backspace seems to work properly. This has something to do with readline 
because when it's not imported, it also works as expected (but other things 
break obviously).

--
components: Library (Lib)
messages: 142887
nosy: idank
priority: normal
severity: normal
status: open
title: raw_input misbehaves when readline is imported
type: behavior
versions: Python 2.6

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



[issue12824] Make the write_file() helper function in test_shutil return the file name it wrote to

2011-08-24 Thread Hynek Schlawack

Hynek Schlawack h...@ox.cx added the comment:

ok. it would have saved some LOC for me, but it's nothing essential of course.

--
resolution:  - rejected
status: open - closed

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



[issue12830] --install-data doesn't effect resources destination

2011-08-24 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

This is one of the things that were left under-specified when the resources 
subsystem was introduced by adding working code instead of a PEP.  I think that 
--install-data is obsolete now, and that there should be another way to 
override specific sysconfig variables or paths (which are used to install data 
files/resources) from the command line and config files, to replace 
--install-data.

--

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



[issue12715] Add symlink support to shutil functions

2011-08-24 Thread Hynek Schlawack

Hynek Schlawack h...@ox.cx added the comment:

What started as a 2 lines fix, grew to a patch of ~400 lines. :)

It's mostly tests though:

Lib/shutil.py   |  102 +--
Lib/test/test_shutil.py |  220 
++
Misc/ACKS   |1 +
3 files changed, 297 insertions(+), 26 deletions(-)

I've AFAIS implemented the desired behavior and hope for feedback/bug reports.

It's tested on Linux  FreeBSD 8.2 and applies cleanly against default/tip.

Please let me know if I've done something stupid.

--
hgrepos: +63

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



[issue12715] Add symlink support to shutil functions

2011-08-24 Thread Hynek Schlawack

Changes by Hynek Schlawack h...@ox.cx:


--
keywords: +patch
Added file: http://bugs.python.org/file23028/e126ceae5ba9.diff

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



[issue12810] Remove check for negative unsigned value in socketmodule.c

2011-08-24 Thread Roundup Robot

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

New changeset 4736e172fa61 by Charles-François Natali in branch 'default':
Issue12810: Remove check for negative unsigned value in socketmodule.c. Patch
http://hg.python.org/cpython/rev/4736e172fa61

--
nosy: +python-dev

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



[issue12810] Remove check for negative unsigned value in socketmodule.c

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

Charles-François Natali neolo...@free.fr added the comment:

Patch committed.
Thanks Joel!

--
resolution:  - fixed
stage: commit review - committed/rejected
status: open - closed

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



[issue12715] Add symlink support to shutil functions

2011-08-24 Thread Antoine Pitrou

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


--
nosy: +haypo, neologix

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



[issue12803] SSLContext.load_cert_chain() should accept a password argument

2011-08-24 Thread Adam Simpkins

Adam Simpkins a...@adamsimpkins.net added the comment:

Good catch.  Here's an updated patch to fix the missing decref in
_pwinfo_set()

The length check in _password_callback() applies to both callback
functions and predefined strings.  The C API always uses a callback,
so _password_callback() is used even when the python caller has passed
in a string.  We can't check the length in _pwinfo_set() since it depends
on the buffer length argument that openssl will pass to
_password_callback().

--
Added file: http://bugs.python.org/file23029/ssl-password.3.patch

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



[issue12834] memoryview.tobytes() incorrect for non-contiguous arrays

2011-08-24 Thread Stefan Krah

New submission from Stefan Krah stefan-use...@bytereef.org:

memoryview.tobytes() converts a non-contiguous array to
a contiguous representation. This result is not right:


 from numpy import *
 x = array([1,2,3,4,5], dtype=B)
 y = x[::-1]
 y
array([5, 4, 3, 2, 1], dtype=uint8)
 m = memoryview(y)
 m.tobytes()
'\x04\x03\x02\x01\x05'


--
assignee: skrah
components: Interpreter Core
messages: 142894
nosy: skrah
priority: normal
severity: normal
stage: needs patch
status: open
title: memoryview.tobytes() incorrect for non-contiguous arrays
type: behavior
versions: Python 3.3

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



[issue12834] memoryview.tobytes() incorrect for non-contiguous arrays

2011-08-24 Thread Antoine Pitrou

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

That's rather funky. What should the right result be?

--
nosy: +pitrou

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



[issue4106] multiprocessing occasionally spits out exception during shutdown

2011-08-24 Thread Antoine Pitrou

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

I can't seem to reproduce this under 3.3. Should it be closed?

--
nosy: +pitrou
resolution:  - out of date
versions: +Python 3.2, Python 3.3 -Python 2.6

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



[issue6560] socket sendmsg(), recvmsg() methods

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

Charles-François Natali neolo...@free.fr added the comment:

As noted by Antoine, the OS X 10.5 buildbots are also failing.

--

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



[issue4106] multiprocessing occasionally spits out exception during shutdown

2011-08-24 Thread Jesse Noller

Jesse Noller jnol...@gmail.com added the comment:

On Wed, Aug 24, 2011 at 3:01 PM, Antoine Pitrou rep...@bugs.python.org wrote:

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

 I can't seem to reproduce this under 3.3. Should it be closed?

I don't think so; it's still applicable to 2.x, and a fix should go
into 2.7 ideally. http://bugs.python.org/issue9207 is the source of
the issue AFAIR

--

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



[issue12834] memoryview.tobytes() incorrect for non-contiguous arrays

2011-08-24 Thread Stefan Krah

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

Antoine Pitrou rep...@bugs.python.org wrote:
 That's rather funky. What should the right result be?

Basically [5, 4, 3, 2, 1] as bytes:

'\x05\x04\x03\x02\x01'

Looks like an off-by-one error.

I was a bit surprised that tobytes() automatically converts anything
to a C-contiguous array. The result can be completely disconnected
from the raw memory.

[The bug also exists for forward strides.]

array([1, 3, 5], dtype=uint64)
 m = memoryview(y)
 m.tobytes()
'\x03\x00\x00\x00\x00\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00'


--

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



[issue12835] Missing SSLSocket.sendmsg() wrapper allows programs to send unencrypted data by mistake

2011-08-24 Thread David Watson

New submission from David Watson bai...@users.sourceforge.net:

Changeset fd10d042b41d removed the wrappers on ssl.SSLSocket for 
the new socket.send/recvmsg() methods (since I forgot to check 
for the existence of the underlying methods - see issue #6560), 
but this leaves SSLSocket with send/recvmsg() methods inherited 
from the underlying socket type; thus SSLSocket.sendmsg() will 
insert the given data into the stream without encrypting it (or 
wrapping it in SSL in any way). 
 
This immediately screws up the SSL connection, resulting in 
receive errors at both ends (SSL3_GET_RECORD:wrong version 
number and the like), but the data is clearly visible in a 
packet capture, so it's too late if it was actually something 
secret. 
 
Correspondingly, recvmsg() and recvmsg_into() return the 
encrypted data, and screw up the connection by removing it from 
the SSL stream. 
 
Of course, these methods don't make sense over SSL anyway, but if 
the programmer naively assumes they do, then ideally they should 
not expose any secret information. 
 
Attaching a patch implementing Antoine Pitrou's suggestion that 
the methods should simply raise NotImplementedError.  I don't 
know if these versions should also be added only if present on 
the underlying socket - they're Not Implemented either way :-)

--
components: Library (Lib)
files: ssl_sendrecvmsg_notimplemented.diff
keywords: patch
messages: 142900
nosy: baikie
priority: normal
severity: normal
status: open
title: Missing SSLSocket.sendmsg() wrapper allows programs to send unencrypted 
data by mistake
versions: Python 3.3
Added file: http://bugs.python.org/file23030/ssl_sendrecvmsg_notimplemented.diff

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



[issue6560] socket sendmsg(), recvmsg() methods

2011-08-24 Thread David Watson

David Watson bai...@users.sourceforge.net added the comment:

On Tue 23 Aug 2011, Nick Coghlan wrote:
 As you can see, I just pushed a change that removed the new
 methods from SSLSocket objects. If anyone wants to step up with
 a valid use case (not already covered by wrap_socket),
 preferably with a patch to add them back that includes proper
 tests and documentation changes, please open a new feature
 request and attach the new patch to that issue.

Hi, sorry about the trouble caused by the broken tests, but
SSLSocket should at least override sendmsg() to stop misguided
programs sending data in the clear:

http://bugs.python.org/issue12835

--

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



[issue12786] subprocess wait() hangs when stdin is closed

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

Changes by Charles-François Natali neolo...@free.fr:


--
nosy: +pitrou, rosslagerwall

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



[issue12834] memoryview.tobytes() incorrect for non-contiguous arrays

2011-08-24 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@haypocalc.com:


--
nosy: +haypo

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



[issue12760] Add create mode to open()

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

Charles-François Natali neolo...@free.fr added the comment:

So, what was the conclusion of the discussion brought up on python-dev?
I had a feeling some core devs were opposed to this (I'm personally -0).

--

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



[issue4106] multiprocessing occasionally spits out exception during shutdown

2011-08-24 Thread Antoine Pitrou

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

Indeed, 2.7 seems still affected.

--
resolution: out of date - 
versions:  -Python 3.2, Python 3.3

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



[issue12287] ossaudiodev: stack corruption with FD = FD_SETSIZE

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

Charles-François Natali neolo...@free.fr added the comment:

So, what should I do with is_selectable.diff?

--

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



[issue12656] test.test_asyncore: add tests for AF_INET6 and AF_UNIX sockets

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

Changes by Charles-François Natali neolo...@free.fr:


--
nosy: +haypo, pitrou

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



[issue5113] 2.5.4.3 / test_posix failing on HPUX systems

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

Changes by Charles-François Natali neolo...@free.fr:


--
nosy: +haypo

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



[issue6419] Broken test_kqueue.py on OpenBSD

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

Charles-François Natali neolo...@free.fr added the comment:

Rémi, can you reproduce this problem?
Could you test the patch attached?
(It's maybe already part of OPenBSD's tree, in which case it would certainly be 
nice to include it).

--
nosy: +rpointel

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



[issue12287] ossaudiodev: stack corruption with FD = FD_SETSIZE

2011-08-24 Thread Antoine Pitrou

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

 So, what should I do with is_selectable.diff?

It looks ok to me.

--

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



[issue4106] multiprocessing occasionally spits out exception during shutdown

2011-08-24 Thread Antoine Pitrou

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

Ok, I think the reason this doesn't appear in 3.2/3.3 is the fix for issue1856. 
In 2.x (and 3.1) daemon threads can continue executing after the interpreter's 
internal structures have started being destroyed.

The least intrusive solution is to always join the helper thread before 
shutting down the interpreter. Patch attached.

--
keywords: +patch
stage:  - patch review
Added file: http://bugs.python.org/file23031/mpqshutdown.patch

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



[issue12656] test.test_asyncore: add tests for AF_INET6 and AF_UNIX sockets

2011-08-24 Thread Antoine Pitrou

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

Perhaps bind_af_aware() should find its place in test.support. Also, using 
test.support.unlink means it filters out acceptable errnos.

Also, do we want an IPv6 test with poll, or is it overkill?

--

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



[issue12801] C realpath not used by os.path.realpath

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

Charles-François Natali neolo...@free.fr added the comment:

 It would probably be simpler, safer and more efficient to simply call
 the POSIX function instead (but it most be exposed somewhere, by
 posixmodule.c I suppose).

Indeed.

 Would it be a good idea to use the full docstring of posixpath.realpath
 to os.realpath and then just do “realpath = os.realpath” in posixpath?

Yes. That would also be a way to add the '.' default argument.

 An initial patch.

I'm actually concerned because realpath doesn't seem as portable as I first 
thought. Here's what my man page says:

OSIX.1-2001 says that the behavior if resolved_path is NULL is 
implementation-defined.  POSIX.1-2008 specifies the behavior described in this 
page.


So I'm not sure that all implementations support passing a NULL buffer as 
argument.

Also:

Solaris may return a relative pathname when the path argument is relative.


Well, I guess we can also commit this patch and see if a buildbot breaks...

--

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



[issue12760] Add create mode to open()

2011-08-24 Thread Antoine Pitrou

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

I haven't seen any discussion on python-dev. Have I missed something?

--

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



[issue12760] Add create mode to open()

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

Charles-François Natali neolo...@free.fr added the comment:

 I haven't seen any discussion on python-dev. Have I missed something?

It was on Python-ideas actually:
http://mail.python.org/pipermail/python-ideas/2011-August/011183.html

--

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



[issue4106] multiprocessing occasionally spits out exception during shutdown

2011-08-24 Thread Vinay Sajip

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

In Antoine's patch, ISTM that the line

created_by_this_process = ...

could also be deleted, as the patch no longer uses that value and it's not used 
anywhere later in the method.

--
nosy: +vinay.sajip

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



[issue12801] C realpath not used by os.path.realpath

2011-08-24 Thread STINNER Victor

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

i12801.patch is not correct: on Windows, you should never encode a filename to 
bytes. Use PyUnicode_Decode() + _Py_wrealpath(), or a #ifdef (as many other 
posixmodule functions).

I prefer to reuse _Py_wrealpath because we will have to add special cases: 
realpath(NULL) and also maybe canonicalize_file_name().

--

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



[issue12786] subprocess wait() hangs when stdin is closed

2011-08-24 Thread Antoine Pitrou

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

You might want to add a comment in the patch that the cloexec flag is removed 
from the child's pipes by calling dup2() before exec() :) I was a bit baffled 
at first when reading the patch.

--

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



[issue8713] multiprocessing needs option to eschew fork() under Linux

2011-08-24 Thread Ask Solem

Ask Solem a...@celeryproject.org added the comment:

I have suspected that this may be necessary, not just merely useful, for some 
time, and issue6721 seems to verify that.  In addition to adding the keyword 
arg to Process, it should also be added to Pool and Manager.

Is anyone working on a patch? If not I will work on a patch asap.

--

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



[issue12760] Add create mode to open()

2011-08-24 Thread Antoine Pitrou

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

Ah, right. Well I think all arguments against it were quite weak (or even 
wrong). Let's see:

- it's not cross-platform: actually it is (OS_EXCL has been POSIX since at 
least 1997 (*), and Windows also has it)

- os.open followed by os.fdopen is easy: it isn't that easy to get the 
incantation right (the pure Python open() in _pyio is 70 lines of code), 
especially if you want the file object to have the right name attribute

- it doesn't fill a use case: actually, avoiding race conditions is an 
important use case, even though many people may never encounter it (I must 
admit I myself never really cared about this)

So this looks like a reasonable feature request IMHO.

(*) http://pubs.opengroup.org/onlinepubs/007908799/xsh/open.html

--

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



[issue12786] subprocess wait() hangs when stdin is closed

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

Charles-François Natali neolo...@free.fr added the comment:

With comment.
I'll add a similar comment to default.

--
Added file: http://bugs.python.org/file23032/subprocess_cloexec-1.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12786
___diff -r d4d9a3e71897 Lib/subprocess.py
--- a/Lib/subprocess.py Tue Aug 23 19:54:20 2011 +0200
+++ b/Lib/subprocess.py Wed Aug 24 22:36:58 2011 +0200
@@ -1035,7 +1035,7 @@
 if stdin is None:
 pass
 elif stdin == PIPE:
-p2cread, p2cwrite = os.pipe()
+p2cread, p2cwrite = self._pipe2()
 elif isinstance(stdin, int):
 p2cread = stdin
 else:
@@ -1045,7 +1045,7 @@
 if stdout is None:
 pass
 elif stdout == PIPE:
-c2pread, c2pwrite = os.pipe()
+c2pread, c2pwrite = self._pipe2()
 elif isinstance(stdout, int):
 c2pwrite = stdout
 else:
@@ -1055,7 +1055,7 @@
 if stderr is None:
 pass
 elif stderr == PIPE:
-errread, errwrite = os.pipe()
+errread, errwrite = self._pipe2()
 elif stderr == STDOUT:
 errwrite = c2pwrite
 elif isinstance(stderr, int):
@@ -1082,6 +1082,19 @@
 fcntl.fcntl(fd, fcntl.F_SETFD, old  ~cloexec_flag)
 
 
+def _pipe2(self, cloexec=True):
+Ad-hoc pipe2() implementation.
+# Pipes are set CLOEXEC by default because we don't want them to be
+# inherited by other subprocesses: the CLOEXEC flag is removed from
+# the child's pipes by _dup2(), between fork() and exec().
+# This is not atomic: we would need the pipe2() syscall for that.
+r, w = os.pipe()
+if cloexec:
+self._set_cloexec_flag(r)
+self._set_cloexec_flag(w)
+return r, w
+
+
 def _close_fds(self, but):
 if hasattr(os, 'closerange'):
 os.closerange(3, but)
@@ -1120,11 +1133,9 @@
 # For transferring possible exec failure from child to parent
 # The first char specifies the exception type: 0 means
 # OSError, 1 means some other error.
-errpipe_read, errpipe_write = os.pipe()
+errpipe_read, errpipe_write = self._pipe2()
 try:
 try:
-self._set_cloexec_flag(errpipe_write)
-
 gc_was_enabled = gc.isenabled()
 # Disable gc to avoid bug where gc - file_dealloc -
 # write to stderr - hang.  
http://bugs.python.org/issue1336
diff -r d4d9a3e71897 Lib/test/test_subprocess.py
--- a/Lib/test/test_subprocess.py   Tue Aug 23 19:54:20 2011 +0200
+++ b/Lib/test/test_subprocess.py   Wed Aug 24 22:36:58 2011 +0200
@@ -995,6 +995,37 @@
 self.assertRaises(OSError, os.waitpid, pid, 0)
 self.assertNotIn(ident, [id(o) for o in subprocess._active])
 
+def test_pipe_cloexec(self):
+# Issue 12786: check that the parent-end FDs of the communication pipes
+# are set CLOEXEC, and not inherited by another child process.
+p1 = subprocess.Popen([sys.executable, -c,
+   'import os;'
+   'os.read(0)'
+  ],
+  stdin=subprocess.PIPE, stdout=subprocess.PIPE,
+  stderr=subprocess.PIPE)
+
+p2 = subprocess.Popen([sys.executable, -c, if True:
+   import os, errno, sys
+   for fd in %r:
+   try:
+   os.close(fd)
+   except OSError as e:
+   if e.errno != errno.EBADF:
+   raise
+   else:
+   sys.exit(1)
+   sys.exit(0)
+% [f.fileno() for f in (p1.stdin, p1.stdout,
+   p1.stderr)]
+  ],
+  stdin=subprocess.PIPE, stdout=subprocess.PIPE,
+  stderr=subprocess.PIPE, close_fds=False)
+p1.communicate('foo')
+_, stderr = p2.communicate()
+
+self.assertEqual(p2.returncode, 0, Unexpected error:  + repr(stderr))
+
 
 @unittest.skipUnless(mswindows, Windows specific tests)
 class Win32ProcessTestCase(BaseTestCase):
___
Python-bugs-list mailing list
Unsubscribe: 

[issue8713] multiprocessing needs option to eschew fork() under Linux

2011-08-24 Thread Jesse Noller

Jesse Noller jnol...@gmail.com added the comment:

No one is currently working on a patch AFAIK

--

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



[issue4106] multiprocessing occasionally spits out exception during shutdown

2011-08-24 Thread Roundup Robot

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

New changeset d316315a8781 by Antoine Pitrou in branch '2.7':
Issue #4106: Fix occasional exceptions printed out by multiprocessing on 
interpreter shutdown.
http://hg.python.org/cpython/rev/d316315a8781

--
nosy: +python-dev

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



[issue4106] multiprocessing occasionally spits out exception during shutdown

2011-08-24 Thread Antoine Pitrou

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

This should hopefully be fixed now. Feel free to reopen if it isn't.

--
resolution:  - fixed
stage: patch review - committed/rejected
status: open - closed

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



[issue12656] test.test_asyncore: add tests for AF_INET6 and AF_UNIX sockets

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

Charles-François Natali neolo...@free.fr added the comment:

New patch.

 Perhaps bind_af_aware() should find its place in test.support.

I'm not sure, it's really specific to this test.

 Also, using test.support.unlink means it filters out acceptable errnos.

Thanks, I didn't know about this.

 Also, do we want an IPv6 test with poll, or is it overkill?

Let's add it (especially since test_asyncore is really fast).

--
Added file: http://bugs.python.org/file23033/test_ayncore-1.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12656
___diff -r c53db7dc4b8f Lib/test/test_asyncore.py
--- a/Lib/test/test_asyncore.py Wed Aug 24 21:40:53 2011 +0200
+++ b/Lib/test/test_asyncore.py Wed Aug 24 23:00:33 2011 +0200
@@ -87,6 +87,13 @@
 serv.close()
 evt.set()
 
+def bind_af_aware(sock, addr):
+Helper function to bind a socket according to its family.
+if sock.family == socket.AF_UNIX:
+# Make sure the path doesn't exist.
+unlink(addr)
+sock.bind(addr)
+
 
 class HelperFunctionTests(unittest.TestCase):
 def test_readwriteexc(self):
@@ -467,22 +474,22 @@
 raise
 
 
-class TCPServer(asyncore.dispatcher):
+class BaseServer(asyncore.dispatcher):
 A server which listens on an address and dispatches the
 connection to a handler.
 
 
-def __init__(self, handler=BaseTestHandler, host=HOST, port=0):
+def __init__(self, family, addr, handler=BaseTestHandler):
 asyncore.dispatcher.__init__(self)
-self.create_socket()
+self.create_socket(family)
 self.set_reuse_addr()
-self.bind((host, port))
+bind_af_aware(self.socket, addr)
 self.listen(5)
 self.handler = handler
 
 @property
 def address(self):
-return self.socket.getsockname()[:2]
+return self.socket.getsockname()
 
 def handle_accepted(self, sock, addr):
 self.handler(sock)
@@ -493,9 +500,9 @@
 
 class BaseClient(BaseTestHandler):
 
-def __init__(self, address):
+def __init__(self, family, address):
 BaseTestHandler.__init__(self)
-self.create_socket()
+self.create_socket(family)
 self.connect(address)
 
 def handle_connect(self):
@@ -525,8 +532,8 @@
 def handle_connect(self):
 self.flag = True
 
-server = TCPServer()
-client = TestClient(server.address)
+server = BaseServer(self.family, self.addr)
+client = TestClient(self.family, server.address)
 self.loop_waiting_for_flag(client)
 
 def test_handle_accept(self):
@@ -534,18 +541,18 @@
 
 class TestListener(BaseTestHandler):
 
-def __init__(self):
+def __init__(self, family, addr):
 BaseTestHandler.__init__(self)
-self.create_socket()
-self.bind((HOST, 0))
+self.create_socket(family)
+bind_af_aware(self.socket, addr)
 self.listen(5)
-self.address = self.socket.getsockname()[:2]
+self.address = self.socket.getsockname()
 
 def handle_accept(self):
 self.flag = True
 
-server = TestListener()
-client = BaseClient(server.address)
+server = TestListener(self.family, self.addr)
+client = BaseClient(self.family, server.address)
 self.loop_waiting_for_flag(server)
 
 def test_handle_accepted(self):
@@ -553,12 +560,12 @@
 
 class TestListener(BaseTestHandler):
 
-def __init__(self):
+def __init__(self, family, addr):
 BaseTestHandler.__init__(self)
-self.create_socket()
-self.bind((HOST, 0))
+self.create_socket(family)
+bind_af_aware(self.socket, addr)
 self.listen(5)
-self.address = self.socket.getsockname()[:2]
+self.address = self.socket.getsockname()
 
 def handle_accept(self):
 asyncore.dispatcher.handle_accept(self)
@@ -567,8 +574,8 @@
 sock.close()
 self.flag = True
 
-server = TestListener()
-client = BaseClient(server.address)
+server = TestListener(self.family, self.addr)
+client = BaseClient(self.family, server.address)
 self.loop_waiting_for_flag(server)
 
 
@@ -584,8 +591,8 @@
 BaseTestHandler.__init__(self, conn)
 self.send(b'x' * 1024)
 
-server = TCPServer(TestHandler)
-client = TestClient(server.address)
+server = BaseServer(self.family, self.addr, TestHandler)
+client = TestClient(self.family, server.address)
 self.loop_waiting_for_flag(client)
 
 def test_handle_write(self):
@@ -595,8 +602,8 @@
 def handle_write(self):
 self.flag = 

[issue12656] test.test_asyncore: add tests for AF_INET6 and AF_UNIX sockets

2011-08-24 Thread Antoine Pitrou

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

Looks good to me :)

--

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



[issue12760] Add create mode to open()

2011-08-24 Thread Amaury Forgeot d'Arc

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

 - os.open followed by os.fdopen is easy: it isn't that easy to get
 the incantation right (the pure Python open() in _pyio is 70 lines
 of code), especially if you want the file object to have the right
 name attribute

What if we can override the inner call to os.open()?
For example, io.open() could grow an additional argument fd_opener which 
defaults to the equivalent of os.open.

Then creation mode can be expressed like this:
open(filename, 'w',
 fd_opener=lambda path, mode: os.open(path, mode|os.O_CREAT)
Another use case with openat (see #12797):
open(filename,
 fd_opener=lambda path, mode: os.openat(fd, path, mode)

--
nosy: +amaury.forgeotdarc

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



[issue12803] SSLContext.load_cert_chain() should accept a password argument

2011-08-24 Thread Antoine Pitrou

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

I have one last concern: what is the character set of an OpenSSL password? I 
see you are using PyUnicode_AsEncodedString(x, NULL, NULL), which basically 
returns a utf8-encoded bytestring. Since the OpenSSL doc don't specify 
anything, we could accept it as a best-effort thing.
Or perhaps we should use PyUnicode_EncodeFSDefault(), which uses the 
filesystem encoding, which is usually the same as the current terminal 
(assuming the password is typed on a terminal).

--

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



[issue12801] C realpath not used by os.path.realpath

2011-08-24 Thread STINNER Victor

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

Patch to get #ifdef REALPATH_SUPPORT_NULL:

diff --git a/configure.in b/configure.in
--- a/configure.in
+++ b/configure.in
@@ -1539,6 +1539,17 @@ if test $have_pthread_t = yes ; then
 #endif
   ])
 fi
+
+AC_MSG_CHECKING(for realpath with NULL)
+realpath_support_null=no
+AC_COMPILE_IFELSE([
+  AC_LANG_PROGRAM([[#include stdlib.h]], [[char *p = realpath(__FILE__, 
NULL);]])
+],[realpath_support_null=yes],[])
+AC_MSG_RESULT($realpath_support_null)
+if test $have_pthread_t = yes ; then
+  AC_DEFINE(REALPATH_SUPPORT_NULL, 1,
+  [Define if the realpath() function supports NULL as the second argument])
+fi
 CC=$ac_save_cc
 
 AC_SUBST(OTHER_LIBTOOL_OPT)

--

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



[issue12656] test.test_asyncore: add tests for AF_INET6 and AF_UNIX sockets

2011-08-24 Thread Roundup Robot

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

New changeset b07b0b7517da by Charles-François Natali in branch 'default':
Issue #12656: Add tests for IPv6 and Unix sockets to test_asyncore.
http://hg.python.org/cpython/rev/b07b0b7517da

--
nosy: +python-dev

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



[issue1298813] sysmodule.c: realpath() is unsafe

2011-08-24 Thread STINNER Victor

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

See issue #12801: it has a more recent patch.

--

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



[issue12760] Add create mode to open()

2011-08-24 Thread Antoine Pitrou

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

 What if we can override the inner call to os.open()?
 For example, io.open() could grow an additional argument fd_opener
 which defaults to the equivalent of os.open.

I agree it would be a much better situation than what we have now.

--

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



[issue12801] C realpath not used by os.path.realpath

2011-08-24 Thread STINNER Victor

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

 I prefer to reuse _Py_wrealpath because we will have
 to add special cases: realpath(NULL) and also maybe
 canonicalize_file_name().

I read that canonicalize_file_name(name) just calls realpath(name, NULL), so we 
can maybe avoid this GNU exception.

I realized that _Py_wrealpath() returns wchar_t*, so it's maybe better to take 
the first approach (#ifdef MS_WINDOWS).

--

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



[issue12801] C realpath not used by os.path.realpath

2011-08-24 Thread Santoso Wijaya

Changes by Santoso Wijaya santoso.wij...@gmail.com:


--
nosy: +santa4nt

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



[issue3754] cross-compilation support for python build

2011-08-24 Thread Roumen Petrov

Changes by Roumen Petrov bugtr...@roumenpetrov.info:


Added file: http://bugs.python.org/file23034/python-py3k-20110825-CROSS.patch

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



[issue12760] Add create mode to open()

2011-08-24 Thread STINNER Victor

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

open(filename, 'w',
 fd_opener=lambda path, mode: os.open(path, mode|os.O_CREAT)

I prefer open(name, c).

 it doesn't fill a use case: actually, avoiding race conditions
 is an important use case, ...

It may help the issue #8604 (and maybe #8828).

--

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



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

2011-08-24 Thread Roumen Petrov

Roumen Petrov bugtr...@roumenpetrov.info added the comment:

follow recent changes to distutils and packaging modules and platform tests 
without os major version ...
(require python-py3k-20110825-CROSS.patch from #3754)

--
Added file: http://bugs.python.org/file23035/python-py3k-20110825-MINGW.patch

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



[issue12801] C realpath not used by os.path.realpath

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

Charles-François Natali neolo...@free.fr added the comment:

 Patch to get #ifdef REALPATH_SUPPORT_NULL:

I'm not really familiar with autotools, but I have the impression that
this will only check that the given code snippet compiles (and it
will), and we want to check that a NULL buffer is supported at
runtime.
Am I missing something?

--

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



[issue12837] Patch for issue #12810 removed a valid check on socket ancillary data

2011-08-24 Thread David Watson

New submission from David Watson bai...@users.sourceforge.net:

Changeset 4736e172fa61 for issue #12810 removed the test 
msg-msg_controllen  0 from socketmodule.c, where 
msg_controllen happened to be unsigned on the reporter's system. 
 
I included this test deliberately, because msg_controllen may be 
of signed type (POSIX allows socklen_t to be signed, as objects 
of that type historically were - as the Rationale says: All 
socklen_t types were originally (in BSD UNIX) of type int.). 
 
Attaching a patch to replace the check and add an accompanying 
comment.

--
components: Extension Modules
files: restore_controllen_check.diff
keywords: patch
messages: 142934
nosy: baikie
priority: normal
severity: normal
status: open
title: Patch for issue #12810 removed a valid check on socket ancillary data
type: behavior
versions: Python 3.3
Added file: http://bugs.python.org/file23036/restore_controllen_check.diff

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



[issue12836] cast() creates circular reference in original object

2011-08-24 Thread Benjamin Gilbert

New submission from Benjamin Gilbert bgilb...@backtick.net:

Section 15.17.1.15 of the ctypes documentation illustrates the use of cast() 
thusly:

 a = (c_byte * 4)()
 cast(a, POINTER(c_int))
ctypes.LP_c_long object at ...


Executing the cast() causes a._objects to gain a reference back to a:

 a = (c_byte * 4)()
 a._objects
 cast(a, POINTER(c_int))
__main__.LP_c_int object at 0x7fb879065b90
 a._objects
{140430281170384: __main__.c_byte_Array_4 object at 0x7fb879065dd0}
 a
__main__.c_byte_Array_4 object at 0x7fb879065dd0
 

If large temporary arrays are allocated, cast, used, and discarded in a tight 
inner loop, a lot of memory can thus be consumed by self-referencing objects 
before the garbage collector has a chance to run.  Even if this behavior is 
correct from the perspective of ctypes, it is surprising.

--
components: ctypes
messages: 142933
nosy: bgilbert
priority: normal
severity: normal
status: open
title: cast() creates circular reference in original object
type: resource usage
versions: Python 2.7

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



[issue12837] Patch for issue #12810 removed a valid check on socket ancillary data

2011-08-24 Thread Antoine Pitrou

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


--
nosy: +neologix

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



[issue12837] Patch for issue #12810 removed a valid check on socket ancillary data

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

Charles-François Natali neolo...@free.fr added the comment:

 I included this test deliberately, because msg_controllen may be 
 of signed type [...] POSIX allows socklen_t to be signed

http://pubs.opengroup.org/onlinepubs/007908799/xns/syssocket.h.html

sys/socket.h makes available a type, socklen_t, which is an unsigned opaque 
integral type of length of at least 32 bits. To forestall portability problems, 
it is recommended that applications should not use values larger than 2**32 - 1.


It seems pretty clear to me.
Did you actually encounter this problem on any OS?
Furthermore, even if it was the case, I don't see how we could end up with a 
negative value for msg_controllen (it's a buffer length), since it's set by the 
kernel.
Also, I'm not convinced by this:

   /* Check for empty ancillary data as old CMSG_FIRSTHDR()
   implementations didn't do so. */
for (cmsgh = ((msg.msg_controllen  0) ? CMSG_FIRSTHDR(msg) : NULL);
 cmsgh != NULL; cmsgh = CMSG_NXTHDR(msg, cmsgh)) {

Did you really have reports of CMSG_NXTHDR not returning NULL upon empty 
ancillary data (it's also raquired by POSIX)?

--

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



[issue12837] Patch for issue #12810 removed a valid check on socket ancillary data

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

Charles-François Natali neolo...@free.fr added the comment:

I checked in glibc, FreeBSD and OpenBSD source codes, and they all define 
socklen_t as an unsigned integer.
I think the confusion arises from this:

   The  third argument of accept() was originally declared as an int * (and 
is that under libc4 and libc5 and on many other systems like 4.x BSD, SunOS 4, 
SGI); a POSIX.1g
   draft standard wanted to change it into a size_t *, and that is what it 
is for SunOS 5.  Later POSIX drafts have socklen_t *, and so do the  Single  
Unix  Specification
   and glibc2.


But this only implies that sizeof(socklen_t) == sizeof(int).

 since it's set by the kernel.

The only place where we compute it is in sock_sendmsg, but it would be catched 
by overflow checks:
if (controllen  SOCKLEN_T_LIMIT || controllen  controllen_last) {
PyErr_SetString(socket_error, too much ancillary data);
goto finally;
}

And we use it as malloc() and memset() argument before it's checked by 
cmsg_min_space...

--

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



[issue12786] subprocess wait() hangs when stdin is closed

2011-08-24 Thread STINNER Victor

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

subprocess_cloexec-1.diff: I'm too tired too review the test. The subprocess.py 
part looks correct, except the pipe2 name. Python 3 uses _create_pipe = 
_posixsubprocess.cloexec_pipe. Pick one of those.

--

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



[issue5113] 2.5.4.3 / test_posix failing on HPUX systems

2011-08-24 Thread STINNER Victor

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

It's surprising to raise a SkipTest *at the end* of the test. Here is another 
patch.

--
Added file: http://bugs.python.org/file23037/chown_hpux-2.diff

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



[issue12656] test.test_asyncore: add tests for AF_INET6 and AF_UNIX sockets

2011-08-24 Thread Roundup Robot

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

New changeset 603025e2d39d by Charles-François Natali in branch 'default':
Issue #12656: Fix test_asyncore failures on Windows buildbots.
http://hg.python.org/cpython/rev/603025e2d39d

--

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



[issue5113] 2.5.4.3 / test_posix failing on HPUX systems

2011-08-24 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@haypocalc.com:


Added file: http://bugs.python.org/file23038/chown_hpux-3.diff

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



[issue5113] 2.5.4.3 / test_posix failing on HPUX systems

2011-08-24 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@haypocalc.com:


Removed file: http://bugs.python.org/file23037/chown_hpux-2.diff

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



[issue5113] 2.5.4.3 / test_posix failing on HPUX systems

2011-08-24 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@haypocalc.com:


Added file: http://bugs.python.org/file23039/chown_hpux-4.diff

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



[issue5113] 2.5.4.3 / test_posix failing on HPUX systems

2011-08-24 Thread STINNER Victor

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

Using chown_hpux-4.diff, we don't skip anything on HP-UX.

--

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



[issue12807] Optimizations for {bytearray,bytes,unicode}.strip()

2011-08-24 Thread John O'Connor

John O'Connor tehj...@gmail.com added the comment:

You are right about those lines in particular; 'dubious' as you say.
Though, the point overall was that the general implementation was noticeably
faster (regardless of those smaller changes).

However, I do think that the single check for len == 0 saves time
particularly
from do_xstrip where we call _getbuffer().

I see. I must have been trigger happy.

  diff -r b5ccdf7c032a Python/bltinmodule.c
  Binary file Python/bltinmodule.c has changed

 Uh, what's this? bltinmodule.c shouldn't be considered a binary file.
 It probably means you added a NUL byte in it by mistake.

 I didn't touch that file at all. I'm not sure what that is. :-P

 Looking at just how similar these 3 implementations are I feel that we
  could also unify/generalize them into one generic helper implementation
  and leave the object marshaling up to the type specific methods.

 You could put it in Objects/stringlib.


I figured. I will when I am able to get to it.

- John

--
Added file: http://bugs.python.org/file23040/unnamed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12807
___divdiv class=gmail_quoteblockquote class=gmail_quote style=margin:0 0 
0 .8ex;border-left:1px #ccc solid;padding-left:1ex;br
Antoine Pitrou lt;a href=mailto:pit...@free.fr;pit...@free.fr/agt; added 
the comment:br
br
+    if (len == 0) {br
+        if (PyByteArray_CheckExact(self)) {br
+            Py_INCREF(self);br
+            return (PyObject *)self;br
+        }br
+        return PyByteArray_FromStringAndSize(NULL, 0);br
+    }br
br
This looks like a dubious micro-optimization. If len == 0,br
all loops will exit early anyway (same for similar snippets in bytesobject.c 
and unicodeobject.c).br
br/blockquotebr class=Apple-interchange-newlineYou are right about 
those lines in particular; #39;dubious#39; as you say. divThough, the 
point overall was that the general implementation was noticeably/divdiv
faster (regardless of those smaller 
changes). /divdivbr/divdivHowever, I do think that the single 
check for len == 0 saves time particularly/divdivfrom do_xstrip where we 
call _getbuffer()./divdivbr/div
divbr/divblockquote class=gmail_quote style=margin:0 0 0 
.8ex;border-left:1px #ccc solid;padding-left:1ex;
+    if (i == 0 amp;amp; j == len amp;amp; PyByteArray_CheckExact(self)) 
{br
+        Py_INCREF(self);br
+        return (PyObject *)self;br
+    }br
br
bytearray objects are mutable, so you can#39;t return the same object without 
breaking expected semantics. e.g.:br
br/blockquotedivbr/divdivI see. I must have been trigger 
happy./divdivbr/divblockquote class=gmail_quote style=margin:0 0 0 
.8ex;border-left:1px #ccc solid;padding-left:1ex;br
gt; diff -r b5ccdf7c032a Python/bltinmodule.cbr
gt; Binary file Python/bltinmodule.c has changedbr
br
Uh, what#39;s this? bltinmodule.c shouldn#39;t be considered a binary 
file.br
It probably means you added a NUL byte in it by mistake.br
div class=imbr/div/blockquotedivI didn#39;t touch that file at 
all. I#39;m not sure what that is. :-P/divdivbr/divblockquote 
class=gmail_quote style=margin:0 0 0 .8ex;border-left:1px #ccc 
solid;padding-left:1ex;
div class=im
gt; Looking at just how similar these 3 implementations are I feel that webr
gt; could also unify/generalize them into one generic helper implementationbr
gt; and leave the object marshaling up to the type specific methods.br
br
/divYou could put it in 
Objects/stringlib.br/blockquotedivbr/divdivI figured. I will when I 
am able to get to it./divdivbr/divdivbr/divdiv- 
John/div/div/div
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12807] Optimizations for {bytearray,bytes,unicode}.strip()

2011-08-24 Thread John O'Connor

Changes by John O'Connor tehj...@gmail.com:


Removed file: http://bugs.python.org/file23040/unnamed

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



[issue12807] Optimizations for {bytearray,bytes,unicode}.strip()

2011-08-24 Thread John O'Connor

John O'Connor tehj...@gmail.com added the comment:

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

 This looks like a dubious micro-optimization. If len == 0,
 all loops will exit early anyway (same for similar snippets in bytesobject.c 
 and unicodeobject.c).

You are right about those lines in particular; 'dubious' as you say. 
Though, the point overall was that the general implementation was noticeably
faster (regardless of those smaller changes). 

However, I do think that the single check for len == 0 saves time particularly
from do_xstrip where we call _getbuffer().


 bytearray objects are mutable, so you can't return the same object without 
 breaking expected semantics. e.g.:

I see. I must have been trigger happy.


 diff -r b5ccdf7c032a Python/bltinmodule.c
 Binary file Python/bltinmodule.c has changed

 Uh, what's this? bltinmodule.c shouldn't be considered a binary file.
 It probably means you added a NUL byte in it by mistake.

I didn't touch that file at all. I'm not sure what that is. :-P

 You could put it in Objects/stringlib.

I figured. I will when I am able to get to it.

--

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



[issue12801] C realpath not used by os.path.realpath

2011-08-24 Thread STINNER Victor

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

Le mercredi 24 août 2011 23:45:00, vous avez écrit :
 Charles-François Natali neolo...@free.fr added the comment:
  Patch to get #ifdef REALPATH_SUPPORT_NULL:
 I'm not really familiar with autotools, but I have the impression that
 this will only check that the given code snippet compiles (and it
 will), and we want to check that a NULL buffer is supported at
 runtime.
 Am I missing something?

Oh, you are right. I don't know autotools, I'm trying to learn.

--

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



[issue5113] 2.5.4.3 / test_posix failing on HPUX systems

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

Charles-François Natali neolo...@free.fr added the comment:

 Using chown_hpux-4.diff, we don't skip anything on HP-UX.

Victor, I don't understand your patch: if we try chown()ing a file to root, 
then this will fail on HP-UX (because chown won't fail with EPERM). That's the 
whole point of the patch.

--

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



[issue5113] 2.5.4.3 / test_posix failing on HPUX systems

2011-08-24 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@haypocalc.com:


Removed file: http://bugs.python.org/file23039/chown_hpux-4.diff

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



[issue5113] 2.5.4.3 / test_posix failing on HPUX systems

2011-08-24 Thread STINNER Victor

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

 if we try chown()ing a file to root, then this will fail on HP-UX

Oooh, I'm confused. I removed this stupid patch.

--

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



[issue5113] 2.5.4.3 / test_posix failing on HPUX systems

2011-08-24 Thread STINNER Victor

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

# HP-UX and Solaris allow a non-root user to chown to root

I didn't see failure on our Solaris / OpenIndiana buildbot. Should we really 
skip the test on Solaris?

--

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



[issue12287] ossaudiodev: stack corruption with FD = FD_SETSIZE

2011-08-24 Thread STINNER Victor

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

You might replace #if defined(_MSC_VER) with #if defined(MS_WINDOWS), but 
in another commit.

--

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



[issue5113] 2.5.4.3 / test_posix failing on HPUX systems

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

Charles-François Natali neolo...@free.fr added the comment:

Well, IIRC, I read in the Solaris man pages that it behaves like HP-UX
in this regard. But this it can be changed with `setprivgrp`, so it
might work on some machines, and fail on others.
According to 
http://unix.derkeiler.com/Newsgroups/comp.unix.solaris/2004-03/2579.html,
the test should work with the default setting (maybe the OP was
testing on a HP-UX machine with the non-default setting).
Anyway, since it depends on the system configuration, I wanted to stay
on the safe side, and just skip on both OS.
But I honestly don't have a strong opinion about this.

--

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



[issue12656] test.test_asyncore: add tests for AF_INET6 and AF_UNIX sockets

2011-08-24 Thread Roundup Robot

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

New changeset f3444d795062 by Charles-François Natali in branch 'default':
Issue #12656: Really fix test_asyncore failures on Windows buildbots...
http://hg.python.org/cpython/rev/f3444d795062

--

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



[issue6676] expat parser throws Memory Error when parsing multiple files

2011-08-24 Thread David H. Gutteridge

David H. Gutteridge dhgutteri...@sympatico.ca added the comment:

The documentation should definitely be updated to clarify that a parser 
instance is not reusable with more than one file.  I had a look at the 
equivalent documentation for Perl and TCL, and Perl's implementation explicitly 
does not allow attempts to reuse the parser instance (which is clearly noted in 
the documentation), and TCL's implementation (or one of them, anyway) offers a 
reset call that explicitly resets the parser in preparation for another file to 
be submitted.

--
nosy: +dhgutteridge

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



[issue7983] The encoding map from Unicode to CP932 is different from that of Windows'

2011-08-24 Thread Nayuta Taga

Changes by Nayuta Taga ganaware+bugs.python@gmail.com:


Removed file: http://bugs.python.org/file16301/cp932_roundtrip.tar.bz2

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



[issue7983] The encoding map from Unicode to CP932 is different from that of Windows'

2011-08-24 Thread Nayuta Taga

Nayuta Taga ganaware+bugs.python@gmail.com added the comment:

I have updated the tables about the latest Pythons (2.7.2, 3.2.1).
The patches for 2.7a3 can be applied to 2.7.2 and 3.2.1 successfully.

The latest Pythons still have the problem.
Their encoding maps from Unicode to CP932 are different from those of Windows'.

--
Added file: http://bugs.python.org/file23041/cp932_roundtrip.tar.bz2

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



[issue12838] FAQ/Programming typo: range[3] is used

2011-08-24 Thread Eli Bendersky

New submission from Eli Bendersky eli...@gmail.com:

User report from docs@python:


On
http://docs.python.org/faq/programming.html

for i in range[3]:

Should be:

for i in range(3):

--
assignee: docs@python
components: Documentation
keywords: easy
messages: 142952
nosy: docs@python, eli.bendersky
priority: normal
severity: normal
stage: needs patch
status: open
title: FAQ/Programming typo: range[3] is used
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3

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



[issue12832] The documentation for the print function should explain/point to how to control the sys.stdout encoding

2011-08-24 Thread Zachary Richey

Zachary Richey mach1...@gmail.com added the comment:

I'm not sure if this is good documentation, but it explains how the encoding is 
gotten for stdout and stderr.

--
keywords: +patch
nosy: +mach1723
Added file: http://bugs.python.org/file23042/functions_print_doc.patch

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



[issue12839] zlibmodule cannot handle Z_VERSION_ERROR zlib error

2011-08-24 Thread rmtew

New submission from rmtew richard.m@gmail.com:

zlibmodule.c calling inflateInit2 and deflateInit2 will subsequently proceed to 
crash in the case where these functions return Z_VERSION_ERROR.

zlib implementation note:

When you compile against zlib, several functions (actually macros) like 
inflateInit2 and deflateInit2 compile the version of zlib you are compiling 
against into the actual call of the underlying real zlib API function.

Our situation:

We are compiling Python as a static library.  When we link Python against our 
main project,  it links against the version of zlib used by that main project.  
The version numbers are different, and rather than getting a nice exception we 
get a crash.

Expected result:

Proper error handling in zlibmodule.c, and not crash.  Unhandled errors in 
zlibmodule.c are passed into the custom function zlib_error which looks at the 
msg field of the zst struct.  In the case of Z_VERSION_ERROR the msg field is 
not initialised and a crash will result from use of the nonsense value in msg.

--
components: None
messages: 142954
nosy: rmtew
priority: normal
severity: normal
status: open
title: zlibmodule cannot handle Z_VERSION_ERROR zlib error
type: crash
versions: Python 2.7, Python 3.2

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



  1   2   >