[issue1164] tp_print slots don't release the GIL

2007-09-15 Thread Armin Rigo

Armin Rigo added the comment:

We need to start from PyFile_WriteString() and PyFile_WriteObject()
and PyObject_Print(), which are what the PRINT_* opcodes use, and make
sure there is no single fprintf() or fputs() that occurs with the GIL
held.  It is not enough to fix a few places that could clearly write a
lot of data, because even if there is just one place left where the GIL
is not released it could be precisely where the OS decides to block,
causing a deadlock.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1165] Should itertools.count work for arbitrary integers?

2007-09-15 Thread Eduardo Padoan

New submission from Eduardo Padoan:

Currently, itertools.count.__next__ checks wether the current value is >
PY_SSIZE_T_MAX and raises OverflowError if so. Shouldn't the value be
stored as "long", at least in Py3k? Not that I have any use case for it,
so it is minor.

--
components: Library (Lib)
messages: 55927
nosy: eopadoan
severity: minor
status: open
title: Should itertools.count work for arbitrary integers?
type: behavior
versions: Python 3.0

__
Tracker <[EMAIL PROTECTED]>

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



[issue1165] Should itertools.count work for arbitrary integers?

2007-09-15 Thread Eric S. R-eyyyy-mond

Eric S. R-e-mond added the comment:

Hi guys.

--
assignee:  -> esr
nosy: +esr

__
Tracker <[EMAIL PROTECTED]>

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



[issue1165] Should itertools.count work for arbitrary integers?

2007-09-15 Thread Eric S. R-eyyyy-mond

Changes by Eric S. R-e-mond:


--
severity: minor -> critical

__
Tracker <[EMAIL PROTECTED]>

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



[issue1165] Should itertools.count work for arbitrary integers?

2007-09-15 Thread Eric S. R-eyyyy-mond

Changes by Eric S. R-e-mond:


--
keywords: +r-eyyy-mond

__
Tracker <[EMAIL PROTECTED]>

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



[issue1165] Should itertools.count work for arbitrary integers?

2007-09-15 Thread Eric S. R-eyyyy-mond

Changes by Eric S. R-e-mond:


--
versions: +3rd party, Python 2.1.1, Python 2.1.2, Python 2.2, Python 2.2.1, 
Python 2.2.2, Python 2.2.3, Python 2.3, Python 2.4, Python 2.5, Python 2.6

__
Tracker <[EMAIL PROTECTED]>

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



[issue1165] Should itertools.count work for arbitrary integers?

2007-09-15 Thread Eric S. R-eyyyy-mond

Changes by Eric S. R-e-mond:


--
type: behavior -> compile error

__
Tracker <[EMAIL PROTECTED]>

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



[issue1165] Should itertools.count work for arbitrary integers?

2007-09-15 Thread Eric S. R-eyyyy-mond

Changes by Eric S. R-e-mond:


--
dependencies: +--install-base not honored on win32
type: compile error -> behavior
versions:  -3rd party, Python 2.1.1, Python 2.1.2, Python 2.2, Python 2.2.1, 
Python 2.2.2, Python 2.2.3, Python 2.3, Python 2.4, Python 2.5, Python 2.6

__
Tracker <[EMAIL PROTECTED]>

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



[issue1165] Should itertools.count work for arbitrary integers?

2007-09-15 Thread Eric S. R-eyyyy-mond

Changes by Eric S. R-e-mond:


--
dependencies: + Elemental Security contribution - pgen2 package

__
Tracker <[EMAIL PROTECTED]>

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



[issue1166] NameError when calling malloc

2007-09-15 Thread Eric S. R-eyyyy-mond

New submission from Eric S. R-e-mond:

I tried this code, and it blew up in my face.

>>> foo = malloc(4096)
NameError: name 'malloc' is not defined

Why?

--
components: Library (Lib)
keywords: r-eyyy-mond
messages: 55929
nosy: esr
priority: high
severity: normal
status: open
title: NameError when calling malloc
type: behavior
versions: Python 2.4

__
Tracker <[EMAIL PROTECTED]>

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



[issue1164] tp_print slots don't release the GIL

2007-09-15 Thread Guido van Rossum

Guido van Rossum added the comment:

Plese do submit a patch.

FWIW I think it's solved in Py3k, the tp_print slot is dead (as is any
use of the C stdio library).

--
nosy: +gvanrossum

__
Tracker <[EMAIL PROTECTED]>

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



[issue1164] tp_print slots don't release the GIL

2007-09-15 Thread Brett Cannon

Changes by Brett Cannon:


--
versions: +Python 2.6

__
Tracker <[EMAIL PROTECTED]>

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



[issue1164] tp_print slots don't release the GIL

2007-09-15 Thread Brett Cannon

Brett Cannon added the comment:

Since I already did this once I just did a more thorough job; patch is
attached.

PyObject_WriteString() just calls PyFile_WriteObject() which ends up
using PyObject_Print(), so it is was simple to handle those cases.  I
then released the GIL for strings, lists, and ints.  That is enough to
pass Armin's deadlock test.

If the approach I am taking is OK with people and I can go through
Object/*.c and do the proper thing for all the various object types for
fprintf(), fputs(), fputc() and fwrite() (while skipping all of the
debug output stuff) before committing the changes.

__
Tracker <[EMAIL PROTECTED]>

__

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



[issue1164] tp_print slots don't release the GIL

2007-09-15 Thread Brett Cannon

Changes by Brett Cannon:


--
keywords: +patch

__
Tracker <[EMAIL PROTECTED]>

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



[issue1134] Parsing a simple script eats all of your memory

2007-09-15 Thread Alexey Suda-Chen

Alexey Suda-Chen added the comment:

--- tokenizer.c (revision 58161)
+++ tokenizer.c (working copy)
@@ -402,6 +402,8 @@
if (allocated) {
Py_DECREF(bufobj);
}
+  Py_XDECREF(tok->decoding_buffer);
+  tok->decoding_buffer = 0;
return s;

--
nosy: +alexeychen

__
Tracker <[EMAIL PROTECTED]>

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



[issue1165] Should itertools.count work for arbitrary integers?

2007-09-15 Thread Martin v. Löwis

Changes by Martin v. Löwis:


--
assignee: esr -> 

__
Tracker <[EMAIL PROTECTED]>

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



[issue1165] Should itertools.count work for arbitrary integers?

2007-09-15 Thread Martin v. Löwis

Changes by Martin v. Löwis:


--
keywords: +patch -r-eyyy-mond

__
Tracker <[EMAIL PROTECTED]>

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



[issue1165] Should itertools.count work for arbitrary integers?

2007-09-15 Thread Martin v. Löwis

Changes by Martin v. Löwis:


--
dependencies:  - Elemental Security contribution - pgen2 package, 
--install-base not honored on win32

__
Tracker <[EMAIL PROTECTED]>

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



[issue1165] Should itertools.count work for arbitrary integers?

2007-09-15 Thread Martin v. Löwis

Changes by Martin v. Löwis:


--
keywords: +py3k -patch

__
Tracker <[EMAIL PROTECTED]>

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



[issue1166] NameError when calling malloc

2007-09-15 Thread Martin v. Löwis

Martin v. Löwis added the comment:

I doubt you are esr, although I'm uncertain how you hijacked his account.

Please stop spamming this tracker.

--
nosy: +loewis
resolution:  -> invalid
status: open -> closed

__
Tracker <[EMAIL PROTECTED]>

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



[issue1134] Parsing a simple script eats all of your memory

2007-09-15 Thread Brett Cannon

Brett Cannon added the comment:

Note the patch is inlined in a message.

--
keywords: +patch, py3k
nosy: +brett.cannon

__
Tracker <[EMAIL PROTECTED]>

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



[issue1164] tp_print slots don't release the GIL

2007-09-15 Thread Guido van Rossum

Guido van Rossum added the comment:

Looks Good, except I think it's a bad idea to release/acquire the GIL
for each character when writing the repr() of a string.  Given that the
string is immutable and its refcount kept alive by the caller I don't
see a reason why you can't just reference the object without holding the
GIL.  (Also you might want to copy the size into a local variable, it
won't change...)

__
Tracker <[EMAIL PROTECTED]>

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



[issue1165] Should itertools.count work for arbitrary integers?

2007-09-15 Thread Paul F. Dubois

Changes by Paul F. Dubois:


__
Tracker <[EMAIL PROTECTED]>

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



[issue1165] Should itertools.count work for arbitrary integers?

2007-09-15 Thread Paul F. Dubois

Changes by Paul F. Dubois:


--
nosy:  -esr

__
Tracker <[EMAIL PROTECTED]>

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



[issue1164] tp_print slots don't release the GIL

2007-09-15 Thread Brett Cannon

Brett Cannon added the comment:

Good point.  I changed it on my machine and it cut that whole section
down to a single release/acquire.

I will go ahead and do this for the other types and then upload another
patch to be reviewed when it's ready.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1164] tp_print slots don't release the GIL

2007-09-15 Thread Brett Cannon

Brett Cannon added the comment:

OK, every PyTypeObject in Objects and Modules has its tp_print release
the GIL.  Once someone OKs the patch I will apply it.

__
Tracker <[EMAIL PROTECTED]>

__

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



[issue1727780] 64/32-bit issue when unpickling random.Random

2007-09-15 Thread sligocki

Changes by sligocki:


--
versions: +Python 2.5 -Python 2.4

_
Tracker <[EMAIL PROTECTED]>

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



[issue1727780] 64/32-bit issue when unpickling random.Random

2007-09-15 Thread sligocki

sligocki added the comment:

I've had this same problem with 2.5.1

Pickling random.getstate() on 64bit and then loading it back with
random.setstate() on 32bit does not work (crashes because of trying cast
64bit ints to 32bit).

The other way around is even worse. It loads but is in a faulty state,
where for example:
>>> random.randrange(1000)
49801980494

This seems like a bug to me.

--
nosy: +sligocki

_
Tracker <[EMAIL PROTECTED]>

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



[issue1167] gdbm/ndbm 1.8.1+ needs libgdbm_compat.so

2007-09-15 Thread Ian Kelly

New submission from Ian Kelly:

The ndbm functions in gdbm 1.8.1+ require the gdbm_compat library in
addition to gdbm.

--
components: Build, Extension Modules
files: gdbm_ndbm.diff
messages: 55939
nosy: ikelly
severity: normal
status: open
title: gdbm/ndbm 1.8.1+ needs libgdbm_compat.so
type: compile error
versions: Python 2.5, Python 2.6, Python 3.0

__
Tracker <[EMAIL PROTECTED]>

__

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