[issue12022] AttributeError should report the same details when raised by lookup_special() as when raised in the REPL

2011-05-07 Thread Daniel Urban

Changes by Daniel Urban :


--
nosy: +durban

___
Python tracker 

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



[issue11375] urllib2 over SOCKS doesn't use proxy for DNS

2011-05-07 Thread torstenb

Changes by torstenb :


--
nosy: +torstenb

___
Python tracker 

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



[issue11164] xml shouldn't use _xmlplus

2011-05-07 Thread Georg Brandl

Georg Brandl  added the comment:

In MinidomTest.tearDown, the majority of the code seems to be for the stdlib 
version, yet you remove the whole method. Can you elaborate?

--

___
Python tracker 

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



[issue11347] libpython3.so: Broken soname and linking

2011-05-07 Thread Georg Brandl

Changes by Georg Brandl :


--
priority: normal -> release blocker

___
Python tracker 

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



[issue11347] libpython3.so: Broken soname and linking

2011-05-07 Thread Georg Brandl

Georg Brandl  added the comment:

Martin?

--

___
Python tracker 

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



[issue11910] test_heapq C tests are not skipped when _heapq is missing

2011-05-07 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Attaching a rough draft of a way to simplify dual path testing.  The idea is 
that the suite shouldn't have to be rewritten with self.module.heapify(...) 
references throughout.  Instead, tests are written normally and the only thing 
that changes in the context that they are executed in (not much different that 
if we simply commented out the import of c accelerator code).

Several things need work:
1) There needs to be a way to run only one block of tests if _heapqmodule isn't 
built.

2) the unittest.skipUnless decorator doesn't work (it does a static computation 
during compilation rather than a dynamic test during execution).  The attached 
rough draft code works around this by putting the skip logic inside the test.  
This should be done more cleanly.

3) It would be great if there were a way to test unittest's test runner which 
version is being tested so that if there is a failure, it's obvious which 
context is being tested.

The patch is a proof-of-concept that would need polishing before becoming the 
preferred way of doing multiple path testing.

--
Added file: http://bugs.python.org/file21932/new_heapq_test.patch

___
Python tracker 

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



[issue11164] xml shouldn't use _xmlplus

2011-05-07 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +georg.brandl

___
Python tracker 

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



[issue11164] xml shouldn't use _xmlplus

2011-05-07 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis  added the comment:

I'm attaching the patch, which fixes this issue. It would be nice if the patch 
was applied before releases of Python 3.1.4 and 3.2.1.

--
keywords: +patch
Added file: http://bugs.python.org/file21931/python-3-remove_pyxml_support.patch

___
Python tracker 

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



[issue8407] expose signalfd(2) and pthread_sigmask in the signal module

2011-05-07 Thread STINNER Victor

STINNER Victor  added the comment:

Update the signalfd patch (version 4) against the default branch. Specify the 
minimum Linux version in signalfd() doc. The patch still lacks a structure to 
parse the bytes written into the file (see msg135438 for a ctypes example): a 
struct sequence should be fine.

--
Added file: http://bugs.python.org/file21930/signalfd-4.patch

___
Python tracker 

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



[issue9971] Optimize BufferedReader.readinto

2011-05-07 Thread John O'Connor

Changes by John O'Connor :


Removed file: http://bugs.python.org/file21900/buffered_readinto2.patch

___
Python tracker 

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



[issue9971] Optimize BufferedReader.readinto

2011-05-07 Thread John O'Connor

Changes by John O'Connor :


Removed file: http://bugs.python.org/file21899/buffered_readinto.patch

___
Python tracker 

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



[issue9205] Parent process hanging in multiprocessing if children terminate unexpectedly

2011-05-07 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Hum, I get a strange skip on a XP buildbot:
> 
> [224/354] test_multiprocessing
> test_multiprocessing skipped -- DLL load failed: The specified
> procedure could not be found.
> 
> Yet _multiprocessing was compiled fine... Does anyone know what it
> means?

Ok, the culprit is CancelIoEx(), which is only supported under Vista and
later (but, strangely enough, compiles fine under XP).
I need to use CancelIo() instead, which will lead me to change the
implementation strategy slightly (the fact that CancelIo() is
thread-specific makes it unsuitable for a tp_dealloc).

--

___
Python tracker 

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



[issue8407] expose signalfd(2) and pthread_sigmask in the signal module

2011-05-07 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset e3cb2c99a5a9 by Victor Stinner in branch 'default':
Issue #8407: Remove debug code from test_signal
http://hg.python.org/cpython/rev/e3cb2c99a5a9

--

___
Python tracker 

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



[issue8407] expose signalfd(2) and pthread_sigmask in the signal module

2011-05-07 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset f8c49a930015 by Victor Stinner in branch 'default':
Issue #8407: The signal handler writes the signal number as a single byte
http://hg.python.org/cpython/rev/f8c49a930015

--

___
Python tracker 

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



[issue9971] Optimize BufferedReader.readinto

2011-05-07 Thread John O'Connor

John O'Connor  added the comment:

FWIW, It seems Java does something similar. They write directly into caller's 
buffer if outstanding bytes needed (after emptying internal buffer) is greater 
than internal buffer len.

--

___
Python tracker 

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



[issue8407] expose signalfd(2) and pthread_sigmask in the signal module

2011-05-07 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 1d8a57deddc4 by Victor Stinner in branch 'default':
Issue #8407: Add pthread_kill(), sigpending() and sigwait() functions to the
http://hg.python.org/cpython/rev/1d8a57deddc4

--

___
Python tracker 

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



[issue12013] file /usr/local/lib/python3.1/lib-dynload/_socket.so: symbol inet_aton: referenced symbol not found

2011-05-07 Thread Alex Lai

Alex Lai  added the comment:

The test fialed on my workstation while successul on another server. Both 
server has the same Pyton installation but different libc and libm version. I 
plan to reinstall the OS(solaris 10 pre-release) on my workstation next week 
and see how it goes.

Regards,

Alex

--

___
Python tracker 

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



[issue11910] test_heapq C tests are not skipped when _heapq is missing

2011-05-07 Thread Ezio Melotti

Ezio Melotti  added the comment:

Thanks (for the record the changeset is a8b82c283524).

> Overall, I don't think the current approach to testing both paths
> is elegant.
That's the most elegant way we have now.  If all the Python tests pass for the 
C version too, a base class could be avoided and the C tests could inherit 
directly from the Python ones (possibly adding additional C-specific tests).  I 
actually prefer this way because the Python tests should be an invariant of all 
the Python implementations and additional tests for the accelerations can be 
created from them with appropriate skip decorators, e.g.:
class PythonFooTests(TestCase):
...

@skipUnless(is_cypthon and c_foo)
class CFooTests(PythonTest):
   ...

@skipUnless(is_jython and j_foo)
class JFooTests(PythonTest):
   ...

This also avoid to list the tests explicitly at the end to exclude the base 
class (e.g. currently we have to exclude TestHeap, and list TestHeapC and 
TestHeapPy).


We could come up with some smart class decorator that runs a set of tests with 
and without accelerations, but it will make more difficult to add tests 
specific to the C or Python versions.

--

___
Python tracker 

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



[issue11347] libpython3.so: Broken soname and linking

2011-05-07 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis  added the comment:

I'm attaching improved patch, which adds detection of -Wl,--no-as-needed flag. 
This issue should be release blocker for Python 3.2.1.

--
Added file: http://bugs.python.org/file21929/libpython3.so.patch

___
Python tracker 

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



[issue9971] Optimize BufferedReader.readinto

2011-05-07 Thread John O'Connor

John O'Connor  added the comment:

It seems to me that the point of using readinto() is to avoid double-buffering 
(and the extra alloc/free that comes with read()). The slowness of using a 
small buffer size seems like only a natural and expected consequence. 

The trade-off of accommodating a small buffer size (by buffering behind the 
scenes anyways) would likely slow the more common cases which use a decent 
buffer size. I am wondering if an effort to accommodate both uses would be 
appropriate. Possibly by not double-buffering if readinto(b): len(b) > 
buffer_size/2 (arbitrary but seems feasible), and copying directly as the patch 
does now. Otherwise, fill the buffer up for subsequent reads and copy len(b) to 
user buffer. There is probably a good equilibrium for when it makes more/less 
sense to bypass the internal buffer.

Changing _bufferedreader_read_generic() would require some of the other helpers 
to be changed as well but it may be the way to go.

Let me know what you think of the above. I will experiment a bit. Unfortunately 
I am a bit busy this weekend but cannot wait to work on this again.

--

___
Python tracker 

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



[issue11910] test_heapq C tests are not skipped when _heapq is missing

2011-05-07 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

I'm imagining a cleaner testing style, like this:

class TestHeap(unittest.TestCase):

def test_nsmallest(self):
self.assertEqual(heapq.nsmallest(3, range(10)), [0,1,2])
...

@test_support.requires('_heapq')
def test_comparison_operator(self):
...

def test_main(verbose=None):
test_classes = [TestHeapPython, TestErrorHandling]
test_support.run_unittest(*test_classes)

test_support.reload('heapq', hiding='_heapq')
test_support.run_unittest(*test_classes)

Ideally, we should be able to hide individual methods and be able to mark 
entire test classes with decorators for required features.

--

___
Python tracker 

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



[issue11347] libpython3.so: Broken soname and linking

2011-05-07 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


Removed file: http://bugs.python.org/file20939/libpython3.so.patch

___
Python tracker 

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



[issue11910] test_heapq C tests are not skipped when _heapq is missing

2011-05-07 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Some of the tests were incorrectly marked as being C specific.  I've fixed that 
on the 2.7 branch.  Re-assigning back to Ezio.

Overall, I don't think the current approach to testing both paths is elegant.  
Is there some alternative approach to running suites in two different context 
without adding .module indirections and multiple subclasses throughout the code?

--
assignee: rhettinger -> ezio.melotti

___
Python tracker 

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



[issue9205] Parent process hanging in multiprocessing if children terminate unexpectedly

2011-05-07 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Hum, I get a strange skip on a XP buildbot:

[224/354] test_multiprocessing
test_multiprocessing skipped -- DLL load failed: The specified procedure could 
not be found.

Yet _multiprocessing was compiled fine... Does anyone know what it means?

http://www.python.org/dev/buildbot/all/builders/x86%20XP-5%20custom/builds/5/steps/test/logs/stdio

--

___
Python tracker 

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



[issue12012] _ssl module doesn't compile with OpenSSL 1.0.0d: SSLv2_method is missing

2011-05-07 Thread Peter Eisentraut

Changes by Peter Eisentraut :


--
nosy: +petere

___
Python tracker 

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



[issue12027] Optimize import this (patch to make it 10x faster)

2011-05-07 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Move on, nothing to see here ;-)

--
resolution:  -> rejected
status: open -> closed

___
Python tracker 

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



[issue10666] OS X installer variants have confusing readline differences

2011-05-07 Thread Ned Deily

Ned Deily  added the comment:

́Éric, was your comment in msg135467 intended for another issue?

--

___
Python tracker 

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



[issue8407] expose signalfd(2) and pthread_sigmask in the signal module

2011-05-07 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> pending_signals-3.patch:
>  - don't check for pending signals in sigwait()
>  - pthread_kill() doc: it is not a good idea to say that pthread_kill() with 
> signum=0 can be used to check if a thread identifier is valid => such test 
> does crash (SIGSEGV) on my Linux box. I changed the doc to say that it can be 
> used to check if a thread is still running (which is different).
>  - add a dedicated test for sigpending()
>  - doc: explain how to get a thread identifier for pthread_kill()
>  - don't compile pthread_kill() without threads: you cannot get a valid 
> thread identifier without the _thread module
> 
> I think that the patch is ready to be commited. Anyone for a last
> review? (antoine, neologix?)

It looks good to me.
It's very nice to have all these extra functions :)

--

___
Python tracker 

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



[issue12027] Optimize import this (patch to make it 10x faster)

2011-05-07 Thread STINNER Victor

STINNER Victor  added the comment:

@Raymond: What do you think? Do you prefer simple or faster code?

I think that the speed of "import this" do matter!

--

___
Python tracker 

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



[issue11910] test_heapq C tests are not skipped when _heapq is missing

2011-05-07 Thread Ezio Melotti

Ezio Melotti  added the comment:

If they are not C specific they should be moved to the base class (TestHeap).  
TestHeapC and TestHeapPython should contain only tests specific to the C and 
Python versions respectively.

The goal here is to make sure that they are run once with the Python version, 
and again with the C version -- but only if the C version is available.
Currently, if _heapq is missing, the C tests (i.e. TestHeapC) are run anyway 
using the Python module, when instead they should be skipped.

c_heapq = import_fresh_module('heapq', fresh=['_heapq']) should be fixed to try 
to import _heapq and return None if the import fails, so that a 
@skipUnless(c_heapq, 'test requires the _heapq module') decorator can be added 
to TestHeapC.
See also http://www.python.org/dev/peps/pep-0399/

This can be fixed in 2.7 first.

--

___
Python tracker 

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



[issue11927] SMTP_SSL doesn't use port 465 by default

2011-05-07 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

The patch was committed in dev and maintenance branches. Thank you!

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

___
Python tracker 

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



[issue11927] SMTP_SSL doesn't use port 465 by default

2011-05-07 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset bcf04ced5ef1 by Antoine Pitrou in branch '2.7':
Issue #11927: SMTP_SSL now uses port 465 by default as documented.  Patch by 
Kasun Herath.
http://hg.python.org/cpython/rev/bcf04ced5ef1

--

___
Python tracker 

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



[issue11668] _multiprocessing.Connection.poll with timeout uses polling under Windows

2011-05-07 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

I have a full patch using overlapped I/O in issue9205 (sentinels3.patch).

--

___
Python tracker 

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



[issue9205] Parent process hanging in multiprocessing if children terminate unexpectedly

2011-05-07 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Ok, this patch seems fully debugged (under Windows and Linux). A couple of 
things come in addition, such as removing repeated polling in 
PipeConnection.poll() and _Popen.wait().

--
Added file: http://bugs.python.org/file21928/sentinels3.patch

___
Python tracker 

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



[issue11927] SMTP_SSL doesn't use port 465 by default

2011-05-07 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 20e9d3e49689 by Antoine Pitrou in branch '3.1':
Issue #11927: SMTP_SSL now uses port 465 by default as documented.  Patch by 
Kasun Herath.
http://hg.python.org/cpython/rev/20e9d3e49689

New changeset 209744660b92 by Antoine Pitrou in branch '3.2':
Merge: Issue #11927: SMTP_SSL now uses port 465 by default as documented.
http://hg.python.org/cpython/rev/209744660b92

New changeset e708a57de190 by Antoine Pitrou in branch 'default':
Merge: Issue #11927: SMTP_SSL now uses port 465 by default as documented.
http://hg.python.org/cpython/rev/e708a57de190

--
nosy: +python-dev

___
Python tracker 

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



[issue12022] AttributeError should report the same details when raised by lookup_special() as when raised in the REPL

2011-05-07 Thread Daniel Holth

Daniel Holth  added the comment:

Thank you Benjamin for following up on this issue

--

___
Python tracker 

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



[issue12026] Support more of MSI api by exposing handles

2011-05-07 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

What's the purpose of the patch? I.e. what can you do when you have the handle 
exposed?

--

___
Python tracker 

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



[issue12002] ftplib.FTP.abort fails with TypeError on Python 3.x

2011-05-07 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 31220cd936d2 by Giampaolo Rodola' in branch '3.1':
#12002 - ftplib's abort() method raises TypeError
http://hg.python.org/cpython/rev/31220cd936d2

--
nosy: +python-dev

___
Python tracker 

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



[issue11910] test_heapq C tests are not skipped when _heapq is missing

2011-05-07 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Are you sure those tests are C specific?  Please be careful about doing 
unnecessary complexification of this module's tests.

--
assignee: ezio.melotti -> rhettinger
nosy: +rhettinger

___
Python tracker 

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



[issue11927] SMTP_SSL doesn't use port 465 by default

2011-05-07 Thread Kasun Herath

Kasun Herath  added the comment:

I'm submitting another patch which includes a test in test_smtpnet. Would 
appreciate further feedback.

--
Added file: 
http://bugs.python.org/file21927/smtp_default_port_with_smtpnet_test.patch

___
Python tracker 

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



[issue11968] wsgiref's wsgi application sample code does not work

2011-05-07 Thread Phillip J. Eby

Phillip J. Eby  added the comment:

Yes, the 'b' is a docs error.

I previously removed this in:

   http://hg.python.org/cpython-fullhistory/rev/2697326d4a77 

It appears to have been reverted during a merge, here:

   http://hg.python.org/cpython-fullhistory/rev/88d04f0143c7

My browser crashed trying to view that huge second revision, so I'm not sure if 
there were any other regressions therein.

--

___
Python tracker 

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



[issue11963] Remove human verification from test suite (test_parser and test_subprocess)

2011-05-07 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

My title suggestion was meant to say "Yes, if you are willing to expand the 
scope of this issue and do more work, go ahead' ;-).

I have not looked at help(test), but it should be complete if it is not.
I was referring to the test module doc 25.5. Someone decided recently that 
test.support 25.6 should be complete, for the benefit of developers (like me) 
even though subject to change. Hence the recent patch. That chapter should 
probably start with a notice that these are private interfaces, subject to 
change, for testing of Python.

I'd like to see at least a listing and brief description of other stuff I 
should know about, perhaps in a new 25.6.2 section. An alternative would be 
something in the developer docs. Looking at the listing of /test is a bit 
confusing. I have pretty much ignored everything other than test_x (and 
regrtest.py), assuming that they were data files used by particular tests. 
Hence I was surprised by script_helper.py as an annex to support.py. Are there 
others (that are not single-test specific)? (I know, this should become another 
issue.)

--

___
Python tracker 

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



[issue12022] AttributeError should report the same details when raised by lookup_special() as when raised in the REPL

2011-05-07 Thread Daniel Holth

Daniel Holth  added the comment:

Python should explain AttributeError in the same way when it's raised by the 
interpreter. The with: statement below should raise the second AttributeError, 
not the first.

import transaction
with transaction: pass
>>> AttributeError: __exit__

import sys
sys.__exit__
>>> AttributeError: 'module' object has no attribute '__exit__'

--
title: improve special method lookup error message -> AttributeError should 
report the same details when raised by lookup_special() as when raised in the 
REPL

___
Python tracker 

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



[issue11910] test_heapq C tests are not skipped when _heapq is missing

2011-05-07 Thread Ezio Melotti

Ezio Melotti  added the comment:

Attempting to fix import_fresh_module might be better.

--
assignee:  -> ezio.melotti

___
Python tracker 

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



[issue5421] Irritating error message by socket's sendto method

2011-05-07 Thread Ezio Melotti

Ezio Melotti  added the comment:

I backported the patch to 2.7 in 7c3a20b5943a, and added tests to the 3.x 
branches.

--
nosy: +ezio.melotti

___
Python tracker 

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



[issue10169] socket.sendto raises incorrect exception when passed incorrect types

2011-05-07 Thread Ezio Melotti

Ezio Melotti  added the comment:

This turned out to be a duplicate of #5421 already fixed in 3.x, so I 
backported the patch and added the tests to 3.x too.

--
resolution:  -> fixed
stage: commit review -> committed/rejected
status: open -> closed
versions:  -Python 3.1, Python 3.2

___
Python tracker 

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



[issue11743] Rewrite PipeConnection and Connection in pure Python

2011-05-07 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Updated patch, fixing a sporadic failure in test_spawn_close.

--
Added file: http://bugs.python.org/file21926/mpconn2.patch

___
Python tracker 

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



[issue11882] test_imaplib failed on x86 ubuntu

2011-05-07 Thread Kasun Herath

Kasun Herath  added the comment:

david, I'm not much familiar with c. Still trying to figure out how to do it

--
status: pending -> open

___
Python tracker 

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



[issue5421] Irritating error message by socket's sendto method

2011-05-07 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 9222c9d747c1 by Ezio Melotti in branch '3.1':
#5421: add tests.
http://hg.python.org/cpython/rev/9222c9d747c1

New changeset 4b3352b49483 by Ezio Melotti in branch '3.2':
#5421: merge with 3.1.
http://hg.python.org/cpython/rev/4b3352b49483

New changeset 20273f2195ba by Ezio Melotti in branch 'default':
#5421: merge with 3.2.
http://hg.python.org/cpython/rev/20273f2195ba

--

___
Python tracker 

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



[issue10169] socket.sendto raises incorrect exception when passed incorrect types

2011-05-07 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 7c3a20b5943a by Ezio Melotti in branch '2.7':
#10169: Fix argument parsing in socket.sendto() to avoid error masking.
http://hg.python.org/cpython/rev/7c3a20b5943a

--
nosy: +python-dev

___
Python tracker 

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



[issue12022] improve special method lookup error message

2011-05-07 Thread Benjamin Peterson

Changes by Benjamin Peterson :


--
resolution: invalid -> 
status: closed -> open
title: 'transaction' module-as-context-manager thwarted by Python 2.7.1 -> 
improve special method lookup error message

___
Python tracker 

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



[issue12027] Optimize import this (patch to make it 10x faster)

2011-05-07 Thread Georg Brandl

Georg Brandl  added the comment:

(And subsequently cc10b010f40b.  I agree with Benjamin.)

--
nosy: +georg.brandl

___
Python tracker 

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



[issue12027] Optimize import this (patch to make it 10x faster)

2011-05-07 Thread Benjamin Peterson

Changes by Benjamin Peterson :


--
nosy: +rhettinger

___
Python tracker 

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



[issue12027] Optimize import this (patch to make it 10x faster)

2011-05-07 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

I suggest rejecting. See 8ae88db7843c

--

___
Python tracker 

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



[issue12002] ftplib.FTP.abort fails with TypeError on Python 3.x

2011-05-07 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

This is a nasty one and mainly it's the reason why there are no tests for 
abort() method.
In FTP, ABOR command is supposed to be sent as OOB (out-of-band) "urgent" data 
and the dummy FTP server we're using for the funcional tests must handle this 
appopriately.

In practical terms this means that when the client calls 
self.sock.sendall(line, MSG_OOB) the server is supposed to call 
socket.recv(1024, MSG_OOB).
Since our server uses asyncore this becomes quite twisted to handle.
This can be avoided by setting SO_OOBINLINE which tells the server to handle 
the urgent data inline meaning that both plain and urgent data can be received 
with a normal sock.recv(1024) call.

The patch in attachment does this and also fixes FTP_TLS.abort() which is not 
able to accept the extra MSG_OOB flag argument.

There's a side note: on certain platforms SO_OOBINLINE has no effect, resulting 
in asyncore's handle_expt method being called, see:
http://code.google.com/p/pyftpdlib/source/browse/trunk/pyftpdlib/ftpserver.py#2064
I haven't handled this case in my patch because I'm not sure what platforms are 
broken.
I'd say we can commit this patch as-is, wait for the buildbots to turn red and 
then disable the test for those platforms afterwards.

--
keywords: +patch
Added file: http://bugs.python.org/file21925/ftplib.patch

___
Python tracker 

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



[issue9516] sysconfig: $MACOSX_DEPLOYMENT_TARGET mismatch: now "10.3" but "10.5" during configure

2011-05-07 Thread Éric Araujo

Éric Araujo  added the comment:

> I haven't changed the CompileError handling though, that would change
> a test failure into a test error.
Ah, thanks for correcting my mistake.

--

___
Python tracker 

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



[issue12017] Decoding a highly-nested object with json (_speedups enabled) causes segfault

2011-05-07 Thread Ezio Melotti

Ezio Melotti  added the comment:

Fixed, thanks Ivan for the report and Alex for suggesting Py_EnterRecursiveCall!

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

___
Python tracker 

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



[issue10964] Mac installer need not add things to /usr/local

2011-05-07 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +eric.araujo

___
Python tracker 

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



[issue9859] Add tests to verify API match of modules with 2 implementations

2011-05-07 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +belopolsky, brett.cannon, eric.araujo, pitrou

___
Python tracker 

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



[issue12017] Decoding a highly-nested object with json (_speedups enabled) causes segfault

2011-05-07 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 6fa20e360e5e by Ezio Melotti in branch '2.7':
#12017: Fix segfault in json.loads() while decoding highly-nested objects using 
the C accelerations.
http://hg.python.org/cpython/rev/6fa20e360e5e

New changeset 61164d09337e by Ezio Melotti in branch '3.1':
#12017: Fix segfault in json.loads() while decoding highly-nested objects using 
the C accelerations.
http://hg.python.org/cpython/rev/61164d09337e

New changeset db97968379dd by Ezio Melotti in branch '3.2':
#12017: merge with 3.1.
http://hg.python.org/cpython/rev/db97968379dd

New changeset 389620c9e609 by Ezio Melotti in branch 'default':
#12017: merge with 3.2.
http://hg.python.org/cpython/rev/389620c9e609

--
nosy: +python-dev

___
Python tracker 

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



[issue9923] mailcap module may not work on non-POSIX platforms if MAILCAPS env variable is set

2011-05-07 Thread Éric Araujo

Éric Araujo  added the comment:

BTW, is there a real use case that lead you to open this report, or is it just 
theoretical?  I’m not even sure mailcap is used on non-UNIX (and even there, I 
think it’s not used by recent tools).

--
nosy: +eric.araujo

___
Python tracker 

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



[issue9923] mailcap module may not work on non-POSIX platforms if MAILCAPS env variable is set

2011-05-07 Thread Éric Araujo

Changes by Éric Araujo :


--
dependencies: +No unit test for mailcap module

___
Python tracker 

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



[issue10581] Review and document string format accepted in numeric data type constructors

2011-05-07 Thread Éric Araujo

Éric Araujo  added the comment:

> I may be in minority, but I find it convenient to use int(), float()
> etc. for data validation.
A number of libraries agree: argparse, HTML form handling libs, etc.

> I may be too strict, but I don't think anyone would want to see
> columns with a mix of Bengali and Devanagari numerals. [...]
> On the other hand there is certain convenience in promiscuous
> parsers, but this is not an expectation that I have from int() and
> friends. [...] There are pros and cons in any approach.
Indeed, tough question.  On one hand, I tend to agree that mixing Hindi/Arab 
numerals with Bengali does not make sense; on the other hand, rejecting it 
means that the int code does know about Unicode, which you argued against.

>[MAL]
>> The codecs, Unicode methods and other Unicode support features
>> happily work with all kinds of languages, mixed or not, without any
>> such specification.
> In my view int() and friends are only marginally related to Unicode
> and Unicode methods design is not directly relevant to their behavior.
I think I agree.  It’s perfectly fine that Unicode support features don’t care 
about the type of the characters but just encode and decode; however, int has a 
validation step.  It rejects numerals that don’t make sense with the given base 
for example, so rejecting nonsensical sequences of Unicode numerals makes sense 
IMO.

What do the other languages that are able to convert from Unicode numerals to 
integer objects?

--
nosy: +eric.araujo

___
Python tracker 

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



[issue10663] configure shouldn't set a default OPT

2011-05-07 Thread Éric Araujo

Éric Araujo  added the comment:

Sounds reasonable.

--

___
Python tracker 

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



[issue10666] OS X installer variants have confusing readline differences

2011-05-07 Thread Éric Araujo

Éric Araujo  added the comment:

FTR, readline.read_init_file() works with libedit too (provided that the config 
file uses libedit-style format), so you can remove the branch from your code.

--
nosy: +eric.araujo

___
Python tracker 

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



[issue10713] re module doesn't describe string boundaries for \b

2011-05-07 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue10713] re module doesn't describe string boundaries for \b

2011-05-07 Thread Éric Araujo

Éric Araujo  added the comment:

Thanks for the report.  Would you be interested in experimenting and/or reading 
the code to find the anwser and propose a doc patch?

--
keywords: +easy
nosy: +eric.araujo
stage:  -> needs patch
versions: +Python 2.7, Python 3.1, Python 3.2, Python 3.3

___
Python tracker 

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



[issue11963] Remove human verification from test suite (test_parser and test_subprocess)

2011-05-07 Thread Éric Araujo

Éric Araujo  added the comment:

Please feel free to improve titles; we’re a team, there’s no ego in bug title 
phrasing :)  I did so on at least one bug of yours; hope you didn’t consider it 
rude.

Are you asking about the docstring of the test module or the reST doc of 
test.support?  A brief mention of test.script_helper (and possibly the other 
undocumented test helpers) could be added in either or both IMO, but just to 
let people know about about the file and go read it or pydoc it; we don’t want 
to spend too much time documenting private modules with no compat constraints.

--
title: Use real assert* for test_trigger_memory_error (test_parser) -> Remove 
human verification from test suite (test_parser and test_subprocess)

___
Python tracker 

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



[issue12013] file /usr/local/lib/python3.1/lib-dynload/_socket.so: symbol inet_aton: referenced symbol not found

2011-05-07 Thread Éric Araujo

Éric Araujo  added the comment:

$ python3.1 -m test.regrtest

If your distribution removes tests from the binary package, this won’t work.

--

___
Python tracker 

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



[issue11072] Add MLSD command support to ftplib

2011-05-07 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 153bd8fc22c7 by Giampaolo Rodola' in branch 'default':
#11072- applying http://bugs.python.org/review/11072/show suggestions
http://hg.python.org/cpython/rev/153bd8fc22c7

--

___
Python tracker 

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



[issue11877] Change os.fsync() to support physical backing store syncs

2011-05-07 Thread Steffen Daode Nurpmeso

Changes by Steffen Daode Nurpmeso :


Removed file: http://bugs.python.org/file21771/11877.4.diff

___
Python tracker 

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



[issue11877] Change os.fsync() to support physical backing store syncs

2011-05-07 Thread Steffen Daode Nurpmeso

Changes by Steffen Daode Nurpmeso :


Removed file: http://bugs.python.org/file21749/11877.3.diff

___
Python tracker 

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



[issue11877] Change os.fsync() to support physical backing store syncs

2011-05-07 Thread Steffen Daode Nurpmeso

Steffen Daode Nurpmeso  added the comment:

11877.5.diff incorporates all changes suggested by
Charles-François except for the 'auto' keyword, which is extremely
important and which would need to be invented if it would not
yet exist.

I'm dropping the old stuff.  And i think this is the final version
of the patch.  I've changed the default argument to 'True' as
i really think it's better to be on the safe side here.  (The
french are better off doing some gracy and dangerous sports to
discover edges of life!)  I'm still of the opinion that this
should be completely hidden, but since it's completely transparent
wether a Python function gets yet another named argument or not...

So, thanks to Ronald, i detected that also NetBSD introduced
a FDISKSYNC flag in 2005 and that you really need fsync_range()
there (at least by definition)!  How could they do that?  But i'm
also happy to see that all other systems try hard to achieve
security transparently and by default and unless i missed
something once again.

--
Added file: http://bugs.python.org/file21924/11877.5.diff

___
Python tracker 

___diff --git a/Doc/library/os.rst b/Doc/library/os.rst
--- a/Doc/library/os.rst
+++ b/Doc/library/os.rst
@@ -798,7 +798,7 @@
Availability: Unix.
 
 
-.. function:: fsync(fd)
+.. function:: fsync(fd, full_fsync=True)
 
Force write of file with filedescriptor *fd* to disk.  On Unix, this calls 
the
native :c:func:`fsync` function; on Windows, the MS :c:func:`_commit` 
function.
@@ -807,6 +807,12 @@
``f.flush()``, and then do ``os.fsync(f.fileno())``, to ensure that all 
internal
buffers associated with *f* are written to disk.
 
+   The POSIX standart only requires that :c:func:`fsync` must transfer the
+   buffered data to the storage device, not that the data is actually
+   written by the device itself.  On operating systems where it is
+   necessary and possible the optional *full_fsync* argument can be used to
+   initiate additional steps to synchronize the physical backing store.
+
Availability: Unix, and Windows.
 
 
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -2121,13 +2121,46 @@
 
 #ifdef HAVE_FSYNC
 PyDoc_STRVAR(posix_fsync__doc__,
-"fsync(fildes)\n\n\
-force write of file with filedescriptor to disk.");
-
-static PyObject *
-posix_fsync(PyObject *self, PyObject *fdobj)
-{
-return posix_fildes(fdobj, fsync);
+"fsync(fildes, full_fsync=True)\n\n"
+"force write of file buffers with fildes to disk;\n"
+"full_fsync forces flush of disk caches in case fsync() alone is not enough.");
+
+static PyObject *
+posix_fsync(PyObject *self, PyObject *args, PyObject *kwargs)
+{
+auto PyObject *fdobj;
+auto int full_fsync = 1;
+static char *keywords[] = {"fd", "full_fsync", NULL };
+
+if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|i", keywords,
+ &fdobj, &full_fsync))
+return NULL;
+
+/* See issue 11877 discussion */
+# if ((defined __APPLE__ && defined F_FULLFSYNC) || \
+  (defined __NetBSD__ && defined FDISKSYNC))
+if (full_fsync != 0) {
+int res, fd = PyObject_AsFileDescriptor(fdobj);
+if (fd < 0)
+return NULL;
+if (!_PyVerify_fd(fd))
+return posix_error();
+
+Py_BEGIN_ALLOW_THREADS
+#  if defined __APPLE__
+res = fcntl(fd, F_FULLFSYNC);
+#  elif defined __NetBSD__
+res = fsync_range(fd, FFILESYNC|FDISKSYNC, 0, 0);
+#  endif
+Py_END_ALLOW_THREADS
+
+if (res < 0)
+return posix_error();
+Py_INCREF(Py_None);
+return Py_None;
+} else
+# endif
+return posix_fildes(fdobj, fsync);
 }
 #endif /* HAVE_FSYNC */
 
@@ -9472,7 +9505,8 @@
 {"fchdir",  posix_fchdir, METH_O, posix_fchdir__doc__},
 #endif
 #ifdef HAVE_FSYNC
-{"fsync",   posix_fsync, METH_O, posix_fsync__doc__},
+{"fsync",   (PyCFunction)posix_fsync, METH_VARARGS|METH_KEYWORDS,
+posix_fsync__doc__},
 #endif
 #ifdef HAVE_SYNC
 {"sync",posix_sync, METH_NOARGS, posix_sync__doc__},
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9205] Parent process hanging in multiprocessing if children terminate unexpectedly

2011-05-07 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Here is an updated patch. Much of it consists of changes in the Windows 
Connection implementation, where I had to use overlapped I/O in order to use 
WaitForMultipleObjects on named pipes.

test_concurrent_futures sometimes blocks (under Windows), I'll try to debug.

--
nosy: +brian.curtin
versions:  -Python 2.7, Python 3.2
Added file: http://bugs.python.org/file21923/sentinels2.patch

___
Python tracker 

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



[issue11969] Can't launch multiproccessing.Process on methods

2011-05-07 Thread Jesse Noller

Jesse Noller  added the comment:

Do things like this in the REPL are known not to work. Things are not protected 
in the if __name__ block so we can import the script properly to run it.

--

___
Python tracker 

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



[issue11999] sporadic failure in test_mailbox

2011-05-07 Thread Steffen Daode Nurpmeso

Steffen Daode Nurpmeso  added the comment:

This tracker - sorry!
(I surely will try to write and offer a patch for the tracker,
but first i need to understand that mailbox.py jungle for
#11935, next week.)

--
title: sporadic failure in test_mailbox on FreeBSD -> sporadic failure in 
test_mailbox

___
Python tracker 

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



[issue11877] Change os.fsync() to support physical backing store syncs

2011-05-07 Thread Steffen Daode Nurpmeso

Steffen Daode Nurpmeso  added the comment:

On Sat,  7 May 2011 14:20:51 +0200, Charles-François Natali wrote:
> # ifdef __APPLE__
> res = fcntl(fd, F_FULLFSYNC);
> # endif
> # ifdef __NetBSD__
> res = fsync_range(fd, FFILESYNC|FDISKSYNC, 0, 0);
> # endif
> 
> Since __APPLE__ and __NetBSD__ are exclusive, you could use something like
> # if defined(__APPLE__)
> res = fcntl(fd, F_FULLFSYNC);
> # elif defined(__NetBSD__)
> res = fsync_range(fd, FFILESYNC|FDISKSYNC, 0, 0);
> # endif

Yes, you're right, i'll update the patch accordingly.

--
Steffen, sdaoden(*)(gmail.com)

--

___
Python tracker 

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



[issue11877] Change os.fsync() to support physical backing store syncs

2011-05-07 Thread Steffen Daode Nurpmeso

Steffen Daode Nurpmeso  added the comment:

On Sat,  7 May 2011 14:20:51 +0200, Charles-François Natali wrote:
> I really can't see a good reason for using it here (and
> anywhere, see http://c-faq.com/decl/auto.html).

You're right.

> Why are you using the "auto" storage class specifier? I know
> that "explicit is better than implicit"

Yup.  I'm doing what is happening for real in (x86) assembler.
Thus "auto" means (at a glance!) that this one will need space on
the stack.
(Conversely i'm not using "register" because who knows if that is
really true?  ;))

> Do you really need to use goto for such a simple code?

Yup.  Ok, this is more complicated.  The reason is that my funs
have exactly one entry point and exactly one place where they're
left.  This is because we here do manual instrumentalisation as in

ret
fun(args)
{
locals
s_NYD_ENTER;

assertions

...

jleave:
s_NYD_LEAVE;
return;

[maybe only, if large: possibly "predict-false" code blocks]

[possible error jumps here
goto jleave;]
}

We're prowd of that.  N(ot)Y(et)D(ead) is actually pretty cool,
i've used debuggers exactly 5 times in the past about ten years!
I don't even know exactly *how to use debuggers*.  8---} (NYD can
do backtracing, or, with NDEBUG and optional, profiling.)
A really good optimizing compiler will produce the very same code!
And i love nasm, but it's pretty non-portable.
But C is also nice.

But of course i can change this (in C) to simply use return, this
is easy here, no resources to be freed.

Thanks for looking at this, by the way.  :)

--

___
Python tracker 

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



[issue12027] Optimize import this (patch to make it 10x faster)

2011-05-07 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

That's a good one, but um, no not for 2.6, unless you can argue that a delay in 
obtaining the received wisdom of The Timbot is a serious security hole in 
Python.

Bag of ham.

--

___
Python tracker 

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



[issue11277] Crash with mmap and sparse files on Mac OS X

2011-05-07 Thread Nadeem Vawda

Nadeem Vawda  added the comment:

sdaoden> @Nadeem: note that the committed versions of the tests would not
sdaoden> show up the Mac OS X mmap() bug AFAIK, because there is an
sdaoden> intermediate .close() of the file to be mmapped.

Thanks for catching that. Should be fixed now.

haypo> I now agree Antoine: the test is useless. It can be removed today.
haypo>
haypo> About mmap: add a new test for this issue (mmap on Mac OS X and
haypo> F_FULLSYNC)  is a good idea.

Done and done.

haypo> I suppose that we will need to backport the F_FULLSYNC fix too.

It has already been backported, as changeset 618c3e971e80.

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

___
Python tracker 

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



[issue11999] sporadic failure in test_mailbox on FreeBSD

2011-05-07 Thread Steffen Daode Nurpmeso

Steffen Daode Nurpmeso  added the comment:

That's really a good one.
(In my eyes.)

--
title: sporadic failure in test_mailbox -> sporadic failure in test_mailbox on 
FreeBSD

___
Python tracker 

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



[issue11877] Change os.fsync() to support physical backing store syncs

2011-05-07 Thread Charles-François Natali

Charles-François Natali  added the comment:

> I'll attach 11877.4.diff

A couple comments:

static PyObject *
posix_fsync(PyObject *self, PyObject *args, PyObject *kwargs)
{
PyObject *retval = NULL;
auto PyObject *fdobj;
auto int full_fsync = 1;

Why are you using the "auto" storage class specifier? I know that "explicit is 
better than implicit", but I really can't see a good reason for using it here 
(and anywhere, see http://c-faq.com/decl/auto.html).

# ifdef __APPLE__
res = fcntl(fd, F_FULLFSYNC);
# endif
# ifdef __NetBSD__
res = fsync_range(fd, FFILESYNC|FDISKSYNC, 0, 0);
# endif

Since __APPLE__ and __NetBSD__ are exclusive, you could use something like
# if defined(__APPLE__)
res = fcntl(fd, F_FULLFSYNC);
# elif defined(__NetBSD__)
res = fsync_range(fd, FFILESYNC|FDISKSYNC, 0, 0);
# endif

Do you really need to use goto for such a simple code?

--

___
Python tracker 

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



[issue11277] Crash with mmap and sparse files on Mac OS X

2011-05-07 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 9b9f0de19684 by Nadeem Vawda in branch '2.7':
Issue #11277: Fix tests - crash will not trigger if the file is closed and 
reopened.
http://hg.python.org/cpython/rev/9b9f0de19684

New changeset b112c72f8c01 by Nadeem Vawda in branch '3.1':
Issue #11277: Fix tests - crash will not trigger if the file is closed and 
reopened.
http://hg.python.org/cpython/rev/b112c72f8c01

New changeset a9da17fcb564 by Nadeem Vawda in branch '3.2':
Merge: #11277: Fix tests - crash will not trigger if the file is closed and 
reopened.
http://hg.python.org/cpython/rev/a9da17fcb564

New changeset b3a94906c4a0 by Nadeem Vawda in branch 'default':
Merge: #11277: Fix tests - crash will not trigger if the file is closed and 
reopened.
http://hg.python.org/cpython/rev/b3a94906c4a0

--

___
Python tracker 

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



[issue12023] non causal behavior

2011-05-07 Thread R. David Murray

R. David Murray  added the comment:

In 3.x, yes (the nonlocal keyword).  Not in 2.7, though.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue11277] Crash with mmap and sparse files on Mac OS X

2011-05-07 Thread Steffen Daode Nurpmeso

Steffen Daode Nurpmeso  added the comment:

(Of course this may also be intentional, say.
But then i would vote against it :), because it's better the
tests bring out errors than end-user apps.)

--

___
Python tracker 

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



[issue12027] Optimize import this (patch to make it 10x faster)

2011-05-07 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

STINNER Victor wrote:
> 
> New submission from STINNER Victor :
> 
> Patch to optimize this: make it 10 times faster.
> 
> Try attached benchmark script. On a debug build I got the following results:
>  * original: 299.8 ms
>  * patched: 23.2 ms
> 
> I expected a factor of 10 because it uses a C implementation of rot13 instead 
> of an hand made Python implementation.

It's a bit late for an April 1st patch, but +1 for the fun of it :-)

--

___
Python tracker 

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



[issue11277] Crash with mmap and sparse files on Mac OS X

2011-05-07 Thread Steffen Daode Nurpmeso

Steffen Daode Nurpmeso  added the comment:

@Nadeem: note that the committed versions of the tests would not
show up the Mac OS X mmap() bug AFAIK, because there is an
intermediate .close() of the file to be mmapped.  The OS X bug is
that the VMS/VFS interaction fails to provide a valid memory
region for <>
- i.e. there is no true sparse file support as on Linux, which
simply uses references to a single COW zero page.
(I've not tried it out for real yet, but i'm foolish like a prowd
cock, so i've looked at the changeset :)

--

___
Python tracker 

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



[issue12016] Wrong behavior for '\xff\n'.decode('gb2312', 'ignore')

2011-05-07 Thread zy

zy  added the comment:

I do not have documents on this subject. Though, I found that GNU iconv(1) 
behaves the same as my proposed behavior. My reading of the source code 
suggests that iconv(1) treat all encodings equally, which I think should also 
be true for python.

As of security concerns, I do not think the change in decoding function itself 
would introduce any security vulnerabilities. If a security issue arises 
because of the proposed change, there must be improper code out side of python, 
which is out of python's control. That said, the proposed change is unlikely to 
introduce new security vulnerability, as all it does in effect is retaining a 
few ascii characters in the string to the output as opposed to removing.  In 
the issue of wordpress, if we suppose that wordpress was written in python, and 
that the attacker was using gb2312 encoded strings instead of gbk, then my 
proposed change would by chance fix the issue, as the backslash would be 
retained when we decode the string.

--

___
Python tracker 

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



[issue11277] Crash with mmap and sparse files on Mac OS X

2011-05-07 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 8d27d2b22394 by Nadeem Vawda in branch '2.7':
Issue #11277: Add tests for mmap crash when using large sparse files on OS X.
http://hg.python.org/cpython/rev/8d27d2b22394

--

___
Python tracker 

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



[issue11277] Crash with mmap and sparse files on Mac OS X

2011-05-07 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset d5d4f2967879 by Nadeem Vawda in branch '3.1':
Issue #11277: Add tests for mmap crash when using large sparse files on OS X.
http://hg.python.org/cpython/rev/d5d4f2967879

New changeset e447a68742e7 by Nadeem Vawda in branch '3.2':
Merge: #11277: Add tests for mmap crash when using large sparse files on OS X.
http://hg.python.org/cpython/rev/e447a68742e7

New changeset bc13badf10a1 by Nadeem Vawda in branch 'default':
Merge: #11277: Add tests for mmap crash when using large sparse files on OS X.
http://hg.python.org/cpython/rev/bc13badf10a1

--

___
Python tracker 

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



[issue11994] [2.7/gcc-4.4.3] Segfault under valgrind in string.split()

2011-05-07 Thread STINNER Victor

STINNER Victor  added the comment:

GCC does have bugs: see a recent example with a development version of GCC 4.6 
=> #9880 (the bug was fixed before the final release of GCC 4.6).

If you would like to go futher, you should open a bug report in GCC bug tracker 
(not in the Python bug tracker).

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue12028] threading._get_ident(): remove it in the doc and make it public

2011-05-07 Thread STINNER Victor

STINNER Victor  added the comment:

I think that threading._get_ident() is more reliable than 
threading.current_thread().ident because Thread.ident can be None in some cases.

--

___
Python tracker 

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



[issue8407] expose signalfd(2) and pthread_sigmask in the signal module

2011-05-07 Thread STINNER Victor

STINNER Victor  added the comment:

The threading has a function to get directly the identifier of the current 
thread: threading._get_ident() instead of threading.current_thread().ident. I 
think that threading._get_ident() is more reliable to 
threading.current_thread().ident because Thread.ident can be None in some 
cases. I created the issue #12028 to decide what to do with this function.

--

___
Python tracker 

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



[issue12028] threading._get_ident(): remove it in the doc and make it public

2011-05-07 Thread STINNER Victor

New submission from STINNER Victor :

I don't know why threading._get_ident() (which is _thread.get_ident()) is 
private: this function is safe.

This function becomes useful with pthread_kill() which will be added by #8407.

--
assignee: docs@python
components: Documentation, Library (Lib)
messages: 135441
nosy: docs@python, haypo
priority: normal
severity: normal
status: open
title: threading._get_ident(): remove it in the doc and make it public
versions: Python 3.3

___
Python tracker 

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



[issue8407] expose signalfd(2) and pthread_sigmask in the signal module

2011-05-07 Thread STINNER Victor

STINNER Victor  added the comment:

pending_signals-3.patch: doc nit, the link to Thread.ident doesn't work. The 
doc should be replaced by something like:
  
   *thread_id* can be read from the :attr:`~threading.Thread.ident` attribute   
   of a :class:`threading.Thread` object.  For example, 
   ``threading.current_thread().ident`` gives the identifier of the current 
   thread.

... but ident or Thread are not link, I don't know why.

--

___
Python tracker 

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



[issue8407] expose signalfd(2) and pthread_sigmask in the signal module

2011-05-07 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file21883/pending_signals.patch

___
Python tracker 

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



[issue8407] expose signalfd(2) and pthread_sigmask in the signal module

2011-05-07 Thread STINNER Victor

STINNER Victor  added the comment:

wakeup_signum.patch: simple patch to write the signal number (as a single byte) 
instead of just b'\x00' into the wake up file descriptor. It gives the ability 
to watch more than one signal and be able to know which one was raised. 
Included tests demonstrate the feature. The doc explains how to decode data 
written to the file descriptor.

--
Added file: http://bugs.python.org/file21922/wakeup_signum.patch

___
Python tracker 

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



[issue8407] expose signalfd(2) and pthread_sigmask in the signal module

2011-05-07 Thread STINNER Victor

STINNER Victor  added the comment:

About signalfd(): this patch doesn't provide any information or tool to decode 
data written to the file descriptor. We should expose the signalfd_siginfo 
structure or you cannot handle more than one signal (how do you know which 
signal numbers were raised?). Example with ctypes:

class signalfd_siginfo(Structure):
_fields_ = (
('ssi_signo', c_uint32),# Signal number
('ssi_errno', c_int32), # Error number (unused)
('ssi_code', c_int32),  # Signal code
('ssi_pid', c_uint32),  # PID of sender
('ssi_uid', c_uint32),  # Real UID of sender
('ssi_fd', c_int32),# File descriptor (SIGIO)
('ssi_tid', c_uint32),  # Kernel timer ID (POSIX timers)
('ssi_band', c_uint32), # Band event (SIGIO)
('ssi_overrun', c_uint32),  # POSIX timer overrun count
('ssi_trapno', c_uint32),   # Trap number that caused signal
('ssi_status', c_int32),# Exit status or signal (SIGCHLD)
('ssi_int', c_int32),   # Integer sent by sigqueue(2)
('ssi_ptr', c_uint64),  # Pointer sent by sigqueue(2)
('ssi_utime', c_uint64),# User CPU time consumed (SIGCHLD)
('ssi_stime', c_uint64),# System CPU time consumed (SIGCHLD)
('ssi_addr', c_uint64), # Address that generated signal
# (for hardware-generated signals)
('_padding', c_char * 46),  # Pad size to 128 bytes (allow for
# additional fields in the future)
)

--

___
Python tracker 

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



[issue8407] expose signalfd(2) and pthread_sigmask in the signal module

2011-05-07 Thread STINNER Victor

STINNER Victor  added the comment:

Note: we might expose pth_raise() which is similar to pthread_kill(), but... 
pth support was deprecated by the PEP 11 and pth support will be removed from 
Python 3.3 source code.

--

___
Python tracker 

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



[issue8407] expose signalfd(2) and pthread_sigmask in the signal module

2011-05-07 Thread STINNER Victor

STINNER Victor  added the comment:

> I mistakenly removed your pending_signals-2 patch
> I'm really sorry about this, could you re-post it?

No problem, anyway I worked on a new version in the train.

> So, if anything, you shouldn't check for a pending signal [in sigwait]

Right, fixed in the new patch.

--

pending_signals-3.patch:
 - don't check for pending signals in sigwait()
 - pthread_kill() doc: it is not a good idea to say that pthread_kill() with 
signum=0 can be used to check if a thread identifier is valid => such test does 
crash (SIGSEGV) on my Linux box. I changed the doc to say that it can be used 
to check if a thread is still running (which is different).
 - add a dedicated test for sigpending()
 - doc: explain how to get a thread identifier for pthread_kill()
 - don't compile pthread_kill() without threads: you cannot get a valid thread 
identifier without the _thread module

I think that the patch is ready to be commited. Anyone for a last review? 
(antoine, neologix?)

--
Added file: http://bugs.python.org/file21921/pending_signals-3.patch

___
Python tracker 

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



  1   2   >