[issue9972] PyGILState_XXX missing in Python builds without threads

2010-09-28 Thread Lisandro Dalcin

New submission from Lisandro Dalcin :

I've built Python-2.6.5 form with this :

$ ./configure --without-threads --prefix=$HOME/python-without-threads
$ make && make install

$ cd ~/python-without-threads/lib
$ nm libpython2.6.so | grep PyGILState
$ 

At Include/pystate.h,  PyGILState_{Ensure|Release} are not protected with 
#ifdef WITH_THREADS

At Python/pystate.c PyGILState_{Ensure|Release} are implemented in a block 
protected with #ifdef WITH_THREADS

AFAIK, this happens in all Python versions back to 2.3 and up to 3.2

--
messages: 117531
nosy: dalcinl
priority: normal
severity: normal
status: open
title: PyGILState_XXX missing in Python builds without threads
versions: Python 2.5, Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3

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



[issue6195] Serious regression in doctest in Py3.1rc1

2009-06-09 Thread Lisandro Dalcin

Lisandro Dalcin  added the comment:

I've tested latest David's patch against Cython test suite (doctests
living in extension modules), and all is working as expected.

--

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



[issue6195] Serious regression in doctest in Py3.1rc1

2009-06-04 Thread Lisandro Dalcin

New submission from Lisandro Dalcin :

When doctests are written in docstrings from C extension modules,
'doctest' reads the binary extension module file.

The attached one-line patch seems to fix the problem, it is in fact very
similar to patch for issue4050 related to 'inspect'.

--
components: Library (Lib), Tests
files: doctest.diff
keywords: patch
messages: 88907
nosy: dalcinl, scoder
severity: normal
status: open
title: Serious regression in doctest in Py3.1rc1
versions: Python 3.1
Added file: http://bugs.python.org/file14187/doctest.diff

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



[issue5630] Create alternative CObject API that is safe and clean

2009-05-04 Thread Lisandro Dalcin

Lisandro Dalcin  added the comment:

In Doc/c-api/capsule.rst, you wrote

.. cfunction:: int PyCapsule_Import(const char* name, int no_block)

but it should be:

.. cfunction:: void* PyCapsule_Import(const char* name, int no_block)

Additionally, you wrote "disambugate" in many places.

--

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



[issue5630] Update CObject API so it is safe and regular

2009-03-31 Thread Lisandro Dalcin

Lisandro Dalcin  added the comment:

Two questions:

1) Why do you prefer to pass destructor as a first argument?

2) Do we really need two different calls for providing a context
pointer? Why no just one call and pass a NULL context?

A comment:

Suppose one wants to implement export/import module C-API's in a
function-by-function basis. This is nice, as you can extend your module
C-API, and make it be backward "ABI" compatible.

As the void* <-> void(*)(void) conversion is illegal(?) in C(99?), one
has to go to the oddities of doing some sort of type-punning with
unions... this could be somewhat tedious for hand-written extension
modules. 

Do you have any idea on how extend the CObject API for the commented use
case?

--
nosy: +dalcinl

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



[issue5248] Adding T_SIZET to structmember.h

2009-02-13 Thread Lisandro Dalcin

Lisandro Dalcin  added the comment:

In 2.6 and 3.0, we already have 'Py_ssize_t', see 'T_PYSSIZET'
definition on Include/structmember.h. I'm asking for 'size_t' support.

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



[issue5248] Adding T_SIZET to structmember.h

2009-02-13 Thread Lisandro Dalcin

New submission from Lisandro Dalcin :

structmember.h lacks a 'T_SIZET' define in order to properly support
struct fields of type 'size_t'  within PyMemberDef.

If this feature request is accepted, I can provide the patches. 

For 2.7, It would be nice to do:

#define T_SIZET  20  /* size_t */

However, this value is already used in 3.0 for 'T_NONE'. Perhaps T_NONE
should be backported to 2.7?

To avoid future merge conflicts, I would vote for this definition:

#define T_SIZET  21  /* size_t */

--
components: Interpreter Core
messages: 81942
nosy: dalcinl, marketdickinson
severity: normal
status: open
title: Adding T_SIZET to structmember.h
type: feature request
versions: Python 2.7, Python 3.1

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



[issue5175] negative PyLong -> C unsigned integral, TypeError or OverflowError?

2009-02-10 Thread Lisandro Dalcin

Lisandro Dalcin  added the comment:

It worked for me.

BTW, 'make test' did not noticed the change in Modules/testcapi_long.h,
which is #include'd by Modules/_testcapimodule.c. I've attached a
trivial patch for setup.py fixing the dependency issue.

Added file: http://bugs.python.org/file13014/setup.py.diff

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



[issue5175] negative PyLong -> C unsigned integral, TypeError or OverflowError?

2009-02-10 Thread Lisandro Dalcin

Lisandro Dalcin  added the comment:

Mark, here you have a patch. I've only 'make test' on a 32bit Linux box

Just two comments:

- in docs: perhaps the 'versionchanged' stuff should be added.

- in tests: I did not touch Modules/_testcapimodule.c, as it seems the
test is covered. However, note that in all these tests, actual exception
types are not checked)

--
keywords: +patch
Added file: http://bugs.python.org/file13010/negative-to-unsigned.diff

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



[issue5175] negative PyLong -> C unsigned integral, TypeError or OverflowError?

2009-02-08 Thread Lisandro Dalcin

Lisandro Dalcin  added the comment:

I can contribute a patch. However, I would like to wait until Tim 
comments on this.

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



[issue5175] negative PyLong -> C unsigned integral, TypeError or OverflowError?

2009-02-06 Thread Lisandro Dalcin

New submission from Lisandro Dalcin :

At Objects/longobject.c, in almost all cases
OverflowError is raised when a unsigned integral is requested from a
negative PyLong. However, this one breaks the rules:

int
_PyLong_AsByteArray(PyLongObject* v,
  unsigned char* bytes, size_t n,
  int little_endian, int is_signed)
{
<...>
  if (!is_signed) {
  PyErr_SetString(PyExc_TypeError,
  "can't convert negative long to 
unsigned");
  return -1;
  }
<...>
}

--
components: Interpreter Core
messages: 81316
nosy: dalcinl
severity: normal
status: open
title: negative PyLong -> C unsigned integral, TypeError or OverflowError?
type: behavior
versions: Python 2.7

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



[issue3639] segfaults calling warnings.warn() with non-string message

2008-08-21 Thread Lisandro Dalcin

New submission from Lisandro Dalcin <[EMAIL PROTECTED]>:

from warnings import warn

warn("hello world") # -> Success
warn(UserWarning)   # -> Segmentation fault
warn(None)  # -> Segmentation fault
warn(1) # -> Segmentation fault

--
components: Interpreter Core
messages: 71694
nosy: dalcinl
severity: normal
status: open
title: segfaults calling warnings.warn() with non-string message
type: crash
versions: Python 3.0

___
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue3639>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com