[issue12875] backport re.compile flags default value documentation

2011-09-01 Thread Eli Bendersky

Eli Bendersky eli...@gmail.com added the comment:

Ezio,

but using ints instead of flags is discouraged (see #11957).  OTOH there's no 
re.NOFLAGS flag that can be used instead.

Indeed, there's no re.NOFLAGS, and as I mentioned the 3k docs mention 0 as the 
default value, thus (in a way) encouraging passing the numeric value. 

Perhaps re.NOFLAGS should be added (at least in 3.3)? The docs can then be 
modified to specify it as the default value of 'flags' instead of 0.

--

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



[issue12875] backport re.compile flags default value documentation

2011-09-01 Thread Eli Bendersky

Eli Bendersky eli...@gmail.com added the comment:

Regarding backporting 106ee4eb5970 - it's probably a good thing to do but I 
wouldn't mix it with this issue.

--

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



[issue12837] Patch for issue #12810 removed a valid check on socket ancillary data

2011-09-01 Thread Charles-François Natali

Charles-François Natali neolo...@free.fr added the comment:

`long long` is not ANSI, but C99.
Anyhow, I'm still not sure this check is necessary, because:
1) I really doubt any modern OS uses a signed socklen_t
2) even if it's the case, I don't see how we could possibly end up with a 
negative msg_controllen

I'm adding Nick and Antoine to the noisy list to know what they think about 
this...

--
nosy: +ncoghlan, pitrou

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



[issue12868] test_faulthandler.test_stack_overflow() failed on OpenBSD

2011-09-01 Thread Charles-François Natali

Charles-François Natali neolo...@free.fr added the comment:

 without-threads, it segfault:


It's normal :-)
_stack_overflow triggers - as it names implies - a stack overflow.
However, as you can see in the output, faulthandler is now able to
catch the SIGSEGV and display the backtrace (because it set up an
alternate stack for the signal handler with sigaltstack).

 However, if I run test_faulthandler.py, it seems to be ok:

Yes: the test checks that the stack overflow was correctly caught by
faulthandler.

@Victor: can I commit the patch?

--

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



[issue12837] Patch for issue #12810 removed a valid check on socket ancillary data

2011-09-01 Thread Nick Coghlan

Nick Coghlan ncogh...@gmail.com added the comment:

I tend to be fairly paranoid about operating systems doing occasionally bizarre 
things, so I like having clearly defined behaviour even when the OS does 
something arguably nuts, but permitted by the relevant standard. Hence I think 
keeping the check is the right thing to do, which means finding an alternative 
to silence the compiler warning on Mac OS X (and similar systems).

The right way is probably a configure check, but that feels like overkill for 
something minor like this.

Brett's patch seems like a reasonable alternative if an appropriate 
guaranteed-to-be-at-least-64-bits type can be found, but 'long long' isn't a 
valid cast target for this unless Guido is OK with PEP 7 being modified to 
include a small number of permitted C99 features.

--

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



[issue4153] Unicode HOWTO up to date?

2011-09-01 Thread Ezio Melotti

Ezio Melotti ezio.melo...@gmail.com added the comment:

After the recent discussions on python-dev I went through the Unicode howto and 
fixed a few things, then I found this issue so I'm attaching the patch here.
The patch addresses mostly markup issues, but it also removes the usage of 
'byte string'.
A few more things that should be done:
  * clarify some more terms (e.g. codepoints, code units, characters, possibly 
scalar values etc.);
  * mention the differences between narrow and wide builds, including:
- a discussion about the UCS-2/UTF-16 implementation of narrow builds;
- something about surrogates and surrogate pairs;
- effects of slicing and indexing on narrow builds;
- functions/methods that (don't) accept non-BMP chars on narrow builds;
  * something about Unicode supports in the re module (this probably can wait 
after the 'regex' inclusion).

Also the codecs doc has a section about Unicode and encodings that might be 
moved to the howto.

--
assignee: georg.brandl - 
resolution: fixed - 
stage:  - commit review
versions: +Python 3.3
Added file: http://bugs.python.org/file23081/issue4153-2.diff

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



[issue12868] test_faulthandler.test_stack_overflow() failed on OpenBSD

2011-09-01 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

 @Victor: can I commit the patch?

I don't like the skip message. It doesn't tell that the problem comes 
from sigaltstack() and it doesn't contain the issue number. I would 
expect something like: Issue #12868: sigaltstack() doesn't work on 
OpenBSD if Python is compiled with pthread.

Do you think that the bug will be fixed in OpenBSD? If yes, we should 
test the OpenBSD version in the skip. But it looks like OpenBSD thread 
implementation is very different than operating systems (e.g. threads 
are run in user space), and I don't expect a new implementation before 
some months/years...

Anyway, skip the test if the right fix for this issue. Python cannot fix 
kernel/libc bugs.

--

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



[issue12494] subprocess: check_output() doesn't close pipes on error

2011-09-01 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

 The second patch looks good. Tests?

Ok, I will try to write a new patch with tests.

 But, it *probably* shouldn't be applied to 2.7  3.2 given that it is a 
 behaviour change.

I consider that this issue is a bug, so it should be fixed in 2.7 and 
3.2. I agree that *killing* the process is a behaviour change, but we 
can just close pipes on error for 2.7 and 3.2.

--

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



[issue12494] subprocess: check_output() doesn't close pipes on error

2011-09-01 Thread Ross Lagerwall

Ross Lagerwall rosslagerw...@gmail.com added the comment:

 I consider that this issue is a bug, so it should be fixed in 2.7 and 
 3.2. I agree that *killing* the process is a behaviour change, but we 
 can just close pipes on error for 2.7 and 3.2.

Yeah, that seems right.

--

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



[issue8409] gettext should honor $LOCPATH environment variable

2011-09-01 Thread Danilo Segan

Danilo Segan dse...@users.sourceforge.net added the comment:

I believe it's invalid. GNU gettext itself doesn't honor the LOCPATH variable, 
LOCPATH is basically used by GNU libc for pointing to locale data. Even though 
this also includes LC_MESSAGES, gettext has never used it afaik.

If it's not invalid (iow, gettext should use it), it'd first need to be fixed 
upstream in GNU gettext.

FWIW, I've grepped for any occurrence of LOCPATH in upstream gettext git tree 
and it returned zero results.

--
nosy: +dsegan

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



[issue12876] Make Test Error : ImportError: No module named _sha256

2011-09-01 Thread Wong Wah Meng

New submission from Wong Wah Meng wahm...@freescale.com:

Hi there, 
I just build python 2.7.1 on my HP 11.31 Itanium 64 bit machine using gcc. When 
I finished the build and run make test. It gives me error as depicted below:-

 

$ ./python Lib/test/regrtest.py -v  

Traceback (most recent call last):

  File Lib/test/regrtest.py, line 157, in module

import random

  File /home/r32813/Build/2.7.1/Python-2.7.1/Lib/random.py, line 49, in 
module

import hashlib as _hashlib

  File /home/r32813/Build/2.7.1/Python-2.7.1/Lib/hashlib.py, line 136, in 
module

globals()[__func_name] = __get_hash(__func_name)

  File /home/r32813/Build/2.7.1/Python-2.7.1/Lib/hashlib.py, line 74, in 
__get_builtin_constructor

import _sha256

ImportError: No module named _sha256

This is the server information. 

$ uname -a

HP-UX zmy02hp3 B.11.31 U ia64 3240906838 unlimited-user license 

Here is other information in the configure.log file. 

Target: ia64-hp-hpux11.23

Configured with: /tmp/gcc-4.4.3.tar.gz/gcc-4.4.3/configure 
--host=ia64-hp-hpux11.23 --target=ia64-hp-hpux11.23 --build=ia64-hp-hpux11.23 
--prefix=/opt/hp-

gcc-4.4.3 --with-gnu-as --without-gnu-ld --enable-threads=posix 
--enable-languages=c,c++ --with-gmp=/proj/opensrc/be/ia64-hp-hpux11.23 
--with-mpfr=/proj/o

pensrc/be/ia64-hp-hpux11.23 SED=/usr/bin/sed

Thread model: posix

--
components: Tests
messages: 143315
nosy: wah meng
priority: normal
severity: normal
status: open
title: Make Test Error : ImportError: No module named _sha256
type: compile error
versions: Python 2.7

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



[issue12868] test_faulthandler.test_stack_overflow() failed on OpenBSD

2011-09-01 Thread Steffen Daode Nurpmeso

Steffen Daode Nurpmeso sdao...@googlemail.com added the comment:

Heya.
OpenBSD does support 1:1 threads via the RThread library
since 2005, thanks to tedu@ and more fantastic guys!
It about to be super-stable (one commit in 2011, last real
fix in april 2010).
(There is a techtalk from tedu@ (Ted Unangst) about this library
on YouTube, btw.)

--
nosy: +sdaoden

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



[issue4153] Unicode HOWTO up to date?

2011-09-01 Thread Ezio Melotti

Ezio Melotti ezio.melo...@gmail.com added the comment:

I also left a few comments on rietveld about other things that can be improved. 
 Please reply and comment there.

--

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



[issue12876] Make Test Error : ImportError: No module named _sha256

2011-09-01 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

Please run the make command again.  It will list the modules that were 
skipped and not compiled.  Which modules do you see there?
Also, which version of OpenSSL is installed?

--
nosy: +amaury.forgeotdarc

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



[issue12873] 2to3 incorrectly handles multi-line imports from __future__

2011-09-01 Thread Sebastian Wiesner

Changes by Sebastian Wiesner lunary...@googlemail.com:


--
nosy: +lunar

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



[issue8409] gettext should honor $LOCPATH environment variable

2011-09-01 Thread Barry A. Warsaw

Changes by Barry A. Warsaw ba...@python.org:


--
resolution:  - invalid
status: open - closed

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



[issue12837] Patch for issue #12810 removed a valid check on socket ancillary data

2011-09-01 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

If you're casting to a larger signed type, then the semantics change, since 
there is a sign extension.
For example (unsigned int) 0x could be cast to (long long) -1.

You could cast to size_t instead and compare the result to SOCKLEN_T_MAX (which 
currently doesn't exist :-)).

--

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



[issue12868] test_faulthandler.test_stack_overflow() failed on OpenBSD

2011-09-01 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

 OpenBSD does support 1:1 threads via the RThread library
 since 2005, thanks to tedu@ and more fantastic guys!
 It about to be super-stable (one commit in 2011, last real
 fix in april 2010).
 (There is a techtalk from tedu@ (Ted Unangst) about this library
 on YouTube, btw.)

Does Python support the RThread library? If not, is it planned? Is 
anyone working on it?

In Python 3.3, you can use sys.thread_info to check which threading 
library is used.

--

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



[issue12386] packaging fails in install_distinfo when writing RESOURCES

2011-09-01 Thread Vinay Sajip

Vinay Sajip vinay_sa...@yahoo.co.uk added the comment:

@Éric: I also noticed that your latest comment 

All text is bytes, so we can do all I/O in bytes when writing resources and 
avoid special-casing.

contradicts your earlier position:

I agree about the nonsense of opening in binary mode.

If using text mode, we might lose any specific encoding used for the source 
script unless we do encoding-detection as the interpreter does, and preserve 
that across the change-shebang-and-save. Using binary does avoid this, and 
should be doable with simpler code, so perhaps it is preferable - as long as we 
do it correctly so as to avoid the TypeError :-)

--

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



[issue2771] Test issue

2011-09-01 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
status: closed - open

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



[issue2771] Test issue

2011-09-01 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 90586887032e by Ezio Melotti in branch 'default':
test: change the content of the p file so
http://hg.python.org/test/rev/90586887032e

--
nosy: +python-dev
status: open - closed

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



[issue12877] Popen(...).stdout.seek(...) throws Illegal seek

2011-09-01 Thread Jonas H.

New submission from Jonas H. jo...@lophus.org:

from subprocess import Popen, PIPE
p = Popen(['ls'], stdout=PIPE)
p.wait()
p.stdout.seek(0)


Traceback (most recent call last):
  File t.py, line 5, in module
p.stdout.seek(0)
IOError: [Errno 29] Illegal seek

Python 2.7.2, Arch Linux x86-64 (Kernel 3.0)

--
messages: 143323
nosy: jonash
priority: normal
severity: normal
status: open
title: Popen(...).stdout.seek(...) throws Illegal seek
versions: Python 2.7

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



[issue12877] Popen(...).stdout.seek(...) throws Illegal seek

2011-09-01 Thread Nadeem Vawda

Nadeem Vawda nadeem.va...@gmail.com added the comment:

This is expected behaviour - you cannot seek on a pipe.

--
nosy: +nadeem.vawda

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



[issue12877] Popen(...).stdout.seek(...) throws Illegal seek

2011-09-01 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

stdout is a PIPE. You cannot seek in a PIPE.

Write stdout into a file, or use maybe BytesIO or StringIO?

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

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



[issue12876] Make Test Error : ImportError: No module named _sha256

2011-09-01 Thread Wong Wah Meng

Wong Wah Meng wahm...@freescale.com added the comment:

Thanks for your reply:

This is the output of the make, _ctypes and termios are failed to build.

Python build finished, but the necessary bits to build these modules were not 
found:
_bsddb _curses_curses_panel   
_sqlite3   _ssl   _tkinter
bsddb185   bz2gdbm
linuxaudiodev  ossaudiodevreadline
spwd   sunaudiodevzlib
To find the necessary bits, look in setup.py in detect_modules() for the 
module's name.


Failed to build these modules:
_ctypestermios

running build_scripts
$ 

On version of OpenSSL on this server, I need to check with my Unix admin first, 
as I don't know what command to run to check what software and its version 
installed. :P. Will revert to you!

--

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



[issue12876] Make Test Error : ImportError: No module named _sha256

2011-09-01 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

Do you have OpenSSL headers?

--
nosy: +haypo

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



[issue12877] Popen(...).stdout.seek(...) throws Illegal seek

2011-09-01 Thread Jonas H.

Jonas H. jo...@lophus.org added the comment:

Why does it have a 'seek' method then?

--

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



[issue12877] Popen(...).stdout.seek(...) throws Illegal seek

2011-09-01 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

 Why does it have a 'seek' method then?

Python doesn't remove a method if the operation is forbidden. For example, 
Python doesn't remove write() method if the file is read only, and it doesn't 
remove most methods after close().

I prefer to have files with always the same API. I think that it's more 
practical.

Note: Text files of the io module (TextIOWrapper) raises 
io.UnsupportedOperation on seek() if the file is not seekable (e.g. if the file 
is a pipe):

$ ~/prog/python/default/python 
Python 3.3.0a0 (default:d26c7b18fc9d, Jul 22 2011, 12:04:31) 
 import os
 a,b=os.pipe()
 f=os.fdopen(a, 'rb')
 f
_io.BufferedReader name=3
 f.seek(0)
Traceback (most recent call last):
  File stdin, line 1, in module
IOError: [Errno 29] Illegal seek

 f2=os.fdopen(a, 'r')
 f2
_io.TextIOWrapper name=3 mode='r' encoding='UTF-8'
 f2.seek(0)
Traceback (most recent call last):
  File stdin, line 1, in module
io.UnsupportedOperation: underlying stream is not seekable

--

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



[issue6069] casting error from ctypes array to structure

2011-09-01 Thread Vlad Riscutia

Vlad Riscutia riscutiav...@gmail.com added the comment:

Meador, I believe this was the first issue on the tracker that got me looking 
into bitfield allocation. I agree that big-endian on MSVC doesn't make too much 
sense but you can disregard that - using default endianess will still yield 
different sizes of bitfields when compiled with GCC and MSVC.

Basically bitfield allocation is compiler specific and patch in issue12528 
implements a way to select which allocation strategy to be used at runtime 
instead of hardcoding the one with which Python is compiled. This should 
improve cross-compiler interop. I wanted to hyperlink that patch to all other 
bitfield bugs, that's why I followed up with link to the patch.

Feel free to close this, either as not an issue or as a duplicate of 
issue12528. 

And yes, this bit about bitfield allocation should be documented and I was 
planning to look into it at some point after 12528 gets committed.

--

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



[issue12868] test_faulthandler.test_stack_overflow() failed on OpenBSD

2011-09-01 Thread Steffen Daode Nurpmeso

Steffen Daode Nurpmeso sdao...@googlemail.com added the comment:

 In Python 3.3, you can use sys.thread_info to check which threading 
 library is used.

Great!  I didn't know that!

--

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



[issue12868] test_faulthandler.test_stack_overflow() failed on OpenBSD

2011-09-01 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

 Great!  I didn't know that!

It's a new feature of Python 3.3. I added it to skip a test on old FreeBDB, see 
test_threadsignal.py:

USING_PTHREAD_COND = (sys.thread_info.name == 'pthread'
  and sys.thread_info.lock == 'mutex+cond')
...
@unittest.skipIf(USING_PTHREAD_COND,
 'POSIX condition variables cannot be interrupted')
def test_lock_acquire_interruption(self):


It is also used in test_os.py:
---
if hasattr(sys, 'thread_info') and sys.thread_info.version:
USING_LINUXTHREADS = sys.thread_info.version.startswith(linuxthreads)
else:
USING_LINUXTHREADS = False
---

This linux threads check does already exist in Python 3.2, but is uses:
---
libpthread = os.confstr(CS_GNU_LIBPTHREAD_VERSION)
USING_LINUXTHREADS= libpthread.startswith(linuxthreads)
---

See also the doc:
http://docs.python.org/dev/library/sys.html#sys.thread_info

--

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



[issue2636] Adding a new regex module (compatible with re)

2011-09-01 Thread Ezio Melotti

Ezio Melotti ezio.melo...@gmail.com added the comment:

I tried to run a test suite of 3kloc (not just about regex, but regex were used 
in several places) and I had only one failure:
 s = u'void foo ( type arg1 [, type arg2 ] )'
 re.sub('(?=[][()]) |(?!,) (?!\[,)(?=[][(),])', '', s)
u'void foo(type arg1 [, type arg2])'
 regex.sub('(?=[][()]) |(?!,) (?!\[,)(?=[][(),])', '', s)
u'void foo ( type arg1 [, type arg2 ] )'

Note than when the two patterns are used independently they both yield the same 
result on re and regex, but once they are combined the result is different:
 re.sub('(?=[][()]) ', '', s)
u'void foo (type arg1 [, type arg2 ])'
 regex.sub('(?=[][()]) ', '', s)
u'void foo (type arg1 [, type arg2 ])'

 re.sub('(?!,) (?!\[,)(?=[][(),])', '', s)
u'void foo( type arg1 [, type arg2])'
 regex.sub('(?!,) (?!\[,)(?=[][(),])', '', s)
u'void foo( type arg1 [, type arg2])'

--

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



[issue2636] Adding a new regex module (compatible with re)

2011-09-01 Thread Matthew Barnett

Matthew Barnett pyt...@mrabarnett.plus.com added the comment:

The regex module supports nested sets and set operations, eg. 
r[[a-z]--[aeiou]] (the letters from 'a' to 'z', except the vowels). This 
means that literal '[' in a set needs to be escaped.

For example, re module sees [][()]... as:

[  start of set
 ] literal ']'
 [()   literals '[', '(', ')'
]  end of set
...   ...

but the regex module sees it as:

[  start of set
 ] literal ']'
 [()]  nested set [()]
 ...   ...

Thus:

 s = u'void foo ( type arg1 [, type arg2 ] )'
 regex.sub(r'(?=[][()]) |(?!,) (?!\[,)(?=[][(),])', '', s)
u'void foo ( type arg1 [, type arg2 ] )'
 regex.sub('(?=[]\[()]) |(?!,) (?!\[,)(?=[]\[(),])', '', s)
u'void foo(type arg1 [, type arg2])'

If it can't parse it as a nested set, it tries again as a non-nested set (like 
re), but there are bound to be regexes where it could be either.

--

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



[issue6069] casting error from ctypes array to structure

2011-09-01 Thread Meador Inge

Meador Inge mead...@gmail.com added the comment:

On Thu, Sep 1, 2011 at 9:45 AM, Vlad Riscutia rep...@bugs.python.org wrote:

 Vlad Riscutia riscutiav...@gmail.com added the comment:

 Meador, I believe this was the first issue on the tracker that got me looking 
 into bitfield allocation.
 I agree that big-endian on MSVC doesn't make too much sense but you can 
 disregard that - using default endianess will still yield
 different sizes of bitfields when compiled with GCC and MSVC.

Sure, but this particular issue is purporting that the layout of the
structure is incorrect, not that the size is.

 Basically bitfield allocation is compiler specific and patch in issue12528 
 implements a way to select which
 allocation strategy to be used at runtime instead of hardcoding the one with 
 which Python is compiled. This
 should improve cross-compiler interop. I wanted to hyperlink that patch to 
 all other bitfield bugs, that's why I
 followed up with link to the patch.

Yes, it is very compiler specific.  I have some thoughts about making
this configurable, but I will comment on issue12528 with those.

 Feel free to close this, either as not an issue or as a duplicate of 
 issue12528.

I will open a documentation bug and close this one out.

--

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



[issue12868] test_faulthandler.test_stack_overflow() failed on OpenBSD

2011-09-01 Thread Charles-François Natali

Charles-François Natali neolo...@free.fr added the comment:

Here's a patch with an updated skip message.

As for rthreads support, a quick search seems to indicate that its API is 
exactly the same as pthreads, and it's even binary compatible. Python will 
automatically use it when run on a OpenBSD system with rthreads enabled.

--
Added file: http://bugs.python.org/file23082/openbsd_sigaltstack-1.diff

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



[issue12868] test_faulthandler.test_stack_overflow() failed on OpenBSD

2011-09-01 Thread Charles-François Natali

Changes by Charles-François Natali neolo...@free.fr:


Removed file: http://bugs.python.org/file23078/openbsd_sigaltstack.diff

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



[issue2636] Adding a new regex module (compatible with re)

2011-09-01 Thread Ezio Melotti

Ezio Melotti ezio.melo...@gmail.com added the comment:

Thanks for the explanation, but isn't this a backward incompatible feature?
I think it should be enabled only when the re.NEW flag is passed.
The idiom [][...] is also quite common, so I think it might break different 
programs if regex has a different behavior.

--

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



[issue6069] casting error from ctypes array to structure

2011-09-01 Thread Vlad Riscutia

Vlad Riscutia riscutiav...@gmail.com added the comment:

Sounds good. Please nosy me in the doc bug.

--

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



[issue12528] Implement configurable bitfield allocation strategy

2011-09-01 Thread Meador Inge

Meador Inge mead...@gmail.com added the comment:

As stated, how a particular compiler allocates bitfields is *extremely* 
implementation specific.  There can be differences in implementations between 
different compilers, different *versions* of the same compiler, and different 
invocations of the same compiler where the options are varied.

I am wondering whether adding this feature will open up a can of worms that we 
don't want to deal with.  There are other options beyond MSVC and GCC that seem 
reasonable.  For example, GCC packs bitfields together on structures defined 
with '__attribute__((packed))'.  Do we need a GCCPACKED option now?

Also, GCC 4.4 fixed a bug that can lead to differences in structure layout from 
previous versions.  See -Wpacked-bitfield-compat option [1].
Do we need a GCC44 option now?

Finally, structure layout is architecture specific.  GCC for x86, for example, 
has the 'ms_struct' attribute extensions for x86 [2].  Does this mean that for 
a GCC compiled Python that the MSVC option will only work for an x86 host?

My point is that there are many, many variations on how a *single* compiler can 
allocate bitfields.  So just saying GCC allocation
strategy is not adequate.

So, lets take a step back.  What exact problem is this feature trying
to solve?  Is one of the use cases that 'ctypes' for a Windows hosted Python 
built with MSVC++ can interop with C code compiled with a Windows  hosted GCC 
(e.g. cygwin)?  If so, then is that realistic?  ISTM, that there are other ABI 
differences that would prevent that from working.

It seem perfectly reasonable to me that ctypes will only interact with bits 
that were constructed with the exact same compiler (and options) as the 
interpreter itself.  If it is not already, then we should document this.

[1] http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
[2] http://gcc.gnu.org/onlinedocs/gcc/Variable-Attributes.html

--
nosy: +meadori

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



[issue2636] Adding a new regex module (compatible with re)

2011-09-01 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 Thanks for the explanation, but isn't this a backward incompatible
 feature?
 I think it should be enabled only when the re.NEW flag is passed.
 The idiom [][...] is also quite common, so I think it might break
 different programs if regex has a different behavior.

As someone said, I'd rather have a re.COMPAT flag.  re.NEW will look
silly in a few years.
Also, we can have a warning about unescaped brackets during a
transitional period. However, it really needs the warning to be enabled
by default, IMO.

--

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



[issue12876] Make Test Error : ImportError: No module named _sha256

2011-09-01 Thread Antoine Pitrou

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


--
nosy: +gregory.p.smith

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



[issue12850] [PATCH] stm.atomic

2011-09-01 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

I'm worried that by allowing users to pass function pointers here, we are 
allowing all kinds of uses that we will have to more or less support later. 
What exactly taking the GIL means and when exactly it is done in the 
execution process is an implementation detail.

Armin, is there a way to implement what you want to do with a more constraining 
API?

--
nosy: +pitrou

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



[issue7171] Add inet_ntop and inet_pton support for Windows

2011-09-01 Thread Antoine Pitrou

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


--
components: +Library (Lib) -IO, Windows
keywords: +easy
versions: +Python 3.3 -Python 3.2

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



[issue12528] Implement configurable bitfield allocation strategy

2011-09-01 Thread Vlad Riscutia

Vlad Riscutia riscutiav...@gmail.com added the comment:

Well currently we pack bitfields with an algorithm that uses #ifdefs for GCC 
and MSVC builds. This feature tries to remove the hardcoded behavior and 
implement it as a runtime option. This should improve interop with other 
compilers. Currently I provided these for MSVC-style and GCC-style bitfield 
allocations. These, of course, can be extended with other strategies.

I am not sure that the fact that GCC has different types of bitfield 
allocations in different versions is a point against this feature. Consider 
that in our current code we don't use compiler bitfield allocation, we create 
the structure layout using our own algorithm, interop might be broken even if 
Python gets built with same version of GCC as the binary we want to interop 
with as long as algorithm is out of date. This patch should provide some 
flexibility in this matter.

Wouldn't a GCC44 constant provided at API level be better than saying you 
can't interop with anything build with GCC 4.4 and up? Or vice-versa, anything 
built with GCC  4.4.

--

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



[issue2636] Adding a new regex module (compatible with re)

2011-09-01 Thread Ezio Melotti

Ezio Melotti ezio.melo...@gmail.com added the comment:

Changing the name of the flag is fine with me.

Having a warning for unescaped brackets that trigger set operations might also 
be a solution (once escaped they will still work on the old re).  Maybe the 
same could also be done for scoped flags.

FWIW I tried to come up with a simpler regex that makes some sense and triggers 
unwanted set operations and I didn't come up with anything except:
 regex.findall('[[(]foo[)]]', '[[foo] (foo)]')
['f', 'o', 'o', '(', 'f', 'o', 'o', ')']
 re.findall('[[(]foo[)]]', '[[foo] (foo)]')
['(foo)]']
(but this doesn't make too much sense).  Complex regex will still break though, 
so the issue needs to be addressed somehow.

--

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



[issue12878] io.StringIO doesn't provide a __dict__ field

2011-09-01 Thread Eric Promislow

New submission from Eric Promislow er...@activestate.com:

I see that going from Python 3.1.1 to 3.1.2 
instances of io.StringIO no longer have a __dict__ field.

Why?  Is this to make them unpicklable?

--
components: IO
messages: 143344
nosy: ericp
priority: normal
severity: normal
status: open
title: io.StringIO doesn't provide a __dict__ field
type: behavior
versions: Python 3.1

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



[issue12876] Make Test Error : ImportError: No module named _sha256

2011-09-01 Thread Gregory P. Smith

Gregory P. Smith g...@krypto.org added the comment:

The fact that it called __get_builtin_constructor implies that the ssl backed 
_hashlib module was not available.  It looks like the non-openssl standalone 
_sha256 module (and likely the _sha512 module) both failed to be compiled.

I would not expect that to ever happen when using gcc regardless of the OS and 
crazy architecture.

--

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



[issue12802] Windows error code 267 should be mapped to ENOTDIR, not EINVAL

2011-09-01 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 385c2ec78f16 by Antoine Pitrou in branch '3.2':
Issue #12802: the Windows error ERROR_DIRECTORY (numbered 267) is now
http://hg.python.org/cpython/rev/385c2ec78f16

New changeset d72d5c942232 by Antoine Pitrou in branch 'default':
Issue #12802: the Windows error ERROR_DIRECTORY (numbered 267) is now
http://hg.python.org/cpython/rev/d72d5c942232

--
nosy: +python-dev

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



[issue12802] Windows error code 267 should be mapped to ENOTDIR, not EINVAL

2011-09-01 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Committed now. Hopefully it won't break anything!

--
resolution:  - fixed
stage: patch review - committed/rejected
status: open - closed
versions:  -Python 2.7

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



[issue12878] io.StringIO doesn't provide a __dict__ field

2011-09-01 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

I'm not sure why that is. Note that you can still set and get arbitrary 
attributes, so there must be a dict somewhere, but it isn't exposed. Also, 
there wasn't any significant change in StringIO in the 3.1 line.
Benjamin, do you have any idea?

 s = io.StringIO()
 s.x = 5
 s.x
5
 s.__dict__
Traceback (most recent call last):
  File stdin, line 1, in module
AttributeError: '_io.StringIO' object has no attribute '__dict__'

--
nosy: +amaury.forgeotdarc, benjamin.peterson, pitrou
versions: +Python 3.2, Python 3.3 -Python 3.1

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



[issue12879] method-wrapper objects are difficult to inspect

2011-09-01 Thread Antoine Pitrou

New submission from Antoine Pitrou pit...@free.fr:

This is a bit unhelpful:

 s = io.StringIO()
 s.__getattribute__
method-wrapper '__getattribute__' of _io.StringIO object at 0x7f118a2997f0
 dir(s.__getattribute__)
Traceback (most recent call last):
  File stdin, line 1, in module
TypeError: object does not provide __dir__

--
components: Interpreter Core
messages: 143349
nosy: amaury.forgeotdarc, benjamin.peterson, pitrou
priority: normal
severity: normal
status: open
title: method-wrapper objects are difficult to inspect
type: behavior
versions: Python 3.2, Python 3.3

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



[issue11879] TarFile.chown: should use TarInfo.uid if user lookup fails

2011-09-01 Thread Doug Hellmann

Changes by Doug Hellmann doug.hellm...@gmail.com:


--
nosy: +doughellmann

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



[issue2636] Adding a new regex module (compatible with re)

2011-09-01 Thread Matthew Barnett

Matthew Barnett pyt...@mrabarnett.plus.com added the comment:

I think I need a show of hands.

Should the default be old behaviour (like re) or new behaviour? (It might be 
old now, new later.)

Should there be a NEW flag (as at present), or an OLD flag, or a VERSION 
parameter (0=old, 1=new, 2=?)?

--

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



[issue12528] Implement configurable bitfield allocation strategy

2011-09-01 Thread Terry J. Reedy

Terry J. Reedy tjre...@udel.edu added the comment:

As a (Windows) user, I would like to be able to download any working 
pre-compiled shared library (.dll) and access it via ctypes. The particular 
compiler used to compile cpythonx.y.z should not determine whether a Pythonx.y 
program works. The use of VSC2008 is not part of the Python3.2 definition. So I 
am in favor of features than makes ctypes more likely to work.

I understand that this should be easy if the datatypes sent and received are 
standard ints, floats, and arrays thereof, since the bit patterns are then 
knowable. I gather that the problem with custom bitfields is that the resulting 
bit pattern format is not only not documented in the .dll, but is also not 
determined by the external documentation (the .h files).

Does anyone know how Cython, for instance, handles this problem? Stephen Behnel 
recommends it as an alternative to ctypes. Does it even try to deal with 
bitfields?

--

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



[issue12537] mailbox's _become_message is very fragile

2011-09-01 Thread Justin Wehnes

Changes by Justin Wehnes jweh...@gmail.com:


--
nosy: +jwehnes

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



[issue2636] Adding a new regex module (compatible with re)

2011-09-01 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 I think I need a show of hands.
 
 Should the default be old behaviour (like re) or new behaviour? (It
 might be old now, new later.)
 
 Should there be a NEW flag (as at present), or an OLD flag, or a
 VERSION parameter (0=old, 1=new, 2=?)?

VERSION might be best, but then it should probably be a separate
argument rather than a flag.

old now, new later doesn't solve the issue unless we have a careful
set of warnings to point out problematic regexes.

--

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



[issue12868] test_faulthandler.test_stack_overflow() failed on OpenBSD

2011-09-01 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

 As for rthreads support, a quick search seems to indicate that its API is
 exactly the same as pthreads, and it's even binary compatible. Python will
 automatically use it when run on a OpenBSD system with rthreads enabled.

Well... not exactly. I asked on #openbsd:

22:07  haypo hi. what is the status of rthread? it looks like it is not 
available by default
22:14  tp76 I might be wrong, but I don't think much work has been done on 
that in a while.
22:15  haypo tp76: i'm working on Python. Python is linked to pthread. I 
would like to know if we can link Python to rthread
22:16  farhaven no, you can't
22:17  farhaven rthreads is not (yet) a drop in replacement for pthreads and 
it basically works only if you use 
  it for kernel threads
22:17  farhaven at least the manpage for rfork() advises against using it in 
userspace to create rthreads
22:18  haypo farhaven: does rthread have a userland API, similar to pthread, 
to manage threads?
22:18  farhaven nope, not that i know of
22:18  haypo i cannot find informations about rthread, only some old 
documents (2005)
22:18  farhaven afaik the only thing exposed to userland is rfork()'s 
RFTHREAD
22:19  farhaven i think tedu made a presentation about rthreads a while ago
22:19  farhaven but yeah, i wondered about that too one or two months ago
22:19  farhaven and it turned out, rthreads are not exactly usable :D

Your last patch is correct. Go ahead.

--

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



[issue12879] method-wrapper objects are difficult to inspect

2011-09-01 Thread Benjamin Peterson

Benjamin Peterson benja...@python.org added the comment:

51e27f42beda and friends.

--
resolution:  - fixed
status: open - closed

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



[issue2636] Adding a new regex module (compatible with re)

2011-09-01 Thread Jeffrey C. Jacobs

Jeffrey C. Jacobs timeho...@users.sourceforge.net added the comment:

On 1 September 2011 16:12, Matthew Barnett rep...@bugs.python.org wrote:

 Matthew Barnett pyt...@mrabarnett.plus.com added the comment:

 I think I need a show of hands.

For my part, I recommend literal flags, i.e. re.VERSION222,
re.VERSION300, etc.  Then you know exactly what you're getting and
although it may be confusing, we can then slowly deprecate
re.VERSION222 so that people can get used to the new syntax.

Returning to lurking on my own issue.  :)

--

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



[issue12868] test_faulthandler.test_stack_overflow() failed on OpenBSD

2011-09-01 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset a29b72950795 by Charles-François Natali in branch 'default':
Issue #12868: Skip test_faulthandler.test_stack_overflow() on OpenBSD:
http://hg.python.org/cpython/rev/a29b72950795

--
nosy: +python-dev

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



[issue12868] test_faulthandler.test_stack_overflow() failed on OpenBSD

2011-09-01 Thread Charles-François Natali

Charles-François Natali neolo...@free.fr added the comment:

Committed.

Rémi, thanks once again for this report!

--
resolution:  - fixed
stage: needs patch - committed/rejected
status: open - closed

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



[issue8813] SSLContext doesn't support loading a CRL

2011-09-01 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Is it enough to just load a CRL file, or is other functionality usually needed?

The following APIs should help us do it:
- X509_STORE *SSL_CTX_get_cert_store(const SSL_CTX *ctx);
- int X509_STORE_add_crl(X509_STORE *ctx, X509_CRL *x);
- X509_CRL *d2i_X509_CRL_fp(FILE *fp,X509_CRL **crl);

And also for configuration (enable CRL checking on the context):
- X509_VERIFY_PARAM *X509_STORE_CTX_get0_param(X509_STORE_CTX *ctx);
- int X509_VERIFY_PARAM_set_flags(X509_VERIFY_PARAM *param, unsigned long 
flags);

--
stage:  - needs patch
versions: +Python 3.3 -Python 3.2

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



[issue12494] subprocess: check_output() doesn't close pipes on error

2011-09-01 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 86b7f14485c9 by Victor Stinner in branch 'default':
Issue #12494: Close pipes and kill process on error in subprocess functions
http://hg.python.org/cpython/rev/86b7f14485c9

--
nosy: +python-dev

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



[issue12494] subprocess: check_output() doesn't close pipes on error

2011-09-01 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

 The second patch looks good. Tests?

I don't see how to test that the pipes are closed, because the Popen object 
(and its stdout and stderr attributes) are not visible outside the patched 
functions.

 I consider that this issue is a bug, so it should be fixed in 2.7
 and 3.2.

I tried to write a patch, but I chose to keep the code unchanged. I prefer to 
keep this little tricky bug, instead of introducing another more important 
regression.

Reopen the issue if you have a script to test the fix, or if you really want a 
backport.

--
resolution:  - fixed
status: open - closed

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



[issue6560] socket sendmsg(), recvmsg() methods

2011-09-01 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@haypocalc.com:


--
nosy:  -haypo

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



[issue12871] Disable sched_get_priority_min/max if Python is compiled without threads

2011-09-01 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

 For example, the following snippet builds correctly on Linux

It builds correctly with -pthread or -lpthread, but it fails to build without 
these options.

sched_get_priority_max() and sched_get_priority_min() come from libpthread on 
OpenBSD, whereas Python only checks for #ifdef HAVE_SCHED_H.

--

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



[issue12871] Disable sched_get_priority_min/max on OpenBSD if Python is compiled without threads

2011-09-01 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@haypocalc.com:


--
title: Disable sched_get_priority_min/max if Python is compiled without threads 
- Disable sched_get_priority_min/max on OpenBSD if Python is compiled without 
threads

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



[issue12636] IDLE ignores -*- coding -*- with -r option

2011-09-01 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

Fixed, thanks for the report.

Python 2.7 is not affected by this bug.

--
versions: +Python 3.3

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



[issue12636] IDLE ignores -*- coding -*- with -r option

2011-09-01 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@haypocalc.com:


--
resolution: works for me - fixed
status: open - closed

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



[issue12636] IDLE ignores -*- coding -*- with -r option

2011-09-01 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset fef1ed14 by Victor Stinner in branch '3.2':
Issue #12636: IDLE reads the coding cookie when executing a Python script.
http://hg.python.org/cpython/rev/fef1ed14

New changeset a8748022504f by Victor Stinner in branch 'default':
Merge 3.2: Issue #12636: IDLE reads the coding cookie when executing a Python 
script.
http://hg.python.org/cpython/rev/a8748022504f

--
nosy: +python-dev

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



[issue10278] add time.wallclock() method

2011-09-01 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

clock_gettime.patch: add time.clock_gettime() function and time.CLOCK_xxx 
constants. The patch requires to rerun autoconf.

For the documentation, I don't know the availability of this function. Is it 
available on Windows? CLOCK_REALTIME doc contains Setting this clock requires 
appropriate privileges: this sentence might be removed if we don't expose 
clock_settime.

The constants are not defined if the function is not available.

timemodule.c and datetimemodule.c are no more linked to libm. I don't know why 
libm was used? Copy/paste failure?

On Linux, clock_gettime() requires librt. I chose to check for librt in 
configure.in. To get this info in setup.py, I close to use the TIMEMODULE_LIBS 
define (in pyconfig.h). I don't know if there is something simpler.

time.clock_gettime() returns a float. It would be nice to keep nanoseconds as 
an integer, but I chose a float to mimic other time functions. If we need 
nanosecond resolution, a new function can be added.

The unit test is very simple, but less than time.clock() test :-)

--
Added file: http://bugs.python.org/file23083/clock_gettime.patch

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



[issue12852] POSIX level issues in posixmodule.c on OpenBSD 5.0

2011-09-01 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@haypocalc.com:


--
title: test_posix.test_fdlistdir() segfault on OpenBSD - POSIX level issues in 
posixmodule.c on OpenBSD 5.0

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



[issue12852] POSIX level issues in posixmodule.c on OpenBSD 5.0

2011-09-01 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Rémi : what happens if you manually add

extern DIR *fdopendir(int fd);

at the beginning of posixmodule.c?

--
nosy: +pitrou

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



[issue2636] Adding a new regex module (compatible with re)

2011-09-01 Thread Ezio Melotti

Ezio Melotti ezio.melo...@gmail.com added the comment:

In order to replace the re module, regex must have the same behavior (except 
for bugs, where the correct behavior is most likely preferred, even if it's 
different).

Having re.OLD and warnings active by default in 3.3 (and possibly 3.4) should 
give enough time to fix the regex if/when necessary (either by changing the 
regex or by adding the re.OLD flag manually).  In 3.4 (or 3.5) we can then 
change the default behavior to the new semantics.

In this way we won't have to keep using the re.NEW flag on every regex.  I'm 
not sure if a version flag is useful, unless you are planning to add more 
incompatible changes.  Also each new version *flag* means one more path to 
add/maintain in the code.  Having a simple .regex_version attribute might be a 
more practical (albeit less powerful) solution.

--

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



[issue2636] Adding a new regex module (compatible with re)

2011-09-01 Thread Steven D'Aprano

Steven D'Aprano steve+pyt...@pearwood.info added the comment:

Matthew Barnett wrote:
 Matthew Barnett pyt...@mrabarnett.plus.com added the comment:
 
 I think I need a show of hands.
 
 Should the default be old behaviour (like re) or new behaviour? (It might be 
 old now, new later.)
 
 Should there be a NEW flag (as at present), or an OLD flag, or a VERSION 
 parameter (0=old, 1=new, 2=?)?

I prefer Antoine's suggested spelling, COMPAT, rather than OLD.

How would you write the various options? After the transition is easy:

 # Get backwards-compatible behaviour:
 compile(string, COMPAT)
 compile(string, VERSION0)

 # Get regex non-compatible behaviour:
 compile(string)  # will be the default in the future
 compile(string, VERSION1)

But what about during the transition, when backwards-compatible 
behaviour is the default? There needs to be a way to turn compatibility 
mode off, not just turn it on.

 # Get backwards-compatible behaviour:
 compile(string)  # will be the default for a release or two
 compile(string, COMPAT)
 compile(string, VERSION0)

 # Get regex non-compatible behaviour:
 compile(string, VERSION1)

So I guess my preference is VERSION0 and VERSION1 flags, even if there 
is never going to be a VERSION2.

--

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



[issue10882] Add os.sendfile()

2011-09-01 Thread Yury Selivanov

Changes by Yury Selivanov yseliva...@gmail.com:


--
nosy: +Yury.Selivanov

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



[issue12528] Implement configurable bitfield allocation strategy

2011-09-01 Thread Meador Inge

Meador Inge mead...@gmail.com added the comment:

Hi Vlad,

On Thu, Sep 1, 2011 at 1:30 PM, Vlad Riscutia rep...@bugs.python.org wrote:

 Vlad Riscutia riscutiav...@gmail.com added the comment:

 Well currently we pack bitfields with an algorithm that uses #ifdefs for GCC 
 and MSVC builds. This feature tries to remove the
 hardcoded behavior and implement it as a runtime option. This should improve 
 interop with other compilers. Currently I provided these
 for MSVC-style and GCC-style bitfield allocations. These, of course, can be 
 extended with other strategies.

Yup, I understand what the feature is doing.  I just wanted to
reiterate (as I am sure you already know) that typically the rules for
implementing bit fields in a particular compiler are pretty complex.
I just wanted to make sure that the use cases are out there to justify
the complexity.  issue11920 really does seem like a use case where
someone would otherwise be stuck without a runtime configurable
allocation strategy.

BTW, out of curiosity I explored the packed case that I mentioned
earlier with GCC more (reproduction case attached):

[meadori@motherbrain ctypes]$ make clean; make
rm -f foo.o libfoo.so.1.0
gcc -Wall -fPIC  -c foo.c
gcc -shared -Wl,-soname,libfoo.so.1 -o libfoo.so.1.0 foo.o
python repro.py
In Python: (85, 85)
From C: (85, 85)
From Python: (85, 85)
[meadori@motherbrain ctypes]$ make clean; CFLAGS=-DPACK=1 make
rm -f foo.o libfoo.so.1.0
gcc -Wall -fPIC -DPACK=1 -c foo.c
gcc -shared -Wl,-soname,libfoo.so.1 -o libfoo.so.1.0 foo.o
python repro.py
In Python: (85, 85)
From C: (85, 85)
From Python: (85, 170)

This shows that there are already cases that can't be handled with
packed bit fields and GCC.  This runtime configuration feature, could
fix this case as well.  However, it is probably better to wait for a
real world use case before implementing some pathological case that I
cooked up ;-)

 Wouldn't a GCC44 constant provided at API level be better than saying you 
 can't interop with anything build with GCC 4.4 and up? Or  vice-versa, 
 anything built with GCC  4.4.

Yeah, probably so.  I think the compiler constraint I stated before is
probably a bit too strong.  I need to think about it more.  But,
again, my point is that there are a lot of different variations when
it comes to bit field allocations.  I don't think we want to end up
implementing all of them.

--
Added file: http://bugs.python.org/file23084/ctypes-packed-bitfields.tar.bz2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12528
___

ctypes-packed-bitfields.tar.bz2
Description: BZip2 compressed data
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12880] ctypes: clearly document how structure bit fields are allocated

2011-09-01 Thread Meador Inge

New submission from Meador Inge mead...@gmail.com:

As issues like issue6069 and issue11920 allude to, figuring out how 'ctypes' 
allocates bit-fields is not very clear.  The documentation should be enhanced 
to flesh this out in more detail.  As an example, Microsoft documents the VC++ 
implementation in a reasonably clear manner ( 
http://msdn.microsoft.com/en-us/library/ewwyfdbe(v=vs.71).aspx ).

--
assignee: docs@python
components: Documentation
messages: 143369
nosy: docs@python, meadori, terry.reedy, vladris
priority: normal
severity: normal
stage: needs patch
status: open
title: ctypes: clearly document how structure bit fields are allocated
type: feature request
versions: Python 3.3, Python 3.4

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



[issue6069] casting error from ctypes array to structure

2011-09-01 Thread Meador Inge

Changes by Meador Inge mead...@gmail.com:


--
stage: test needed - committed/rejected

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



[issue6069] casting error from ctypes array to structure

2011-09-01 Thread Meador Inge

Meador Inge mead...@gmail.com added the comment:

I opened issue12880 for the doc bug.  Closing this one out ...

--
resolution:  - invalid
status: open - closed

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



[issue11920] ctypes: Strange bitfield structure sizing issue

2011-09-01 Thread Meador Inge

Meador Inge mead...@gmail.com added the comment:

Hi Steve,

There is currently no way to deal with this situation.  Vlad has opened 
issue12528 with a proposal to make the allocation strategy configurable from 
the 'ctypes' API.  Please follow that issue if you are still interested.  I am 
closing this issue.

--
nosy: +meadori
resolution:  - duplicate
stage:  - committed/rejected
status: open - closed
superseder:  - Implement configurable bitfield allocation strategy

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



[issue9030] ctypes variable limits

2011-09-01 Thread Meador Inge

Changes by Meador Inge mead...@gmail.com:


--
nosy:  -theller
stage:  - needs patch

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



[issue9175] ctypes doesn't build on hp-ux

2011-09-01 Thread Meador Inge

Changes by Meador Inge mead...@gmail.com:


--
assignee: theller - 
nosy:  -theller
priority: normal - low

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



[issue6980] fix ctypes build failure on armel-linux-gnueabi with -mfloat-abi=softfp

2011-09-01 Thread Meador Inge

Meador Inge mead...@gmail.com added the comment:

This was, in fact, committed already.

--
assignee: theller - 
nosy: +meadori -theller
resolution:  - fixed
stage:  - committed/rejected
status: open - closed

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



[issue6980] fix ctypes build failure on armel-linux-gnueabi with -mfloat-abi=softfp

2011-09-01 Thread Meador Inge

Meador Inge mead...@gmail.com added the comment:

Whoops.  I meant to post a link to the commit before.  It is here: 
http://hg.python.org/cpython/rev/584db03e5248.

--

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



[issue5718] Problem compiling ffi part of build on AIX 5.3.

2011-09-01 Thread Meador Inge

Changes by Meador Inge mead...@gmail.com:


--
assignee: theller - 
nosy:  -theller
priority: normal - low
stage:  - needs patch

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



[issue6006] ffi.c compile failures on AIX 5.3 with xlc

2011-09-01 Thread Meador Inge

Changes by Meador Inge mead...@gmail.com:


--
assignee: theller - 
nosy:  -theller
priority: normal - low
stage:  - patch review
type:  - compile error

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



[issue12819] PEP 393 - Flexible Unicode String Representation

2011-09-01 Thread Jesús Cea Avión

Changes by Jesús Cea Avión j...@jcea.es:


--
nosy: +jcea

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



[issue2636] Adding a new regex module (compatible with re)

2011-09-01 Thread Ezio Melotti

Ezio Melotti ezio.melo...@gmail.com added the comment:

Also note that some behaviors are not old or compatible, but just 
different.  For example why inline flags should be the old (or new) behavior?  
Or e.g. the behavior of version 2 but not 0 and 1?
Also what if I want zero-width splits but not nested sets and sets operations?  
Or if I want inline flags but not zero-width splits?

A new set of features flags might be an alternative approach.  It will also 
make possible to add new features that are not backward compatible that can be 
turned on explicitly with their flag.

It would be fine for me if I had to turn on explicitly e.g. nested sets if/when 
I'll need to use them, and keep having the normal behavior otherwise.

OTOH there are three problems with these approach:
  1) it's not compatible with regex (I guess people will use the external 
module in Python 3.3 and the included one in 3.3+, probably expecting the same 
semantics).  This is also true with the OLD/COMPAT flag though;
  2) it might require other inline feature-flags;
  3) the new set of flags might be added to the other flags or be separate, so 
e.g. re.compile(pattern, flags=re.I|re.NESTEDSETS) or re.compile(pattern, 
flags=re.I, features=re.NESTEDSETS).  I'm not sure it's a good idea to add 
another arg though.

Matthew, is there a comprehensive list of all the bugfix/features that have a 
different behavior from re?
We should first check what changes are acceptable and what aren't, and 
depending on how many and what they are we can then decide what is the best 
approach (a catch-all flag or several flags to change the behavior, transition 
period + warning before setting it as default, etc.)

--

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



[issue12764] segfault in ctypes.Struct with bad _fields_

2011-09-01 Thread Meador Inge

Meador Inge mead...@gmail.com added the comment:

Vlad,

Thanks for the patch.  A few nits:

   1. The test case is in 'test_bitfields.py'.
  I think it should go in 'test_structures.py'.

   2. The test case would probably be cleaner using a 'with' context
  manager:

 with self.assertRaises(TypeError):
   class S(Structure):
   _fields_ = [(bx, c_int)]

  A few more test cases might be nice too.

   3. The TypeError message display something like:

  structure field name must be string not bytes

  maybe the following would be more understandable:

  field name must be an object of type str not bytes

   4. The 'ptr', 'len', and 'buf' initializers are unnecessary.

Otherwise, looks good.

--
nosy: +meadori
stage:  - patch review
versions: +Python 3.3, Python 3.4

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



[issue12881] ctypes: segfault with large structure field names

2011-09-01 Thread Meador Inge

New submission from Meador Inge mead...@gmail.com:

Reproduced on Fedora 15 with tip Python:

[meadori@motherbrain cpython]$ ./python 
Python 3.3.0a0 (default:3102951cc1ce+, Sep  1 2011, 22:19:06) 
[GCC 4.6.0 20110603 (Red Hat 4.6.0-10)] on linux
Type help, copyright, credits or license for more information.
 import ctypes
[68588 refs]
 class S(ctypes.Structure):
... _fields_ = [('x' * 1000, ctypes.c_int)]
... 
Segmentation fault (core dumped)

--
components: ctypes
messages: 143376
nosy: amaury.forgeotdarc, belopolsky, meadori
priority: normal
severity: normal
stage: needs patch
status: open
title: ctypes: segfault with large structure field names
type: crash
versions: Python 3.3, Python 3.4

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



[issue2636] Adding a new regex module (compatible with re)

2011-09-01 Thread Steven D'Aprano

Steven D'Aprano steve+pyt...@pearwood.info added the comment:

Ezio Melotti wrote:
 Ezio Melotti ezio.melo...@gmail.com added the comment:
 
 Also note that some behaviors are not old or compatible, but just 
 different.  For example why inline flags should be the old (or new) behavior? 
  Or e.g. the behavior of version 2 but not 0 and 1?
 Also what if I want zero-width splits but not nested sets and sets 
 operations?  Or if I want inline flags but not zero-width splits?

I think this is adding excessive complexity. Please consider poor 
Matthew's sanity (or whoever ends up maintaining the module long term), 
not to mention that of the users of the module.

I think it is reasonable to pick a *set* of features as a whole:

I want the regex module to behave exactly the same as the re module

or

I don't care about the re module, give me all the goodies offered by 
the regex module

but I don't think it is reasonable to expect to pick and choose 
individual features:

I want zero-width splits but not nested sets or inline flags, and I 
want the locale flag to act like the re module, and ASCII characters to 
be treated just like in Perl, but non-ASCII characters to be treated 
just like grep, and a half double decaff half-caf soy mocha with a twist 
of lemon with a dash of half-fat unsweetened whipped cream on the side.

wink

If you don't want a feature, don't use it.

Feature flags leads to a combinational explosion that makes 
comprehensive testing all but impossible. If you have four features 
A...D, then for *each* feature you need sixteen tests:

A with flags 
A with flags 0001
A with flags 0010
A with flags 0011
[...]
A with flags 

to ensure that there are no side-effects from turning features off. The 
alternative is hard to track down bugs:

this regular expression returns the wrong result, but only if you have 
flags A, B and G turned on and C and F turned off.

--

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



[issue12882] mmap crash on Windows

2011-09-01 Thread Abhijit Bhattacharjee

New submission from Abhijit Bhattacharjee itabhij...@gmail.com:

The following Code causes Python to crash
import os
import mmap
data = mmap.mmap(open(Certain File,r+).fileno(),os.path.getsize(Certain 
File))

assuming Certain File is present in the current working directory

--
components: Interpreter Core, Windows
messages: 143378
nosy: itabhijitb
priority: normal
severity: normal
status: open
title: mmap crash on Windows
type: crash
versions: Python 2.7

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



[issue12850] [PATCH] stm.atomic

2011-09-01 Thread Armin Rigo

Armin Rigo ar...@users.sourceforge.net added the comment:

Antoine: we could take two lines from the current implementation of these hook 
from stm/transactionmodule.c, and move them to the interpreter core.  CPython 
would end up with containing the core logic for transactions.  A possible API 
would look like that:

/* stops all threads different from 'tstate' at their next
   bytecode, at which point the given callback is invoked */
_PyEval_SetThreadStopper(PyThreadState *tstate, void (*callback)(void));

Such a function can also be tested in CPython, e.g. with ctypes.  Still maybe a 
different name would be better, like _PyEval_InternalThreadStopper().  Or, if 
that's still a callback too much:

/* stops all threads different from 'tstate' at their next bytecode,
   at which point they wait for the 'lock' to be available */
_PyEval_SetThreadStopper(PyThreadState *tstate, PyThread_lock_type lock);

--

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



[issue12852] POSIX level issues in posixmodule.c on OpenBSD 5.0

2011-09-01 Thread Remi Pointel

Remi Pointel pyt...@xiri.fr added the comment:

 Rémi : what happens if you manually add
 extern DIR *fdopendir(int fd);
 at the beginning of posixmodule.c?

Hello,

it seems to correctly work:
 ./python Lib/test/test_posix.py 
testNoArgFunctions (__main__.PosixTester) ... ok
test_access (__main__.PosixTester) ... ok
test_chdir (__main__.PosixTester) ... ok
test_chflags (__main__.PosixTester) ... ok
test_chown (__main__.PosixTester) ... ok
test_confstr (__main__.PosixTester) ... ok
test_cpu_set_basic (__main__.PosixTester) ... skipped don't have sched 
affinity support
test_cpu_set_bitwise (__main__.PosixTester) ... skipped don't have sched 
affinity support
test_cpu_set_cmp (__main__.PosixTester) ... skipped don't have sched affinity 
support
test_dup (__main__.PosixTester) ... ok
test_dup2 (__main__.PosixTester) ... ok
test_environ (__main__.PosixTester) ... ok
test_faccessat (__main__.PosixTester) ... ok
test_fchmodat (__main__.PosixTester) ... ok
test_fchown (__main__.PosixTester) ... ok
test_fchownat (__main__.PosixTester) ... ok
test_fdlistdir (__main__.PosixTester) ... ok
test_fexecve (__main__.PosixTester) ... skipped 'test needs posix.fexecve()'
test_fstat (__main__.PosixTester) ... ok
test_fstatat (__main__.PosixTester) ... ok
test_fstatvfs (__main__.PosixTester) ... ok
test_ftruncate (__main__.PosixTester) ... ok
test_futimens (__main__.PosixTester) ... ok
test_futimes (__main__.PosixTester) ... ok
test_futimesat (__main__.PosixTester) ... skipped 'test needs posix.futimesat()'
test_get_and_set_scheduler_and_param (__main__.PosixTester) ... skipped can't 
change scheduler
test_getcwd_long_pathnames (__main__.PosixTester) ... ok
test_getgrouplist (__main__.PosixTester) ... ok
test_getgroups (__main__.PosixTester) ... ok
test_getresgid (__main__.PosixTester) ... ok
test_getresuid (__main__.PosixTester) ... ok
test_initgroups (__main__.PosixTester) ... ok
test_lchflags_regular_file (__main__.PosixTester) ... skipped 'test needs 
os.lchflags()'
test_lchflags_symlink (__main__.PosixTester) ... skipped 'test needs 
os.lchflags()'
test_lchown (__main__.PosixTester) ... ok
test_linkat (__main__.PosixTester) ... ok
test_listdir (__main__.PosixTester) ... ok
test_listdir_default (__main__.PosixTester) ... ok
test_lockf (__main__.PosixTester) ... ok
test_lutimes (__main__.PosixTester) ... skipped 'test needs posix.lutimes()'
test_mkdirat (__main__.PosixTester) ... ok
test_mkfifo (__main__.PosixTester) ... ok
test_mkfifoat (__main__.PosixTester) ... ok
test_mknod (__main__.PosixTester) ... ok
test_mknodat (__main__.PosixTester) ... ok
test_openat (__main__.PosixTester) ... ok
test_oscloexec (__main__.PosixTester) ... ok
test_osexlock (__main__.PosixTester) ... ok
test_osshlock (__main__.PosixTester) ... ok
test_pipe (__main__.PosixTester) ... ok
test_pipe2 (__main__.PosixTester) ... skipped 'test needs os.pipe2()'
test_posix_fadvise (__main__.PosixTester) ... skipped 'test needs 
posix.posix_fadvise()'
test_posix_fallocate (__main__.PosixTester) ... skipped 'test needs 
posix.posix_fallocate()'
test_pread (__main__.PosixTester) ... ok
test_pwrite (__main__.PosixTester) ... ok
test_readlinkat (__main__.PosixTester) ... ok
test_readv (__main__.PosixTester) ... ok
test_renameat (__main__.PosixTester) ... ok
test_sched_affinity (__main__.PosixTester) ... skipped don't have sched 
affinity support
test_sched_priority (__main__.PosixTester) ... ok
test_sched_rr_get_interval (__main__.PosixTester) ... skipped 'no function'
test_sched_yield (__main__.PosixTester) ... ok
test_setresgid (__main__.PosixTester) ... ok
test_setresgid_exception (__main__.PosixTester) ... ok
test_setresuid (__main__.PosixTester) ... ok
test_setresuid_exception (__main__.PosixTester) ... ok
test_stat (__main__.PosixTester) ... ok
test_statvfs (__main__.PosixTester) ... ok
test_strerror (__main__.PosixTester) ... ok
test_symlinkat (__main__.PosixTester) ... ok
test_truncate (__main__.PosixTester) ... ok
test_umask (__main__.PosixTester) ... ok
test_unlinkat (__main__.PosixTester) ... ok
test_utime (__main__.PosixTester) ... ok
test_utimensat (__main__.PosixTester) ... ok
test_waitid (__main__.PosixTester) ... skipped 'test needs posix.waitid()'
test_writev (__main__.PosixTester) ... ok
test_initgroups (__main__.PosixGroupsTester) ... skipped 'not enough privileges'
test_setgroups (__main__.PosixGroupsTester) ... skipped 'not enough privileges'

--
Ran 79 tests in 0.801s

OK (skipped=17)

And this command now works:

$ ./python -c 'import os; print(os.fdlistdir(os.open(/tmp, os.O_RDONLY)))'
['.X11-unix', '.ICE-unix', 'orbit-remi', '.X0-lock', 'dbus-WWfX2JhDtb']

Attached file patch-Modules_posixmodule_c is the patch to do this.

Thanks a lot,

Remi.

--
Added file: http://bugs.python.org/file23085/patch-Modules_posixmodule_c

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12852

[issue12871] Disable sched_get_priority_min/max if Python is compiled without threads

2011-09-01 Thread Charles-François Natali

Charles-François Natali neolo...@free.fr added the comment:

 It builds correctly with -pthread or -lpthread, but it fails to build without 
 these options.


Not on Linux: this is specific to OpenBSD.

 sched_get_priority_max() and sched_get_priority_min() come from libpthread on 
 OpenBSD, whereas Python only checks for #ifdef HAVE_SCHED_H.


That's exactly what I said in my previous message ;-)
I'll post a patch later.

--
title: Disable sched_get_priority_min/max on OpenBSD if Python is compiled 
without threads - Disable sched_get_priority_min/max if Python is compiled 
without threads

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