[issue8040] It would be nice if documentation pages linked to other versions of the same document

2011-04-25 Thread anatoly techtonik

Changes by anatoly techtonik techto...@gmail.com:


--
nosy: +techtonik

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



[issue9523] Improve dbm modules

2011-04-25 Thread ysj.ray

ysj.ray ysj@gmail.com added the comment:

Sorry, previous patch(issue_9523_4.diff) missed a file(Lib/test/dbm_tests.py)
Here is an intact one.

--
Added file: http://bugs.python.org/file21769/issue_9523_5.diff

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



[issue11908] Weird `slice.stop or sys.maxint`

2011-04-25 Thread ysj.ray

ysj.ray ysj@gmail.com added the comment:

`step` argument for xrange() could not be 0.

But `s.stop or sys.maxint` is really a problem, in the case of `s.stop == 0`.

So the given `Equivalent to` python code in the doc is not precisely equivalent 
to the c implementation. The doc needs a fix.

--
nosy: +ysj.ray

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



[issue11912] Python shouldn't use the mprotect() system call

2011-04-25 Thread Nils Breunese

Nils Breunese n...@breun.nl added the comment:

I contacted the author of iotop and he told me iotop does not use mprotect (but 
it does use dlopen).

Guess I'll have to do some more digging to find what is exactly doing the call 
to mprotect.

--

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



[issue11908] Weird `slice.stop or sys.maxint`

2011-04-25 Thread Raymond Hettinger

Raymond Hettinger raymond.hettin...@gmail.com added the comment:

I've got from here.  Thanks.

--

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



[issue11849] glibc allocator doesn't release all free()ed memory

2011-04-25 Thread kaifeng

kaifeng cafe...@gmail.com added the comment:

Sorry for the later update.

Valgrind shows there is no memory leak (see attached valgrind.log).

The following code,
while True:
XML(gen_xml())
has an increasing memory usage in the first 5~8 iterations, and waves around a 
constant level afterwards.

So I guess there's a component, maybe libc, Python interpreter, 
ElementTree/pyexpat module or someone else, hold some memory until process ends.

--
Added file: http://bugs.python.org/file21770/valgrind.log

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



[issue11882] test_imaplib failed on x86 ubuntu

2011-04-25 Thread ysj.ray

ysj.ray ysj@gmail.com added the comment:

Guess the problem is with time.mktime() and time.localtime(). Could you  debug 
into the Internaldate2Tuple() function and see at which step the time value(a 
time_struct or a float which represents seconds) is wrong?

--
nosy: +ysj.ray

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



[issue11662] Redirect vulnerability in urllib/urllib2

2011-04-25 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/issue11662
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3561] Windows installer should add Python and Scripts directories to the PATH environment variable

2011-04-25 Thread Jonathan Hartley

Changes by Jonathan Hartley tart...@tartley.com:


--
nosy: +jonathan.hartley

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



[issue11917] Test Error

2011-04-25 Thread Hamid

New submission from Hamid abbaszade...@gmail.com:

== CPython 3.2 (r32:88445, Apr 24 2011, 14:27:42) [GCC 4.4.4 20100726 (Red Hat 
4.4.4-13)]
==   Linux-2.6.32-71.el6.x86_64-x86_64-with-redhat-6.0-Santiago little-endian
==   /usr/local/src/Python-3.2/build/test_python_2976
Testing with flags: sys.flags(debug=0, division_warning=0, inspect=0, 
interactive=0, optimize=0, dont_write_bytecode=0, no_user_site=0, no_site=0, 
ignore_environment=0, verbose=0, bytes_warning=0, quiet=0)
[1/1] test_whatever
test test_whatever crashed -- class 'ImportError': No module named 
test_whatever
Traceback (most recent call last):
  File /usr/local/src/Python-3.2/Lib/test/regrtest.py, line 962, in 
runtest_inner
the_package = __import__(abstest, globals(), locals(), [])
ImportError: No module named test_whatever
1 test failed:
test_whatever

--
components: Tests
messages: 134377
nosy: Abbaszadeh
priority: normal
severity: normal
status: open
title: Test Error
type: compile error
versions: Python 3.2

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



[issue11856] Optimize parsing of JSON numbers

2011-04-25 Thread Jesús Cea Avión

Jesús Cea Avión j...@jcea.es added the comment:

Patch seems OK. Please, commit.

--
nosy: +jcea

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



[issue11877] Change os.fsync() to support physical backing store syncs

2011-04-25 Thread Steffen Daode Nurpmeso

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

I'll attach 11877.4.diff:

- Docu change (i hope to be better)
- Kept NetBSD after looking into

http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/kern/vfs_syscalls.c?rev=1.423content-type=text/x-cvsweb-markuponly_with_tag=MAIN
  because fsync_range() with FDISKSYNC set causes a FSYNC_CACHE
  flag to be passed through to VOP_FSYNC() in addition to
  FSYNC_WAIT, which is what plain fsync() passes exclusively.
  (I have not furtherly discovered that.  FDISKSYNC was introduced
  2005.  I believe existence of such a flag will sooner or later
  force somebody to make a difference in wether it is set or not.)
- Drop of AIX.  According to the systems manual (link in
  msg134213) there does not seem to be a difference in between
  fsync() and fsync_range()
- Drop of Linux sync_file_range() (see messages above).
  By the way, does Linux still require

--
Added file: http://bugs.python.org/file21771/11877.4.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11877
___diff --git a/Doc/library/os.rst b/Doc/library/os.rst
--- a/Doc/library/os.rst
+++ b/Doc/library/os.rst
@@ -798,7 +798,7 @@
Availability: Unix.
 
 
-.. function:: fsync(fd)
+.. function:: fsync(fd, full_fsync=False)
 
Force write of file with filedescriptor *fd* to disk.  On Unix, this calls 
the
native :c:func:`fsync` function; on Windows, the MS :c:func:`_commit` 
function.
@@ -807,6 +807,12 @@
``f.flush()``, and then do ``os.fsync(f.fileno())``, to ensure that all 
internal
buffers associated with *f* are written to disk.
 
+   The POSIX standart only requires that :c:func:`fsync` must transfer the
+   buffered data to the storage device, not that the data is actually
+   written by the device itself.  On operating systems where it is
+   necessary and possible the optional *full_fsync* argument can be used to
+   initiate additional steps to synchronize the physical backing store.
+
Availability: Unix, and Windows.
 
 
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -2119,13 +2119,55 @@
 
 #ifdef HAVE_FSYNC
 PyDoc_STRVAR(posix_fsync__doc__,
-fsync(fildes)\n\n\
-force write of file with filedescriptor to disk.);
-
-static PyObject *
-posix_fsync(PyObject *self, PyObject *fdobj)
-{
-return posix_fildes(fdobj, fsync);
+fsync(fildes, full_fsync=False)\n\n
+force write of file buffers with fildes to disk;\n
+full_fsync forces flush of disk caches in case fsync() alone is not enough.);
+
+static PyObject *
+posix_fsync(PyObject *self, PyObject *args, PyObject *kwargs)
+{
+PyObject *retval = NULL;
+auto PyObject *fdobj;
+auto int full_fsync = 1;
+static char *keywords[] = {fd, full_fsync, NULL };
+
+if (!PyArg_ParseTupleAndKeywords(args, kwargs, O|i, keywords,
+ fdobj, full_fsync))
+goto jleave;
+
+/* See issue 11877 discussion */
+# if ((defined __APPLE__  defined F_FULLFSYNC) || \
+  (defined __NetBSD__  defined FDISKSYNC))
+if (full_fsync != 0) {
+int res, fd = PyObject_AsFileDescriptor(fdobj);
+if (fd  0)
+goto jleave;
+if (!_PyVerify_fd(fd)) {
+retval = posix_error();
+goto jleave;
+}
+
+Py_BEGIN_ALLOW_THREADS
+#  ifdef __APPLE__
+res = fcntl(fd, F_FULLFSYNC);
+#  endif
+#  ifdef __NetBSD__
+res = fsync_range(fd, FFILESYNC|FDISKSYNC, 0, 0);
+#  endif
+Py_END_ALLOW_THREADS
+
+if (res  0) {
+retval = posix_error();
+goto jleave;
+}
+Py_INCREF(Py_None);
+retval = Py_None;
+} else
+# endif
+retval = posix_fildes(fdobj, fsync);
+
+jleave:
+return retval;
 }
 #endif /* HAVE_FSYNC */
 
@@ -9470,7 +9512,8 @@
 {fchdir,  posix_fchdir, METH_O, posix_fchdir__doc__},
 #endif
 #ifdef HAVE_FSYNC
-{fsync,   posix_fsync, METH_O, posix_fsync__doc__},
+{fsync,   (PyCFunction)posix_fsync, METH_VARARGS|METH_KEYWORDS,
+posix_fsync__doc__},
 #endif
 #ifdef HAVE_SYNC
 {sync,posix_sync, METH_NOARGS, posix_sync__doc__},
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11917] Test Error

2011-04-25 Thread Hamid

Changes by Hamid abbaszade...@gmail.com:


--
status: open - closed

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



[issue11849] glibc allocator doesn't release all free()ed memory

2011-04-25 Thread Charles-Francois Natali

Charles-Francois Natali neolo...@free.fr added the comment:

 The MALLOC_MMAP_THRESHOLD improvement is less visible here:


Are you running on 64-bit ?
If yes, it could be that you're exhausting M_MMAP_MAX (malloc falls
back to brk when there are too many mmap mappings).
You could try with
MALLOC_MMAP_THRESHOLD_=1024 MALLOC_MMAP_MAX_=16777216 ../opt/python
issue11849_test.py

By the way, never do that in real life, it's a CPU and memory hog ;-)

I think the root cause is that glibc's malloc coalescing of free
chunks is called far less often than in the original ptmalloc version,
but I still have to dig some more.

 By the way, I noticed that dictionnaries are never allocated through
 pymalloc, since a new dictionnary takes more than 256B...

 On 64-bit builds indeed. pymalloc could be improved to handle allocations up
 to 512B. Want to try and write a patch?

Sure.
I'll open another issue.

--

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



[issue9319] imp.find_module('test/badsyntax_pep3120') causes segfault

2011-04-25 Thread STINNER Victor

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

 Correctly merging #9319 into 3.3?

No, this issue was fixed differently in Python 3.3. I see that you reverted 
(bb62908896fe) this merge (except the test, which is a good idea).

--

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



[issue11882] test_imaplib failed on x86 ubuntu

2011-04-25 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

Yeah, I looked at the source of calendar.gmtime, and it turns out it ignores 
the isdst flag, which it also seems should be irrelevant anyway, looking at the 
test code again.

I tried setting my /etc/localtime to /usr/share/zoneinfo/posix/Asia/Calcutta, 
which gives me IST/GMT +5:30, but test_imaplib still passes for me on default.

Here is what an interpreter session looks like for me with my timezone set to 
IST:

 import calendar
 calendar.timegm((2000, 1, 1, 0, 0, 0, -1, -1, -1))
946684800
 import imaplib
 x = imaplib.Internaldate2tuple(b'25 (INTERNALDATE 01-Jan-2000 00:00:00 
 +)')
 x
time.struct_time(tm_year=2000, tm_mon=1, tm_mday=1, tm_hour=5, tm_min=30, 
tm_sec=0, tm_wday=5, tm_yday=1, tm_isdst=0)
 import time
 time.mktime(x)
946684800.0

Can you show us what yours looks like?  Comparing the above numbers to
yours, it appears to be your mktime that is giving the anomalous results.

--

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



[issue11917] Test Error

2011-04-25 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

For the record: yes this is the way regrtest works when a test named on the 
command line doesn't exist. Not pretty, I'll grant you.  Maybe someone will 
propose a patch/feature request to improve the error message some day.

--
nosy: +r.david.murray
resolution:  - invalid
stage:  - committed/rejected
type: compile error - behavior

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



[issue11918] Drop OS/2 and VMS support in Python 3.3

2011-04-25 Thread STINNER Victor

New submission from STINNER Victor victor.stin...@haypocalc.com:

Because we don't have any OS/2 and VMS maintainer for Python 3, I propose to 
drop OS/2 and VMS support in Python 3.3: OSes unsupported in 3.3, code removed 
in 3.4 (see the PEP 11 for the process).

--
components: Interpreter Core
messages: 134384
nosy: haypo
priority: normal
severity: normal
status: open
title: Drop OS/2 and VMS support in Python 3.3
versions: Python 3.3

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



[issue8326] Cannot import name SemLock on Ubuntu

2011-04-25 Thread Barry A. Warsaw

Barry A. Warsaw ba...@python.org added the comment:

Is this still a problem for people?  Ubuntu 11.04's python2.7 has been fixed:

@neurotica[~:1000]% type python2.7
python2.7 is /usr/bin/python2.7
@neurotica[~:1001]% python2.7 -c 'from _multiprocessing import SemLock'
@neurotica[~:1002]% 

The Launchpad bug for the issue is here:

https://bugs.launchpad.net/ubuntu/+source/python2.7/+bug/672209

--

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



[issue10616] Change PyObject_AsCharBuffer() error message

2011-04-25 Thread Antoine Pitrou

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

+1 to Victor's proposal (expected bytes, bytearray or buffer compatible 
object).

--
nosy: +pitrou

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



[issue11919] test_imp failures

2011-04-25 Thread Antoine Pitrou

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

http://www.python.org/dev/buildbot/all/builders/AMD64%20Leopard%203.2/builds/215/steps/test/logs/stdio
http://www.python.org/dev/buildbot/all/builders/AMD64%20Leopard%203.x/builds/1223/steps/test/logs/stdio

==
ERROR: test_issue9319 (test.test_imp.ImportTests)
--
Traceback (most recent call last):
  File 
/Users/pythonbuildbot/buildarea/3.2.hansen-osx-x86-2/build/Lib/test/test_imp.py,
 line 175, in test_issue9319
imp.find_module, test/badsyntax_pep3120)
  File 
/Users/pythonbuildbot/buildarea/3.2.hansen-osx-x86-2/build/Lib/unittest/case.py,
 line 574, in assertRaises
callableObj(*args, **kwargs)
ImportError: No module named test/badsyntax_pep3120

--
assignee: haypo
components: Tests
messages: 134387
nosy: haypo, pitrou
priority: high
severity: normal
stage: needs patch
status: open
title: test_imp failures
type: behavior
versions: Python 3.2, Python 3.3

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



[issue11849] glibc allocator doesn't release all free()ed memory

2011-04-25 Thread Antoine Pitrou

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

  The MALLOC_MMAP_THRESHOLD improvement is less visible here:
 
 
 Are you running on 64-bit ?

Yes.

 If yes, it could be that you're exhausting M_MMAP_MAX (malloc falls
 back to brk when there are too many mmap mappings).
 You could try with
 MALLOC_MMAP_THRESHOLD_=1024 MALLOC_MMAP_MAX_=16777216 ../opt/python
 issue11849_test.py

It isn't better.

--

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



[issue11917] Test Error

2011-04-25 Thread Hamid

Hamid abbaszade...@gmail.com added the comment:

Dear sir;

I will try to compile python-3.2 in REDHAT EL 6.0. There are a lot of
failure in make test. How can I fix them?

for example test_import, test_httpserver, 

Thanks
Abbaszadeh

On Mon, Apr 25, 2011 at 6:36 PM, R. David Murray rep...@bugs.python.orgwrote:


 R. David Murray rdmur...@bitdance.com added the comment:

 For the record: yes this is the way regrtest works when a test named on the
 command line doesn't exist. Not pretty, I'll grant you.  Maybe someone will
 propose a patch/feature request to improve the error message some day.

 --
 nosy: +r.david.murray
 resolution:  - invalid
 stage:  - committed/rejected
 type: compile error - behavior

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


--
Added file: http://bugs.python.org/file21772/unnamed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11917
___div dir=ltrfont size=2font face=tahoma,sans-serifDear sir;brbrI 
will try to compile python-3.2 in REDHAT EL 6.0. There are a lot of failure in 
quot;make testquot;. How can I fix them?brbrfor example test_import, 
test_httpserver, br

brThanksbrAbbaszadehbr/font/fontbrdiv class=gmail_quoteOn Mon, 
Apr 25, 2011 at 6:36 PM, R. David Murray span dir=ltrlt;a 
href=mailto:rep...@bugs.python.org;rep...@bugs.python.org/agt;/span 
wrote:br

blockquote class=gmail_quote style=margin: 0pt 0pt 0pt 0.8ex; border-left: 
1px solid rgb(204, 204, 204); padding-left: 1ex;br
R. David Murray lt;a 
href=mailto:rdmur...@bitdance.com;rdmur...@bitdance.com/agt; added the 
comment:br
br
For the record: yes this is the way regrtest works when a test named on the 
command line doesn#39;t exist. Not pretty, I#39;ll grant you.  Maybe someone 
will propose a patch/feature request to improve the error message some day.br


br
--br
nosy: +r.david.murraybr
resolution:  -gt; invalidbr
stage:  -gt; committed/rejectedbr
type: compile error -gt; behaviorbr
divdiv/divdiv class=h5br
___br
Python tracker lt;a 
href=mailto:rep...@bugs.python.org;rep...@bugs.python.org/agt;br
lt;a href=http://bugs.python.org/issue11917; 
target=_blankhttp://bugs.python.org/issue11917/agt;br
___br
/div/div/blockquote/divbrbr clear=allbr-- brdiv 
dir=ltrbiHamid Abbaszadeh/i/bbrwebsite: a 
href=http://www.respinar.com; target=_blankwww.respinar.com/abremail: 
a href=mailto:i...@respinar.com; target=_blanki...@respinar.com/abr

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



[issue10616] Change PyObject_AsCharBuffer() error message

2011-04-25 Thread Sijin Joseph

Sijin Joseph sijinjos...@gmail.com added the comment:

Looking at object.h the buffer interface is defined as 

/* buffer interface */
typedef struct bufferinfo {
void *buf;
PyObject *obj;/* owned reference */
Py_ssize_t len;
Py_ssize_t itemsize;  /* This is Py_ssize_t so it can be
 pointed to by strides in simple case.*/
int readonly;
int ndim;
char *format;
Py_ssize_t *shape;
Py_ssize_t *strides;
Py_ssize_t *suboffsets;
Py_ssize_t smalltable[2];  /* static store for shape and strides of
  mono-dimensional buffers. */
void *internal;
} Py_buffer;

typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
typedef void (*releasebufferproc)(PyObject *, Py_buffer *);

typedef struct {
 getbufferproc bf_getbuffer;
 releasebufferproc bf_releasebuffer;
} PyBufferProcs;

The code that's throwing that error looks like

if (pb == NULL || pb-bf_getbuffer == NULL) {
PyErr_SetString(PyExc_TypeError,
expected an object with the buffer interface);

I would argue that the error message gives appropriate information because it 
is expecting the object to have a bf_getbuffer member.

Maybe the friendly error message is best handled at a higher level?

--
nosy: +sijinjoseph

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



[issue11917] Test Error

2011-04-25 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

Your best resources would probably be the python mailing list (python-list, see 
http://mail.python.org) which is also comp.lang.python, or the #python irc 
channel on freenode.

--

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



[issue11849] glibc allocator doesn't release all free()ed memory

2011-04-25 Thread Charles-Francois Natali

Charles-Francois Natali neolo...@free.fr added the comment:

 It isn't better.

Requests above 256B are directly handled by malloc, so MALLOC_MMAP_THRESHOLD_ 
should in fact be set to 256 (with 1024 I guess that on 64-bit every mid-sized 
dictionnary gets allocated with brk).

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11849
___
___
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-04-25 Thread Steve Thompson

New submission from Steve Thompson steve.f.thomp...@gmail.com:

Consider the following:
import ctypes

class struct1( ctypes.Structure ):
_pack_ = 1
_fields_ =  [
( first,  ctypes.c_uint8,  1  ),
( second, ctypes.c_uint8,  1  ),
( third,  ctypes.c_uint8,  1  ),
( fourth, ctypes.c_uint8,  1  ),
( fifth,  ctypes.c_uint8,  1  ),
( pad,ctypes.c_uint16, 11 ),
]

s1 = struct1()
print ctypes.sizeof( s1 )

class struct2( ctypes.Structure ):
_pack_ = 1
_fields_ =  [
( first,  ctypes.c_uint16, 1  ),
( second, ctypes.c_uint16, 1  ),
( third,  ctypes.c_uint16, 1  ),
( fourth, ctypes.c_uint16, 1  ),
( fifth,  ctypes.c_uint16, 1  ),
( pad,ctypes.c_uint16, 11 ),
]

s2 = struct2()
print ctypes.sizeof( s2 )

The output is:
3
2

I'm generating python code from real c code.  The compiler I'm using for the 
real c code packs both of these structures into two bytes.  I need a way to 
make the first example work in python like the compiler without having to 
modify the source code.

Is this possible?

--
components: ctypes
messages: 134393
nosy: Steve.Thompson
priority: normal
severity: normal
status: open
title: ctypes: Strange bitfield structure sizing issue
versions: Python 2.6

___
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



[issue11921] distutils2 should be able to compile an Extension based on the Python implementation version

2011-04-25 Thread dholth

New submission from dholth dho...@fastmail.fm:

It might be useful to be able to declare optional Extensions that for example 
won't attempt to compile on Jython or any implementation of Python for which 
the extension (a) doesn't work or (b) would be slower than the Python fallback.

I suppose this could be accomplished without changing anything by packaging the 
extension separately and using the extant ; plat=win32 style dependency 
qualifiers?

--
assignee: tarek
components: Distutils2
messages: 134394
nosy: alexis, dholth, eric.araujo, tarek
priority: normal
severity: normal
status: open
title: distutils2 should be able to compile an Extension based on the Python 
implementation version
versions: Python 2.7

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



[issue2736] datetime needs an epoch method

2011-04-25 Thread Roundup Robot

Roundup Robot devnull@devnull added the comment:

New changeset b55eac85e39c by Alexander Belopolsky in branch 'default':
Issue #2736: Documented how to compute seconds since epoch.
http://hg.python.org/cpython/rev/b55eac85e39c

--
nosy: +python-dev

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



[issue2736] datetime needs an epoch method

2011-04-25 Thread Alexander Belopolsky

Changes by Alexander Belopolsky belopol...@users.sourceforge.net:


--
components: +Documentation -Library (Lib)
resolution:  - fixed
stage: test needed - committed/rejected
status: open - closed

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



[issue11918] Drop OS/2 and VMS support in Python 3.3

2011-04-25 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/issue11918
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11856] Optimize parsing of JSON numbers

2011-04-25 Thread Roundup Robot

Roundup Robot devnull@devnull added the comment:

New changeset d60f9d9983bb by Antoine Pitrou in branch 'default':
Issue #11856: Speed up parsing of JSON numbers.
http://hg.python.org/cpython/rev/d60f9d9983bb

--
nosy: +python-dev

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



[issue11856] Optimize parsing of JSON numbers

2011-04-25 Thread Antoine Pitrou

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


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

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



[issue11918] Drop OS/2 and VMS support in Python 3.3

2011-04-25 Thread Nadeem Vawda

Changes by Nadeem Vawda nadeem.va...@gmail.com:


--
nosy: +nadeem.vawda

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



[issue11834] wrong module installation dir on Windows

2011-04-25 Thread Bryce Verdier

Bryce Verdier bryceverd...@gmail.com added the comment:

Here is a patch for the documentation. I'm not quite sure about the scripts and 
data part. Tested with Paramiko and a new install of 2.7 to see what would 
happen and that was the result.

--
keywords: +patch
nosy: +louiscipher
Added file: http://bugs.python.org/file21773/issue133572.py33.patch

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



[issue11922] Add General Index to Windows .chm help file Contents

2011-04-25 Thread Terry J. Reedy

New submission from Terry J. Reedy tjre...@udel.edu:

The Windows distribution comes with the docs in a very nice Windows help file 
.chm form. When displayed, they is a left side bar with a Contents tab. The top 
entry is 'Python vx.y documentation' followed by 'Python Module Index' and 
'What's New in Python' and so on down to 'History and Licence'. Everything on 
the Python vx.y documentation' page is listed in the Contents EXCEPT the 
General Index. Consequently, if one only uses the contents lists, one might not 
even know it exists. In any case, it is harder to get to than anything else.

I presume the omission is unintentional. In any case, I would like to see it 
fixed, with 'General Index' added right after the module index entry. I presume 
this should be easy for someone who knows how the contents list is generated.

--
assignee: docs@python
components: Documentation, Windows
keywords: easy
messages: 134398
nosy: docs@python, terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: Add General Index to Windows .chm help file Contents
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3

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



[issue11901] Docs for sys.hexversion should give the algorithm

2011-04-25 Thread Sijin Joseph

Sijin Joseph sijinjos...@gmail.com added the comment:

Patch attached.

--
keywords: +patch
nosy: +sijinjoseph
Added file: http://bugs.python.org/file21774/11901.patch

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



[issue11901] Docs for sys.hexversion should give the algorithm

2011-04-25 Thread Sijin Joseph

Changes by Sijin Joseph sijinjos...@gmail.com:


Removed file: http://bugs.python.org/file21774/11901.patch

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



[issue11901] Docs for sys.hexversion should give the algorithm

2011-04-25 Thread Sijin Joseph

Sijin Joseph sijinjos...@gmail.com added the comment:

Fixed minor typo.

--
Added file: http://bugs.python.org/file21775/11901.patch

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



[issue11908] Weird `slice.stop or sys.maxint`

2011-04-25 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


--
versions:  -Python 2.5, Python 2.6, Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11908
___
___
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-04-25 Thread Santoso Wijaya

Changes by Santoso Wijaya santoso.wij...@gmail.com:


--
nosy: +santa4nt
type:  - behavior
versions: +Python 2.7, Python 3.1, Python 3.2, Python 3.3 -Python 2.6

___
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



[issue11846] Remove non-guaranteed implementation details from docs.

2011-04-25 Thread Terry J. Reedy

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

The range of interned ints was once much smaller, but it was expanded upwards 
to 256 so that the bytes extracted from bytes and bytearray objects, as when 
indexing or iterating, would *all* be pre-allocated objects. I should presume 
that their indexers and iterators are cognizant of this and take advantage of 
this to bypass int() creation and directly index into the the array of 
preallocated ints without a range check.

As for space and some time saving, just on startup,
a nearly fresh IDLE shell shows

 sum((sys.getrefcount(i) for i in range(-5, 257)))
4432

There are hundreds of references for each of 0 and 1.

--
nosy: +terry.reedy

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11846
___
___
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-04-25 Thread Amaury Forgeot d'Arc

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

The output is: 3 2 on windows. It is 2 2 on the linux 64bit I tried.
This is consistent with what the usual compilers do on these platforms: MSVC on 
windows, and gcc on linux.

The specification of the C language specifies that If an adjacent bitfield 
will not fit into the remainder of the unit, the implementation defines whether 
bitfields are allowed to span units or whether another unit is allocated for 
the second bitfield

Are you using gcc on windows? In this case I suggest to always use the largest 
type to declare the bitfields.

--
nosy: +amaury.forgeotdarc
Added file: http://bugs.python.org/file21776/bitfields.c

___
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



[issue11849] glibc allocator doesn't release all free()ed memory

2011-04-25 Thread Dave Malcolm

Changes by Dave Malcolm dmalc...@redhat.com:


--
nosy: +dmalcolm

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



[issue1346874] httplib simply ignores CONTINUE

2011-04-25 Thread Terry J. Reedy

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

Carl, anyone is free to submit an incomplete patch, and people often do, but if 
people who are affected by an issue do not think it worth their time to 
complete it, or even move it along, there is no reason to expect people who are 
not affected by it to think so either. All of us volunteers are busy doing 
whatever it is we do.

--
nosy: +terry.reedy

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



[issue10914] Python sub-interpreter test

2011-04-25 Thread Roundup Robot

Roundup Robot devnull@devnull added the comment:

New changeset d195ff5c44f4 by Antoine Pitrou in branch '3.2':
Issue #10914: Add a minimal embedding test to test_capi.
http://hg.python.org/cpython/rev/d195ff5c44f4

New changeset 77cf9e4b144b by Antoine Pitrou in branch '3.2':
Issue #10914: add NEWS item.
http://hg.python.org/cpython/rev/77cf9e4b144b

New changeset ef1ad39e3c40 by Antoine Pitrou in branch 'default':
Issue #10914: Add a minimal embedding test to test_capi.
http://hg.python.org/cpython/rev/ef1ad39e3c40

--

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



[issue10914] Python sub-interpreter test

2011-04-25 Thread Antoine Pitrou

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

Should be fixed.

--
resolution:  - fixed
stage:  - committed/rejected
status: open - pending

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



[issue1943] improved allocation of PyUnicode objects

2011-04-25 Thread Amaury Forgeot d'Arc

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

I just found that the extension zope.i18nmessageid: 
http://pypi.python.org/pypi/zope.i18nmessageid subclasses unicode at the C 
level:
http://svn.zope.org/zope.i18nmessageid/trunk/src/zope/i18nmessageid/_zope_i18nmessageid_message.c?rev=120914view=markup

Notably, the Message structure is defined this way:
typedef struct {
  PyUnicodeObject base;
  PyObject *domain;
  PyObject *default_;
  PyObject *mapping;
} Message;

How would such an extension type behave after the patch? Is there a workaround 
we can propose?

--

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



[issue11919] test_imp failures

2011-04-25 Thread Roundup Robot

Roundup Robot devnull@devnull added the comment:

New changeset 2f2c7eb27437 by Antoine Pitrou in branch '3.2':
Issue #11919: try to fix test_imp failure on some buildbots.
http://hg.python.org/cpython/rev/2f2c7eb27437

--
nosy: +python-dev

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



[issue11919] test_imp failures

2011-04-25 Thread Roundup Robot

Roundup Robot devnull@devnull added the comment:

New changeset 0c70c24750fd by Antoine Pitrou in branch 'default':
Issue #11919: try to fix test_imp failure on some buildbots.
http://hg.python.org/cpython/rev/0c70c24750fd

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11919
___
___
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-04-25 Thread Santoso Wijaya

Santoso Wijaya santoso.wij...@gmail.com added the comment:

What compilers were used to build your Python distro and the native structure?

I found out in _ctypes/cfield.c (lns. 76-95):

if (bitsize /* this is a bitfield request */
 *pfield_size /* we have a bitfield open */
#ifdef MS_WIN32
/* MSVC, GCC with -mms-bitfields */
 dict-size * 8 == *pfield_size
#else
/* GCC */
 dict-size * 8 = *pfield_size
#endif
 (*pbitofs + bitsize) = *pfield_size) {
/* continue bit field */
fieldtype = CONT_BITFIELD;
#ifndef MS_WIN32
} else if (bitsize /* this is a bitfield request */
 *pfield_size /* we have a bitfield open */
 dict-size * 8 = *pfield_size
 (*pbitofs + bitsize) = dict-size * 8) {
/* expand bit field */
fieldtype = EXPAND_BITFIELD;
#endif

So the allocation of the extra byte for the structure seems to depend on 
Python's compiler. To make sure, I compiled a native structure using MSVC:

#pragma pack(1)
typedef struct _struct1
{
UINT8 first   : 1;
UINT8 second  : 1;
UINT8 third   : 1;
UINT8 fourth  : 1;
UINT8 fifth   : 1;
UINT16 pad: 11;
} struct1;

And I got the same value (sizeof == 3).

--

___
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



[issue11918] Drop OS/2 and VMS support in Python 3.3

2011-04-25 Thread STINNER Victor

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


--
nosy: +loewis

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



[issue11923] gcc: unrecognized option '-n32'

2011-04-25 Thread Paul Griffith

New submission from Paul Griffith pa...@cse.yorku.ca:

In compiling Python 2.7.1 on RHEL I run into the following error message when 
running make.

gcc: unrecognized option '-n32'
gcc -pthread -n32  -Xlinker -export-dynamic -o python \
Modules/python.o \
-L. -lpython2.7 -lpthread -ldl  -lutil   -lm  
gcc: unrecognized option '-n32'
running build
running build_ext


Configured with:

./configure --prefix=/cs/local --enable-shared --libdir=/cs/local/lib64 
--with-gcc=yes

GCC:

 # gcc --version
gcc (GCC) 4.4.4 20100726 (Red Hat 4.4.4-13)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I checked the bug tracker, but I only thing I see related deals with IRIX.

--
components: Build
messages: 134410
nosy: paulg_ca
priority: normal
severity: normal
status: open
title: gcc: unrecognized option '-n32'
type: compile error
versions: Python 2.7

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



[issue11901] Docs for sys.hexversion should give the algorithm

2011-04-25 Thread Roundup Robot

Roundup Robot devnull@devnull added the comment:

New changeset 48758cd0769b by R David Murray in branch '2.7':
#11901: add description of how bitfields are laid out to hexversion docs
http://hg.python.org/cpython/rev/48758cd0769b

New changeset b84384fbdbf0 by R David Murray in branch '3.1':
#11901: add description of how bitfields are laid out to hexversion docs
http://hg.python.org/cpython/rev/b84384fbdbf0

New changeset cca4c92bf337 by R David Murray in branch '3.2':
Merge #11901: add description of how bitfields are laid out to hexversion docs
http://hg.python.org/cpython/rev/cca4c92bf337

New changeset 07149918bce1 by R David Murray in branch 'default':
Merge #11901: add description of how bitfields are laid out to hexversion docs
http://hg.python.org/cpython/rev/07149918bce1

--
nosy: +python-dev

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



[issue11901] Docs for sys.hexversion should give the algorithm

2011-04-25 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

Thanks!  I tidied up the ReST formatting a bit and changed the bit numbering to 
the more standard left to right order (standard for bit fields...I realize 
hexversion is a number, but conceptually one deals with it as a bit field).

--
resolution:  - accepted
stage: needs patch - committed/rejected
status: open - closed
versions: +Python 2.7, Python 3.1, Python 3.2, Python 3.3

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



[issue11919] test_imp failures

2011-04-25 Thread Antoine Pitrou

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


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

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



[issue10914] Python sub-interpreter test

2011-04-25 Thread Antoine Pitrou

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

There's a failure on certain locales that Victor, I believe, is currently 
investigating.

--
status: pending - open

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10914
___
___
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-04-25 Thread Steve Thompson

Steve Thompson steve.f.thomp...@gmail.com added the comment:

So, knowing there's a potential cross platform inconsistency here, is there
a proposed way to deal with this that doesn't involve modifying the real c
code I'm interfacing with?  That's not always an option.

On Mon, Apr 25, 2011 at 2:49 PM, Santoso Wijaya rep...@bugs.python.orgwrote:


 Santoso Wijaya santoso.wij...@gmail.com added the comment:

 What compilers were used to build your Python distro and the native
 structure?

 I found out in _ctypes/cfield.c (lns. 76-95):

if (bitsize /* this is a bitfield request */
 *pfield_size /* we have a bitfield open */
 #ifdef MS_WIN32
/* MSVC, GCC with -mms-bitfields */
 dict-size * 8 == *pfield_size
 #else
/* GCC */
 dict-size * 8 = *pfield_size
 #endif
 (*pbitofs + bitsize) = *pfield_size) {
/* continue bit field */
fieldtype = CONT_BITFIELD;
 #ifndef MS_WIN32
} else if (bitsize /* this is a bitfield request */
 *pfield_size /* we have a bitfield open */
 dict-size * 8 = *pfield_size
 (*pbitofs + bitsize) = dict-size * 8) {
/* expand bit field */
fieldtype = EXPAND_BITFIELD;
 #endif

 So the allocation of the extra byte for the structure seems to depend on
 Python's compiler. To make sure, I compiled a native structure using MSVC:

 #pragma pack(1)
 typedef struct _struct1
 {
UINT8 first   : 1;
UINT8 second  : 1;
UINT8 third   : 1;
UINT8 fourth  : 1;
UINT8 fifth   : 1;
UINT16 pad: 11;
 } struct1;

 And I got the same value (sizeof == 3).

 --

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


--
Added file: http://bugs.python.org/file21777/unnamed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11920
___So, knowing there#39;s a potential cross platform inconsistency here, is there 
a proposed way to deal with this that doesn#39;t involve modifying the real c 
code I#39;m interfacing with?  That#39;s not always an option.br
brdiv class=gmail_quoteOn Mon, Apr 25, 2011 at 2:49 PM, Santoso Wijaya 
span dir=ltrlt;a 
href=mailto:rep...@bugs.python.org;rep...@bugs.python.org/agt;/span 
wrote:brblockquote class=gmail_quote style=margin:0 0 0 
.8ex;border-left:1px #ccc solid;padding-left:1ex;
br
Santoso Wijaya lt;a 
href=mailto:santoso.wij...@gmail.com;santoso.wij...@gmail.com/agt; added 
the comment:br
br
What compilers were used to build your Python distro and the native 
structure?br
br
I found out in _ctypes/cfield.c (lns. 76-95):br
br
    if (bitsize /* this is a bitfield request */br
        amp;amp; *pfield_size /* we have a bitfield open */br
#ifdef MS_WIN32br
        /* MSVC, GCC with -mms-bitfields */br
        amp;amp; dict-gt;size * 8 == *pfield_sizebr
#elsebr
        /* GCC */br
        amp;amp; dict-gt;size * 8 lt;= *pfield_sizebr
#endifbr
        amp;amp; (*pbitofs + bitsize) lt;= *pfield_size) {br
        /* continue bit field */br
        fieldtype = CONT_BITFIELD;br
#ifndef MS_WIN32br
    } else if (bitsize /* this is a bitfield request */br
        amp;amp; *pfield_size /* we have a bitfield open */br
        amp;amp; dict-gt;size * 8 gt;= *pfield_sizebr
        amp;amp; (*pbitofs + bitsize) lt;= dict-gt;size * 8) {br
        /* expand bit field */br
        fieldtype = EXPAND_BITFIELD;br
#endifbr
br
So the allocation of the extra byte for the structure seems to depend on 
Python#39;s compiler. To make sure, I compiled a native structure using 
MSVC:br
br
#pragma pack(1)br
typedef struct _struct1br
{br
    UINT8 first   : 1;br
    UINT8 second  : 1;br
    UINT8 third   : 1;br
    UINT8 fourth  : 1;br
    UINT8 fifth   : 1;br
    UINT16 pad    : 11;br
} struct1;br
br
And I got the same value (sizeof == 3).br
br
--br
divdiv/divdiv class=h5br
___br
Python tracker lt;a 
href=mailto:rep...@bugs.python.org;rep...@bugs.python.org/agt;br
lt;a href=http://bugs.python.org/issue11920; 
target=_blankhttp://bugs.python.org/issue11920/agt;br
___br
/div/div/blockquote/divbr
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10517] test_concurrent_futures crashes with --with-pydebug on RHEL5 with Fatal Python error: Invalid thread state for this thread

2011-04-25 Thread Charles-Francois Natali

Charles-Francois Natali neolo...@free.fr added the comment:

 So, if it is possible to fix this and remove this weird special case and cast 
 it into the abyss, then by all means, you have my 10 thumbs up.  Not that it 
 counts for much :)

Me too.
We still have a couple hundred RHEL4/5 boxes at work, and I guess we're not 
alone in this case. It's a really specific case, but I think it would be nice 
to fix it, especially since it also makes the code more understandable and less 
error-prone. Unless of course this special treatment is really necessary, in 
which case I'll have to think of another solution or just drop it.
I'm adding Antoine to the noisy list, since he's noted as thread expert in the 
Experts Index.

--
nosy: +pitrou

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



[issue11924] Pickle and copyreg modules doesn't document the interface

2011-04-25 Thread Jesús Cea Avión

New submission from Jesús Cea Avión j...@jcea.es:

Python 3.2 here.

copyreg module documentation says See the pickle module for more details on 
the interface expected of function and constructor., but I don't see any 
useful copyreg reference in pickle documentation.

Some examples would be useful here, too.

--
assignee: docs@python
messages: 134416
nosy: docs@python, jcea
priority: normal
severity: normal
status: open
title: Pickle and copyreg modules doesn't document the interface
versions: Python 2.7, Python 3.2, Python 3.3

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



[issue11924] Pickle and copyreg modules don't document the interface

2011-04-25 Thread Jesús Cea Avión

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


--
title: Pickle and copyreg modules doesn't document the interface - Pickle and 
copyreg modules don't document the interface

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



[issue10914] Python sub-interpreter test

2011-04-25 Thread STINNER Victor

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

Modules/_testembed fails with ISO-8859-15 locale encoding because of a 
bootstrap issue. The problem is that the filesystem encoding codec is 
implemented in Python: Python requires the codec to loads modules, but it has 
to load a module to load the codec. I already solved this issue in Python using 
C functions instead of the Python codec until Python is able to load modules 
(able to load the Python codec).

The problem is the test on the python initialization: 
PyUnicode_EncodeFSDefault / PyUnicode_DecodeFSDefaultAndSize check the global 
Py_FileSystemDefaultEncoding variable (use C functions if it is NULL).

We should use C functions if Py_FileSystemDefaultEncoding is NULL *or* if 
interp-codecs_initialized is zero.

I think that Python used interp-codecs_initialized flag. I removed the test on 
interp-codecs_initialized because I thought that it was useless.

--

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



[issue10517] test_concurrent_futures crashes with --with-pydebug on RHEL5 with Fatal Python error: Invalid thread state for this thread

2011-04-25 Thread Antoine Pitrou

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

 I think that if we were to call PyThread_set_key_value twice on the
 same key it's either an error, or we want the last version to be
 stored, not the old one.

Not necessarily. You can have several interpreters (and therefore several 
thread states) in a single thread, using Py_NewInterpreter(). It's used by 
mod_wsgi and probably other software. If you overwrite the old value with the 
new one, it may break such software.

Would it be possible to cleanup the autoTLS mappings in PyOS_AfterFork() 
instead?

--

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



[issue8808] imaplib should support SSL contexts

2011-04-25 Thread Sijin Joseph

Sijin Joseph sijinjos...@gmail.com added the comment:

Is anyone working on this?

--
nosy: +sijinjoseph

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



[issue8808] imaplib should support SSL contexts

2011-04-25 Thread Antoine Pitrou

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

 Is anyone working on this?

I don't think so, you could try if you are interested.

--

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



[issue10914] Python sub-interpreter test

2011-04-25 Thread STINNER Victor

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

 I think that Python used interp-codecs_initialized flag

Yes in PyUnicode_AsEncodedString(), in Python 3.0 and 3.1. Python 3.2 has also 
the test, but PyUnicode_AsEncodedString() is no more used to encode filenames. 
I removed the test in Python 3.3.

Extract of Python 3.1:

/* During bootstrap, we may need to find the encodings
   package, to load the file system encoding, and require the
   file system encoding in order to load the encodings
   package.

   Break out of this dependency by assuming that the path to
   the encodings module is ASCII-only.  XXX could try wcstombs
   instead, if the file system encoding is the locale's
   encoding. */
else if (Py_FileSystemDefaultEncoding 
 strcmp(encoding, Py_FileSystemDefaultEncoding) == 0 
 !PyThreadState_GET()-interp-codecs_initialized)
return PyUnicode_AsASCIIString(unicode);

I implemented the XXX could try wcstombs part, but in new functions:  
PyUnicode_EncodeFSDefault and PyUnicode_DecodeFSDefaultAndSize.

--

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



[issue9390] Error in sys.excepthook on windows when redirecting output of the script

2011-04-25 Thread Sijin Joseph

Sijin Joseph sijinjos...@gmail.com added the comment:

I was not able to reproduce this on Python 2.7 x64 or Python 3.2 x64 on Win 7 
SP1.

I am curious what the output is if you just run test.py, do you still get an 
error?

--
nosy: +sijinjoseph

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



[issue10914] Python sub-interpreter test

2011-04-25 Thread Graham Dumpleton

Graham Dumpleton graham.dumple...@gmail.com added the comment:

Hmmm, I wander if that is related to the workaround I have added in mod_wsgi 
recently of:

/*
 * Force loading of codecs into interpreter. This has to be
 * done as not otherwise done in sub interpreters and if not
 * done, code running in sub interpreters can fail on some
 * platforms if a unicode string is added in sys.path and an
 * import then done.
 */

item = PyCodec_Encoder(ascii);
Py_XDECREF(item);

This fixes problem some have seen where one gets:

  LookupError: no codec search functions registered: can't find encoding

I haven't been able to reproduce the problem myself so no bug report ever 
lodged.

Have been told it affects some other embedded systems as well which use sub 
interpreters but other systems don't employ the workaround that I am now using.

--

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



[issue9035] os.path.ismount on windows doesn't support windows mount points

2011-04-25 Thread Sijin Joseph

Changes by Sijin Joseph sijinjos...@gmail.com:


--
nosy: +sijinjoseph

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



[issue11923] gcc: unrecognized option '-n32'

2011-04-25 Thread Antoine Pitrou

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

Can you check CFLAGS and friends? Also, attach of output of configure?

--
nosy: +dmalcolm, pitrou

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



[issue11893] Obsolete SSLFakeFile in smtplib?

2011-04-25 Thread Sijin Joseph

Changes by Sijin Joseph sijinjos...@gmail.com:


--
nosy: +sijinjoseph

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



[issue11923] gcc: unrecognized option '-n32'

2011-04-25 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/issue11923
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10914] Python sub-interpreter test

2011-04-25 Thread STINNER Victor

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

 The problem is the test on the python initialization:
 PyUnicode_EncodeFSDefault / PyUnicode_DecodeFSDefaultAndSize
 check the global Py_FileSystemDefaultEncoding variable (use
 C functions if it is NULL).

The problem is a little bit more complex. interp-codecs_initialized is set to 
1 by _PyCodecRegistry_Init(), but the filesystem codec is not loaded yet. We 
need another variable: interp-fscodec_initialized.

fscodec_subinterpreter.patch fixes this issue.

Note: the patch replaces also PyErr_Print() by PyErr_PrintEx(0) to avoid a 
crash on error, if PyErr_PrintEx(0) is called before the sys module is 
initialized. For example, if 
PyModule_GetDict(_PyImport_FindBuiltin(builtins)) is NULL. Anyway, it's 
useless to set sys attributes on error, because sys is destroyed just after 
printing the error.

--
Added file: http://bugs.python.org/file21778/fscodec_subinterpreter.patch

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



[issue9390] Error in sys.excepthook on windows when redirecting output of the script

2011-04-25 Thread Michal Molhanec

Michal Molhanec molha...@gmail.com added the comment:

Running it without redirecting output, like
c:\p\test.py
works OK

--

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



[issue11888] Add C99's log2() function to the math library

2011-04-25 Thread STINNER Victor

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

 The main issue is that we'd have to provide (and maintain) our own
 implementation of log2 for Windows (and other OSs that don't have all
 the C99 support.  Solaris?)

Can't we simply use (approximation to 1/log(2)) * log(x)? Is it worse than 
reimplementing it using log(x)/log(2) in Python?

 That implementation should, ideally: ...

Because some platforms are less accurate, you prefer to not provide a more 
accurate function when log2() is available? Can't we start with something 
simple and improve it later?

It can be documented than the Python log2 function may be the same than 
log(x)/log(2) if the platform/CPU doesn't provide a C log2 function.

--

... And indeed, on Windows ...

 numpy.log2(8.0)
2.9996

Oh. Python is better on Linux:

Python 2.6.6 (r266:84292, Dec 26 2010, 22:31:48) 
[GCC 4.4.5] on linux2
Type help, copyright, credits or license for more information.
 import math
 math.log(8) / math.log(2)
3.0

--

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



[issue11888] Add C99's log2() function to the math library

2011-04-25 Thread STINNER Victor

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

 Can't we simply use (approximation to 1/log(2)) * log(x)?
 Is it worse than reimplementing it using log(x)/log(2) in Python?

Hum. With a x86 and the right compiler optimization level, log(x)/log(2) in C 
can be more accurate than log(x)/log(2) in Python, because the FPU works with 
80 bits float internally, and the result is only truncated to 64 bits float 
at the end. In Python, the result is truncated to 64 bits on each Python 
instruction.

I don't know if it should be called a feature or a bug. In PHP world, it would 
be called a bug :-D http://bugs.php.net/bug.php?id=53632

--

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



[issue11915] test_ctypes hangs in sandbox

2011-04-25 Thread STINNER Victor

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

I reported the bug on Gentoo bug tracker:
http://bugs.gentoo.org/show_bug.cgi?id=364877

--

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



[issue11925] test_ttk_guionly.test_traversal() failed on x86 Windows7 3.x

2011-04-25 Thread STINNER Victor

New submission from STINNER Victor victor.stin...@haypocalc.com:

test_ttk_guionly.test_traversal() failed on x86 Windows7 3.x:
---
[120/354] test_ttk_guionly
test test_ttk_guionly failed -- Traceback (most recent call last):
  File 
D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\tkinter\test\test_ttk\test_widgets.py,
 line 713, in test_traversal
self.assertEqual(self.nb.select(), str(self.child2))
AssertionError: '.116458816' != '.116461336'
- .116458816
+ .116461336
---
http://www.python.org/dev/buildbot/all/builders/x86%20Windows7%203.x/builds/2984/steps/test/logs/stdio

--
components: Tests, Tkinter, Windows
messages: 134430
nosy: haypo
priority: normal
severity: normal
status: open
title: test_ttk_guionly.test_traversal() failed on x86 Windows7 3.x
versions: Python 3.3

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



[issue11925] test_ttk_guionly.test_traversal() failed on x86 Windows7 3.x

2011-04-25 Thread STINNER Victor

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

Code of the test:
-
class NotebookTest(unittest.TestCase):

def setUp(self):
support.root_deiconify()
self.nb = ttk.Notebook(padding=0)
self.child1 = ttk.Label()
self.child2 = ttk.Label()
self.nb.add(self.child1, text='a')
self.nb.add(self.child2, text='b')



def test_traversal(self):
self.nb.pack()
self.nb.wait_visibility()

self.nb.select(0)

support.simulate_mouse_click(self.nb, 5, 5)
self.nb.focus_force()
self.nb.event_generate('Control-Tab')
self.assertEqual(self.nb.select(), str(self.child2)) ~~~ HERE
...
-

--

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



[issue11918] Drop OS/2 and VMS support in Python 3.3

2011-04-25 Thread STINNER Victor

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

@loewis: Would you like to review the patch?

You wrote on python-dev:

For OS/2, I propose to syntactically break the makefile
and
For VMS, I *think* the build process is configure-based (but I may
misremember); if so, adding an exit into configure.in would be
appropriate.

But I don't know how to do that.

I added two #error for each OS, I hope that it is enough. But I am unable to 
test my patch, I don't have access to these OSes :-)

--
keywords: +patch
Added file: http://bugs.python.org/file21779/unsupport_os2_vms.patch

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



[issue11918] Drop OS/2 and VMS support in Python 3.3

2011-04-25 Thread STINNER Victor

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

Oh, I just realized that the PEP 11 doesn't ask to mention unsupported OSes in 
the What's new document. New patch to mention that OS/2 and VMS are no more 
supported.

--
Added file: http://bugs.python.org/file21780/unsupport_os2_vms-2.patch

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



[issue11918] Drop OS/2 and VMS support in Python 3.3

2011-04-25 Thread STINNER Victor

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


Removed file: http://bugs.python.org/file21779/unsupport_os2_vms.patch

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



[issue9035] os.path.ismount on windows doesn't support windows mount points

2011-04-25 Thread Sijin Joseph

Sijin Joseph sijinjos...@gmail.com added the comment:

I'd like to add the win_ismount function mentioned by Tim. Is anyone else 
working on this presently?

--

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



[issue9035] os.path.ismount on windows doesn't support windows mount points

2011-04-25 Thread Santoso Wijaya

Changes by Santoso Wijaya santoso.wij...@gmail.com:


--
nosy: +santa4nt
versions: +Python 3.3

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



[issue11223] interruption of locks by signals not guaranteed when locks are implemented using POSIX condition variables

2011-04-25 Thread STINNER Victor

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

   - Rename _PyThread_Info() to PyThread_GetInfo() (consistent name with
  PyFloat_GetInfo() and PyLong_GetInfo())
 
 I don't think we want that API to be public, so it should be
 _PyThread_GetInfo().

Why should it be private in C, but not in Python?

Why should it be private whereas PyLong_GetInfo() and PyFloat_GetInfo()
are public?

   - Always compile thread.c, but add #ifdef WITH_THREAD around most the
  file (except PyThread_GetInfo())
 
 What's the point? Sounds like pointless complication.

Complication? It does *simplify* configure.in.

I don't want to create a new file just for a small function.

--

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



[issue11926] help(keywords) returns incomplete list of keywords

2011-04-25 Thread Carl M. Johnson

New submission from Carl M. Johnson cmjohnson.mailingl...@gmail.com:

In Python 3.2, help(keywords) returns the following:



Here is a list of the Python keywords.  Enter any keyword to get more help.

and elifimport  raise
as  elsein  return
assert  except  is  try
break   finally lambda  while
class   for nonlocalwith
continuefromnot yield
def global  or  
del if  pass

- - - -

This list is missing True, False, and None.

--
assignee: docs@python
components: Documentation
messages: 134440
nosy: Carl.M.Johnson, docs@python
priority: normal
severity: normal
status: open
title: help(keywords) returns incomplete list of keywords
versions: Python 3.2

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



[issue11926] help(keywords) returns incomplete list of keywords

2011-04-25 Thread Chris Rebert

Changes by Chris Rebert pyb...@rebertia.com:


--
nosy: +cvrebert

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



[issue11926] help(keywords) returns incomplete list of keywords

2011-04-25 Thread Ezio Melotti

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

True, False and None are also included in keyword.kwlist:
 keyword.kwlist
['False', 'None', 'True', 'and', 'as', 'assert', 'break', 'class', 'continue', 
'def', 'del', 'elif', 'else', 'except', 'finally', 'for', 'from', 'global', 
'if', 'import', 'in', 'is', 'lambda', 'nonlocal', 'not', 'or', 'pass', 'raise', 
'return', 'try', 'while', 'with', 'yield']

The help() is also missing for 'None' and 'False', but works for 'True':

 help('None')
no Python documentation found for 'None'
 help('False')
no Python documentation found for 'False'
 help('True')
Help on bool object:

True = class bool(int)
 |  bool(x) - bool
 ...

On 3.3 it's the same.

--
nosy: +ezio.melotti
stage:  - needs patch
versions: +Python 3.3

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



[issue6780] startswith error message is incomplete

2011-04-25 Thread Roundup Robot

Roundup Robot devnull@devnull added the comment:

New changeset 3ceeccbc2c3b by Ezio Melotti in branch '2.7':
#6780: fix starts/endswith error message to mention that tuples are accepted 
too.
http://hg.python.org/cpython/rev/3ceeccbc2c3b

New changeset bcbf8c3c4a88 by Ezio Melotti in branch '3.1':
#6780: fix starts/endswith error message to mention that tuples are accepted 
too.
http://hg.python.org/cpython/rev/bcbf8c3c4a88

New changeset f393c507717a by Ezio Melotti in branch '3.2':
#6780: merge with 3.1.
http://hg.python.org/cpython/rev/f393c507717a

New changeset a1a1296556d7 by Ezio Melotti in branch 'default':
#6780: merge with 3.2.
http://hg.python.org/cpython/rev/a1a1296556d7

--
nosy: +python-dev

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



[issue6780] startswith error message is incomplete

2011-04-25 Thread Ezio Melotti

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


--
resolution:  - fixed
stage: patch review - 
status: open - closed

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



[issue8809] smtplib should support SSL contexts

2011-04-25 Thread Kasun Herath

Kasun Herath kasun...@gmail.com added the comment:

I did another patch based on feedback given. A test for SMTP_SSL wasn't added; 
will look into it later. Tab character that were present are removed. Also 
SSLContext support was added to starttls() but it is slightly different from 
the starttls() implementation of imaplib. Further feedback would be much 
appreciated.

--
Added file: http://bugs.python.org/file21781/smtp_sslcontext_updated2.patch

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



[issue11925] test_ttk_guionly.test_traversal() failed on x86 Windows7 3.x

2011-04-25 Thread Ned Deily

Ned Deily n...@acm.org added the comment:

Might be a duplicate of Issue10736.

--
nosy: +ned.deily

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



[issue11918] Drop OS/2 and VMS support in Python 3.3

2011-04-25 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

The patch looks fine; please add a reference to PEP 11 into the error messages, 
though (so that people can find out that they can volunteer to maintain it).

--
resolution:  - accepted

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