[issue13429] provide __file__ to extension init function

2011-11-19 Thread Stefan Behnel

Stefan Behnel  added the comment:

I'm aware that these things happen, that's why I said it. Actually, wouldn't it 
rather be *correct* for __file__ to be set to the same file path for all 
modules that an extension module creates in its init function? That would 
suggest that _Py_ModuleImportContext shouldn't be set to NULL after the first 
assignment, but instead stay alive until it gets reset by the dynlib loader. If 
the loader gets invoked recursively later on, it will do the right thing by 
storing away the old value during the import and restoring it afterwards. So 
_Py_ModuleImportContext would always point to the path that contains the init 
function that is currently being executed.

Regarding the lock (which, I assume, is simply reentrant), it's being acquired 
far up when the import mechanism starts, so the dynlib loader and the init 
function call are protected.

Note that this does not apply to the reinit case. 
_PyImport_FindExtensionObject() does not acquire the lock itself (which seems 
correct), and it can be called directly from imp.init_builtin(), i.e. from user 
code. Maybe that's why the _Py_PackageContext protocol was not implemented 
there. That's rather unfortunate, though. I guess the reasoning is that new 
code that uses this new feature is expected to actually be reentrant, also in 
parallel, because the module it creates and works on is local to the current 
thread until the init function terminates. So the import lock is not strictly 
required here. This does complicate the __file__ feature, though, so the second 
("reinit") patch won't work as is. I think the right fix for Python 4 would be 
to simply pass a context struct into the module init function.

On a related note, I just stumbled over this code in 
_PyImport_FindExtensionObject():

else {
if (def->m_base.m_init == NULL)
return NULL;
mod = def->m_base.m_init();
if (mod == NULL)
return NULL;
PyDict_SetItem(PyImport_GetModuleDict(), name, mod);
Py_DECREF(mod);
}
if (_PyState_AddModule(mod, def) < 0) {
PyDict_DelItem(PyImport_GetModuleDict(), name);
Py_DECREF(mod);
return NULL;
}

If PyDict_SetItem() fails, this is bound to crash. I think it would be worth 
looking into this mechanism a bit more.

--

___
Python tracker 

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



[issue13429] provide __file__ to extension init function

2011-11-19 Thread Stefan Behnel

Stefan Behnel  added the comment:

Updated patch that does not reset _Py_ModuleImportContext after use.

--
Added file: http://bugs.python.org/file23728/ext_module_init_file_path_2.patch

___
Python tracker 

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



[issue13215] multiprocessing Manager.connect() aggressively retries refused connections

2011-11-19 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 34fcc0d5c3c5 by Charles-François Natali in branch 'default':
Issue #13215: multiprocessing.Connection: don't hammer the remote end with
http://hg.python.org/cpython/rev/34fcc0d5c3c5

--
nosy: +python-dev

___
Python tracker 

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



[issue13431] Pass context information into the extension module init function

2011-11-19 Thread Stefan Behnel

New submission from Stefan Behnel :

This is a follow-up to issue 13429, which deals with setting __file__ on newly 
created extension modules earlier than it is currently the case.

Currently, the module init function of extension modules lacks a way to find 
out the context in which it is being imported, e.g. its package path or its 
location in the file system. This makes it tricky for extension modules to do 
things like loading package resources or using relative imports at init time.

This can be fixed by allowing the init function to take a context struct as 
argument, which would contain object pointers to the FQ package name and file 
path, and potentially other information.

I think this would be backwards compatible to existing code, because C should 
allow the caller of the init function to pack additional arguments on the stack 
that the called function simply doesn't care about. From CPython 3.3 on, 
however, new and updated code could benefit from this feature.

--
components: Extension Modules, Interpreter Core
messages: 147931
nosy: scoder
priority: normal
severity: normal
status: open
title: Pass context information into the extension module init function
type: feature request
versions: Python 3.3

___
Python tracker 

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



[issue13429] provide __file__ to extension init function

2011-11-19 Thread Stefan Behnel

Stefan Behnel  added the comment:

Replying to myself:
> I think the right fix for Python 4 would be to simply pass
> a context struct into the module init function.

Actually, this doesn't have to wait for Python 4. Changing the module init 
function to take a parameter should be backwards compatible in C. Existing code 
simply wouldn't read the value from the stack, and new (or updated) code could 
benefit from the feature, Cython code in particular.

Here is a follow-up ticket for this more general feature:

http://bugs.python.org/issue13431

--

___
Python tracker 

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



[issue13431] Pass context information into the extension module init function

2011-11-19 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

This approach is not correct C. You may pass an "incorrect" number of arguments 
only if the function is declared with an ellipsis, else the behavior is 
undefined (6.5.5.2p6). Your proposed approach works with most implementations 
of C, but Python shouldn't deliberately rely on undefined behavior.

--
nosy: +loewis

___
Python tracker 

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



[issue13431] Pass context information into the extension module init function

2011-11-19 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

FWIW, I think that a PEP will be needed to redesign the module initialization 
for Python 4. Hopefully, this time people will then identify all requirements 
before the PEP is accepted (which unfortunately didn't happen for PEP 3121).

--

___
Python tracker 

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



[issue13431] Pass context information into the extension module init function

2011-11-19 Thread Stefan Behnel

Stefan Behnel  added the comment:

Yes, that's unfortunate. I found the same paragraph in section 6.5.2.2p6 of the 
C99 standard now, so it seems that this idea isn't suitable for the Py3.x 
series.

There's no Python 4 target version in the bug tracker, BTW. :)

--

___
Python tracker 

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



[issue13402] Document absoluteness of sys.executable

2011-11-19 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy: +petri.lehtinen

___
Python tracker 

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



[issue13403] Option for XMLPRC Server to support HTTPS

2011-11-19 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy: +petri.lehtinen

___
Python tracker 

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



[issue13407] tarfile.getnames misses members again

2011-11-19 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy: +petri.lehtinen

___
Python tracker 

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



[issue13432] Encoding alias "unicode"

2011-11-19 Thread kxroberto

New submission from kxroberto :

"unicode" seems not to be an official unicode encoding name alias.
Yet it is quite frequent on the web - and obviously means UTF-8. 
(search '"text/html; charset=unicode"' in Google)
Chrome and IE display it as UTF-8.  (Mozilla as ASCII, thus mixed up chars).

Should it be added in to aliases.py ?

--- ./aliases.py
+++ ./aliases.py
@@ -511,6 +511,7 @@
 'utf8'   : 'utf_8',
 'utf8_ucs2'  : 'utf_8',
 'utf8_ucs4'  : 'utf_8',
+'unicode': 'utf_8',
 
 # uu_codec codec
 'uu' : 'uu_codec',

--
messages: 147936
nosy: kxroberto
priority: normal
severity: normal
status: open
title: Encoding alias "unicode"

___
Python tracker 

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



[issue13432] Encoding alias "unicode"

2011-11-19 Thread kxroberto

Changes by kxroberto :


--
components: +Unicode
nosy: +ezio.melotti
type:  -> feature request
versions: +Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 
3.4

___
Python tracker 

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



[issue13432] Encoding alias "unicode"

2011-11-19 Thread STINNER Victor

STINNER Victor  added the comment:

Sorry, but it's not obviously that Unicode means UTF-8.

--
nosy: +haypo

___
Python tracker 

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



[issue13432] Encoding alias "unicode"

2011-11-19 Thread Georg Brandl

Georg Brandl  added the comment:

Definitely; this will just serve to create more confusion for beginners over 
what a Unicode string is:

unicodestring.encode('unicode')   <- WTF?

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

___
Python tracker 

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



[issue13430] Add a curry function to the functools module

2011-11-19 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

@markonervo: Have you tried the pointfree library: 
http://pypi.python.org/pypi/pointfree/ ? I think it's exactly what you're 
asking for.

The only case I've ever needed currying was managing callback soup in async 
code. And even then, functools.partial() was perfectly enough.

I don't think this would be useful in Python stdlib, so -1 from me.

--
nosy: +petri.lehtinen

___
Python tracker 

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



[issue13433] String format documentation contains error regarding %g

2011-11-19 Thread Christian Iversen

New submission from Christian Iversen :

The documentation for string format options state that both %f, %g and %e 
default to 6 digits after the decimal point. In fact, %g always seems to use 5 
digits by default:

>>> "%g" % 2.1234567
'2.12346'
>>> "%f" % 2.1234567
'2.123457'
>>> "%e" % 2.1234567
'2.123457e+00'

But something much more insidious is wrong, because even when explicitly told 
how many digits to have, %g is one off:

>>> "%.6g" % 2.1234567
'2.12346'
>>> "%.6f" % 2.1234567
'2.123457'
>>> "%.6e" % 2.1234567
'2.123457e+00'

This can't be right?

--
assignee: docs@python
components: Documentation
messages: 147940
nosy: Christian.Iversen, docs@python
priority: normal
severity: normal
status: open
title: String format documentation contains error regarding %g
type: behavior
versions: Python 2.6, Python 2.7

___
Python tracker 

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



[issue12156] test_multiprocessing.test_notify_all() timeout (1 hour) on FreeBSD 7.2

2011-11-19 Thread Charles-François Natali

Charles-François Natali  added the comment:

Alright, I got tired of seeing the FreeBSD buildbots consistently choke on 
test_multiprocessing, so here's a simple patch that skips the test if the OS 
doesn't support a reasonable number (30) of semaphores.

--
keywords: +patch
Added file: http://bugs.python.org/file23729/test_multi_sem.diff

___
Python tracker 

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



[issue13433] String format documentation contains error regarding %g

2011-11-19 Thread Mark Dickinson

Mark Dickinson  added the comment:

Yep, there's an oddity here that's directly inherited from C's sprintf family 
of functions, namely that in %e-style formatting you give the number of digits 
after the point (= one less than the total number of significant digits), and 
in %g-style formatting you give the total number of significant digits instead.

Can you give a pointer, or link, to the documentation section you were looking 
at?

The description at:

http://docs.python.org/library/stdtypes.html#string-formatting-operations

looks fine to me.  Note 3, which relates to the '%e' and '%f'-style formatting, 
talks about number of places after the point.  Note 4, which relates to '%g' 
formatting, talks about the total number of significant digits.

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue13433] String format documentation contains error regarding %g

2011-11-19 Thread Christian Iversen

Christian Iversen  added the comment:

That was exactly the page I was looking at, and after some discussion on 
#python, I can see how they differ.

Perhaps this could be clarified in the documentation? It's very easy to miss as 
it is now. Maybe a note describing that %g is different from the others in this 
regard?

--

___
Python tracker 

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



[issue13397] Option for XMLRPC clients to automatically transform Fault exceptions into standard exceptions

2011-11-19 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti
stage:  -> needs patch

___
Python tracker 

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



[issue12258] Clean up bytes I/O in get_compiler_versions

2011-11-19 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti
type:  -> behavior

___
Python tracker 

___
___
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-11-19 Thread Ezio Melotti

Changes by Ezio Melotti :


--
keywords: +easy
nosy: +ezio.melotti
stage:  -> needs patch
versions:  -Python 3.1

___
Python tracker 

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



[issue1047540] Turtle.py hangs Idle

2011-11-19 Thread Ezio Melotti

Ezio Melotti  added the comment:

Can you still reproduce this?
I tried on winxp with Python 3.2 and following the steps in msg82419 (or even 
if I open IDLE from cmd as msg82553 suggests) I get a popup error that says 
"IDLE's subprocess didn't make connection".  If I open IDLE, do 
File->Open->turtle.py I can run the demo and do Ctrl+Q with no tracebacks.

--
nosy: +ezio.melotti, kbk, ned.deily, terry.reedy
versions: +Python 3.3 -Python 3.1

___
Python tracker 

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



[issue10318] "make altinstall" installs many files with incorrect shebangs

2011-11-19 Thread Ezio Melotti

Ezio Melotti  added the comment:

Éric, what's the status of this?

--
nosy: +ezio.melotti

___
Python tracker 

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



[issue9750] sqlite3 iterdump fails on column with reserved name

2011-11-19 Thread Ezio Melotti

Changes by Ezio Melotti :


--
stage:  -> patch review

___
Python tracker 

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



[issue1047397] cgitb failures

2011-11-19 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy:  -BreamoreBoy
versions: +Python 3.3 -Python 3.1

___
Python tracker 

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



[issue7267] format method: c presentation type broken

2011-11-19 Thread Ezio Melotti

Changes by Ezio Melotti :


--
versions:  -Python 2.6

___
Python tracker 

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



[issue13433] String format documentation contains error regarding %g

2011-11-19 Thread Mark Dickinson

Mark Dickinson  added the comment:

> Maybe a note describing that %g is different from the others in this regard?

-1 from me;  I don't really see that that would improve the documentation.  
Maybe that's just me, but I expect reference documentation to be clean, and 
uncluttered with too many warnings.  All the necessary information is already 
there, and adding extra notes like this just increases the total number of 
words to be read without adding new information.

In a tutorial, that would be different ... :-)

Leaving this open---others may have different takes on this.

--

___
Python tracker 

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



[issue5066] IDLE documentation for Unix obsolete/incorrect

2011-11-19 Thread Ezio Melotti

Changes by Ezio Melotti :


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

___
Python tracker 

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



[issue11842] slice.indices with negative step and default stop

2011-11-19 Thread Ezio Melotti

Changes by Ezio Melotti :


--
keywords: +easy
stage:  -> needs patch
versions: +Python 2.7, Python 3.3 -Python 3.1

___
Python tracker 

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



[issue7695] missing termios constants

2011-11-19 Thread Ezio Melotti

Changes by Ezio Melotti :


--
stage: needs patch -> patch review
versions: +Python 3.3

___
Python tracker 

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



[issue13424] Add examples for open’s new opener argument

2011-11-19 Thread Ezio Melotti

Changes by Ezio Melotti :


--
keywords: +easy
stage:  -> needs patch

___
Python tracker 

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



[issue7695] missing termios constants

2011-11-19 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +haypo
versions:  -Python 2.7, Python 3.2

___
Python tracker 

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



[issue12907] Update test coverage devguide page

2011-11-19 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +eli.bendersky, eric.araujo, terry.reedy

___
Python tracker 

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



[issue12908] Update dev-in-a-box for new coverage steps

2011-11-19 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +eli.bendersky, eric.araujo, ezio.melotti, terry.reedy

___
Python tracker 

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



[issue12907] Update test coverage devguide page

2011-11-19 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue6733] curses line wrap broken when mixing full- and half-width unicode characters

2011-11-19 Thread Ezio Melotti

Changes by Ezio Melotti :


--
versions: +Python 3.3

___
Python tracker 

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



[issue2527] Pass a namespace to timeit

2011-11-19 Thread Ezio Melotti

Changes by Ezio Melotti :


--
versions: +Python 3.3 -Python 3.2

___
Python tracker 

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



[issue13431] Pass context information into the extension module init function

2011-11-19 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue13215] multiprocessing Manager.connect() aggressively retries refused connections

2011-11-19 Thread Charles-François Natali

Charles-François Natali  added the comment:

Benjamin, thanks for the report.

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

___
Python tracker 

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



[issue13434] time.xmlrpc.com dead

2011-11-19 Thread Antoine Pitrou

New submission from Antoine Pitrou :

time.xmlrpc.com seems dead (no DNS entry), which leads to failures on one of 
the stable buildbots (redirecting DNS catchall?):

==
ERROR: test_current_time (test.test_xmlrpc_net.CurrentTimeTest)
--
Traceback (most recent call last):
  File 
"/home/buildbot/buildarea/3.x.ochtman-gentoo-amd64/build/Lib/test/test_xmlrpc_net.py",
 line 19, in test_current_time
t0 = server.currentTime.getCurrentTime()
  File 
"/home/buildbot/buildarea/3.x.ochtman-gentoo-amd64/build/Lib/xmlrpc/client.py", 
line 1089, in __call__
return self.__send(self.__name, args)
  File 
"/home/buildbot/buildarea/3.x.ochtman-gentoo-amd64/build/Lib/xmlrpc/client.py", 
line 1420, in __request
verbose=self.__verbose
  File 
"/home/buildbot/buildarea/3.x.ochtman-gentoo-amd64/build/Lib/xmlrpc/client.py", 
line 1131, in request
return self.single_request(host, handler, request_body, verbose)
  File 
"/home/buildbot/buildarea/3.x.ochtman-gentoo-amd64/build/Lib/xmlrpc/client.py", 
line 1163, in single_request
dict(resp.getheaders())
xmlrpc.client.ProtocolError: 

--
components: Tests
messages: 147948
nosy: flox, loewis, pitrou
priority: high
severity: normal
stage: needs patch
status: open
title: time.xmlrpc.com dead
type: behavior
versions: Python 3.2, Python 3.3

___
Python tracker 

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



[issue12245] Document the meaning of FLT_ROUNDS constants for sys.float_info

2011-11-19 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset de1ecda2afa2 by Mark Dickinson in branch '2.7':
Issue #12245: Document sys.float_info.rounds better.
http://hg.python.org/cpython/rev/de1ecda2afa2

New changeset 795c184b0282 by Mark Dickinson in branch '3.2':
Issue #12245: Document sys.float_info.rounds better.
http://hg.python.org/cpython/rev/795c184b0282

New changeset 5e45dfc421e4 by Mark Dickinson in branch 'default':
Issue #12245 merge.
http://hg.python.org/cpython/rev/5e45dfc421e4

--
nosy: +python-dev

___
Python tracker 

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



[issue12245] Document the meaning of FLT_ROUNDS constants for sys.float_info

2011-11-19 Thread Mark Dickinson

Changes by Mark Dickinson :


--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue7433] MemoryView memory_getbuf causes segfaults, double call to tp_releasebuffer

2011-11-19 Thread Mark Dickinson

Changes by Mark Dickinson :


--
assignee: mark.dickinson -> 

___
Python tracker 

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



[issue13434] time.xmlrpc.com dead

2011-11-19 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

Not sure whether this is actually new, but it may be that Dave Winer is 
migrating all this stuff to Amazon S3, and that he just didn't get to restoring 
the time service yet.

--

___
Python tracker 

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



[issue7049] decimal.py: Three argument power issues

2011-11-19 Thread Mark Dickinson

Mark Dickinson  added the comment:

Closing as won't fix.  Even deprecation doesn't seem worth the effort here.

--
resolution:  -> wont fix
status: open -> closed

___
Python tracker 

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



[issue2813] No float formatting in PyString_FromFormat

2011-11-19 Thread Mark Dickinson

Changes by Mark Dickinson :


--
versions: +Python 3.3 -Python 2.7, Python 3.2

___
Python tracker 

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



[issue13434] time.xmlrpc.com dead

2011-11-19 Thread R. David Murray

R. David Murray  added the comment:

We've had problems with this service going away for a while before.  I think 
the test was marked skip for at least a year before someone (it might have been 
me) noticed that it was back and reactivated it.  There's a ticket in here 
somewhere for it.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue12156] test_multiprocessing.test_notify_all() timeout (1 hour) on FreeBSD 7.2

2011-11-19 Thread STINNER Victor

STINNER Victor  added the comment:

Testing os.sysconf("SC_SEM_NSEMS_MAX") value is maybe better than creating 30 
semaphores. See the function added by the changeset 746143ec1f60 (fixing 
#10798) is maybe faster than creating 30 semaphores.

Value on the FreeBSD 7.2 buildbot:

>>> import os
>>> os.sysconf("SC_SEM_NSEMS_MAX")
30

--

___
Python tracker 

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



[issue9530] integer undefined behaviors

2011-11-19 Thread Mark Dickinson

Mark Dickinson  added the comment:

Status update:  all the reported errors from the Objects/ directory have been 
fixed in the default branch (many of these were fixed recently as part of 
making sure that the test-suite runs under Clang's -ftrapv option), or are out 
of date.  I haven't checked the reports for the extension Modules.

--
versions: +Python 3.3 -Python 3.2

___
Python tracker 

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



[issue9530] integer undefined behaviors

2011-11-19 Thread Mark Dickinson

Mark Dickinson  added the comment:

See also issue #1621.

--

___
Python tracker 

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



[issue12890] cgitb displays tags when executed in text mode

2011-11-19 Thread Jeff McNeil

Jeff McNeil  added the comment:

Is there anything else needed here?

--

___
Python tracker 

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



[issue9530] integer undefined behaviors

2011-11-19 Thread Mark Dickinson

Mark Dickinson  added the comment:

The issues reported for the datetime, array, itertools and math modules are 
also already fixed.  That just leaves the following two of the reported issues 
outstanding:

 : Op: <<=, Reason : 
Signed Left Shift Error: Right operand is negative or is greater than or equal 
to the width of the promoted left operand, BINARY OPERATION: left (int32): 0 
right (int32): -2 

and

 : Op: -, Reason : 
Signed Subtraction Overflow, UNARY OPERATION: left (int32): 0 right (int32): 
-2147483648

I'm using r63764 as the revision that the line numbers relate to; not sure 
whether this exactly right, but it seems to be close enough.

--

___
Python tracker 

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



[issue1621] Do not assume signed integer overflow behavior

2011-11-19 Thread Mark Dickinson

Mark Dickinson  added the comment:

See also issue #9530.

--

___
Python tracker 

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



[issue12156] test_multiprocessing.test_notify_all() timeout (1 hour) on FreeBSD 7.2

2011-11-19 Thread Charles-François Natali

Charles-François Natali  added the comment:

> Testing os.sysconf("SC_SEM_NSEMS_MAX") value is maybe better than
> creating 30 semaphores.

Yeah, I thought about that, but the problem is that it doesn't take into 
account the number of semaphores already allocated: so, for example, if 
sysconf() returns 50 but you already have 30 allocated semaphores, the test 
will fail with ENOFILE.
But if we consider that most buildbots don't have many semaphores allocated 
(and in particular no dangling semaphores), and that FreeBSD 8 has a limit 
substentially higher than 30 (ideally above 256), then I guess we could use 
this.
Patch attached.

--
Added file: http://bugs.python.org/file23730/test_multi_sem-1.diff

___
Python tracker 

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



[issue12890] cgitb displays tags when executed in text mode

2011-11-19 Thread Ezio Melotti

Ezio Melotti  added the comment:

A test?

--
stage:  -> test needed
type:  -> behavior

___
Python tracker 

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



[issue9530] integer undefined behaviors

2011-11-19 Thread John Regehr

John Regehr  added the comment:

This is great.  I'd be happy to re-run the tests sometime, and also we're 
talking with the LLVM folks about getting our patches into the main LLMM tree.  
Basically it'll act as a more powerful -ftrapv, and the error message will be 
much better than "aborted".

--

___
Python tracker 

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



[issue13435] Copybutton does not hide tracebacks

2011-11-19 Thread Robert Lehmann

New submission from Robert Lehmann :

The recently added copybutton.js (r18bbfed9aafa) does not work with the 2.7 
docs since they are deployed with JQuery 1.2 (which is shipped with Sphinx 0.6).

Copybutton is an unobtrusive Javascript feature which adds a little button to 
all doctests that removes the interactive prompts in order to copy the code 
as-is into Python scripts.  I think that feature could well be ported to Sphinx 
itself.

In line 44 and 51 of Doc/tools/sphinxext/static/copybutton.js the code uses 
jQuery.nextUntil(), which is new in JQuery 1.4.  That results in tracebacks 
being only partially hidden.  Reproduce the error at 
http://docs.python.org/tutorial/errors.html#exceptions for example.

The Python 3.2+ documentation is not affected as it is built with Sphinx 1.0, 
which ships with JQuery 1.4.  JQuery Untils are available as a separate plugin 
(http://benalman.com/projects/jquery-untils-plugin/).

--
assignee: docs@python
components: Documentation
messages: 147962
nosy: docs@python, ezio.melotti, lehmannro
priority: normal
severity: normal
status: open
title: Copybutton does not hide tracebacks
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue12890] cgitb displays tags when executed in text mode

2011-11-19 Thread Jeff McNeil

Jeff McNeil  added the comment:

I didn't add one initially as I was just changing output format and not actual 
behavior.  I guess I could add something to ensure it doesn't regress? I'll 
make sure there's coverage to begin with.

--

___
Python tracker 

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



[issue9530] integer undefined behaviors

2011-11-19 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 71100ef4f7a2 by Mark Dickinson in branch 'default':
Issue #9530: Fix undefined behaviour due to signed overflow in testcapi_long.h.
http://hg.python.org/cpython/rev/71100ef4f7a2

--
nosy: +python-dev

___
Python tracker 

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



[issue12890] cgitb displays tags when executed in text mode

2011-11-19 Thread Jeff McNeil

Jeff McNeil  added the comment:

Test to ensure html isn't included when the formatting is text.  I don't seem 
to be able to update the stage.

--
Added file: http://bugs.python.org/file23731/head-cgitb-display-tests.patch

___
Python tracker 

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



[issue12890] cgitb displays tags when executed in text mode

2011-11-19 Thread Ezio Melotti

Changes by Ezio Melotti :


--
stage: test needed -> patch review

___
Python tracker 

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



[issue13433] String format documentation contains error regarding %g

2011-11-19 Thread Eric V. Smith

Changes by Eric V. Smith :


--
nosy: +eric.smith

___
Python tracker 

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



[issue13433] String format documentation contains error regarding %g

2011-11-19 Thread Mark Dickinson

Changes by Mark Dickinson :


--
versions: +Python 3.2, Python 3.3 -Python 2.6

___
Python tracker 

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



[issue13435] Copybutton does not hide tracebacks

2011-11-19 Thread Ezio Melotti

Changes by Ezio Melotti :


--
assignee: docs@python -> ezio.melotti
nosy: +georg.brandl
stage:  -> needs patch

___
Python tracker 

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



[issue12779] Update packaging documentation

2011-11-19 Thread Nebelhom

Changes by Nebelhom :


--
nosy: +Nebelhom

___
Python tracker 

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



[issue7330] PyUnicode_FromFormat: implement width and precision for %s, %S, %R, %V, %U, %A

2011-11-19 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

Hi!

I'd like to have this committed to be able to fix #13349. So here's a review.

- In Doc/c-api/unicode.rst, the two "versionchanged:: 3.3" directives can be 
merged

- In tests, I'd use 'abcde' rather than 'x' to make sure that correct 
characters are copied to the output (hope you understand what I mean)

- No test checks that width and precision work on characters rather than bytes

- The changes to unicodeobject.c don't apply on top of current default branch.

--
keywords: +needs review
stage:  -> patch review
versions: +Python 3.3 -Python 3.2

___
Python tracker 

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



[issue13089] parsetok.c: memory leak

2011-11-19 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy: +petri.lehtinen

___
Python tracker 

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



[issue13338] Not all enumerations used in _Py_ANNOTATE_MEMORY_ORDER

2011-11-19 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset f855f929bc48 by Petri Lehtinen in branch '3.2':
Issue #13338: Handle all enumerations in _Py_ANNOTATE_MEMORY_ORDER
http://hg.python.org/cpython/rev/f855f929bc48

New changeset c2e588a5237a by Petri Lehtinen in branch 'default':
Merge branch 3.2 (closes #13338)
http://hg.python.org/cpython/rev/c2e588a5237a

--
nosy: +python-dev
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue13338] Not all enumerations used in _Py_ANNOTATE_MEMORY_ORDER

2011-11-19 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

Your patch was applied with the default: case removed. Thanks!

--

___
Python tracker 

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



[issue13432] Encoding alias "unicode"

2011-11-19 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

Joining the chorus: people who need it in their application will have to add it 
themselves (monkeypatching the aliases dictionary as appropriate).

--
nosy: +loewis

___
Python tracker 

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



[issue13431] Pass context information into the extension module init function

2011-11-19 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

I really do propose to close this issue as "won't fix". By the time Python 4 
comes along, things will have changed a lot; it's not clear that the value of 
keeping it open will outweigh the cost of keeping it open.

--

___
Python tracker 

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



[issue13432] Encoding alias "unicode"

2011-11-19 Thread Ezio Melotti

Changes by Ezio Melotti :


--
stage:  -> committed/rejected
versions:  -Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.4

___
Python tracker 

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



[issue7433] MemoryView memory_getbuf causes segfaults, double call to tp_releasebuffer

2011-11-19 Thread Stefan Krah

Stefan Krah  added the comment:

My last comment could be misinterpreted: This *is* actually
already fixed in features/pep-3118.

--
versions: +Python 3.3 -Python 3.1

___
Python tracker 

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



[issue6715] xz compressor support

2011-11-19 Thread Nadeem Vawda

Changes by Nadeem Vawda :


Added file: http://bugs.python.org/file23732/9276fc685c05.diff

___
Python tracker 

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



[issue6715] xz compressor support

2011-11-19 Thread Nadeem Vawda

Changes by Nadeem Vawda :


Removed file: http://bugs.python.org/file23466/371a133b770a.diff

___
Python tracker 

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



[issue13436] compile() doesn't work on ImportFrom with level=None

2011-11-19 Thread Janosch Gräf

New submission from Janosch Gräf :

The documentation for ast says that arguments that are marked with a '?' in the 
abstract grammar are optional and can therefore be None.
When I try to compile a Module node which contains an ImportFrom node with 
attribute level=None compile() throws an exception:

Module(body=[ImportFrom(module='time', names=[alias(name='sleep', asname=None), 
alias(name='time', asname=None)], level=None, lineno=0, col_offset=0)])

Traceback (most recent call last):
  File "g0.py", line 423, in 
p.main()
  File "g0.py", line 65, in main
self.reproduce("g1.pyc")
  File "g0.py", line 85, in reproduce
co = self.generate_bytecode(st, genome)
  File "g0.py", line 243, in generate_bytecode
co = compile(st, id, "exec")
ValueError: invalid integer value: 

So, I tried to set level=0:
Module(body=[ImportFrom(module='time', names=[alias(name='sleep', asname=None), 
alias(name='time', asname=None)], level=0, lineno=0, col_offset=0)])

and everything worked fine.

BTW: The unprintable bytes in the error message are:
ef bf bd ef bf bd ef bf bd ef bf bd ef bf bd ef bf bd ef bf bd ef bf bd

--
assignee: docs@python
components: Documentation, Interpreter Core
messages: 147972
nosy: Janosch.Gräf, docs@python
priority: normal
severity: normal
status: open
title: compile() doesn't work on ImportFrom with level=None
type: behavior
versions: Python 3.1

___
Python tracker 

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



[issue13437] Provide links to the source code for every module in the documentation

2011-11-19 Thread Julian Berman

New submission from Julian Berman :

The documentation occasionally contains a link to the source code for a module 
in the stdlib. See for instance http://docs.python.org/library/urlparse.html 
and http://docs.python.org/library/collections.html , or many others.

With a quick perusal, I couldn't immediately guess as to which ones managed to 
have one and which ones don't, but it'd be convenient to have a link in as many 
places as possible, which is certainly more than we have now. (See e.g. 
http://docs.python.org/library/json.html and 
http://docs.python.org/library/itertools.html and many others for examples of 
pages that lack a link).

Perhaps putting it in a more conspicuous but still consistent location would be 
reasonable (the sidebar?).

--
assignee: docs@python
components: Documentation
messages: 147973
nosy: Julian, docs@python
priority: normal
severity: normal
status: open
title: Provide links to the source code for every module in the documentation
type: feature request
versions: Python 2.7, Python 3.3

___
Python tracker 

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



[issue13241] llvm-gcc-4.2 miscompiles Python (XCode 4.1 on Mac OS 10.7)

2011-11-19 Thread Michael Foord

Michael Foord  added the comment:

Note that this works for me on a Macbook Air that has never had Snow Leopard, 
nor XCode 3 installed. 

As far as I can tell non-llvm gcc *is* installed by XCode 4.2: /usr/bin/gcc-4.2

--

___
Python tracker 

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



[issue9530] integer undefined behaviors

2011-11-19 Thread Jesús Cea Avión

Changes by Jesús Cea Avión :


--
nosy: +jcea

___
Python tracker 

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



[issue13430] Add a curry function to the functools module

2011-11-19 Thread Collin Winter

Collin Winter  added the comment:

I assume I was added to this thread since I wrote the functional module, so 
I'll give my take in that capacity. IMO Python doesn't need a more general 
version of partial(); indeed, I question the need for partial() as it is today. 
Querying Google Code Search for code using partial, I haven't found any usages 
in the wild where partial() makes code more readable than simply defining a new 
function. partial() is almost always a loss for readability.

--

___
Python tracker 

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



[issue13431] Pass context information into the extension module init function

2011-11-19 Thread Jesús Cea Avión

Jesús Cea Avión  added the comment:

What about providing a function that "init" would call to get this information, 
instead of a "hidden" parameter?.

--
nosy: +jcea

___
Python tracker 

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



[issue13429] provide __file__ to extension init function

2011-11-19 Thread Jesús Cea Avión

Changes by Jesús Cea Avión :


--
nosy: +jcea

___
Python tracker 

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