[issue18892] sqlite3, valued records not persisted, default ones are

2013-08-31 Thread Heijink

New submission from Heijink:

In the end I tracked down the behaviour with the attached program
behaviour with an initially empty table:

7 : insert two records with values in the columns
two records show up, # 1,2
as expected
9 : show al records
none
whereas two are to be expected
8 : add records with default values
two records show up # 1,2
as expected in an empty table
7
two records # 3,4
record numbers as expected, but where are records 1,2?  (ABC)
9
the default records are present #1,2
the previous valued records 3,4 not
  unexpected, but identical to first behaviour issuing 7
8
4 records show up # 1-4
record numbers as expected when valued records are not present
0  :  I quit

to summarize:
It is not possible to store records in the database with valued columns.
Records with default values can be stored and retrieved, they are the ones that 
are persistent
Additional strange behaviour is that after adding valued records (3,4) also the 
already present records with default values (1,2) should have shown show up, 
remark (ABC).

--
components: Demos and Tools
files: dump.py
messages: 196617
nosy: debewerker
priority: normal
severity: normal
status: open
title: sqlite3, valued records not persisted, default ones are
type: behavior
versions: Python 3.2
Added file: http://bugs.python.org/file31531/dump.py

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



[issue11798] Test cases not garbage collected after run

2013-08-31 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Good catch!
That's because -R run the same test suite several times.
I'm working on patch.

--
resolution: fixed - 
status: closed - open

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



[issue18892] sqlite3, valued records not persisted, default ones are

2013-08-31 Thread R. David Murray

R. David Murray added the comment:

What happens if you actually call commit()?

--
nosy: +r.david.murray

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



[issue18892] sqlite3, valued records not persisted, default ones are

2013-08-31 Thread Heijink

Heijink added the comment:

your suggestion is a bit to cryptic for me
- you mean intermediate messages from Python: there are none
- you mean to change a command in another format
  newbie with programming experience
  drop me a program line / show three records where one is your alternative

--

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



[issue16853] add a Selector to the select module

2013-08-31 Thread Charles-François Natali

Charles-François Natali added the comment:

2013/8/31 Guido van Rossum rep...@bugs.python.org:
 But still I agree with Giampaolo that the decorator doesn't feel
 right. It's like a try/except around the entire body of your function,
 which is usually a code smell (even though I realize the exception it
 catches can only be raised by the syscall). Please go back to the
 explicit try/except returning [].

Well, I'll change it, but:
We have to change the select() docstring to Wait until some
registered file objects become ready, or for *at most* timeout
seconds

All user code that wants to handle EINTR or correct timeout (which
should be all user code in a perfect world) will have to wrap the
call to select() inside a loop equivalent to this decorator, and I
personally like the a rule of never let the user do what the library
can do for him.
This includes for example multiprocessing and telnetlib which
currently implement this EINTR handling loop with timeout computation,
see e.g.:
http://hg.python.org/cpython/file/acc7439b1406/Lib/telnetlib.py#l297

And other places in the stdlib either don't handle EINTR properly, or
don't re-compute timeout (see e.g. http://bugs.python.org/issue12338).

Also, I don't really see the problem with retrying upon EINTR, since:
- the signal handler will be called right away anyway
- in case where the select() is a part of an event loop, the event
loop registers a wakup file descriptor with the selector, which means
that upon interesting signal delivery, the select() call will return
to the schedulor

So in short, I don't see how that could be a nuisance, but I can
certainly see how this could trick user code into raising spurious
timeout-related errors, or be much more complicated than it ought to
be (the above telnetlib example is IMO a great example of why EINTR
and timeout computation should be handled at the selector level).

--

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



[issue18418] Thread.isAlive() sometimes True after fork

2013-08-31 Thread Charles-François Natali

Charles-François Natali added the comment:

 The final patch includes tests that are very reliable at
 revealing the bug in 2.7 and 3.3.

Indeed, I could reproduce it systematically without the patch.

 Thanks for accepting this patch!

Well, thanks for the patch!

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

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



[issue18892] sqlite3, valued records not persisted, default ones are

2013-08-31 Thread Peter Otten

Peter Otten added the comment:

David means you should replace the line

conn.commit

in your script which does not invoke the method with

conn.commit()

Side note: as long as you are a newbie it is a good idea to ask on the python 
mailing list first before adding a report to the bug tracker.

--
nosy: +peter.otten

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



[issue18892] sqlite3, valued records not persisted, default ones are

2013-08-31 Thread R. David Murray

R. David Murray added the comment:

Sorry, I didn't mean to be cryptic.  Yes, Peter has figured out what I was 
trying to say.

--

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



[issue16853] add a Selector to the select module

2013-08-31 Thread Charles-François Natali

Charles-François Natali added the comment:

Oh, and FWIW, that's also what Java does:

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5100121
http://hg.openjdk.java.net/jdk6/jdk6-gate/jdk/file/6daa81bdfd18/src/solaris/native/sun/nio/ch/PollArrayWrapper.c

(I know some people don't like Java, but I've found that they have
some really competent people and an extensive real-life exposure and
feedback).

--

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



[issue18888] Add stdlib support for random sampling with replacement

2013-08-31 Thread Mark Dickinson

Mark Dickinson added the comment:

This was already considered and rejected in issue18414.

--
nosy: +mark.dickinson, rhettinger
resolution:  - duplicate
status: open - closed
superseder:  - random.choices(seq, k)

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



[issue18808] Thread.join returns before PyThreadState is destroyed

2013-08-31 Thread Antoine Pitrou

Antoine Pitrou added the comment:

 I don't understand the need for all the indirections in the second
 patch.  Like, why use a weakref?  It's not like we have to worry about
 an immortal tstate keeping a measly little lock object alive forever,
 right?  Seems to me that if the tstate object held the new lock
 directly, the tstate destructor could release the lock directly (and
 so also skip the new tstate-on_delete and tstate-on_delete_data
 indirections too).

The problem is if the tstate holds the last reference to the lock. It
will destroy the lock at the end, but the lock could have weakrefs
attached to it with arbitrary callbacks. Those callbacks will run
without a current thread state and may crash. OTOH, this can't happen
with a private weakref.

You may suggest we only keep the Py_thread_lock in the tstate, rather
than the enclosing PyObject. But it has lifetime problems of its owns
(the Py_thread_lock doesn't have a refcount, and it is shared with a
PyObject who thinks it owns it and will destroy it on dealloc... adding
the necessary logic to circumvent this would make the final solution
more complicated than the weakref one).

 Then again, I'd settle for Py_EndInterpreter simply sleeping for a
 second and trying again when it finds another thread hanging around
 (effectively moving Tamas's sleep() into Py_EndInterpreter, but only
 sleeping if needed).  Yes, that's theoretically insecure.

Well, that sounds less predictable. Depending on machine load,
Py_EndInterpreter might succeed or crash with a fatal error. Users may
not like this :-)

 But if we're worried about wildly improbable timing problems, then the
 patched code can appear not to honor a non-None Thread.join()
 `timeout` argument too.  That is, the first call to the new `pred()`
 can theoretically consume any amount of time, due to its
 self._tstate_lock.acquire().

Ah, well, good point. It's weird it didn't get caught by the unit
tests... I'll take a look.

--

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



[issue18892] sqlite3, valued records not persisted, default ones are

2013-08-31 Thread Heijink

Heijink added the comment:

that did the trick, my confidence is restored.

sorry to have bothered you, I could have found in myself, by comparing 
differences. Just staring blind after many attempts. 
I did look in the list, but could not find an issue that matched my description 
of the problem.

I closed the subject

--
status: open - closed

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



[issue18893] typo in Lib/ctypes/macholib/dyld.py

2013-08-31 Thread Stefan Behnel

New submission from Stefan Behnel:

The exception handling clauses in framework_find() are weird.


def framework_find(fn, executable_path=None, env=None):

Find a framework using dyld semantics in a very loose manner.

Will take input such as:
Python
Python.framework
Python.framework/Versions/Current

try:
return dyld_find(fn, executable_path=executable_path, env=env)
except ValueError as e:
pass
fmwk_index = fn.rfind('.framework')
if fmwk_index == -1:
fmwk_index = len(fn)
fn += '.framework'
fn = os.path.join(fn, os.path.basename(fn[:fmwk_index]))
try:
return dyld_find(fn, executable_path=executable_path, env=env)
except ValueError:
raise e


My guess is that this is left-over code from Py2.x. Since it doesn't make sense 
to catch an exception in the second clause just to re-raise it, I think the 
intention was really to re-raise the original exception caught in the first 
clause, which no longer works that way in Py3.

The fix would then be to assign the exception to a new variable in the first 
except clause and re-raise that in the second.

I found this problem because Cython rejected the module with a compile error 
about e being undefined in the last line.

--
components: Library (Lib), ctypes
messages: 196629
nosy: scoder
priority: normal
severity: normal
status: open
title: typo in Lib/ctypes/macholib/dyld.py
type: behavior
versions: Python 3.2, Python 3.3, Python 3.4

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



[issue18893] typo in Lib/ctypes/macholib/dyld.py

2013-08-31 Thread Antoine Pitrou

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


--
nosy: +amaury.forgeotdarc, belopolsky, meador.inge

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



[issue18893] invalid exception handling in Lib/ctypes/macholib/dyld.py

2013-08-31 Thread Stefan Behnel

Stefan Behnel added the comment:

changing title as it doesn't really look like a typo, more a converto

--
title: typo in Lib/ctypes/macholib/dyld.py - invalid exception handling in 
Lib/ctypes/macholib/dyld.py

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



[issue18888] Add stdlib support for random sampling with replacement

2013-08-31 Thread Madison May

Madison May added the comment:

Whoops, my apologies.

--

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



[issue16853] add a Selector to the select module

2013-08-31 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

I may be missing something here but isn't the whole point of EINTR to interrupt 
a potentially long running syscall?
Why protract function return time as a consequence?
All the event loops I'm familiar with (twisted, tornado and asyncore) just 
'return' on EINTR, supposedly because that was the best compromise to support 
syscall interruption without forcing users to handle EINTR themselves.

--

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



[issue16853] add a Selector to the select module

2013-08-31 Thread Antoine Pitrou

Antoine Pitrou added the comment:

 I may be missing something here but isn't the whole point of EINTR to
 interrupt a potentially long running syscall?

Not exactly. The point is to signal (!) that a signal was received.
The received signal is not necessarily expected.

Also, from what I understand, it is more reliable to use a wakeup fd
(using e.g. signal.set_wakeup_fd) rather than expect EINTR to be
returned:
http://mail.python.org/pipermail/python-dev/2013-August/128204.html

--

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



[issue16853] add a Selector to the select module

2013-08-31 Thread Antoine Pitrou

Antoine Pitrou added the comment:

 All the event loops I'm familiar with (twisted, tornado and asyncore)
 just 'return' on EINTR, supposedly because that was the best
 compromise to support syscall interruption without forcing users to
 handle EINTR themselves.

What do you mean? Tornado simply retries on EINTR:
https://github.com/facebook/tornado/blob/master/tornado/ioloop.py#L652

--

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



[issue16853] add a Selector to the select module

2013-08-31 Thread Charles-François Natali

Charles-François Natali added the comment:

 I may be missing something here but isn't the whole point of EINTR to 
 interrupt a potentially long running syscall?

No.
EINTR is an artifact of the early Unix design, because failing when a
signal was delivered was simpler than restarting the syscall.
Nowadays, most syscalls are restarted by default (that's was true on
BSD, and nowadays Linux also follows this trend).
See e.g. http://lkml.indiana.edu/hypermail/linux/kernel/0104.0/0743.html
and http://man7.org/linux/man-pages/man7/signal.7.html

One reason why EINTR can occur so often in CPython is because we set
up signal handlers without SA_RESTART (which is set by default by
signal(3)). The reason is likely that we want the syscall to return to
be able to call PyCheckSignals() (since we cannot run Python code from
a signal handler).
But since in this case, PyCheckSignals() is called anyway from the
main eval loop, signal handlers will still be run in a timely manner
(and as noted, the proper way to handle signals is to use a wakeup
file descriptor which can be used by select()).

--

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



[issue12304] expose signalfd(2) in the signal module

2013-08-31 Thread Antoine Pitrou

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


--
versions: +Python 3.4 -Python 3.3

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



[issue18843] Py_FatalError (msg=0x7f0e3b373232 bad leading pad byte) at Python-2.7.5/Python/pythonrun.c:1689

2013-08-31 Thread Martin Mokrejs

Martin Mokrejs added the comment:

So with your test program I did not yet hit the error. It used in the end 1.3GB 
of RAM, maybe in the good region. while this was python-2.7.5 configures as 
--without-pymalloc maybe the output from valgrind becomes more useful.

--
Added file: http://bugs.python.org/file31532/stress.valgrind.stderr

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



[issue18831] importlib.import_module() bypasses builtins.__import__

2013-08-31 Thread Brett Cannon

Brett Cannon added the comment:

builtins.__import__ and importlib.__import__ are different objects.

This isn't about whether this is whole situation is a bug per-se, but whether 
users expect that overriding builtins.__import__ will affect all import-related 
code in the stdlib and if that's reasonable.

--

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



[issue18843] Py_FatalError (msg=0x7f0e3b373232 bad leading pad byte) at Python-2.7.5/Python/pythonrun.c:1689

2013-08-31 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Hardware failures or glitches can involve any number of parameters.
Instead of trying to reproduce the memory corruption with other Python 
programs, I would suggest you run the exact same workload (including Python 
version and build options) on another computer (preferably with different 
hardware characteristics) and see if you can still trigger it.

(bonus points if you can try on a setup with ECC RAM)

--
nosy: +pitrou

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



[issue17741] event-driven XML parser

2013-08-31 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1faaec66c73d by Eli Bendersky in branch 'default':
Fix XMLPullParser documentation to say non-blocking instead of asynchronous.
http://hg.python.org/cpython/rev/1faaec66c73d

--

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



[issue18738] String formatting (% and str.format) issues with Enum

2013-08-31 Thread Eli Bendersky

Eli Bendersky added the comment:

The idea looks reasonable. Posted a code review.

--

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



[issue16853] add a Selector to the select module

2013-08-31 Thread Guido van Rossum

Guido van Rossum added the comment:

 Charles-François Natali added the comment:

 Well, I'll change it, but:
 We have to change the select() docstring to Wait until some
 registered file objects become ready, or for *at most* timeout
 seconds

Doesn't sound so bad to me. It's about the same guarantee as sleep().

 All user code that wants to handle EINTR or correct timeout (which
 should be all user code in a perfect world) will have to wrap the
 call to select() inside a loop equivalent to this decorator, and I
 personally like the a rule of never let the user do what the library
 can do for him.

No, they'll use a framework with an event loop like Tulip that takes
care of all of this for them. Such frameworks all have logic in them
to handle early returns from the low-level select/poll operation.

I find it easier to reason about the correctness of the framework's
code without your decorator:

(1) I have to convince myself that the code wrapped by your decorator
doesn't change any global state, *or* that there is a guarantee that
the exception caught is only raised by the select()/poll()/etc.
syscall, not anywhere else in the wrapped method.

(2) I have to remember that if a signal handler is called that
modifies the event loop's deadline, the selector will return
immediately anyway (so the event loop can recalculate its deadline)
because of the self-pipe.

(3) I have to prove that your decorator uses the same clock as my framework.

(4) I have to prove that your code does the same thing if the process
is suspended for a really long time and the system clock changes in
the meantime.

 This includes for example multiprocessing and telnetlib which
 currently implement this EINTR handling loop with timeout computation,
 see e.g.:
 http://hg.python.org/cpython/file/acc7439b1406/Lib/telnetlib.py#l297

 And other places in the stdlib either don't handle EINTR properly, or
 don't re-compute timeout (see e.g. http://bugs.python.org/issue12338).

 Also, I don't really see the problem with retrying upon EINTR, since:
 - the signal handler will be called right away anyway
 - in case where the select() is a part of an event loop, the event
 loop registers a wakup file descriptor with the selector, which means
 that upon interesting signal delivery, the select() call will return
 to the schedulor

 So in short, I don't see how that could be a nuisance, but I can
 certainly see how this could trick user code into raising spurious
 timeout-related errors, or be much more complicated than it ought to
 be (the above telnetlib example is IMO a great example of why EINTR
 and timeout computation should be handled at the selector level).

The selector is a helper for higher-level frameworks. I think the
EINTR handling belongs in the framework.

--

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



[issue18623] Factor out the _SuppressCoreFiles context manager

2013-08-31 Thread Valerie Lambert

Valerie Lambert added the comment:

Running through both your scripts on my machine (using Ubuntu) WCOREDUMP is 
always True (though I'll only be able to find a core file when ulimit is set to 
unlimited, as expected).

Because there doesn't seem to be a good way to test this, I've cut the test 
from the patch. Is there anything else that this patch should address?

--
Added file: http://bugs.python.org/file31533/issue-18623_v4.patch

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



[issue18889] test_sax: multiple failures on Windows desktop

2013-08-31 Thread Antoine Pitrou

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


--
components: +Tests
stage: commit review - patch review

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



[issue18889] test_sax: multiple failures on Windows desktop

2013-08-31 Thread Antoine Pitrou

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


--
nosy: +serhiy.storchaka

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



[issue18889] test_sax: multiple failures on Windows desktop

2013-08-31 Thread Antoine Pitrou

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


--
nosy: +brian.curtin

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



[issue18889] test_sax: multiple failures on Windows desktop

2013-08-31 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Why Lib/test/xmltestdata/test.xml.out contains '\r'? AFAIK Windows buildbots 
are happy with current tests.

A nitpick for first proposed solution: you can append .replace(b'\r', b'') 
just to f.read().

A nitpick for second proposed solution: encoding should be iso-8859-1 (for 
both open() and encode()).

--

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



[issue18891] Master patch for content manager addtion to email package.

2013-08-31 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
nosy: +serhiy.storchaka

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



[issue18823] Idle: use pipes instead of sockets to talk with user subprocess

2013-08-31 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
nosy: +serhiy.storchaka

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



[issue18894] In unittest.TestResult.failures remove deprecated fail* methods

2013-08-31 Thread py.user

New submission from py.user:

http://docs.python.org/3/library/unittest.html#unittest.TestResult.failures

--
assignee: docs@python
components: Documentation
files: issue.diff
keywords: patch
messages: 196644
nosy: docs@python, py.user
priority: normal
severity: normal
status: open
title: In unittest.TestResult.failures remove deprecated fail* methods
type: enhancement
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file31534/issue.diff

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



[issue18895] In unittest.TestResult.addError split the sentence

2013-08-31 Thread py.user

New submission from py.user:

http://docs.python.org/3/library/unittest.html#unittest.TestResult.addError

--
assignee: docs@python
components: Documentation
files: issue.diff
keywords: patch
messages: 196645
nosy: docs@python, py.user
priority: normal
severity: normal
status: open
title: In unittest.TestResult.addError split the sentence
type: enhancement
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file31535/issue.diff

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



[issue18882] Add threading.main_thread() function

2013-08-31 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
components: +Library (Lib)
nosy: +serhiy.storchaka
stage:  - patch review
type:  - enhancement

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



[issue18885] handle EINTR in the stdlib

2013-08-31 Thread Gregory P. Smith

Gregory P. Smith added the comment:

FYI - use the changes made in http://bugs.python.org/issue12268 as a guide for 
how to deal with EINTR properly at the C level.  See the _PyIO_trap_eintr() 
function for example.

See also _eintr_retry_call() in Lib/subprocess.py.

FWIW, there are times when we *want* the interrupted system call to return 
control to Python rather than retrying the call.  If someone is making a Python 
equivalent of the low level system call such as select() or poll(), the EINTR 
should be exposed for Python code to handle.

Things like time.sleep() are documented as sleeping for less time when a signal 
has arrived even though an exception may not be raised. People have written 
code which depends on this behavior so adding an EINTR retry for the remaining 
sleep time would break some programs.

Getting an EINTR errno does *not* mean you can simply retry the system calls 
with the exact same arguments.  ie: If you did that with the select() call 
within time.sleep it'd be trivial to make the process sleep forever by sending 
it signals with a frequency less than the sleep time.

--
nosy: +gregory.p.smith

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



[issue18885] handle EINTR in the stdlib

2013-08-31 Thread Guido van Rossum

Changes by Guido van Rossum gu...@python.org:


--
nosy: +gvanrossum

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



[issue18885] handle EINTR in the stdlib

2013-08-31 Thread Charles-François Natali

Charles-François Natali added the comment:

Gregory, thanks, that's what I was planning to do.

But since the recent discussions (mainly on selectors), there are points I 
obviously don't - and won't - agree with (such as select() returning EINTR or 
returning early, same for sleep()), I'm not interested in this anymore.
Anyone interested can pick this up, though.

(BTW, as for applications relying on EINTR being returned, I'm positive *way 
more applications* will break because of the recent change making file 
descriptors close-on-exec by default).

--

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



[issue18885] handle EINTR in the stdlib

2013-08-31 Thread Charles-François Natali

Changes by Charles-François Natali cf.nat...@gmail.com:


--
nosy:  -neologix

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



[issue18885] handle EINTR in the stdlib

2013-08-31 Thread Antoine Pitrou

Antoine Pitrou added the comment:

 FWIW, there are times when we *want* the interrupted system call to
 return control to Python rather than retrying the call.

I'm a bit curious, do you know of any use cases?

 If someone is making a Python equivalent of the low level system call
 such as select() or poll(), the EINTR should be exposed for Python
 code to handle.

As mentioned in another issue, you would use a special wakeup fd to
wakeup select() or poll() calls.

 Getting an EINTR errno does *not* mean you can simply retry the system
 calls with the exact same arguments.  ie: If you did that with the
 select() call within time.sleep it'd be trivial to make the process
 sleep forever by sending it signals with a frequency less than the
 sleep time.

Indeed. That's already done in e.g. socketmodule.c : take a look at the
BEGIN_SELECT_LOOP / END_SELECT_LOOP macros.

--

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



[issue16853] add a Selector to the select module

2013-08-31 Thread Charles-François Natali

Charles-François Natali added the comment:

Here's a patch returning [] on EINTR.

I've tested it on Linux, Windows, FreeBSD, OpenSolaris and OS-X.

--
Added file: http://bugs.python.org/file31536/selectors-15.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16853
___diff -r 78f3c32a92ce Doc/library/selectors.rst
--- /dev/null   Thu Jan 01 00:00:00 1970 +
+++ b/Doc/library/selectors.rst Sat Aug 31 17:47:17 2013 +0200
@@ -0,0 +1,229 @@
+:mod:`selectors` -- High-level I/O multiplexing
+===
+
+.. module:: selectors
+   :synopsis: High-level I/O multiplexing.
+
+.. versionadded:: 3.4
+
+
+Introduction
+
+
+This module allows high-level and efficient I/O multiplexing, built upon the
+:mod:`select` module primitives. Users are encouraged to use this module
+instead, unless they want precise control over the OS-level primitives used.
+
+It defines a :class:`BaseSelector` abstract base class, along with several
+concrete implementations (:class:`KqueueSelector`, :class:`EpollSelector`...),
+that can be used to wait for I/O readiness notification on multiple file
+objects. In the following, file object refers to any object with a
+:meth:`fileno()` method, or a raw file descriptor. See :term:`file object`.
+
+:class:`DefaultSelector` is an alias to the most efficient implementation
+available on the current platform: this should be the default choice for most
+users.
+
+.. note::
+   The type of file objects supported depends on the platform: on Windows,
+   sockets are supported, but not pipes, whereas on Unix, both are supported
+   (some other types may be supported as well, such as fifos or special
+   devices).
+
+.. seealso::
+
+   :mod:`select`
+   Low-level I/O multiplexing module.
+
+
+Classes
+---
+
+Classes hierarchy::
+
+   BaseSelector
+   +-- SelectSelector
+   +-- PollSelector
+   +-- EpollSelector
+   +-- KqueueSelector
+
+
+In the following, *events* is a bitwise mask indicating which I/O events should
+be waited for on a given file object. It can be a combination of the constants
+below:
+
+   +---+---+
+   | Constant  | Meaning   |
+   +===+===+
+   | :const:`EVENT_READ`   | Available for read|
+   +---+---+
+   | :const:`EVENT_WRITE`  | Available for write   |
+   +---+---+
+
+
+.. class:: SelectorKey
+
+   A :class:`SelectorKey` is a :class:`~collections.namedtuple` used to
+   associate a file object to its underlying file decriptor, selected event
+   mask and attached data. It is returned by several :class:`BaseSelector`
+   methods.
+
+   .. attribute:: fileobj
+
+  File object registered.
+
+   .. attribute:: fd
+
+  Underlying file descriptor.
+
+   .. attribute:: events
+
+  Events that must be waited for this file object.
+
+   .. attribute:: data
+
+  Optional opaque data associated to this file object: for example, this
+  could be used to store per-client session.
+
+
+.. class:: BaseSelector
+
+   A :class:`BaseSelector` is used to wait for I/O event readiness on multiple
+   file objects. It supports file stream registration, unregistration, and a
+   method to wait for I/O events on those streams, with an optional timeout.
+   It's an abstract base class, so cannot be instanciated. Use
+   :class:`DefaultSelector` instead, or one of :class:`SelectSelector`,
+   :class:`KqueueSelector` etc. if you want to specifically use an
+   implementation, and your platform supports it.
+   :class:`BaseSelector` and its concrete implementations support the context
+   manager protocol.
+
+   .. method:: register(fileobj, events, data=None)
+
+  Register a file object for selection, monitoring it for I/O events.
+
+  *fileobj* is the file object to monitor
+  *events* is a bitwise mask of events to monitor
+  *data* is an opaque object
+
+  This returns a new :class:`SelectorKey` instance, or raises a
+  :exc:`ValueError` in case of invalid event mask or file descriptor, or
+  :exc:`KeyError` if the file object is already registered.
+
+   .. method:: unregister(fileobj)
+
+  Unregister a file object from selection, removing it from monitoring.
+
+  *fileobj* must be a file object previously registered.
+
+  This returns the associated :class:`SelectorKey` instance, or raises a
+  :exc:`KeyError` if the file object is not registered.
+
+   .. method:: modify(fileobj, events, data=None)
+
+  Change a registered file object monitored events or attached data.
+
+  This is equivalent to 

[issue18831] importlib.import_module() bypasses builtins.__import__

2013-08-31 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Adding something like '(not builtins.__import__)' or '(different from 
builtins.__import__') after 'importlib.__import__' should reduce the 
possibility of confusing the two and expecting something that will not happen.

You might check the doc for (builtins.)__import__ to make sure it does not 
promise anything that is no longer true.

What happens if people monkeypatch importlib.__import__?

--

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



[issue16853] add a Selector to the select module

2013-08-31 Thread Antoine Pitrou

Antoine Pitrou added the comment:

 Here's a patch returning [] on EINTR.

Hmm... Shouldn't it simply let the InterruptedError bubble up?
I know there's the sleep() precedent, but I find it a bit embarassing actually: 
the call can return early, but there's no way for the caller to know that it 
returned early.

--

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



[issue18780] SystemError when formatting int subclass

2013-08-31 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 33727fbb4668 by Ethan Furman in branch 'default':
Close #18780: %-formatting now prints value for int subclasses with %d, %i, and 
%u codes.
http://hg.python.org/cpython/rev/33727fbb4668

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

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



[issue18885] handle EINTR in the stdlib

2013-08-31 Thread Guido van Rossum

Guido van Rossum added the comment:

On Sat, Aug 31, 2013 at 9:56 AM, Charles-François Natali
rep...@bugs.python.org wrote:

 Charles-François Natali added the comment:

 Gregory, thanks, that's what I was planning to do.

 But since the recent discussions (mainly on selectors), there are points I 
 obviously don't - and won't - agree with (such as select() returning EINTR or 
 returning early, same for sleep()), I'm not interested in this anymore.

Whoa. Maybe you're overreacting a bit? I personally see a big divide
here between system calls whose functionality includes sleeping (e.g.
sleep(), poll(), select()) and those that just want some I/O to
complete (e.g. recv(), send(), read(), write()). The former are almost
always used in a context that can handle premature returns just fine,
since the return value for a premature return is the same as for
hitting the deadline, and the timeout is often used just as a hint
anyway. It's the latter category (recv() etc.) where the EINTR return
is problematic, and I think for many of those the automatic retry
(after the Python-level signal handler has been run and conditional on
it not raising an exception) will be a big improvement.

 Anyone interested can pick this up, though.

 (BTW, as for applications relying on EINTR being returned, I'm positive *way 
 more applications* will break because of the recent change making file 
 descriptors close-on-exec by default).

Again, I'd make a distinction: I agree for send(), recv() etc., but I
don't think there are many buggy uses of select()/poll() timeouts
around. (And even if there are, I still think it's better to fix these
by correcting the retry logic in the framework or the application,
since it may have other considerations.)

--

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



[issue16853] add a Selector to the select module

2013-08-31 Thread Guido van Rossum

Guido van Rossum added the comment:

Hm... I like the [] return just fine, it matches what Tulip's selector did.  
The framework should be re-checking the clock anyway -- it's possible that 
select() returned late too...

--

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



[issue18889] test_sax: multiple failures on Windows desktop

2013-08-31 Thread Terry J. Reedy

Terry J. Reedy added the comment:

As I said on #12037, I would rather \r was not in the file. I do not know if it 
is present in the master repository or added by hg when cloning.

Buildbots and developer desktops are different environments. The tests must 
work on both.

Nit 1: right, I should have seen that. On #12037, I originally did the 
conversion in the test call.

Nit 2: why? The test passes as is.

Please pick a solution, test it on non-Windows if you can, and apply it so I 
can have the test suite pass on Windows after I apply a patch.

--

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



[issue18843] Py_FatalError (msg=0x7f0e3b373232 bad leading pad byte) at Python-2.7.5/Python/pythonrun.c:1689

2013-08-31 Thread Tim Peters

Tim Peters added the comment:

Someone may find the new stress.valgrind.stderr interesting, but - since I've 
never used valgrind - it doesn't mean much to me.

I _expected_ you'd run the little stress program under a debug Python and 
without valgrind, since that's the only combination you've tried so far that 
showed a definite problem (pad leading pad byte death, or the segfault in the 
other issue you filed).

But it doesn't much matter - this is all just thrashing at random, yes?  You 
need to find a reproducible test case, and/or try different hardware.  The 
little stress program may or may not provoke an error under a debug-build 
Python, and may or may not require increasing N (to consume more RAM).

If it does provoke an error, the next thing to try would be to write a little 
program that just writes 0xfb across a massive number of bytes, and then reads 
them all to verify they're still 0xfb.  Or write one like that now, and 
preferably in C (it may matter how quickly the bytes are written - and it may 
not matter).  But at this point youj're starting to write your own 
memory-testing program.

In any case, there's really no evidence of an error in Python so far.  Yes, 
Python has _detected_ a problem in some cases.  But without a reproducible test 
case, I don't see that there's anything more we can do for you on our end - 
sorry.

--

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



[issue18843] Py_FatalError (msg=0x7f0e3b373232 bad leading pad byte) at Python-2.7.5/Python/pythonrun.c:1689

2013-08-31 Thread Stephen J. Turnbull

Stephen J. Turnbull added the comment:

I did emerge =dev-lang/python-2.7.5-r1 *twice* with the environment 
configuration described in msg196520, then *once* with it disabled because one 
of the cases you described was when you tried to revert to a non-debug Python.  
(Besides, I am willing to risk your crash while I'm watching for it, but not a 
time bomb that will go off when I'm on deadline :-).  All builds succeeded and 
all passed the test suite.  Here's how the debug build describes itself:

== CPython 2.7.5 (default, Sep 1 2013, 00:59:02) [GCC 4.6.4] 
==   Linux-3.9.0-x86_64-Dual_Core_AMD_Opteron-tm-_Processor_265-with-gentoo-2.2 
little-endian 

The test suite ran uneventfully (with a few DeprecationWarnings) except for 
this:

6 skips unexpected on linux2: 
test_bsddb test_bsddb3 test_tcl test_tk test_ttk_guionly 
test_ttk_textonly 

but I suppose that is expected on Gentoo.  If any of those modules (bsddb, tcl, 
tk) are built into your Python, a problem in one of those might be the culprit.

Oh, damn.  I just reread the whole thread.  For some reason I thought you were 
using gcc 4.6.4, but now I see you report 4.7.3.  OK build with 4.7.3 and your 
flags (also restore the --with-pydebug config):

# export CFLAGS= -ggdb -pipe -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 
-msse4 -mavx -maes -mpclmul -mpopcnt
# export CXXFLAGS=${CFLAGS}
# export CC=gcc-4.7.3

and we crash (from make output) immediately after linking ./python:

x86_64-pc-linux-gnu-ranlib libpython2.7.a 
gcc-4.7.3 -pthread -Wl,--hash-style=gnu -Wl,-O1 -Wl,--as-needed -L. -Xlinker 
-export-dynamic -o python \ 
Modules/python.o \ 
-L. -lpython2.7 -lpthread -ldl  -lutil   -lm   
LD_LIBRARY_PATH=/var/tmp/portage/dev-lang/python-2.7.5-r1/work/x86_64-pc-linux-gnu:
 ./python -E -S -m sysconfig --generate-posix-vars 
make: *** [pybuilddir.txt] Illegal instruction 

However, I'm pretty sure this is due to my hardware not liking your -m flags, 
not the crash you reported.  I'll try backing those flags out, but if anybody 
has a suggestion for the most aggressive set similar to yours, I'd appreciate 
it.

But first this process is going to go sleep(25200).

--

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



[issue18882] Add threading.main_thread() function

2013-08-31 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Ok, some comments about the patch (no review links appears so I'm gonna do it 
inline here):

- the doc addition needs a versionadded tag

- The main thread is the thread that the OS creates to run application.: I 
would rephrase this In normal conditions, the main thread is the thread from 
which the Python interpreter was started.

- in the tests:
+self.assertEqual(data, Thread-1\nTrue\nTrue\n)

Hmm, how do you know it will be called Thread-1?
I would give a specific name to the Thread, so as to make the test 
deterministic.

+self.assertEqual(rc, 0)

You don't need this, it is already ensured by assert_python_ok().

- in threading.py, why doesn't _exitfunc() reuse the _main_thread global 
variable, instead of taking it as a parameter?

--

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



[issue11798] Test cases not garbage collected after run

2013-08-31 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 868ad6fa8e68 by Andrew Svetlov in branch 'default':
Temporary disable tests cleanup (issue 11798).
http://hg.python.org/cpython/rev/868ad6fa8e68

--

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



[issue18896] Remove namedtuple 255 arguments restriction

2013-08-31 Thread Alori

New submission from Alori:

Named tuples offer a useful mix of features from both dict and tuple data 
structures. However, unlike dictionaries and tuples, Named tuples are only 
allowed to hold up to 255 items.

This behavior seems inconsistent and un-Pythonic.
Is there a way to remove this restriction? Why not set a much higher limit?

Also see:
http://grokbase.com/t/python/python-ideas/109hbv63sv/new-3-x-restriction-on-number-of-keyword-arguments#responses_tab_top

http://stackoverflow.com/questions/18550270/any-way-to-bypass-namedtuple-255-arguments-limitation

--
messages: 196660
nosy: valorien
priority: normal
severity: normal
status: open
title: Remove namedtuple 255 arguments restriction
type: enhancement
versions: Python 3.3

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



[issue18885] handle EINTR in the stdlib

2013-08-31 Thread Gregory P. Smith

Gregory P. Smith added the comment:

I wrote too many words.  In short:

time.sleep()'s behavior should remain as it is today given how it is documented 
to behave.  If you disagree, consider adding an optional interruptable=False 
parameter so that both behavior options exist.

ALL IO calls and wait* should handle EINTR transparently for the user and never 
expose it to the Python application.

select(), poll() and equivalents.  If you want to transparently handle EINTR on 
these, just make sure you deal with the timeouts properly.  While I suspect a 
few people wanted to see the signal interruption on those I agree: very 
uncommon and undesirable for most.

If people need a specific signal interruption they should define a signal 
handler that raises.

--

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



[issue17276] HMAC: deprecate default hash

2013-08-31 Thread Gregory P. Smith

Gregory P. Smith added the comment:

comments added to the review.

I don't think a DeprecationWarning should be raised as that'll infuriate users 
of python programs more than developers who can fix code.

--

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



[issue18808] Thread.join returns before PyThreadState is destroyed

2013-08-31 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Ok, here is a new patch observing the timeout parameter. I've changed the 
implementation strategy a bit, it seems hopefully sane.

There's a remaining (slightly bordeline) issue: the thread state lock isn't 
reinitialized on fork(). Should it?

--
Added file: http://bugs.python.org/file31537/threadstate_join_2.patch

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



[issue18885] handle EINTR in the stdlib

2013-08-31 Thread Giampaolo Rodola'

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


--
nosy: +giampaolo.rodola

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



[issue18896] Remove namedtuple 255 arguments restriction

2013-08-31 Thread Giampaolo Rodola'

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


--
nosy: +giampaolo.rodola

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



[issue18896] Remove namedtuple 255 arguments restriction

2013-08-31 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I'll let Raymond give his answer here, but namedtuples are meant as lightweight 
structures or records (if you know C, think struct), not arbitrary containers.

--
nosy: +pitrou, rhettinger

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



[issue11798] Test cases not garbage collected after run

2013-08-31 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Er... your latest commit broke this issue's own tests!

--
nosy: +pitrou

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



[issue12304] expose signalfd(2) in the signal module

2013-08-31 Thread Giampaolo Rodola'

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


--
nosy: +giampaolo.rodola

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



[issue18100] socket.sendall() cannot send buffers of 2GB or more

2013-08-31 Thread Giampaolo Rodola'

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


--
nosy: +giampaolo.rodola

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



[issue18876] Problems with files opened in append mode with io module

2013-08-31 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Thanks for the patch. It looks mostly ok.
Could you sign a contributor agreement so that we can move forward?
http://www.python.org/psf/contrib/

--

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



[issue18896] Remove namedtuple 255 arguments restriction

2013-08-31 Thread Alori

Alori added the comment:

@pitrou:
Thank you for your answer.
I agree they should not replace databases or files, but I think 255 is just way 
too lightweight. It feels unnatural to have this limitation for no specific 
reason. 

Recently, I've seen a lot of solutions that emulate the namedtuple 
functionality with some classes in order to workaround this issue, but they all 
feel forced and require some unsavory hacks.

I think namedtuple is one the most useful structures in the language, and like 
tuples and dicts, shouldn't be limited by design.

--

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



[issue18780] SystemError when formatting int subclass

2013-08-31 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 833246d42825 by Ethan Furman in branch 'default':
Issue #18780: code cleanup.
http://hg.python.org/cpython/rev/833246d42825

--

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



[issue18489] IDLE Unit test for SearchEngine.py

2013-08-31 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4179e2312089 by Terry Jan Reedy in branch '2.7':
Issue #18489: Add complete, gui-free tests for idlelib.SearchEngine.
http://hg.python.org/cpython/rev/4179e2312089

New changeset dfbf0f9034cc by Terry Jan Reedy in branch '3.3':
Issue #18489: Add complete, gui-free tests for idlelib.SearchEngine.
http://hg.python.org/cpython/rev/dfbf0f9034cc

New changeset 7605847c15a4 by Terry Jan Reedy in branch 'default':
Merge from 3.3 #18489 Search Engine tests
http://hg.python.org/cpython/rev/7605847c15a4

--

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



[issue18489] IDLE Unit test for SearchEngine.py

2013-08-31 Thread Terry J. Reedy

Terry J. Reedy added the comment:

By masking mock Text.index with instance functions, I removed the need for 
tk.Text and hence the tests are gui free.

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

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



[issue18831] importlib.import_module() bypasses builtins.__import__

2013-08-31 Thread Brett Cannon

Brett Cannon added the comment:

help(__import__) doesn't mention anything about overriding the function. I 
already touched up the stdlib docs for builtins.__import__ to strongly advise 
you don't override the function.

As for overriding importlib.__import__, it won't do anything; the code for 
importlib.import_module() cuts through the cruft in __import__ that is unneeded 
and skips straight to the relevant code.

--

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



[issue18808] Thread.join returns before PyThreadState is destroyed

2013-08-31 Thread Tim Peters

Tim Peters added the comment:

I'm getting a headache now - LOL ;-)  Thanks for the explanation!

What I still don't understand:  the new lock is an internal implementation 
detail.  How would it gain a weakref with a callback?  Users aren't going to 
mess with this lock, and if you want to stop Python maintainers from giving it 
a weakref with a callback, simply say they shouldn't do that (in the code 
comments) - you could even add code verifying it doesn't have any weakrefs 
outstanding (although that would likely be a waste of time and code:  no 
maintainer is going to _want_ to make a weakref to it, let alone a weakref with 
a callback).

My concern is the bulk and obscurity of this code, all to plug such a minor 
hole.  I call it minor because it's been reported once in the history of the 
project, and Tamas wormed around it with a 1-liner (added a sleep).

Granted, it's much harder to fix for real and when most of the interpreter 
has been destroyed ;-)

--

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



[issue12037] test_email failures under Windows with the eol extension activated

2013-08-31 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f0eedca4b2a2 by Terry Jan Reedy in branch '3.3':
Issue #12037: Fix test_email for desktop Windows.
http://hg.python.org/cpython/rev/f0eedca4b2a2

--
nosy: +python-dev

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



[issue12037] test_email failures under Windows with the eol extension activated

2013-08-31 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5600e9a5c35d by Terry Jan Reedy in branch 'default':
Issue #12037: Fix test_email for desktop Windows.
http://hg.python.org/cpython/rev/5600e9a5c35d

--

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



[issue12037] test_email failures under desktop Windows

2013-08-31 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


--
resolution:  - fixed
stage: commit review - committed/rejected
status: open - closed
title: test_email failures under Windows with the eol extension activated - 
test_email failures under desktop Windows

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



[issue18831] importlib.import_module() bypasses builtins.__import__

2013-08-31 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Looking at the actual doc:
importlib.__import__(name, globals=None, locals=None, fromlist=(), level=0) An 
implementation of the built-in __import__() function.

I think this is pretty clear that builtin.__import__ has no effect unless 
directly called.

importlib.import_module(name, package=None)...The import_module() function 
acts as a simplifying wrapper around importlib.__import__().

The word 'wrapper' implies that import_module calls __import__, but you say it 
currently does not. So if you want to keep the code as is, I would change 'acts 
as a simplifying wrapper around' to 'is a simplified version of', which makes 
no promises.

Do you really want people to directly call importlib.__import__? If not, maybe 
the nearly empty entry should be deleted and the entry for import_module 
changed to make no reference to it.

--

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



[issue18738] String formatting (% and str.format) issues with Enum

2013-08-31 Thread Ethan Furman

Ethan Furman added the comment:

Final (hopefully ;) patch attached.  Thanks, Eli, for your comments and help.

--
Added file: http://bugs.python.org/file31538/issue18738.stoneleaf.04.patch

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



[issue18738] String formatting (% and str.format) issues with Enum

2013-08-31 Thread Ethan Furman

Ethan Furman added the comment:

Thanks, Eric, for teaching me a bunch about format.  :)

--

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



[issue18720] Switch suitable constants in the socket module to IntEnum

2013-08-31 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 038543d34166 by Eli Bendersky in branch 'default':
Switch the AF_* and SOCK_* constants in the socket module to IntEnum.
http://hg.python.org/cpython/rev/038543d34166

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

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



[issue18738] String formatting (% and str.format) issues with Enum

2013-08-31 Thread Ethan Furman

Ethan Furman added the comment:

Okay, the final final patch.  ;)

--
Added file: http://bugs.python.org/file31539/issue18738.stoneleaf.05.patch

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



[issue18720] Switch suitable constants in the socket module to IntEnum

2013-08-31 Thread Ethan Furman

Ethan Furman added the comment:

Eli Bendersky added the comment:

 Another issue is _intenum_converter. Ethan - do you think it belongs in the 
 enum module as a helper function or something of the sort?

I'm fine with it being a non-public member of enum, although if we had a place 
for miscellaneous tools that might be a 
better spot for it.

--

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



[issue18730] suffix parameter in NamedTemporaryFile silently fails when not prepending with a period

2013-08-31 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4d604f1f0219 by Eli Bendersky in branch 'default':
Update whatsnew/3.4.rst wrt. the socket constants switch to IntEnum
http://hg.python.org/cpython/rev/4d604f1f0219

--
nosy: +python-dev

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



[issue18720] Switch suitable constants in the socket module to IntEnum

2013-08-31 Thread Eli Bendersky

Eli Bendersky added the comment:

On Sat, Aug 31, 2013 at 3:18 PM, Ethan Furman rep...@bugs.python.orgwrote:


 Ethan Furman added the comment:

 Eli Bendersky added the comment:
 
  Another issue is _intenum_converter. Ethan - do you think it belongs in
 the enum module as a helper function or something of the sort?

 I'm fine with it being a non-public member of enum, although if we had a
 place for miscellaneous tools that might be a
 better spot for it.


For the time being, I'm OK with Guido's suggestion to keep it lazy. As long
as it's just being used in a single module, there's not much to think
about. If we end up needing it when switching other modules, we'll see what
to do.

--

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



[issue18738] String formatting (% and str.format) issues with Enum

2013-08-31 Thread Eli Bendersky

Eli Bendersky added the comment:

lgtm

--

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



[issue18897] Illegal instruction at Python-2.7.5/Modules/_sre.c:1173

2013-08-31 Thread Martin Mokrejs

New submission from Martin Mokrejs:

I was trying to use DUMA to find errors in python runtime and it indeed killed 
python-based utility called emerge. Let's see what you say now:

# export LD_PRELOAD=/usr/lib64/libduma.so.0.0.0
# sysctl -w vm.max_map_count=100

# emerge dev-lang/python:2.7 
DUMA 2.5.15 (shared library, NO_LEAKDETECTION)
Copyright (C) 2006 Michael Eddington medding...@gmail.com
Copyright (C) 2002-2008 Hayati Ayguen h_ayg...@web.de, Procitec GmbH
Copyright (C) 1987-1999 Bruce Perens br...@perens.com

DUMA 2.5.15 (shared library, NO_LEAKDETECTION)
Copyright (C) 2006 Michael Eddington medding...@gmail.com
Copyright (C) 2002-2008 Hayati Ayguen h_ayg...@web.de, Procitec GmbH
Copyright (C) 1987-1999 Bruce Perens br...@perens.com

DUMA 2.5.15 (shared library, NO_LEAKDETECTION)
Copyright (C) 2006 Michael Eddington medding...@gmail.com
Copyright (C) 2002-2008 Hayati Ayguen h_ayg...@web.de, Procitec GmbH
Copyright (C) 1987-1999 Bruce Perens br...@perens.com


DUMA Aborting: mprotect() failed: Cannot allocate memory.
Check README section 'MEMORY USAGE AND EXECUTION SPEED'
  if your (Linux) system may limit the number of different page mappings per 
process
Illegal instruction (core dumped)
# ulimit -a
core file size  (blocks, -c) unlimited
data seg size   (kbytes, -d) unlimited
scheduling priority (-e) 0
file size   (blocks, -f) unlimited
pending signals (-i) 127104
max locked memory   (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files  (-n) 1024
pipe size(512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority  (-r) 0
stack size  (kbytes, -s) 8192
cpu time   (seconds, -t) unlimited
max user processes  (-u) 127104
virtual memory  (kbytes, -v) unlimited
file locks  (-x) unlimited
#

(gdb) where
#0  0x7febd6ed84d7 in kill () from /lib64/libc.so.6
#1  0x7febd78e2f9c in DUMA_Abort () from /usr/lib64/libduma.so.0.0.0
#2  0x7febd78e1b77 in _duma_allocate () from /usr/lib64/libduma.so.0.0.0
#3  0x7febd78e1fef in _duma_malloc () from /usr/lib64/libduma.so.0.0.0
#4  0x7febd7626c60 in sre_umatch (state=0x7fff96f0de10, 
pattern=0x7feb2804ecb8) at 
/mnt/1TB/var/tmp/portage/dev-lang/python-2.7.5-r2/work/Python-2.7.5/Modules/_sre.c:1173
#5  0x7febd762932f in pattern_match (self=0x7feb2804ec58, 
args=(u'=gnome-base/libbonobo-2.32::gentoo-haskell',), kw=0x0) at 
/mnt/1TB/var/tmp/portage/dev-lang/python-2.7.5-r2/work/Python-2.7.5/Modules/_sre.c:1896
#6  0x7febd751ffcc in PyCFunction_Call (func=built-in method match of 
_sre.SRE_Pattern object at remote 0x7feb2804ec58, 
arg=(u'=gnome-base/libbonobo-2.32::gentoo-haskell',), kw=0x0) at 
/mnt/1TB/var/tmp/portage/dev-lang/python-2.7.5-r2/work/Python-2.7.5/Objects/methodobject.c:85
#7  0x7febd75c4b81 in call_function (pp_stack=0x7fff96f0e6d0, oparg=1) at 
/mnt/1TB/var/tmp/portage/dev-lang/python-2.7.5-r2/work/Python-2.7.5/Python/ceval.c:4021
#8  0x7febd75bf6c6 in PyEval_EvalFrameEx (f=Frame 0x7feb374ebce8, for file 
/usr/lib64/portage/pym/portage/dep/__init__.py, line 1227, in __init__ 
(self=Atom(blocker=False, eapi=None) at remote 0x7fea931d5fb0, 
s=u'=gnome-base/libbonobo-2.32::gentoo-haskell', unevaluated_atom=None, 
allow_wildcard=True, allow_repo=True, _use=None, eapi=None, is_valid_flag=None, 
eapi_attrs=_eapi_attrs at remote 0x7feb31931f48, atom_re=_sre.SRE_Pattern at 
remote 0x7feb2804ec58, blocker_prefix=u'', blocker=False), throwflag=0) at 
/mnt/1TB/var/tmp/portage/dev-lang/python-2.7.5-r2/work/Python-2.7.5/Python/ceval.c:2666

[cut]

(gdb) bt full
#0  0x7febd6ed84d7 in kill () from /lib64/libc.so.6
No symbol table info available.
#1  0x7febd78e2f9c in DUMA_Abort () from /usr/lib64/libduma.so.0.0.0
No symbol table info available.
#2  0x7febd78e1b77 in _duma_allocate () from /usr/lib64/libduma.so.0.0.0
No symbol table info available.
#3  0x7febd78e1fef in _duma_malloc () from /usr/lib64/libduma.so.0.0.0
No symbol table info available.
#4  0x7febd7626c60 in sre_umatch (state=0x7fff96f0de10, 
pattern=0x7feb2804ecb8) at 
/mnt/1TB/var/tmp/portage/dev-lang/python-2.7.5-r2/work/Python-2.7.5/Modules/_sre.c:1173
end = 0x7fea931cfffc
alloc_pos = 1648
ctx_pos = 1648
i = 128
ret = 0
jump = 2
sigcount = 187
ctx = 0x7fea931fbcf8
nextctx = 0x7fea931fbcf8
__PRETTY_FUNCTION__ = sre_umatch
#5  0x7febd762932f in pattern_match (self=0x7feb2804ec58, 
args=(u'=gnome-base/libbonobo-2.32::gentoo-haskell',), kw=0x0) at 
/mnt/1TB/var/tmp/portage/dev-lang/python-2.7.5-r2/work/Python-2.7.5/Modules/_sre.c:1896
state = {ptr = 0x7fea931cffbc, beginning = 0x7fea931cff50, start = 
0x7fea931cff50, end = 0x7fea931cfffc, string = 
u'=gnome-base/libbonobo-2.32::gentoo-haskell', pos = 0, endpos = 43, charsize 
= 4, lastindex = 2, 

[issue18897] Illegal instruction at Python-2.7.5/Modules/_sre.c:1173

2013-08-31 Thread Martin Mokrejs

Martin Mokrejs added the comment:

To a naive user two places with numbers are in the stacktrace:

size = -1282872823

and
instr_ub = -1
instr_lb = 0
instr_prev = -1

--

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



[issue18897] Illegal instruction at Python-2.7.5/Modules/_sre.c:1173

2013-08-31 Thread Antoine Pitrou

Antoine Pitrou added the comment:

This is a malloc() failure, not a Python bug (DUMA Aborting: mprotect() 
failed: Cannot allocate memory).

Line 1173 in _sre.c allocates a fixed-sized structure (SRE_REPEAT):

ctx-u.rep = (SRE_REPEAT*) PyObject_MALLOC(sizeof(*ctx-u.rep));

That structure is probably 32 bytes long in 64-bit mode.

--
nosy: +haypo, pitrou
resolution:  - invalid
status: open - closed

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



[issue18738] String formatting (% and str.format) issues with Enum

2013-08-31 Thread Eric V. Smith

Eric V. Smith added the comment:

Looks good to me, too. Thanks for considering all of the feedback!

--

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



[issue18897] Illegal instruction at Python-2.7.5/Modules/_sre.c:1173

2013-08-31 Thread Martin Mokrejs

Martin Mokrejs added the comment:

I was actually printing every 10 seconds how much memory it was using, the last 
before got killed was:

  PIDVSZ   RSS TIME ELAPSED %CPU %MEM COMMAND
 4097 4938188 2445712 00:22:4425:04 90.7 15.0 /usr/bin/python2.7 
/usr/bin/emerge dev-lang/python:2.7

Provided I have 16GB RAM then maybe it was really some limit in the Bourne 
shell or OS which prevented DUMA to obtain more memory. But my own python-based 
app can can grow to even 12GB RSS on this computer so I wonder what limit would 
be the cause. Probably some overhead due to DUMA.



I increased shell limits and looks it can continue further so far:

vostro crashtest # ulimit -l unlimited
vostro crashtest # ulimit -s unlimited
vostro crashtest # ulimit -i unlimited
vostro crashtest # 
vostro crashtest # ulimit -a
core file size  (blocks, -c) unlimited
data seg size   (kbytes, -d) unlimited
scheduling priority (-e) 0
file size   (blocks, -f) unlimited
pending signals (-i) unlimited
max locked memory   (kbytes, -l) unlimited
max memory size (kbytes, -m) unlimited
open files  (-n) 1024
pipe size(512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority  (-r) 0
stack size  (kbytes, -s) unlimited
cpu time   (seconds, -t) unlimited
max user processes  (-u) 127104
virtual memory  (kbytes, -v) unlimited
file locks  (-x) unlimited
#


Currently the emerge through DUMA is at:

  PIDVSZ   RSS TIME ELAPSED %CPU %MEM COMMAND
 9528 6121764 3041960 00:34:1656:05 61.1 18.6 /usr/bin/python2.7 
/usr/bin/emerge dev-lang/python:2.7

and still continues ...


Sorry, should better read the main STDERR output before diving into gdb 
stacktraces. I thought those negative numbers are a true sign of an error. ;)

--

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



[issue18897] Illegal instruction at Python-2.7.5/Modules/_sre.c:1173

2013-08-31 Thread Tim Peters

Tim Peters added the comment:

Note this line in your first post:

DUMA Aborting: mprotect() failed: Cannot allocate memory.

Python never calls mprotect(), but DUMA() probably does.  Also note what it 
said after that:

   Check README section 'MEMORY USAGE AND EXECUTION SPEED'
   if your (Linux) system may limit the number of different page
   mappings per process

That is, it may be a limitation of your kernel.

In any case, there's no Python issue here, so closing this.

--
nosy: +tim.peters
stage:  - committed/rejected

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



[issue17628] str==str: compare the first character before calling memcmp()

2013-08-31 Thread Martin Mokrejs

Martin Mokrejs added the comment:

Regarding benchmarking and code performance inspection, maybe you want to try 
on your linux box:

perf top
perf stat /usr/bin/python mytest.py

http://perf.wiki.kernel.org/

--
nosy: +mmokrejs

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



[issue18843] Py_FatalError (msg=0x7f0e3b373232 bad leading pad byte) at Python-2.7.5/Python/pythonrun.c:1689

2013-08-31 Thread Stephen J. Turnbull

Stephen J. Turnbull added the comment:

OK, I backed off the aggressive CFLAGS/CXXFLAGS to  -ggdb -pipe, and ran 
emerge =dev-lang/python-2.7.5-r1 *once* each with and without the 
'EXTRA_ECONF=--with-pydebug' flag.  Compiled with GCC 4.7.3.

No crash, same test results as described previously for GCC 4.6.4.

If you have other suggestions, let me know.

--

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



[issue18835] Add aligned memory variants to the suite of PyMem functions/macros

2013-08-31 Thread Raymond Hettinger

Changes by Raymond Hettinger raymond.hettin...@gmail.com:


--
title: Add aligned memroy variants to the suite of PyMem functions/macros - 
Add aligned memory variants to the suite of PyMem functions/macros

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



[issue18835] Add aligned memroy variants to the suite of PyMem functions/macros

2013-08-31 Thread Raymond Hettinger

Raymond Hettinger added the comment:

 Adding yet another API to allocate memory has a cost

Please don't FUD this one to death.  Aligned memory access is sometimes 
important and we currently have no straight-forward way to achieve it.  If 
you're truly worried about adding single new function to the public C API, we 
can create  just a single internal function:  void 
*PyMem_RawMallocAligned(size_t size, size_t alignment).

 aligning every data structure on a cacheline boundary 
 doesn't sound like a very good idea

We don't have to align EVERY data structure.  But I do have immediate 
beneficial use cases for set tables and for data blocks in deque objects.  I 
need this function and would appreciate your help in fitting it in nicely with 
the current memory management functions and macros.

--

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



[issue18835] Add aligned memory variants to the suite of PyMem functions/macros

2013-08-31 Thread Raymond Hettinger

Changes by Raymond Hettinger raymond.hettin...@gmail.com:


--
Removed message: http://bugs.python.org/msg196692

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



[issue18835] Add aligned memory variants to the suite of PyMem functions/macros

2013-08-31 Thread Raymond Hettinger

Raymond Hettinger added the comment:

 Adding yet another API to allocate memory has a cost

Please don't FUD this one to death.  Aligned memory access is sometimes 
important and we currently have no straight-forward way to achieve it.  If 
you're truly worried about adding single new function to the public C API, we 
can create  just a single internal function:  void * 
_PyMem_RawMallocAligned(size_t size, size_t alignment).

 aligning every data structure on a cacheline boundary 
 doesn't sound like a very good idea

We don't have to align EVERY data structure.  But I do have immediate 
beneficial use cases for set tables and for data blocks in deque objects.  I 
need this function and would appreciate your help in fitting it in nicely with 
the current memory management functions and macros.

--

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



[issue18843] Py_FatalError (msg=0x7f0e3b373232 bad leading pad byte) at Python-2.7.5/Python/pythonrun.c:1689

2013-08-31 Thread Tim Peters

Tim Peters added the comment:

Thanks for that, Stephen!  I don't know of anything else you could try that 
would be helpful.  The OP doesn't appear able to reproduce his problems either, 
and last I heard he was off running `emerge` under DUMA:

http://duma.sourceforge.net/

Why?  Hope springs eternal ;-)

--

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



[issue18843] Py_FatalError (msg=0x7f0e3b373232 bad leading pad byte) at Python-2.7.5/Python/pythonrun.c:1689

2013-08-31 Thread Stephen J. Turnbull

Stephen J. Turnbull added the comment:

Yeah, hope is a good thing.  But I've spent the last 20 years debugging an X11 
application based on a Lisp interpreter, I save hope for fireflies, my dog, and 
my daughter these days. :-)

To the OP:

I don't follow Gentoo closely, but I have acquaintances who do.  Between them 
and the occasional foray into the forums, I've gotten the impression that 
providing CFLAGS for optimization is associated with having hard-to-debug 
problems.  They increase performance noticably only in a few applications.  
Python being a  dynamic language, function calls and even variable references 
can be quite inefficient anyway.  So I see no good reason to compile Python 
with aggressive CFLAGS, because it should be used only for moderately 
performance sensitive applications and as glue code and to provide UI.  
Instead, use them only for the specific applications that benefit (I suppose 
matplotlib *might* be one).

Second, I tend to agree with the maintainers.  The packages.env / pydebug.conf 
approach is the right thing for this kind of variant build.

Third, you said you hoped to get better backtraces from --with-pydebug.  That's 
a vain hope.  Such options are intended to get better backtraces of C code from 
coredumps where the interpreter breaks down, not of Python code induced by 
Python exceptions caused by problems in user code.  If you have trouble 
interpreting a backtrace, ask on python-l...@python.org or comp.lang.python 
(they mirror each other, you only need one).  If, after understanding the 
backtrace, you have an idea for way to get a better backtrace in this case, you 
can suggest it on python-id...@python.org.

Unfortunately, reporting this backtrace is unintelligible, please improve it 
as an RFE on the tracker is likely to get the reply You're right, but we don't 
know how at this time.  Patches welcome!  But you could try that if all else 
fails.

--

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



[issue18335] Add textwrap.dedent, .indent, as str methods.

2013-08-31 Thread Martin Panter

Martin Panter added the comment:

If this goes ahead, would a bytes.dedent() method be also considered? I 
recently discovered that textwrap.dedent() does not work on bytes() in Python 
3. I would have used it for the contents of an input file in a test case.

For the record there’s an older issue 1237680 on this, rejected in 2005.

--
nosy: +vadmium

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



[issue18738] String formatting (% and str.format) issues with Enum

2013-08-31 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 058cb219b3b5 by Ethan Furman in branch 'default':
Close #18738:  Route __format__ calls to mixed-in type for mixed Enums (such as 
IntEnum).
http://hg.python.org/cpython/rev/058cb219b3b5

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

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



[issue18745] Test enum in test_json is ignorant of infinity value

2013-08-31 Thread Ethan Furman

Ethan Furman added the comment:

Fixed formatting in patch.  ;)

--
Added file: http://bugs.python.org/file31541/issue18745.stoneleaf.02.patch

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



[issue18896] Remove namedtuple 255 arguments restriction

2013-08-31 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
nosy: +r.david.murray

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



  1   2   >