[issue11568] docstring of select.epoll.register() is wrong

2011-06-27 Thread Roundup Robot

Roundup Robot devnull@devnull added the comment:

New changeset 0610f70e6694 by Senthil Kumaran in branch '3.2':
Fix closes issue 11568 - update select.epoll.register docstring with mention of 
correct behavior.
http://hg.python.org/cpython/rev/0610f70e6694

--
nosy: +python-dev
resolution:  - fixed
stage: patch review - committed/rejected
status: open - closed

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



[issue11568] docstring of select.epoll.register() is wrong

2011-06-27 Thread Roundup Robot

Roundup Robot devnull@devnull added the comment:

New changeset a6586cb660dc by Senthil Kumaran in branch '2.7':
Fix closes issue 11568 - update select.epoll.register docstring with mention of 
correct behavior.
http://hg.python.org/cpython/rev/a6586cb660dc

--

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



[issue11568] docstring of select.epoll.register() is wrong

2011-06-27 Thread Senthil Kumaran

Senthil Kumaran sent...@uthcode.com added the comment:

On Sun, Jun 26, 2011 at 03:12:30PM +, Sandro Tosi wrote:
 The patch is fine: but would you be interested in trying to write a
 unittest for select.epoll.register ? it would be really nice to

This is covered in test_epoll.py

--
nosy: +orsenthil

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



[issue11568] docstring of select.epoll.register() is wrong

2011-06-27 Thread Sandro Tosi

Sandro Tosi sandro.t...@gmail.com added the comment:

Ah, I find the test file name a bit unhappy (why not test select.epoll in 
test_select? or add select in the filename?) but since it's covered - I'm fine! 
:) Next time I'll grep instead of simple file glob - thanks for your help, 
Senthil.

--

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



[issue1475523] gettext breaks on plural-forms header

2011-06-27 Thread Dirkjan Ochtman

Dirkjan Ochtman dirk...@ochtman.nl added the comment:

This looks similar to https://bugs.gentoo.org/show_bug.cgi?id=373115. Is it the 
same thing, or should I file a separate bug for it? (Sorry, I don't intend to 
hijack this bug, but I don't know much about gettext and the patch here looks 
somewhat similar to the patch proposed there.)

--
nosy: +djc

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



[issue12417] Inappropriate copyright on profile files

2011-06-27 Thread Paul Hildebrandt

New submission from Paul Hildebrandt paul_hildebra...@yahoo.com:

profile.py and pstats.py have an inappropriate copyright for some.  These files 
were contributed by a company that was acquired by Disney.  I have a patch that 
has passed Disney legal to resolve the problem.

The following is the cogent part of a conversation between Matthias Klose and 
myself.  He is including information about the issue:

 http://mail.python.org/pipermail/python-dev/2005-February/051450.html


The current license for the Python profiler is not conforming to the
DFSG
(Debian free software guidelines).

http://www.python.org/doc/current/lib/node829.html states

 This permission is explicitly restricted to the copying and
 modification of the software to remain in Python, compiled Python,
 or other languages (such as C) wherein the modified or derived code
 is exclusively imported into a Python module.

The DFSG,
http://www.debian.org/doc/debian-policy/ch-archive.html#s-dfsg,
third paragraph state:

 Derived Works
   The license must allow modifications and derived works, and must
   allow them to be distributed under the same terms as the license
   of the original software.

- Does somebody knows about the history of this license, why it is
 more restricted than the Python license?
- Is there a chance to change the license for these two modules
 (profile.py, pstats.py)?


--
components: Library (Lib)
messages: 139240
nosy: Paul.Hildebrandt
priority: normal
severity: normal
status: open
title: Inappropriate copyright on profile files

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



[issue5375] Unified locals/consts array + register-based instructions

2011-06-27 Thread Dirkjan Ochtman

Dirkjan Ochtman dirk...@ochtman.nl added the comment:

Yeah, I probably won't work on this anytime soon. I think this has also become 
less interesting as pypy has made progress.

--

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



[issue12417] Inappropriate copyright on profile files

2011-06-27 Thread Paul Hildebrandt

Paul Hildebrandt paul_hildebra...@yahoo.com added the comment:

This is the patch. It was created with

hg diff WDAS.patch

at the root of the hg repository.  

This patch is just a comment change and should apply to versions of Python 
currently being update.

--
keywords: +patch
resolution:  - fixed
versions: +Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 
3.4
Added file: http://bugs.python.org/file22491/WDAS.patch

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



[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-06-27 Thread Martin v . Löwis

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

 That would be incorrect for some systems. For example, FreeBSD does
 change sets of symbolic constants across system releases (mostly
 additions, but sometimes also removals). Back then, SunOS 4 and SunOS
 5 were completely unrelated systems.

 
 Well, I don't see the problem in that case.

What I'm advocating is to special-case Linux (and any other system
where major version numbers don't mean much).

 The point I (and others) have been trying to make is that 99% of the
 time, people using sys.platform really mean platform.system() or
 uname[0], since they're only interested in the operating system, and
 don't care about the release. That's true of the vast majority of such
 occurrences in Lib/test, and probably true of the vast majority of the
 user code base.

I don't argue with that. I agree the code is broken (although I disagree
that platform.system is the right answer in most cases), but that
doesn't help resolving this issue (unless the resolution is no change,
which I still oppose to).

 Furthermore, at least on Linux, the major version number doesn't mean
 anything

Indeed - hence I propose to drop it from sys.platform if the system
is Linux.

--

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



[issue1475523] gettext breaks on plural-forms header

2011-06-27 Thread Martin v . Löwis

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

It's difficult to tell whether it's the same thing. Is the po file in question 
available readily for inspection?

--

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



[issue6721] Locks in python standard library should be sanitized on fork

2011-06-27 Thread Antoine Pitrou

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

 If there's agreement that the general problem is unsolvable (so fork and
 threads just don't get along with each other), what we could attempt is
 trying to limit the side effects in the standard library, so that fewest
 users as possible are affected by this problem.

Actually, I think Charles-François' suggested approach is a good one.

 For instance, having deadlocks just because of print statements sounds
 like a bad QoI that we could attempt to improve. Is there a reason while
 BufferedIO needs to hold its internal data-structure lock (used to make
 it thread-safe) while it's doing I/O and releasing the GIL? I would think
 that it's feasible to patch it so that its internal lock is only used to
 synchronize accesses to the internal data structures, but it is never
 held while I/O is performed (and thus the GIL is released -- at which
 point, if another threads forks, the problem appears).

Not really. Whether you update the internal structures depends on the
result of the I/O (so that e.g. two threads don't flush the same buffer
simultaneously).

Also, finer-grained locking is always a risky endeavour and we already have
a couple of bugs to fix in the current buffered I/O implementation :-/

--

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



[issue1475523] gettext breaks on plural-forms header

2011-06-27 Thread Dirkjan Ochtman

Dirkjan Ochtman dirk...@ochtman.nl added the comment:

Looks like this was the problem: 
http://git.fedorahosted.org/git/?p=virt-manager.git;a=commitdiff;h=cb56316cf3702f03b05e30f406ff3028e45f7bfb.

E.g., the empty Plural-Forms header is throwing off the python gettext parser.

--

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



[issue12291] file written using marshal in 3.2 can be read by 2.7, but not 3.2 or 3.3

2011-06-27 Thread Antoine Pitrou

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

Le Sun, 26 Jun 2011 19:49:03 +,
Vinay Sajip rep...@bugs.python.org a écrit :
 
 Added file: http://bugs.python.org/file22487/0feab4e7b27f.diff

Just a nit, could you give descriptive file names to your patches?
Hex numbers quickly get confusing.

--

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



[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-06-27 Thread Antoine Pitrou

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

Le Mon, 27 Jun 2011 08:05:05 +,
Martin v. Löwis rep...@bugs.python.org a écrit :
 
 What I'm advocating is to special-case Linux (and any other system
 where major version numbers don't mean much).

Actually, it would itself break compatibility, because sys.platform would
jump from linux2 to linux from one Python release to another. It would
therefore only be applicable, at best, to 3.3.

I think we should at least document the idiom of using
sys.platform.startswith(...), and mention the platform module as an
alternative. This can be done in all doc versions without breaking
anything, and in time for Linux 3 :)

--

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



[issue1067702] urllib fails with multiple ftp transfers

2011-06-27 Thread Stefan Schwarzer

Stefan Schwarzer sschwar...@sschwarzer.net added the comment:

Hi Senthil,

I don't yet understand what was going on before it resulted in the traceback. I 
also don't understand _why_ the patch fixes _this_ bug. (That's not to say it 
doesn't, but I think it's not obvious either. :-) )

Were you able to reproduce the exception with my attached script before you did 
the change? Here in the hotel I have a much faster internet connection than I 
had yesterday at the sprint (where lots of people shared the uplink), and now I 
can't reproduce the exception after running the test script three times, even 
_without_ having your change applied.

--

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



[issue12291] file written using marshal in 3.2 can be read by 2.7, but not 3.2 or 3.3

2011-06-27 Thread Dirkjan Ochtman

Changes by Dirkjan Ochtman dirk...@ochtman.nl:


--
nosy: +djc

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



[issue5375] Unified locals/consts array + register-based instructions

2011-06-27 Thread Antoine Pitrou

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


--
resolution:  - postponed
status: open - closed

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



[issue12139] Add CCC command support to ftplib

2011-06-27 Thread Roundup Robot

Roundup Robot devnull@devnull added the comment:

New changeset d2eacbbdaf57 by Giampaolo Rodola' in branch 'default':
Issue 12139: add CCC command support to FTP_TLS class to revert the SSL 
connection back to clear-text.
http://hg.python.org/cpython/rev/d2eacbbdaf57

--
nosy: +python-dev

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



[issue12139] Add CCC command support to ftplib

2011-06-27 Thread Giampaolo Rodola'

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


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

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



[issue1475523] gettext breaks on plural-forms header

2011-06-27 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

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



[issue12400] regrtest: always run tests in verbose mode, but hide the output on success

2011-06-27 Thread STINNER Victor

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

 Typical example: (... smtplib ...)

Another example (yesterday):
--
[355/356/2] test_subprocess
...
Re-running test test_subprocess in verbose mode
...
Ran 228 tests in 322.313s

OK (skipped=20)
--

--

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



[issue12139] Add CCC command support to ftplib

2011-06-27 Thread STINNER Victor

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

http://www.python.org/dev/buildbot/all/builders/x86%20Ubuntu%20Shared%203.x/builds/4043/steps/test/logs/stdio

==
ERROR: test_ccc (test.test_ftplib.TestTLS_FTPClass)
--
Traceback (most recent call last):
  File 
/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/test_ftplib.py, line 
890, in test_ccc
self.client.sendcmd('noop')
  File /srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/ftplib.py, line 
261, in sendcmd
return self.getresp()
  File /srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/ftplib.py, line 
236, in getresp
raise error_proto(resp)
ftplib.error_proto:  Ôxé֮º¸qhёøcÞÅ\³9úӅ#ï•å200 noop ok

--
nosy: +haypo

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



[issue12139] Add CCC command support to ftplib

2011-06-27 Thread STINNER Victor

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

http://www.python.org/dev/buildbot/all/builders/x86%20Tiger%203.x/builds/2792/steps/test/logs/stdio

==
ERROR: test_ccc (test.test_ftplib.TestTLS_FTPClass)
--
Traceback (most recent call last):
  File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_ftplib.py, 
line 890, in test_ccc
self.client.sendcmd('noop')
  File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/ftplib.py, line 261, 
in sendcmd
return self.getresp()
  File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/ftplib.py, line 226, 
in getresp
resp = self.getmultiline()
  File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/ftplib.py, line 212, 
in getmultiline
line = self.getline()
  File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/ftplib.py, line 199, 
in getline
line = self.file.readline()
  File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/socket.py, line 279, 
in readinto
return self._sock.recv_into(b)
  File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/ssl.py, line 392, in 
recv_into
return socket.recv_into(self, buffer, nbytes, flags)
socket.timeout: timed out

--

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



[issue12139] Add CCC command support to ftplib

2011-06-27 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

Hmm... Reopening. I'll look into this later.

--
resolution: fixed - 
status: closed - pending

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



[issue12376] unittest.TextTestResult.__init__ does not pass on its init arguments in super call

2011-06-27 Thread Michael Foord

Michael Foord mich...@voidspace.org.uk added the comment:

I have a feeling I added the arguments to TestResult.__init__ to allow it to be 
used as a silent test result directly in place of TextTestResult. I still need 
to check this. 

Not adding the arguments to the super call in TextTestResult would have been an 
oversight. Let me check this understanding is correct, and if there is no 
reason for it not to pass on those arguments I'll fix it.

--

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



[issue12376] unittest.TextTestResult.__init__ does not pass on its init arguments in super call

2011-06-27 Thread Michael Foord

Changes by Michael Foord mich...@voidspace.org.uk:


--
assignee:  - michael.foord

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



[issue10181] Problems with Py_buffer management in memoryobject.c (and elsewhere?)

2011-06-27 Thread Stefan Krah

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

Nick, you know a lot about this issue and I'm probably missing many things
here. I misunderstood your concept of PyManagedBuffer, so my previous
posting might have been hard to understand.

I'd appreciate if you (or anyone in this thread) could comment if the
following would work *in theory*, even if you are against an additional
getslicedbufferproc:


As I understand, there are two major issues that complicate the code:

  1) the copying in PyMemoryView_FromBuffer()
  2) slicing


To address 1), I wanted to create new memoryview objects exclusively
from proper base objects that implement the buffer protocol. So the
plan was to create small wrapper object inside PyMemoryView_FromBuffer()
that handles enough of the buffer protocol to be usable inside the stdlib
for one-dimensional objects. The actual memoryview would then be created
by calling PyMemoryView_FromObject() on that wrapper.

[PyMemoryView_FromObject() would then obviously not call 
PyMemoryView_FromBuffer(),
but would create the view directly.]


To address 2), buffers would *always* have to be filled in by the original
exporting object, hence the proposal to add a getslicedbufferproc.

Then memoryview would always have a proper base object and could always call
getbuffer()/INCREF(base) and releasebuffer()/DECREF(base). I thought this would
make the code much cleaner.


 Direct: the view is directly accessing an underlying object via the PEP 3118 
 API
 Indirect: the view has a reference to another memoryview object that it is 
 using
   as a data source

Is there still a difference if only the original base object manages buffers
and they are never copied?


 This is better than requiring that every implementor of the buffer API
 worry about the slicing logic - we can do it right in memoryview and then
 implementers of producer objects don't have to worry about it.

I'm not sure, but my reasoning was that e.g. in numpy the slicing logic
is already in place. Then again, I don't know if it is a legitimate use
of buf, shapes and strides to implement slicing.

According to this mail, slicing information was supposed to be
part of the memoryview struct:

http://mail.python.org/pipermail/python-dev/2007-April/072584.html

--

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



[issue10181] Problems with Py_buffer management in memoryobject.c (and elsewhere?)

2011-06-27 Thread Pauli Virtanen

Pauli Virtanen p...@iki.fi added the comment:

skrah writes:
 I think slicing (esp. multidimensional slicing) would be greatly
 simplified if we added a requirement for the *exporting* object
 to provide a sliced view. (The same applies to sub-views, also
 see source comments below [1]).

 For example, an exporting object could provide a sliced view by adding 
 a getslicedbufferproc to PyBufferProcs:

 int PyObject_GetSlicedBuffer(PyObject *obj, Py_buffer *view, 
  int flags, PyObject *key);

The same thing can be done via

PyObject_GetBuffer(obj, view, flags);
PyBuffer_Slice(view, sliced_view, flags, key);

given an implementation of PyBuffer_Slice. The logic in PyBuffer_Slice does not 
depend on where the buffer comes from, and every buffer can be sliced.

As far as I see, the advantage of `getslicedbufferproc` would be to make the 
implementation of PyMemoryView simpler, but not much else. In my view, having 
each exporter implement the same logic by itself would only be an unnecessary 
burden.

  o The invariant that all allocated memory in the buffer belongs
to the exporting object remains intact.

Numpy arrays do not have this invariant, and they happily re-export memory 
owned by someone else. This is one root of problems here: the PEP implicitly 
assumes that re-exporting buffers (e.g. memoryview's implementation of 
`getbuffer`) is done in the way Numpy does it. Because of this, there is no 
mechanism for incrementing the refcount of an existing buffer export. 
Maintaining the above invariant then unavoidably leads to strange behavior in 
corner cases (which probably are very rare, as mentioned above), and as 
happened here, make the implementation messy and lead to bugs.

The invariant *is* required for guaranteeing that `memoryview.release()` always 
succeeds. Such a method probably wasn't foreseen in the PEP (and I did not 
remember that it existed in my first patch), as Numpy arrays don't have any 
equivalent. The alternatives here are (i) do as Numpy does and give up the 
invariant and allow `.release()` to fail in some cases, or (ii) document the 
corner cases in the interface spec and try to detect them and fail if they 
occur. Which of these is chosen probably does not matter much in practice, but 
having PyManagedBuffer will make implementing either choice easier.

--

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



[issue11302] Add more tests to test_ast.py

2011-06-27 Thread Vincent Legoll

Vincent Legoll vincent.leg...@gmail.com added the comment:

OK I'll look at it and respin with the comments in mind

--

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



[issue12418] python should inherit the library search path from the compiler for stdlib extensions

2011-06-27 Thread Steve Langasek

New submission from Steve Langasek steve.langa...@ubuntu.com:

related to http://bugs.python.org/issue11715

python 2.7 and 3.1 now include a patch for behavior specific to Ubuntu and 
Debian to search in multiarch directories for libraries needed for building 
stdlib extensions.

This distro-specific patch is unnecessary if instead python could just query 
and use the default search path from the compiler.

With gcc, it's possible to query the list of built-in library directories with:

$ gcc -print-search-dirs | sed -n -e's/libraries: =//p' | sed -e's/:/\n/g' | 
xargs -n1 readlink -f

and the include directories with:

$ gcc -v -E -  /dev/null 21 | awk '/^#include/,/^End of search/ {i=1} i==1 
 /^ / {print}'

(additional filtering, to exclude compiler-internal directories, may be 
sensible.)

Having python query and use these directories when searching for libraries 
would make the build system more robust in a variety of circumstances.

--
components: Build
messages: 139259
nosy: vorlon
priority: normal
severity: normal
status: open
title: python should inherit the library search path from the compiler for 
stdlib extensions
type: behavior

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



[issue12419] Add ident parameter to SysLogHandler

2011-06-27 Thread Floris Bruynooghe

New submission from Floris Bruynooghe floris.bruynoo...@gmail.com:

It would be nice if the SysLogHandler also accepted an ident parameter in 
line with the syslog.openlog() function.  This simply prepends the string 
passed in as ident to each log message which currently needs to be 
implemented with a log filter which modifies the record.

--
components: Library (Lib)
messages: 139260
nosy: flub
priority: normal
severity: normal
status: open
title: Add ident parameter to SysLogHandler
type: feature request
versions: Python 3.3

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



[issue12419] Add ident parameter to SysLogHandler

2011-06-27 Thread Floris Bruynooghe

Changes by Floris Bruynooghe floris.bruynoo...@gmail.com:


--
nosy: +vinay.sajip

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



[issue12420] distutils crashes if PATH is not defined

2011-06-27 Thread Henry Precheur

New submission from Henry Precheur he...@precheur.org:

The function find_executable crashes if PATH is not defined.

I admit that it's an extreme case, but it's probably better to on the safe side 
of things.

What about using the current directory only if PATH is not defined? This seems 
to be a reasonable workaround.

--
assignee: tarek
components: Distutils, Distutils2
files: fix_empty_path.diff
keywords: patch
messages: 139261
nosy: alexis, eric.araujo, henry.precheur, tarek
priority: normal
severity: normal
status: open
title: distutils crashes if PATH is not defined
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4
Added file: http://bugs.python.org/file22492/fix_empty_path.diff

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



[issue12291] file written using marshal in 3.2 can be read by 2.7, but not 3.2 or 3.3

2011-06-27 Thread Vinay Sajip

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

 Just a nit, could you give descriptive file names to your patches?
 Hex numbers quickly get confusing.

Ok - I was under the impression that those names were generated automatically 
from the changeset hash, and that changing the name arbitrarily would break 
something. Is it not better/sufficient if I just update the description?

--

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



[issue12401] unset PYTHON* environment variables when running tests

2011-06-27 Thread Henry Precheur

Henry Precheur he...@precheur.org added the comment:

Here's a small patch to call regression tests without any environment variable 
defined. It's probably a good thing to run all the tests with a clean state, 
this way they are less likely to fail for mysterious external reasons. For 
example test_displayhook_unencodable was failing because I was overriding 
displayhook in my PYTHONSTARTUP file.

On the other hand, some problems with environment variables might go unnoticed. 
But I don't think there's much risk.

Note that test_distutils will fail with this patch if #12420 is not taken care 
of beforehand.

--
keywords: +patch
Added file: http://bugs.python.org/file22493/empty_environment.diff

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



[issue12421] Use PYTHON when calling Parser/asdl_c.py

2011-06-27 Thread Henry Precheur

New submission from Henry Precheur he...@precheur.org:

Parser/asdl_c.py uses `/usr/bin/env python' as an interpreter. But Python 
executable is not always `python'. With OpenBSD's ports, CPython's interpreters 
are installed as pythonX.Y. There's a variable PYTHON in the Makefile, that's 
what should be used.

This way make PYTHON=python2.7 works on OpenBSD.

The attached patch fixes that.

Note that the executable bit and the hashbang can be removed from asdl_c.py if 
the patch is applied.

--
components: Build
files: fix_ASDLGEN.diff
keywords: patch
messages: 139264
nosy: henry.precheur
priority: normal
severity: normal
status: open
title: Use PYTHON when calling Parser/asdl_c.py
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4
Added file: http://bugs.python.org/file22494/fix_ASDLGEN.diff

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



[issue12398] Sending binary data with a POST request in httplib can cause Unicode exceptions

2011-06-27 Thread sorin

sorin sorin.sbar...@gmail.com added the comment:

Here is a test file that will replicate the problem, I added it as a gist so it 
could support contributions ;)

Py 2.7 works
Py ==2.7 fails
Py =3.0 works after minor changes required by py3k

https://gist.github.com/1047551

--

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



[issue10181] Problems with Py_buffer management in memoryobject.c (and elsewhere?)

2011-06-27 Thread Nick Coghlan

Nick Coghlan ncogh...@gmail.com added the comment:

I'll try to do a summary of the conversation so far, since it's quite long and 
hard to follow.

The basic issue is that memoryview needs to support copying and slicing that 
creates a new memoryview object. The major problem with that is that the PEP 
3118 semantics as implemented operate in such a way that neither copying the 
Py_buffer struct *nor* requesting a new copy of the struct from the underlying 
object will do the right thing in all cases. (According to the PEP *as written* 
copying probably should have been OK, but the implementation doesn't match the 
PEP in several important respects such that copying is definitely wrong in the 
absence of tight control of the lifecycles of copies relative to the original).

Therefore, we either need to redesign the buffer export from memoryview to use 
daisy chaining (such that in m = memoryview(obj); m2 = m[:]; m3 = m2[:] m3 
references m2 which references m which in turn references obj) or else we need 
to introduce an internal reference counted object (PyManagedBuffer) which 
allows a single view of an underlying object to be safely shared amongst 
multiple clients (such that m, m2 and m3 would all reference the same managed 
buffer instance which holds the reference to obj). My preference is strongly 
for the latter approach as it prevents unbounded and wasteful daisy chaining 
while also providing a clean, easy to use interface that will make it easier 
for 3rd parties to write PEP 3118 API consumers (by using PyManagedBuffer 
instead of the raw Py_buffer struct).

Once that basic lifecycle problem for the underlying buffers is dealt with then 
we can start worrying about other problems like exporting Py_buffer objects 
from memoryview instances correctly. The lifecycle problem is unrelated to the 
details of the buffer *contents* though - it's entirely about the fact that 
clients can't safely copy all those pointers (as some may refer to addresses 
inside the struct) and asking the original object for a fresh copy is permitted 
to return a different answer each time.

The actual *slicing* code in memoryview isn't too bad - it just needs to use 
dedicated storage rather than messing with the contents of the Py_buffer struct 
it received from the underlying object. Probably the easiest way to handle that 
is by having the PyManagedBuffer reference be in *addition* to the current 
Py_buffer struct in the internal state - then the latter can be used to record 
the effects of the slicing, if any. Because we know the original Py_buffer 
struct is guaranteed to remain alive and unmodified, we don't need to worry 
about fiddling with any copied pointers - we can just leave them pointing into 
the original structure.

When accessed via the PEP 3118 API, memoryview objects would then export that 
modified Py_buffer struct rather than the original one (so daisychaining would 
be possible, but we wouldn't make it easy to do from pure Python code, as both 
the memoryview constructor and slicing would give each new memoryview object a 
reference to the original managed buffer and just update the internal view 
details as appropriate.

Here's the current MemoryView definition:

typedef struct {
PyObject_HEAD
Py_buffer view;
} PyMemoryViewObject;

The TL;DR version of the above is that I would like to see it become:

typedef struct {
PyObject_HEAD
PyManagedBuffer source_data; // shared read-only Py_buffer access
Py_buffer view;  // shape, strides, etc potentially modified
} PyMemoryViewObject;

Once the internal Py_buffer had been initialised, the memoryview code actually 
wouldn't *use* the source data reference all that much (aside from eventually 
releasing the buffer, it wouldn't use it at all). Instead, that reference would 
be retained solely to control the lifecycle of the original Py_buffer object 
relative to the modified copies in the various memoryview instances.

Does all that make my perspective any clearer?

--

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



[issue12419] Add ident parameter to SysLogHandler

2011-06-27 Thread Vinay Sajip

Changes by Vinay Sajip vinay_sa...@yahoo.co.uk:


--
assignee:  - vinay.sajip

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



[issue12421] Use PYTHON when calling Parser/asdl_c.py

2011-06-27 Thread R. David Murray

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

I don't believe we have any desire to support unix systems that do not define 
'python', and 'python3' executables in the path.  If the distribution wishes to 
do that they'll have to patch everything to accommodate it.

That however is mostly irrelevant to this case.  asdl_c.py is not needed for 
building python.  The files it generates are already generated and included in 
the release tarballs, and in the release tarballs the file timestamps should be 
such that asdl_c.py is not invoked.  (When working from a checkout this may not 
be true due to vcs tool file timestamp issues; you just have to touch the files 
manually in that case.)  When the file *is* run, it is not the python being 
built that is used to run it, it is an already existing python.  So using the 
PYTHON variable in the Makefile would be incorrect.

--
nosy: +r.david.murray
resolution:  - invalid
stage:  - committed/rejected
status: open - closed

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



[issue12398] Sending binary data with a POST request in httplib can cause Unicode exceptions

2011-06-27 Thread R. David Murray

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

rdmurraypython2.6 py27-str-unicode-bytes.py 
type(b)=type 'str'
Traceback (most recent call last):
  File py27-str-unicode-bytes.py, line 17, in module
unicode_str += b # this line will throw UnicodeDecodeError on Python 2.7
UnicodeDecodeError: 'ascii' codec can't decode byte 0xff in position 4: ordinal 
not in range(128)

And of course it doesn't work earlier than 2.6 since the b'' notation isn't 
supported before 2.6.

--

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



[issue12398] Sending binary data with a POST request in httplib can cause Unicode exceptions

2011-06-27 Thread STINNER Victor

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


--
nosy: +haypo

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



[issue12398] Sending binary data with a POST request in httplib can cause Unicode exceptions

2011-06-27 Thread R. David Murray

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

To clarify: if I convert your program to using strings pre2.6, it still fails 
with a UnicodeDecodeError, as one would expect.  bytes are strings in 2.x.

--

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



[issue12421] Use PYTHON when calling Parser/asdl_c.py

2011-06-27 Thread Henry Precheur

Henry Precheur he...@precheur.org added the comment:

Indeed, I didn't realize that PYTHON was the name of the target interpreter and 
not the name a an already installed interpreter.

--

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



[issue12398] Sending binary data with a POST request in httplib can cause Unicode exceptions

2011-06-27 Thread R. David Murray

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

And finally, your program does *not* succeed on Python3, except in the trivial 
sense that on python3 you never attempt to add the string and bytes data.  It 
is exactly this kind of programming error that Python3 is designed to avoid: 
instead of sometimes getting a UnicodeDecodeError depending on what is in the 
bytes string, you *always* get a Can't convert 'bytes' object to str 
implicitly error when you attempt to add string and bytes.

--

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



[issue12398] Sending binary data with a POST request in httplib can cause Unicode exceptions

2011-06-27 Thread sorin

sorin sorin.sbar...@gmail.com added the comment:

Right, so you have some binary data and you want to sent it to `httplib`. This 
worked in the past when `msg` was a non-unicode string, but starting with 
Python 2.7 this became an unicode string, so when you try to append the 
`message` if will fail because it will try to decode it.

--

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



[issue12420] distutils crashes if PATH is not defined

2011-06-27 Thread Éric Araujo

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

Thanks for the report.  Can you tell how you ran into this?  Did you call the 
function directly, or did you get the bug while running a setup.py command?  
Also, what do you mean by crash?  We use that for CPython segmentation faults, 
not regular misbehavior.  If you could attach the exact command or script that 
triggered the bug and the full traceback, it would help.

I don’t think using the current directory is a good idea: it’s a security 
hazard.

--
assignee: tarek - eric.araujo
type:  - behavior
versions:  -Python 2.6, Python 3.1, Python 3.4

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



[issue12416] packaging does not have hooks callable during distribution removal

2011-06-27 Thread Éric Araujo

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

I have no objection, but you may want to ask on the fellowship ML first.

Should the hooks be run before the removal or just after?  (Debian for example 
has both, which makes four hooks: preinst, postinst, prerm, postrm).  Our 
setup_hooks (used with pysetup commands) are run right after the setup.cfg file 
is parsed, before any operation is started.

Regarding implementation: The hook should be defined in the global section of 
setup.cfg; upon installation, packaging would write this info into the 
dist-info directory (say in an UNINSTALLHOOKS file), which would be read when 
preparing an uninstallation.

--

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



[issue11302] Add more tests to test_ast.py

2011-06-27 Thread Vincent Legoll

Vincent Legoll vincent.leg...@gmail.com added the comment:

Here we are, I left the exact messages for raised exceptions as comments so 
they can easily be checked in case of test failure...

Does that look OK ?

--
Added file: http://bugs.python.org/file22495/add-more-tests-for-ast_py-2.patch

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



[issue12406] msi.py needs updating for Python 3.3

2011-06-27 Thread Éric Araujo

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

 I've realised there are more additions due to packaging - for example
 there is a whole set of wininst-X.Y[-amd64].exe files

Oh thanks, I had forgotten about msi.py.  Copying the similar section that 
already exists for distutils wininst executables and adding the two files added 
for packaging should do the trick.

--

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



[issue12420] distutils crashes if PATH is not defined

2011-06-27 Thread Henry Precheur

Henry Precheur he...@precheur.org added the comment:

Sorry crash wasn't the right term. It's just that distutils tests fail.

I ran into that when trying to run unit tests without any environment
variable (see #12401).

$ env -i ./python ./Lib/test/regrtest.py test_distutils
[1/1] test_distutils
test test_distutils crashed -- Traceback (most recent call last):
  File ./Lib/test/regrtest.py, line 987, in runtest_inner
  File /home/henry/code/cpython/Lib/test/test_distutils.py, line 13, in 
test_main
test.support.run_unittest(distutils.tests.test_suite())
  File /home/henry/code/cpython/Lib/distutils/tests/__init__.py, line 29, in 
test_suite
__import__(modname)
  File /home/henry/code/cpython/Lib/distutils/tests/test_archive_util.py, 
line 33, in module
unittest.TestCase):
  File /home/henry/code/cpython/Lib/distutils/tests/test_archive_util.py, 
line 96, in ArchiveUtilTestCase
@unittest.skipUnless(find_executable('tar') and find_executable('gzip')
  File /home/henry/code/cpython/Lib/distutils/spawn.py, line 154, in 
find_executable
path = os.environ['PATH']
  File /home/henry/code/cpython/Lib/os.py, line 450, in __getitem__
value = self._data[self.encodekey(key)]
KeyError: b'PATH'

1 test failed:
test_distutils
[98227 refs]

Maybe it's not really a problem, and having a system without PATH
defined shouldn't be supported because it's too weird.

--

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



[issue11493] Add python.exe-gdb.py to .hgignore

2011-06-27 Thread Éric Araujo

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

Ah, it’s for Mac.  gdb + .exe sounded strange in my head :)

--

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



[issue12417] Inappropriate copyright on profile files

2011-06-27 Thread Roundup Robot

Roundup Robot devnull@devnull added the comment:

New changeset 55219254eb77 by Benjamin Peterson in branch '2.7':
update profile license (closes #12417)
http://hg.python.org/cpython/rev/55219254eb77

New changeset e50963c3119d by Benjamin Peterson in branch '3.2':
update profile license (closes #12417)
http://hg.python.org/cpython/rev/e50963c3119d

New changeset 5ae1711d9c19 by Benjamin Peterson in branch 'default':
merge 3.2 (#12417)
http://hg.python.org/cpython/rev/5ae1711d9c19

--
nosy: +python-dev
stage:  - committed/rejected
status: open - closed

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



[issue12420] distutils crashes if PATH is not defined

2011-06-27 Thread Henry Precheur

Henry Precheur he...@precheur.org added the comment:

I don't know exactly in which context find_executable should be used,
but after taking a closer look it seems that returning None when PATH is
not defined could work.

--

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



[issue12417] Inappropriate copyright on profile files

2011-06-27 Thread Éric Araujo

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

Great news for Debian users!  Thanks to all involved.

--
nosy: +eric.araujo
versions:  -Python 2.6, Python 3.1, Python 3.4

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



[issue12420] distutils crashes if PATH is not defined

2011-06-27 Thread Éric Araujo

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

Okay, I see the original use case (#12401).  I think the proper thing to do is 
to skip tests that rely on the environment being non-empty.

--

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



[issue12398] Sending binary data with a POST request in httplib can cause Unicode exceptions

2011-06-27 Thread R. David Murray

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

But senthil already demonstrated in the previous issue that it does not become 
a unicode string unless you use unicode input.

You also claimed that your test program here succeeded in python2.6, but it 
does not.  This casts a little bit of doubt on your claim that there is a 
regression.

Can you produce a minimal example of using httplib that demonstrates the 
regression?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12398
___
___
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-06-27 Thread Éric Araujo

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

Okay for a new sentence.  I think repeating new is clearer:

(This obviously does not apply to new classes or functions, or new optional 
arguments.)

--

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



[issue12169] Factor out common code for d2 commands register, upload and upload_docs

2011-06-27 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


Removed file: http://bugs.python.org/file22309/patch.diff

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



[issue12169] Factor out common code for d2 commands register, upload and upload_docs

2011-06-27 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


Removed file: http://bugs.python.org/file22330/patch.diff

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



[issue12419] Add ident parameter to SysLogHandler

2011-06-27 Thread Roundup Robot

Roundup Robot devnull@devnull added the comment:

New changeset 6baa90fa2b6d by Vinay Sajip in branch 'default':
Closes #12419: Added ident to SysLogHandler.
http://hg.python.org/cpython/rev/6baa90fa2b6d

--
nosy: +python-dev
resolution:  - fixed
stage:  - committed/rejected
status: open - closed

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



[issue11302] Add more tests to test_ast.py

2011-06-27 Thread Benjamin Peterson

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

You still haven't explained why including multiline literals is a good idea.

Also, the reason we avoid matching exact messages is it can vary across 
implementations. You can still do an accurate test with something like 
self.assertIn(foobar, str(e))

--

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



[issue12169] Factor out common code for d2 commands register, upload and upload_docs

2011-06-27 Thread Éric Araujo

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

Great patch, thanks!  It’s on the top of my commit list.

--
priority: normal - high

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



[issue12419] Add ident parameter to SysLogHandler

2011-06-27 Thread Vinay Sajip

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

N.B. I did not add an additional constructor arg - instead, it's a class-level 
attribute which can be overridden at class or instance level.

--

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



[issue10020] docs for sqlite3 describe functions not available without recompiling

2011-06-27 Thread Éric Araujo

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

I just noticed that the blocks in reST should use three-space indent, not two.

--

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



[issue12419] Add ident parameter to SysLogHandler

2011-06-27 Thread Floris Bruynooghe

Floris Bruynooghe floris.bruynoo...@gmail.com added the comment:

That was quick, thanks!

--

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



[issue4296] Python assumes identity implies equivalence; contradicts NaN

2011-06-27 Thread Sven Marnach

Sven Marnach s...@marnach.net added the comment:

The behaviour discussed in this thread does not seem to be reflected in 
Python's documentation.  The documentation of __eq__() [1] doesn't mention that 
objects should compare equal to themselves.

 [1]: http://docs.python.org/dev/reference/datamodel.html#object.__eq__

There are several places in the documentation that are wrong for NaNs; just one 
example is the documentation of sequence types [2], which states:

 This means that to compare equal, every element must compare equal
 and the two sequences must be of the same type and have the same
 length.

 [2]: 
http://docs.python.org/dev/library/stdtypes.html#sequence-types-str-bytes-bytearray-list-tuple-range

It's probably not worthwhile to fix all the places in the documentation that 
implicitly assume that objects compare equal to themselves, but it probably is 
a good idea to mention that __eq__() implementations should fulfil this 
assumption to avoid strange behaviour when used in combination with standard 
containers.  Any thoughts?

--
nosy: +smarnach

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



[issue11302] Add more tests to test_ast.py

2011-06-27 Thread Vincent Legoll

Vincent Legoll vincent.leg...@gmail.com added the comment:

I was testing exact matches on the strings because I think pypy wants to be as 
compliant as possible with cpython, and IMHO that include exception msgs as far 
as possible. I don't see any reason to be different just for the sake of it.

As a user I'd find strange not to get same exc msgs from different 
implementations, and it'll make me loose some time digging why those difference 
exist...

Back to the patch:

The multiline (and also differing offsets) are there for testing .lineno  
.col_offset AST node's attributes. (there was a bug in pypy's implementation of 
those back then...)

Do you want that explained in the comment ?

Do you want me to add self.assertIn(foobar, str(e)) in the tests, remove 
the comments or let them as in the patch #2 ?

--

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



[issue11302] Add more tests to test_ast.py

2011-06-27 Thread Éric Araujo

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

 I think pypy wants to be as compliant as possible with cpython, and
 IMHO that include exception msgs as far as possible. I don't see any
 reason to be different just for the sake of it.

 As a user I'd find strange not to get same exc msgs from different
 implementations, and it'll make me loose some time digging why those
 difference exist...

The language reference purposefully makes no guarantee about the error 
messages, and in some cases about exception types too (AttributeError vs. 
TypeError), so your feeling contradict Python’s rules.

--
nosy: +eric.araujo

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



[issue11302] Add more tests to test_ast.py

2011-06-27 Thread Benjamin Peterson

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

2011/6/27 Vincent Legoll rep...@bugs.python.org:

 Vincent Legoll vincent.leg...@gmail.com added the comment:

 I was testing exact matches on the strings because I think pypy wants to be 
 as compliant as possible with cpython, and IMHO that include exception msgs 
 as far as possible. I don't see any reason to be different just for the sake 
 of it.

It's not difference just for the sake of it. Exact compatibility with
errors messages is not particularly useful as long as they have the
same semantic meaning.


 As a user I'd find strange not to get same exc msgs from different 
 implementations, and it'll make me loose some time digging why those 
 difference exist...

The usually mean the same thing; they're just worded differently.


 Back to the patch:

 The multiline (and also differing offsets) are there for testing .lineno  
 .col_offset AST node's attributes. (there was a bug in pypy's implementation 
 of those back then...)

 Do you want that explained in the comment ?

 Do you want me to add self.assertIn(foobar, str(e)) in the tests, remove 
 the comments or let them as in the patch #2 ?

If you want, you can test the exc message with the assertIn pattern.

I don't find there's much potential for mistaking where the attribute
error is in x.not_an_attribute. :)

--

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



[issue12416] packaging does not have hooks callable during distribution removal

2011-06-27 Thread Tarek Ziadé

Tarek Ziadé ziade.ta...@gmail.com added the comment:

Sounds good. Also, we should make the assumption that this hook might be 
deactivated or might fail. So it should not break the uninstallation in this 
case (a warning seem fine)

--

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



[issue12416] packaging does not have hooks callable during distribution removal

2011-06-27 Thread Éric Araujo

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

Definitely, hooks do not stop operation.  I’ll double-check that.  We may want 
an option to turn hooks failures into fatal errors.

--

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



[issue12420] distutils crashes if PATH is not defined

2011-06-27 Thread Henry Precheur

Henry Precheur he...@precheur.org added the comment:

I think that returning None would be a better option. The function
documentation says:

  Tries to find 'executable' in the directories listed in 'path'.

  A string listing directories separated by 'os.pathsep'; defaults to
  os.environ['PATH'].  Returns the complete filename or None if not found.

If os.environ['PATH'] is empty the function returns None:

   from distutils.spawn import find_executable
   find_executable('does not exist', path='/bin:/usr/bin') is None
  True
   find_executable('test', path='') is None
  True

This would be consistent with the function definition. If PATH is
undefined, the executable cannot be found, therefor returning None seems
like the right thing to do.

On Mon, Jun 27, 2011 at 02:33:09PM +, ??ric Araujo wrote:
 
 ??ric Araujo mer...@netwok.org added the comment:
 
 Okay, I see the original use case (#12401).  I think the proper thing to do 
 is to skip tests that rely on the environment being non-empty.
 
 --
 
 ___
 Python tracker rep...@bugs.python.org
 http://bugs.python.org/issue12420
 ___

--

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



[issue12420] distutils tests fail if PATH is not defined

2011-06-27 Thread Henry Precheur

Changes by Henry Precheur he...@precheur.org:


--
title: distutils crashes if PATH is not defined - distutils tests fail if PATH 
is not defined

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



[issue12416] packaging does not have hooks callable during distribution removal

2011-06-27 Thread Tarek Ziadé

Tarek Ziadé ziade.ta...@gmail.com added the comment:

We need to make it crystal clear in the doc: developers need to understand this 
behavior.

Also, for a fatal error, I am -1 for activating this for an uninstall hook 
because we want to uninstall wathever happens in the hooks, +1 for others (as 
long as it's coupled with a --force option)

It can be a specific exception the hook can raise to stop the process

--

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



[issue11302] Add more tests to test_ast.py

2011-06-27 Thread Vincent Legoll

Vincent Legoll vincent.leg...@gmail.com added the comment:

* removed the comments for exc msgs
* added explanation to multiline statements
* added 2 tests to test_AST_objects()

Regarding Éric's comment, I'm starting to wonder if those Exception tests 
should be added to cpython's testsuite. Maybe that would only be beneficial for 
pypy...

--
Added file: http://bugs.python.org/file22496/add-more-tests-for-ast_py-3.patch

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



[issue12422] When deepcopying, don't store immutable objects in the memo dict

2011-06-27 Thread Alex Gaynor

New submission from Alex Gaynor alex.gay...@gmail.com:

All storing immutable objects in the memo dict does is slow stuff down, due to 
having a larger hash table, and on some other Python's causing hilarious levels 
of GC pressure.  Using http://paste.pocoo.org/show/421310/ as a benchmark, 
CPython get's a 2x speedup on the deepcopy portion, and PyPy a 20x.  Patch is 
attached.

--
components: Library (Lib)
files: d.diff
keywords: patch
messages: 139300
nosy: alex
priority: normal
severity: normal
status: open
title: When deepcopying, don't store immutable objects in the memo dict
versions: Python 2.7, Python 3.3, Python 3.4
Added file: http://bugs.python.org/file22497/d.diff

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



[issue12420] distutils tests fail if PATH is not defined

2011-06-27 Thread Éric Araujo

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

To explain my position: distutils is a very brittle codebase that’s used and 
monkey-patched by a lot of third-party code.  In the past, before the forking 
of distutils/packaging, Tarek tried to gradually improve distutils but he got a 
lot of pushback when his changes broke this third-party code that relied on 
known bugs or undocumented behavior or worked around it.  That’s why a feature 
freeze is now in effect, and behavior is not changed unless it is to fix a bug.

In this case, it is not documented that distutils should run under python -E, 
and nobody reported it as a bug before, that’s why I have the position that the 
tests that require $PATH should be skipped, and the code left untouched.

For distutils2 (named packaging in the 3.3 standard library), we can improve 
find_executable.  We even want to extract it and move it to shutil: #444582

--

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



[issue12416] packaging does not have hooks callable during distribution removal

2011-06-27 Thread Éric Araujo

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

The setup.cfg spec says only this:

 The callables are executed in the order they’re found in the file; if
 one of them cannot be found, tools should not stop, but for example
 produce a warning and continue with the next line.

packaging/commandhooks does not say anything.  I’ll open a bug to add docs and 
tests about that, and a feature request for the new option to turn warnings 
into fatal errors.

--

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



[issue12422] When deepcopying, don't store immutable objects in the memo dict

2011-06-27 Thread Carl Friedrich Bolz

Changes by Carl Friedrich Bolz cfb...@gmx.de:


--
nosy: +Carl.Friedrich.Bolz

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



[issue8617] Better document user site-packages in site module doc

2011-06-27 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


--
keywords: +patch
Added file: http://bugs.python.org/file22498/pep370-doc.diff

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



[issue8617] Better document user site-packages in site module doc

2011-06-27 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


--
keywords: +needs review
stage: needs patch - patch review

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



[issue12422] When deepcopying, don't store immutable objects in the memo dict

2011-06-27 Thread Alex Gaynor

Alex Gaynor alex.gay...@gmail.com added the comment:

A slightly cleverer version (or less clever, depending on how you approach the 
issue) that also works with tuples of immutable content.

--
Added file: http://bugs.python.org/file22499/d.diff

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



[issue12398] Sending binary data with a POST request in httplib can cause Unicode exceptions

2011-06-27 Thread sorin

sorin sorin.sbar...@gmail.com added the comment:

I updated the gist and made a minimal test
https://gist.github.com/1047551

--

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



[issue10020] docs for sqlite3 describe functions not available without recompiling

2011-06-27 Thread Senthil Kumaran

Senthil Kumaran sent...@uthcode.com added the comment:

Eric, you mean for the whole of sqlite3 docmentation or the part in the 
footnote?

--

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



[issue10020] docs for sqlite3 describe functions not available without recompiling

2011-06-27 Thread Éric Araujo

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

I mean in the two commits.  I can check the whole file later (and also use 
automatic reST footnotes, [#] instead of [#fn1]).

--

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



[issue5999] compile error on HP-UX 11.22 ia64 - 'mbstate_t' is used as a type, but has not been defined as a type

2011-06-27 Thread Sridhar Ratnakumar

Sridhar Ratnakumar sridh...@activestate.com added the comment:

On 2011-06-26, at 2:04 PM, Terry J. Reedy wrote:

 Terry J. Reedy tjre...@udel.edu added the comment:
 
 Sridhar, is there still a problem with current 3.2/3?
 
 If you are no longer working on this, I think we should close as 
 languishing/postponed.

I am not working on this yet (its low prio), but will try building 3.2 on HP-UX 
once 3.2 final is released.

--

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



[issue12385] the help for bytearray.maketrans describes bytes.maketrans

2011-06-27 Thread Roundup Robot

Roundup Robot devnull@devnull added the comment:

New changeset 586745894ab8 by Senthil Kumaran in branch '3.2':
Fix closes Issue12385 - Clarify maketrans method docstring for bytes and 
bytearray object.
http://hg.python.org/cpython/rev/586745894ab8

--
nosy: +python-dev
resolution:  - fixed
stage: needs patch - committed/rejected
status: open - closed

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



[issue5999] compile error on HP-UX 11.22 ia64 - 'mbstate_t' is used as a type, but has not been defined as a type

2011-06-27 Thread Éric Araujo

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

« Python 3.2 was released on February 20th, 2011. » (from python.org)

--
nosy: +eric.araujo

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



[issue12043] Update shutil documentation

2011-06-27 Thread Sandro Tosi

Changes by Sandro Tosi sandro.t...@gmail.com:


--
versions:  -Python 3.1

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



[issue12043] Update shutil documentation

2011-06-27 Thread Éric Araujo

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

Can you add links, a list of problems, dependency bugs or a patch?  Otherwise 
this is an empty placeholder.

--

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



[issue12043] Update shutil documentation

2011-06-27 Thread Sandro Tosi

Sandro Tosi sandro.t...@gmail.com added the comment:

I'm starting to work on a patch right now.

--

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



[issue10403] Use member consistently

2011-06-27 Thread Éric Araujo

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

Alexander, could you comment on the review page about datetime.rst changes?

--
nosy: +belopolsky

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



[issue5999] compile error on HP-UX 11.22 ia64 - 'mbstate_t' is used as a type, but has not been defined as a type

2011-06-27 Thread Sridhar Ratnakumar

Sridhar Ratnakumar sridh...@activestate.com added the comment:

On 2011-06-27, at 9:11 AM, Éric Araujo wrote:

 Éric Araujo mer...@netwok.org added the comment:
 
 « Python 3.2 was released on February 20th, 2011. » (from python.org)

My mistake; I meant to say 3.2.1 final.

--

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



[issue10181] Problems with Py_buffer management in memoryobject.c (and elsewhere?)

2011-06-27 Thread Stefan Krah

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

Pauli Virtanen rep...@bugs.python.org wrote:
 skrah writes:
  For example, an exporting object could provide a sliced view by adding 
  a getslicedbufferproc to PyBufferProcs:
 
  int PyObject_GetSlicedBuffer(PyObject *obj, Py_buffer *view, 
   int flags, PyObject *key);
 
 The same thing can be done via
 
 PyObject_GetBuffer(obj, view, flags);
 PyBuffer_Slice(view, sliced_view, flags, key);
 
 given an implementation of PyBuffer_Slice. The logic in PyBuffer_Slice does
 not depend on where the buffer comes from, and every buffer can be sliced.

Ok, that sounds good. I came across a comment that base objects can change
their memory layout:

http://mail.python.org/pipermail/python-dev/2007-April/072606.html

Is that something that must be taken care of?

   o The invariant that all allocated memory in the buffer belongs
 to the exporting object remains intact.
 
 Numpy arrays do not have this invariant, and they happily re-export memory
 owned by someone else.

I'm not sure if we use the same terminology. By exporting object I meant
the original base object and this is the invariant I wanted:

   m1 = memoryview(base) # directly from base
   m2 = memoryview(m1)   # redirects getbuffer/releasebuffer to base
   m3 = memoryview(m2)   # redirects getbuffer/releasebuffer to base
   s1 = m3[1::2, 1::2]   # redirects getslicedbuffer/releasebuffer to base

That's also what you mean by re-exporting, right?

--

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



[issue12422] When deepcopying, don't store immutable objects in the memo dict

2011-06-27 Thread Alex Gaynor

Alex Gaynor alex.gay...@gmail.com added the comment:

Switched to using assertIs, as merwok suggested.

--
Added file: http://bugs.python.org/file22500/d.diff

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



[issue10181] Problems with Py_buffer management in memoryobject.c (and elsewhere?)

2011-06-27 Thread Stefan Krah

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

Nick Coghlan rep...@bugs.python.org wrote:
[Snip liberally]
 The lifecycle problem is unrelated to the details of the buffer *contents*
  though - it's entirely about the fact that clients can't safely copy all
  those pointers (as some may refer to addresses inside the struct) and asking
  the original object for a fresh copy is permitted to return a different answer
  each time.

 The actual *slicing* code in memoryview isn't too bad

I promise that I'll keep quiet about the getslicedbufferproc from now on, since 
there isn't much enthusiasm. :)

The reason I kept mentioning it was that I thought it would eliminate the
need to copy anything at all. All buffers would come from a single, memory
owning base object.

 Does all that make my perspective any clearer?

Yes, thank you. The tricky part is to understand why always redirecting
getbuffer/releasebuffer to the underlying *original base object* is not
sufficient, but as I understood Pauli's last posting that is due to the
addition of the release() method.

--

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



[issue10181] Problems with Py_buffer management in memoryobject.c (and elsewhere?)

2011-06-27 Thread Antoine Pitrou

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

Le Mon, 27 Jun 2011 13:17:57 +,
Nick Coghlan rep...@bugs.python.org a écrit :
 
 The TL;DR version of the above is that I would like to see it become:
 
 typedef struct {
 PyObject_HEAD
 PyManagedBuffer source_data; // shared read-only Py_buffer access
 Py_buffer view;  // shape, strides, etc potentially modified
 } PyMemoryViewObject;

Looks ok to me.
(well, acceptable anyway)

--

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



[issue12420] distutils tests fail if PATH is not defined

2011-06-27 Thread Henry Precheur

Henry Precheur he...@precheur.org added the comment:

OK it makes sense.

I'm working on fixing the tests. I'm not done yet, but I've attached a patch 
with my work in progress (some tests still fail). Do you have any comments?

I'll post a complete version later today or tomorrow.

--
Added file: http://bugs.python.org/file22501/fix_distutils_test.diff

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



[issue12423] signal handler dpes

2011-06-27 Thread Kamil Kisiel

Changes by Kamil Kisiel ka...@kamilkisiel.net:


--
nosy: kisielk
priority: normal
severity: normal
status: open
title: signal handler dpes

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



  1   2   >