[issue4443] Python/pystate.c:561 :PyGILState: The assertion 'autoInterpreterState' has failed

2008-11-27 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment:

The assertion is clear if you open the source code (Python/pystate.c,
line 561):

assert(autoInterpreterState); /* Py_Initialize() hasn't been called! */

Does your code make sure that the python interpreter is initialized?

--
nosy: +amaury.forgeotdarc

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4444] unittest - use contexts to assert exceptions

2008-11-27 Thread David Leonard

New submission from David Leonard <[EMAIL PROTECTED]>:

Patch to allow unit tests to test for exceptions through a 'with' 
statement. Resulting (failing) test would look like this:

  import unittest

  class T(unittest.TestCase):
 def runTest(self):
with self.assertRaises(KeyError):
   raise ValueError

This saves having to put exception raising tests into a try/except 
block, which is cool. And by cool I mean totally sweet.

--
components: Library (Lib)
files: unittest.patch
keywords: patch
messages: 76492
nosy: dleonard0
severity: normal
status: open
title: unittest - use contexts to assert exceptions
type: feature request
versions: Python 3.0
Added file: http://bugs.python.org/file12138/unittest.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4438] Add an easy way to __import___ submodules

2008-11-27 Thread Mart Sõmermaa

Mart Sõmermaa <[EMAIL PROTECTED]> added the comment:

Corrections and clarifications:

 * I'd say labeling the patch naive and "breaking things" was misleading
(there was a breakage that resulted from stale files with incorrect
permissions from my previous build of Python 2.6; after a make distclean
all tests passed as described above). The patch is correct and
backwards-compatible in Python level, but it introduces a change in the
C API:

 PyAPI_FUNC(PyObject *) PyImport_ImportModuleLevel(char *name,
-   PyObject *globals, PyObject *locals, PyObject *fromlist, int level);
+   PyObject *globals, PyObject *locals, PyObject *fromlist,
+   int level, char submodule);


 * The patch was made against Python 2.6 release source.

 * The argument is named 'submodule' instead of 'toplevel' to avoid
confusion with 'level'.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4445] String allocations waste 3 bytes of memory on average.

2008-11-27 Thread Mark Dickinson

Mark Dickinson <[EMAIL PROTECTED]> added the comment:

Updated patch: fix overflow checks to use offsetof instead of sizeof as 
well.

Added file: http://bugs.python.org/file12141/string_alloc.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4445] String allocations waste 3 bytes of memory on average.

2008-11-27 Thread Mark Dickinson

Changes by Mark Dickinson <[EMAIL PROTECTED]>:


Removed file: http://bugs.python.org/file12140/string_alloc.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4426] UTF7 decoding is far too strict

2008-11-27 Thread Nick Barnes

Nick Barnes <[EMAIL PROTECTED]> added the comment:

I'll try to get to this next week.  Right now I'm snowed under.  I don't
promise to do any refactoring.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4443] Python/pystate.c:561 :PyGILState: The assertion 'autoInterpreterState' has failed

2008-11-27 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment:

> Py_Initialize(); 
> Py_Main(7, arg1);
> Py_Finalize();

This seems correct... unless two threads run this function at the same
time. Can you ensure that this is not the case?

It seems to me that a simple call to 
   system("python /home/olpc/copy-to-Journal.py [other-args-here]") 
would be better...

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4443] Python/pystate.c:561 :PyGILState: The assertion 'autoInterpreterState' has failed

2008-11-27 Thread LuisC

LuisC <[EMAIL PROTECTED]> added the comment:

Hi Amaury, thanks for you response...

This is my code sniped

gboolean
gui_file_copy_to_journal(char const *uri)
{
g_printerr("SAVING PYTHON JOURNAL!...%s\n", uri);

char * arg1[7];

arg1[0] = "python";
arg1[1] = "/home/olpc/copy-to-Journal.py"; 
arg1[2] = uri+7;
arg1[3] = "-d";
arg1[4] = "hoja_de_calculo"; 
arg1[5] = "-m";
arg1[6] = "application/x-gnumeric"; 

g_printerr ("Writing py \n");
Py_Initialize(); 
Py_Main(7, arg1);
Py_Finalize();
g_printerr ("Writing Py_Finalize \n");

return TRUE;
}

also, I tried with other method like linux journal show in 
http://www.linuxjournal.com/article/3641

Any help is greatly appreciated...

Luis Carrión
Tata Consultancy Services
Colonia 1329-Piso 3
Montevideo,.
Uruguay
Mailto: [EMAIL PROTECTED]
Website: http://www.tcs.com

Experience certainty.   IT Services
Business Solutions
Outsourcing


Amaury Forgeot d'Arc <[EMAIL PROTECTED]> 
27/11/2008 07:22 a.m.
Please respond to
Python tracker <[EMAIL PROTECTED]>

To
[EMAIL PROTECTED]
cc

Subject
[issue4443] Python/pystate.c:561 :PyGILState: The assertion 
'autoInterpreterState' has failed

Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment:

The assertion is clear if you open the source code (Python/pystate.c,
line 561):

assert(autoInterpreterState); /* Py_Initialize() hasn't been called! */

Does your code make sure that the python interpreter is initialized?

--
nosy: +amaury.forgeotdarc

___
Python tracker <[EMAIL PROTECTED]>

___

ForwardSourceID:NTA7E6 
=-=-=
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you

Added file: http://bugs.python.org/file12139/unnamed

___
Python tracker <[EMAIL PROTECTED]>

___
Hi Amaury, thanks for you response...

This is my code sniped

gboolean
gui_file_copy_to_journal(char const
*uri)
{
        
g_printerr("SAVING
PYTHON JOURNAL!...%s\n", uri);

        char
* arg1[7];
        
        arg1[0]
= "python";
        arg1[1]
= "/home/olpc/copy-to-Journal.py"; 
        arg1[2]
= uri+7;
        arg1[3]
= "-d";
        arg1[4]
= "hoja_de_calculo"; 
        arg1[5]
= "-m";
        arg1[6]
= "application/x-gnumeric"; 

        g_printerr
("Writing py \n");
        
Py_Initialize();
       
        Py_Main(7,
arg1);
        
Py_Finalize();
        g_printerr
("Writing Py_Finalize \n");
        
        return
TRUE;
}

also, I tried with other method like
linux journal show in http://www.linuxjournal.com/article/3641

Any help is greatly appreciated...

Luis Carrión
Tata Consultancy Services
Colonia 1329-Piso 3
Montevideo,.
Uruguay
Mailto: [EMAIL PROTECTED]
Website: http://www.tcs.com

Experience certainty.        IT Services
                
       Business Solutions
                
       Outsourcing






Amaury Forgeot d'Arc <[EMAIL 
PROTECTED]>

27/11/2008 07:22 a.m.



Please respond to
Python tracker <[EMAIL PROTECTED]>





To
[EMAIL PROTECTED]


cc



Subject
[issue4443] Python/pystate.c:561 :PyGILState:
The assertion 'autoInterpreterState' has failed









Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment:

The assertion is clear if you open the source code (Python/pystate.c,
line 561):

assert(autoInterpreterState); /* Py_Initialize() hasn't been called! */

Does your code make sure that the python interpreter is initialized?

--
nosy: +amaury.forgeotdarc

___
Python tracker <[EMAIL PROTECTED]>
;
___

ForwardSourceID:NTA7E6
   
=-=-=
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in err

[issue4445] String allocations waste 3 bytes of memory on average.

2008-11-27 Thread Mark Dickinson

New submission from Mark Dickinson <[EMAIL PROTECTED]>:

There are a number of places in Objects/stringobject.c where memory is 
allocated for a string of length n using:

PyObject_MALLOC(sizeof(PyStringObject) + n)

On my computer (OS X 10.5.5/Intel), and, I suspect, on most common 
platforms, the PyStringObject struct is going to contain some number of 
bytes (probably 3) of trailing padding;  the result is that the 
PyObject_MALLOC call above asks for 3 more bytes than are necessary, and 
on average the Python interpreter will waste 3 bytes of memory per string 
allocation.  Is there any reason not to replace these calls with:

PyObject_MALLOC(offsetof(PyStringObject, ob_sval) + n + 1)

instead?

Patch attached.

--
components: Interpreter Core
files: string_alloc.patch
keywords: patch
messages: 76495
nosy: marketdickinson
severity: normal
status: open
title: String allocations waste 3 bytes of memory on average.
type: performance
versions: Python 2.6, Python 2.7
Added file: http://bugs.python.org/file12140/string_alloc.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4446] Distutils Metadata Documentation Missing "platforms" Keyword

2008-11-27 Thread Simon Cross

New submission from Simon Cross <[EMAIL PROTECTED]>:

The section on Additional meta-data in Doc/distutils/setupscript.rst is
missing any reference to the setup() "platforms" keyword. I've attached
a patch which fills in the basics but there are some outstanding questions:

 - Does note (4) about backwards compatibility with earlier versions of
Python apply?

 - What strings should be used to describe each platform? Perhaps any
final element of an "Operating System ::" trove classifier?

 - Given that we have the classifiers, is the "platforms" keyword
actually needed? Perhaps the docs should just mark it as deprecated? We
would then maybe need to change distutils to populate the platforms key
in PKG-INFO from the classifiers?

--
assignee: georg.brandl
components: Documentation
files: distutils-platforms-keyword-documentation.diff
keywords: patch
messages: 76499
nosy: georg.brandl, hodgestar
severity: normal
status: open
title: Distutils Metadata Documentation Missing "platforms" Keyword
versions: Python 2.5, Python 2.5.3, Python 2.6, Python 2.7, Python 3.0, Python 
3.1
Added file: 
http://bugs.python.org/file12142/distutils-platforms-keyword-documentation.diff

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4444] unittest - use contexts to assert exceptions

2008-11-27 Thread Steve Purcell

Steve Purcell <[EMAIL PROTECTED]> added the comment:

I like this change, since assertRaises can be a bit messy when passing it 
a local function.
 
I'd suggest modifying the patch such that the AssertRaisesContext class is 
also used when callableObj is provided, which would eliminate the 
duplication of the code that checks for exceptions.

--
nosy: +purcell

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4443] Python/pystate.c:561 :PyGILState: The assertion 'autoInterpreterState' has failed

2008-11-27 Thread LuisC

LuisC <[EMAIL PROTECTED]> added the comment:

Thank you so much. It do worked!

I don't think two threads to be running the same function because the 
messages are displayed only once.
Yes it seems to be a better way it worked, thank you again.

Regards, 

Luis Carrión
Tata Consultancy Services
Colonia 1329-Piso 3
Montevideo,.
Uruguay
Mailto: [EMAIL PROTECTED]
Website: http://www.tcs.com

Experience certainty.   IT Services
Business Solutions
Outsourcing


Amaury Forgeot d'Arc <[EMAIL PROTECTED]> 
27/11/2008 10:11 a.m.
Please respond to
Python tracker <[EMAIL PROTECTED]>

To
[EMAIL PROTECTED]
cc

Subject
[issue4443] Python/pystate.c:561 :PyGILState: The assertion 
'autoInterpreterState' has failed

Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment:

> Py_Initialize(); 
> Py_Main(7, arg1);
> Py_Finalize();

This seems correct... unless two threads run this function at the same
time. Can you ensure that this is not the case?

It seems to me that a simple call to 
   system("python /home/olpc/copy-to-Journal.py [other-args-here]") 
would be better...

___
Python tracker <[EMAIL PROTECTED]>

___

ForwardSourceID:NTA982 
=-=-=
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you

Added file: http://bugs.python.org/file12143/unnamed

___
Python tracker <[EMAIL PROTECTED]>

___
Thank you so much. It do worked!

I don't think two threads to be running
the same function because the messages are displayed only once.
Yes it seems to be a better way it worked,
thank you again.

Regards, 

Luis Carrión
Tata Consultancy Services
Colonia 1329-Piso 3
Montevideo,.
Uruguay
Mailto: [EMAIL PROTECTED]
Website: http://www.tcs.com

Experience certainty.        IT Services
                
       Business Solutions
                
       Outsourcing






Amaury Forgeot d'Arc <[EMAIL 
PROTECTED]>

27/11/2008 10:11 a.m.



Please respond to
Python tracker <[EMAIL PROTECTED]>





To
[EMAIL PROTECTED]


cc



Subject
[issue4443] Python/pystate.c:561 :PyGILState:
The assertion 'autoInterpreterState' has failed









Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment:

> Py_Initialize(); 
> Py_Main(7, arg1);
> Py_Finalize();

This seems correct... unless two threads run this function at the same
time. Can you ensure that this is not the case?

It seems to me that a simple call to 
   system("python /home/olpc/copy-to-Journal.py 
[other-args-here]")

would be better...

___
Python tracker <[EMAIL PROTECTED]>
;
___

ForwardSourceID:NTA982
   
=-=-=
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you


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



[issue4443] Python/pystate.c:561 :PyGILState: The assertion 'autoInterpreterState' has failed

2008-11-27 Thread Amaury Forgeot d'Arc

Changes by Amaury Forgeot d'Arc <[EMAIL PROTECTED]>:


--
resolution:  -> invalid
status: open -> closed

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4336] Fix performance issues in xmlrpclib

2008-11-27 Thread Kristján Valur Jónsson

Kristján Valur Jónsson <[EMAIL PROTECTED]> added the comment:

I like the suggestion of having endheaders() accept any extra data.
I have uploaded a new patch which implements this idea.  It simplifies 
things a lot.

The issue with the read buffer size is still open.  I have sent an 
email to python-dev requesting comments.

Added file: http://bugs.python.org/file12144/xmlrpc.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4445] String allocations waste 3 bytes of memory on average.

2008-11-27 Thread Raymond Hettinger

Raymond Hettinger <[EMAIL PROTECTED]> added the comment:

+1 on the idea.  -1 on the current patch.  Can you encapsulate this in a
simpler macro?  I find the proposed replacement to be cryptic and
error-prone (i.e. hard to mentally verify its correctness and somewhat
likely to be screwed-up by a future maintainer).

--
nosy: +rhettinger

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4435] Sphinx does not show failed doctests in quiet mode

2008-11-27 Thread Georg Brandl

Georg Brandl <[EMAIL PROTECTED]> added the comment:

Please submit Sphinx bugs in its own tracker:
http://bitbucket.org/birkenfeld/sphinx/issues

--
resolution:  -> invalid
status: open -> closed

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4436] Sphinx latex writer crashes when encountering deep section levels

2008-11-27 Thread Georg Brandl

Georg Brandl <[EMAIL PROTECTED]> added the comment:

Please submit Sphinx bugs in its own tracker:
http://bitbucket.org/birkenfeld/sphinx/issues

(Yes, I know there was still a Sphinx component -- I've removed that now.)

--
resolution:  -> invalid
status: open -> closed

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4446] Distutils Metadata Documentation Missing "platforms" Keyword

2008-11-27 Thread Georg Brandl

Changes by Georg Brandl <[EMAIL PROTECTED]>:


--
assignee: georg.brandl -> loewis
nosy: +loewis

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4434] Embedding into a shared library fails

2008-11-27 Thread rb

rb <[EMAIL PROTECTED]> added the comment:

What is the purpose of linking to the static library if you're still
going to depend on shared objects in lib-dynload?

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4010] configure options don't trickle down to distutils

2008-11-27 Thread Akira Kitada

Akira Kitada <[EMAIL PROTECTED]> added the comment:

I'm having similar problem with distutils.
http://mail.python.org/pipermail/python-dev/2008-November/083670.html

Is there any reason customize_compiler 
- only get CPPFLAGS in env, not ones from sysconfig?
- doesn't get OPT from from sysconfig, but it's used when env has CFLAGS?

I think this is a bug.
CPPFLAGS and OPT both should be used when building extension modules.
Just imagine a system that has include files in a non-standard locations
and explicitly added -I compiler flags to CPPFLAGS to adjust it.
When building an extension modules, the system should requires
the same CPPFLAGS settings. Without it, it won't compile.

In my opinion, this is rather serious bug.
So it would be nice to fix this before releasing Python 3.0/2.6.1/2.5.3

--
nosy: +akitada
type: behavior -> compile error
versions: +Python 2.6, Python 3.0

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4447] exec inside a function

2008-11-27 Thread David M. Beazley

New submission from David M. Beazley <[EMAIL PROTECTED]>:

Is the following code valid Python 3 or not?

def foo():
x = 1
exec("x = 42")
print(x)# Prints 1  (exec has no effect)

I know there are a variety of issues surrounding exec(), function 
bodies, and other matters.   Just wondering if this sort of thing is now 
forbidden or not.

--
components: Interpreter Core
messages: 76508
nosy: beazley
severity: normal
status: open
title: exec inside a function
type: behavior
versions: Python 3.0

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4447] exec inside a function

2008-11-27 Thread Georg Brandl

Georg Brandl <[EMAIL PROTECTED]> added the comment:

It is "valid" Python 3 and the lack of an effect on the local is correct.

>From Python 3 on, "exec" is a function and therefore lacks the special
magic properties it had in Python 2 that made it possible execute the
code "as if it just was written there".

In effect, what exec() modifies here is similar to what locals()
returns: a mere copy of the local namespace.

--
nosy: +georg.brandl
resolution:  -> wont fix
status: open -> closed

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4434] Embedding into a shared library fails

2008-11-27 Thread John Levon

John Levon <[EMAIL PROTECTED]> added the comment:

Besides, .so files should always declare their dependencies.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4447] exec inside a function

2008-11-27 Thread David M. Beazley

David M. Beazley <[EMAIL PROTECTED]> added the comment:

For what it's worth, I hope this behavior gets well-documented.  Thanks.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4445] String allocations waste 3 bytes of memory on average.

2008-11-27 Thread Raymond Hettinger

Raymond Hettinger <[EMAIL PROTECTED]> added the comment:

Suggestion:

#define PyStringObject_SIZE (offsetof(PyStringObject, ob_sval) + 1)


/* Inline PyObject_NewVar */
-   op = (PyStringObject *)PyObject_MALLOC(sizeof(PyStringObject) + size);
/* Inline PyObject_NewVar */
+   op = (PyStringObject *)PyObject_MALLOC(PyStringObject_SIZE + size);

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4376] Nested ctypes 'BigEndianStructure' fails

2008-11-27 Thread Thomas Heller

Thomas Heller <[EMAIL PROTECTED]> added the comment:

Currently, the _fields_ of ctypes Structures with non-native byte order
can only contain simple types (like int, char, but not pointers), and
arrays of those.

Since this is all Python code (in Lib/ctypes/endian.py) it should be
possible to extend the code to handle other types as well.

If we do this, it must be decided if a Structure (call it 'part' for
this discussion) of some byte order is contained in a _field_ of a
non-native Structure type:
- Should 'part' be inserted as is, leading to a total structure of
fields with mixed byte order?

- Should a new type be created from the 'part' _fields_, with also
non-native byte-order?

Other approaches would be possible as well...

Here is a simple patch that implements the first approach; I have not
tested if it works correctly:

Index: _endian.py
===
--- _endian.py  (revision 67045)
+++ _endian.py  (working copy)
@@ -17,6 +17,8 @@
 except AttributeError:
 if type(typ) == _array_type:
 return _other_endian(typ._type_) * typ._length_
+if issubclass(typ, Structure):
+return typ
 raise TypeError("This type does not support other endian: %s" %
typ)
 
 class _swapped_meta(type(Structure)):

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4376] Nested ctypes 'BigEndianStructure' fails

2008-11-27 Thread Thomas Heller

Thomas Heller <[EMAIL PROTECTED]> added the comment:

Correction:
>> Since this is all Python code (in Lib/ctypes/_endian.py) it should be

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4309] ctypes documentation

2008-11-27 Thread Gabriel Genellina

Changes by Gabriel Genellina <[EMAIL PROTECTED]>:


--
nosy: +gagenellina

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4022] 2.6 dependent on c:\python26\ on windows

2008-11-27 Thread Gabriel Genellina

Changes by Gabriel Genellina <[EMAIL PROTECTED]>:


--
nosy: +gagenellina

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4315] On some Python builds, exec in a function can't create shadows of variables if these are declared "global" in another function of the same module

2008-11-27 Thread Gabriel Genellina

Changes by Gabriel Genellina <[EMAIL PROTECTED]>:


--
nosy: +gagenellina

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4438] Add an easy way to __import___ submodules

2008-11-27 Thread Mart Sõmermaa

Mart Sõmermaa <[EMAIL PROTECTED]> added the comment:

See also
http://mail.python.org/pipermail/python-dev/2008-November/083727.html

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4448] should socket readline() use default_bufsize instead of _rbufsize?

2008-11-27 Thread Gregory P. Smith

New submission from Gregory P. Smith <[EMAIL PROTECTED]>:


From Kristján Valur Jónsson (kristjan at ccpgames.com) on python-dev:

 http://mail.python.org/pipermail/python-dev/2008-November/083724.html


I came across this in socket.c:

# _rbufsize is the suggested recv buffer size.  It is *strictly*
# obeyed within readline() for recv calls.  If it is larger than
# default_bufsize it will be used for recv calls within read().
   

What I worry about is the readline() case.  Is there a reason why we
want to strictly obey it for that function?  Note that in the
documentation for _fileobject.read() it says:

# Use max, disallow tiny reads in a loop as they are very
inefficient.

 
The same argument surely applies for readline().

 
The reason I am fretting about this is that httplib.py (and therefore
xmlrpclib.py) specify bufsize=0 when createing their socket fileobjects,
presumably to make sure that write() operations are not buffered but
flushed immediately.  But this has the side effect of setting the
_rbufsize to 1, and so readline() calls become very slow.

 
I suggest that readline() be made to use at least defaultbufsize, like
read().  Any thoughts?

--
assignee: gregory.p.smith
messages: 76516
nosy: gregory.p.smith
priority: normal
severity: normal
status: open
title: should socket readline() use default_bufsize instead of _rbufsize?
type: performance
versions: Python 2.6

___
Python tracker <[EMAIL PROTECTED]>

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



[issue1529142] Allowing multiple instances of IDLE with sub-processes

2008-11-27 Thread Weeble

Weeble <[EMAIL PROTECTED]> added the comment:

Is this ever likely to make it into IDLE? Running without a subprocess 
in Windows appears to interact badly with the multiprocessing library 
(attempting to spawn a process just creates a new IDLE window). I 
couldn't figure out how to apply the patch on Windows - I couldn't tell 
if the errors were because I was using the patch program wrong or 
because the file is different now. Nevertheless, I made the changes 
manually and they seemed to work. What needs to happen for this issue to 
be fixed, whether by this patch or another solution?

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4434] Embedding into a shared library fails

2008-11-27 Thread Ralf Schmitt

Ralf Schmitt <[EMAIL PROTECTED]> added the comment:

Yes, there is no purpose in linking with a static library when the
dynamically loaded modules still depend on the shared library.
And yes, the dynamically loaded libraries should declare their
dependencies. My point is they do *not* depend on the shared library.
That's why the static lib currently makes sense on ubuntu, but wouldn't
make any sense when your proposal would be implemented.

I recommend closing this issue as invalid.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4434] Embedding into a shared library fails

2008-11-27 Thread Ralf Schmitt

Ralf Schmitt <[EMAIL PROTECTED]> added the comment:

Linking with the static library really works. You have to link with
'-Xlinker -export-dynamic' however on linux in order to make the symbols
from the static library visible. (just in case if I haven't been clear..)

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4073] distutils build_scripts and install_data commands need 2to3 support

2008-11-27 Thread Lars Immisch

Changes by Lars Immisch <[EMAIL PROTECTED]>:


--
nosy: +larsimmisch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4448] should socket readline() use default_bufsize instead of _rbufsize?

2008-11-27 Thread Guido van Rossum

Guido van Rossum <[EMAIL PROTECTED]> added the comment:

You meant socket.py.

This is an extremely subtle area.  I would be very wary of changing this
-- there is a use case where headers are read from the socket using
readline() but the rest of the data is read directly from the socket,
and this would break if there was buffered data in the file objects. 
This is exactly why httplib sets the buffer size to 0.

Fortunately things are completely different in Python 3.0 and I believe
the same problem doesn't exist -- in 3.0 it makes more sense to always
read from the (binary) buffered file object representing the socket.

--
nosy: +gvanrossum

___
Python tracker <[EMAIL PROTECTED]>

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