Re: [Python-Dev] [Python-checkins] cpython: fix formatting

2011-10-04 Thread Victor Stinner
Le 04/10/2011 01:35, benjamin.peterson a écrit : http://hg.python.org/cpython/rev/64495ad8aa54 changeset: 72634:64495ad8aa54 user:Benjamin Peterson date:Mon Oct 03 19:35:07 2011 -0400 summary fix formatting +++ b/Objects/unicodeobject.c @@ -1362,8 +1362,8 @@ re

Re: [Python-Dev] [Python-checkins] cpython: fix compiler warnings

2011-10-04 Thread Victor Stinner
Le 04/10/2011 01:34, benjamin.peterson a écrit : http://hg.python.org/cpython/rev/afb60b190f1c changeset: 72633:afb60b190f1c user:Benjamin Peterson date:Mon Oct 03 19:34:12 2011 -0400 summary: fix compiler warnings +++ b/Objects/unicodeobject.c @@ -369,6 +369,12 @@ }

Re: [Python-Dev] [Python-checkins] cpython: pyexpat uses the new Unicode API

2011-10-04 Thread Victor Stinner
Le 03/10/2011 11:10, Amaury Forgeot d'Arc a écrit : changeset: 72548:a1be34457ccf user:Victor Stinner date:Sat Oct 01 01:05:40 2011 +0200 summary: pyexat uses the new Unicode API files: Modules/pyexpat.c | 12 +++- 1 files changed, 7 insertions(+), 5 deletions(

Re: [Python-Dev] [Python-checkins] cpython: fix formatting

2011-10-04 Thread Benjamin Peterson
2011/10/4 Victor Stinner : > Le 04/10/2011 01:35, benjamin.peterson a écrit : >> >> http://hg.python.org/cpython/rev/64495ad8aa54 >> changeset:   72634:64495ad8aa54 >> user:        Benjamin Peterson >> date:        Mon Oct 03 19:35:07 2011 -0400 >> summary >>   fix formatting >> >> +++ b/Objects/un

Re: [Python-Dev] [Python-checkins] cpython: fix compiler warnings

2011-10-04 Thread Benjamin Peterson
2011/10/4 Victor Stinner : > Le 04/10/2011 01:34, benjamin.peterson a écrit : >> >> http://hg.python.org/cpython/rev/afb60b190f1c >> changeset:   72633:afb60b190f1c >> user:        Benjamin Peterson >> date:        Mon Oct 03 19:34:12 2011 -0400 >> summary: >>   fix compiler warnings >> >> +++ b/Ob

Re: [Python-Dev] Python-Dev Digest, Vol 99, Issue 7

2011-10-04 Thread Peter Harris
> > Hello Python Developers, > > I am a Program Manager with the Ecosystem Engineering team at Microsoft. We are tracking a issue with Python 3.2.2 on Windows Developer Preview when > using Internet Explorer. > [...] > I'd like to connect directly with a developer on the project so that we can > w

[Python-Dev] Using PEP384 Stable ABI for the lzma extension module

2011-10-04 Thread Amaury Forgeot d'Arc
Hi, Has someone already tried to *really* use Py_LIMITED_API for some "serious" extension module? I wanted to give it a try for the _lzma module (see issue 6715) because liblzma does not compile with Microsoft compilers; an alternative could be to use mingw to (pre)build _lzma.pyd, which would lin

Re: [Python-Dev] Python compatibility issue with Windows Developer Preview

2011-10-04 Thread Michael Foord
On 04/10/2011 02:20, Brian Curtin wrote: On Mon, Oct 3, 2011 at 18:32, Ryan Wells (MP Tech Consulting LLC) mailto:v-ry...@microsoft.com>> wrote: Hello Python Developers, I am a Program Manager with the Ecosystem Engineering team at Microsoft. We are tracking a issue with Python 3.2

Re: [Python-Dev] [Python-checkins] cpython: Migrate str.expandtabs to the new API

2011-10-04 Thread Martin v. Löwis
Migrate str.expandtabs to the new API This needs if (PyUnicode_READY(self) == -1) return NULL; right after the ParseTuple call. In most cases, the check will be a noop. But if it's not, omitting it will make expandtabs have no effect, since the string length will be 0 (in a debu

Re: [Python-Dev] Using PEP384 Stable ABI for the lzma extension module

2011-10-04 Thread Nick Coghlan
(My comments are based on the assumption Amaury started with http://hg.python.org/sandbox/nvawda/file/09d984063fca/Modules/_lzmamodule.c) On Tue, Oct 4, 2011 at 12:18 PM, Amaury Forgeot d'Arc wrote: > - Py_LIMITED_API is incompatible with --with-pydebug, and compilation stops. >  I skipped the ch

Re: [Python-Dev] Using PEP384 Stable ABI for the lzma extension module

2011-10-04 Thread Nick Coghlan
On Tue, Oct 4, 2011 at 1:05 PM, Nick Coghlan wrote: > It's probably not a bad idea, otherwise we may compilation without > realising it. s/may/may break/ Actually testing the ABI stability would be much harder - somehow building an extension module against 3.2 with the limited API then testing i

Re: [Python-Dev] Using PEP384 Stable ABI for the lzma extension module

2011-10-04 Thread Martin v. Löwis
Amaury: thanks for your experiment and your report. - I replaced PyBytes_GET_SIZE() with Py_SIZE(), which is OK, and PyBytes_AS_STRING() with PyBytes_AsString(), which may have a slight performance impact. That's the whole point of the stable ABI: AS_STRING assumes that there is an ob_sval fie

Re: [Python-Dev] Using PEP384 Stable ABI for the lzma extension module

2011-10-04 Thread Martin v. Löwis
- Py_LIMITED_API is incompatible with --with-pydebug, and compilation stops. I skipped the check to continue. That seems like an odd (and undesirable) restriction. It's deliberate, though. If different Python versions are going to expose the same ABI, it seems strange of debug and release

Re: [Python-Dev] [Python-checkins] cpython: Optimize string slicing to use the new API

2011-10-04 Thread Martin v. Löwis
+result = PyUnicode_New(slicelength, PyUnicode_MAX_CHAR_VALUE(self)); This is incorrect: the maxchar of the slice might be smaller than the maxchar of the input string. So you'll need to iterate over the input string first, compute the maxchar, and then allocate the result string. Or

Re: [Python-Dev] Python compatibility issue with Windows Developer Preview

2011-10-04 Thread Brian Curtin
On Tue, Oct 4, 2011 at 11:27, Michael Foord wrote: > On 04/10/2011 02:20, Brian Curtin wrote: > > On Mon, Oct 3, 2011 at 18:32, Ryan Wells (MP Tech Consulting LLC) < > v-ry...@microsoft.com> wrote: > >> Hello Python Developers, >> >> >> >> I am a Program Manager with the Ecosystem Engineering te

Re: [Python-Dev] [Python-checkins] cpython: Optimize string slicing to use the new API

2011-10-04 Thread Martin v. Löwis
Am 04.10.11 19:50, schrieb Antoine Pitrou: On Tue, 04 Oct 2011 19:49:09 +0200 "Martin v. Löwis" wrote: +result = PyUnicode_New(slicelength, PyUnicode_MAX_CHAR_VALUE(self)); This is incorrect: the maxchar of the slice might be smaller than the maxchar of the input string. I thought

Re: [Python-Dev] cpython (3.2): Issue #11956: Skip test_import.test_unwritable_directory on FreeBSD when run as

2011-10-04 Thread Ned Deily
In article , charles-francois.natali wrote: > http://hg.python.org/cpython/rev/7697223df6df > changeset: 72670:7697223df6df > branch: 3.2 > parent: 72658:2484b2b8876e > user:Charles-Fran?ssois Natali > date:Tue Oct 04 19:17:26 2011 +0200 > summary: > Issue #11956: S

Re: [Python-Dev] Python compatibility issue with Windows Developer Preview

2011-10-04 Thread Brian Curtin
On Tue, Oct 4, 2011 at 13:24, Ryan Wells (MP Tech Consulting LLC) wrote: > Please let me know if you have an estimated timeframe to address this issue, > and if our team can further assist in this process. No idea about an estimated time frame, but I've entered http://bugs.python.org/issue13101 i

Re: [Python-Dev] cpython (3.2): Issue #11956: Skip test_import.test_unwritable_directory on FreeBSD when run as

2011-10-04 Thread Charles-François Natali
>> summary: >> Issue #11956: Skip test_import.test_unwritable_directory on FreeBSD when >> >> run as >> root (directory permissions are ignored). > > The same directory permission semantics apply to other (all?) > BSD-derived systems, not just FreeBSD. For example, the test still > fails in th

Re: [Python-Dev] Python compatibility issue with Windows Developer Preview

2011-10-04 Thread Ryan Wells (MP Tech Consulting LLC)
Hello, I apologize for the confusion or if this is the wrong mailing listing, I wanted to get in contact with someone before I sent the bug information that I have. We do not have a public bug tracking system that I can direct you to. Based on preliminary testing, the following compatibility

Re: [Python-Dev] Using PEP384 Stable ABI for the lzma extension module

2011-10-04 Thread Amaury Forgeot d'Arc
2011/10/4 "Martin v. Löwis" : > >> - _PyBytes_Resize() is missing; I moved it under a Py_LIMITED_API >>   section. > > ??? Are you proposing to add _PyBytes_Resize to the Py_LIMITED_API > set of functions? It's not even an API function in the first place > (it starts with an underscore), so how can

Re: [Python-Dev] Using PEP384 Stable ABI for the lzma extension module

2011-10-04 Thread Antoine Pitrou
On Tue, 4 Oct 2011 13:05:58 -0400 Nick Coghlan wrote: > > > - _PyBytes_Resize() is missing; I moved it under a Py_LIMITED_API > >  section. > > No, that's not valid. Bytes are officially immutable - mutating them > when the reference count is only 1 is a private for a reason. The > correct way t

Re: [Python-Dev] Using PEP384 Stable ABI for the lzma extension module

2011-10-04 Thread Martin v. Löwis
Am 04.10.11 21:06, schrieb Amaury Forgeot d'Arc: 2011/10/4 "Martin v. Löwis": - _PyBytes_Resize() is missing; I moved it under a Py_LIMITED_API section. ??? Are you proposing to add _PyBytes_Resize to the Py_LIMITED_API set of functions? It's not even an API function in the first place (i

Re: [Python-Dev] Using PEP384 Stable ABI for the lzma extension module

2011-10-04 Thread Nick Coghlan
On Tue, Oct 4, 2011 at 3:12 PM, Antoine Pitrou wrote: > Uh, no, it depends what you're doing. There's no reason not to allow > people to resize a bytes object which they've just allocated and is > still private to their code. That's the whole reason why > _PyBytes_Resize() exists, and the use case

Re: [Python-Dev] Using PEP384 Stable ABI for the lzma extension module

2011-10-04 Thread Antoine Pitrou
On Tue, 04 Oct 2011 21:33:34 +0200 "Martin v. Löwis" wrote: > Am 04.10.11 21:06, schrieb Amaury Forgeot d'Arc: > > 2011/10/4 "Martin v. Löwis": > >> > >>> - _PyBytes_Resize() is missing; I moved it under a Py_LIMITED_API > >>>section. > >> > >> ??? Are you proposing to add _PyBytes_Resize to t

Re: [Python-Dev] cpython: PyUnicode_Join() checks output length in debug mode

2011-10-04 Thread Georg Brandl
On 10/03/11 23:35, victor.stinner wrote: > http://hg.python.org/cpython/rev/bfd8b5d35f9c > changeset: 72623:bfd8b5d35f9c > user:Victor Stinner > date:Mon Oct 03 23:36:02 2011 +0200 > summary: > PyUnicode_Join() checks output length in debug mode > > PyUnicode_CopyCharacters()

Re: [Python-Dev] [Python-checkins] cpython: fix compiler warnings

2011-10-04 Thread Vlad Riscutia
Why does the function even return a value? As Benjamin said, it is just a bunch of asserts with return 1 at the end. I believe another way you can get rid of "statement with no effect" is to cast return value to void, like (void)_PyUnicode_CHECK(unicode). Thank you, Vlad On Tue, Oct 4, 2011 at 4

Re: [Python-Dev] cpython: PyUnicode_Join() checks output length in debug mode

2011-10-04 Thread Victor Stinner
Le 04/10/2011 23:41, Georg Brandl a écrit : I don't understand this change. Why would you not always add "copied" once you already have it? It seems to be the more correct version anyway. If you use copied instead of seplen/itemlen, you suppose that the string has been overallocated in some ca

Re: [Python-Dev] [Python-checkins] cpython: fix compiler warnings

2011-10-04 Thread Victor Stinner
Le 05/10/2011 00:30, Vlad Riscutia a écrit : Why does the function even return a value? As Benjamin said, it is just a bunch of asserts with return 1 at the end. It's just to be able to write assert(_PyUnicode_CheckConsistency(...)). assert() is just used to remove the instruction in release m

Re: [Python-Dev] [Python-checkins] cpython: Migrate str.expandtabs to the new API

2011-10-04 Thread Victor Stinner
Le 04/10/2011 18:45, "Martin v. Löwis" a écrit : Migrate str.expandtabs to the new API This needs if (PyUnicode_READY(self) == -1) return NULL; right after the ParseTuple call. In most cases, the check will be a noop. But if it's not, omitting it will make expandtabs have no effect, since t

Re: [Python-Dev] [Python-checkins] cpython: Optimize string slicing to use the new API

2011-10-04 Thread Victor Stinner
Le 04/10/2011 20:09, "Martin v. Löwis" a écrit : Am 04.10.11 19:50, schrieb Antoine Pitrou: On Tue, 04 Oct 2011 19:49:09 +0200 "Martin v. Löwis" wrote: + result = PyUnicode_New(slicelength, PyUnicode_MAX_CHAR_VALUE(self)); This is incorrect: the maxchar of the slice might be smaller than the