[issue17192] libffi-3.0.13 import

2013-04-29 Thread Georg Brandl

Georg Brandl added the comment:

Thanks. For 3.2, please attach a patch here.

--

___
Python tracker 

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



[issue17870] Python does not provide PyLong_FromIntMax_t() or PyLong_FromUintMax_t() function

2013-04-29 Thread Mark Dickinson

Changes by Mark Dickinson :


--
stage:  -> needs patch
type:  -> enhancement

___
Python tracker 

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



[issue17852] Built-in module _io can loose data from buffered files at exit

2013-04-29 Thread Charles-François Natali

Charles-François Natali added the comment:

> Hum, POSIX (2004) is not so strict:
> "Whether open streams are flushed or closed, or temporary files are
> removed is implementation-defined."
> http://pubs.opengroup.org/onlinepubs/009695399/functions/exit.html

You're looking at the wrong section:

"The exit() function shall then flush all open streams with unwritten
buffered data, close all open streams"

Then a couple lines below:

"The _Exit() [CX]   and _exit()  functions shall not call functions
registered with atexit() nor any registered signal handlers. Whether
open streams are flushed or closed, or temporary files are removed is
implementation-defined."

It's guaranteed for exit(), not _Exit()/_exit().

--

___
Python tracker 

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



[issue17192] libffi-3.0.13 import

2013-04-29 Thread Gregory P. Smith

Gregory P. Smith added the comment:

it _looks_ like the libffi updates i put in 3.2, 3.3 and default (3.4) are 
messed up with some changes missing in 3.2 and more missing in 3.3 and 3.4.  
(i'm comparing vs upstream 3.0.13 <-> 2.7 <-> 3.2 <-> 3.3 <-> 3.4).

i blame the mess of merging that was required by hg due to the plethora of 
versions of libffi we had in different states in 2.7, 3.2 and 3.3+ before i did 
the update.  i'm fixing it now.

--
resolution: fixed -> 

___
Python tracker 

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



[issue17870] Python does not provide PyLong_FromIntMax_t() or PyLong_FromUintMax_t() function

2013-04-29 Thread Mark Dickinson

Changes by Mark Dickinson :


--
nosy: +mark.dickinson

___
Python tracker 

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



[issue17642] IDLE add font resizing hot keys

2013-04-29 Thread Abhishek Kumar

Abhishek Kumar added the comment:

Thanks Roger, for the feedback especially the licence part. I have least idea 
about licences but will take care in future.

One question: Is it right to change IdleConf on Ctrl+ and Ctrl- ? I mean to 
change font for all open windows?
It happens with most text editors but not with browsers.

To remove those 2 hacks for CodeContext and LineNumbers, what we can do is 
write a ResetFont() for each extenstion and can call it from the ResetFont() of 
editor window like this: 
for extension in self.extensions:
extension.ResetFont()
so that we don't have to write seperate font-size hacks for each extension 
while resetting the font.

--

___
Python tracker 

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



[issue17876] Doc issue with threading.Event

2013-04-29 Thread Xavier Ordoquy

New submission from Xavier Ordoquy:

The documentation isn't correct for the threading.Event class under python 3.2.

In the threading doc page (http://docs.python.org/3.2/library/threading.html), 
Event is said to be at the same time a function and a class.

This is misleading and lead to a regression for celery under python 3.2 
(https://github.com/celery/celery/pull/1333).

Could the doc be updated under python 3.2 so that threading.Event leads to the 
function and threading._Event leads to the class ?

Regards,
Xavier.

--
assignee: docs@python
components: Documentation
messages: 188127
nosy: docs@python, xordoquy
priority: normal
severity: normal
status: open
title: Doc issue with threading.Event
type: enhancement
versions: Python 3.2

___
Python tracker 

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



[issue17870] Python does not provide PyLong_FromIntMax_t() or PyLong_FromUintMax_t() function

2013-04-29 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> It is the same question than yours: is there a platform with an integer type 
> wider than a pointer (intptr_t/void*)?

It's x86. sizeof(void*) == 4, sizeof(long long) == 8.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue17875] Set Intersection returns unexpected results

2013-04-29 Thread Afif Elghraoui

New submission from Afif Elghraoui:

I have two lists of strings (gene identifiers) that I know have something in 
common. I convert them to lists and do an intersection and I get the empty set. 
As an example test case, I know they both have the string 'Rv0500'

>>> list1.index('Rv0500')
278
>>> list2.index('Rv0500')
245
>>> set(list1).intersection(set(list2))
set([])

I was expecting to get a few hundred matches. My two lists are attached to this 
report. This is how I created the data file:

>>> x = shelve.open('lists.dat')
>>> x['list1'] = list1
>>> x['list2'] = list2
>>> x.close()

I did my best to make this report complete-- thanks for all your help.

--
components: Interpreter Core
files: lists.dat
messages: 188125
nosy: Afif.Elghraoui
priority: normal
severity: normal
status: open
title: Set Intersection returns unexpected results
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file30075/lists.dat

___
Python tracker 

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



[issue17642] IDLE add font resizing hot keys

2013-04-29 Thread Roger Serwy

Roger Serwy added the comment:

Abhishek, Alejandro, welcome to IDLE development! If you can, please sign a 
contributor agreement.

We have two patches to create this enhancement, both are good. I suggest that 
we figure out how to merge the solutions.

The zoom-out binding should also include Ctrl-Equal, so that holding shift is 
no longer necessary. There's also a corner case where the zooming in on the 
editor may cause the cursor to go outside of viewing window.

Using idleConf to query the font information is not strictly necessary since 
the font configuration in the text widget contains the font size already.

In the future, please be careful with licensing. The top part of the 
ZoomFont.py extension places it under the NCSA license. Fortunately UIUC has 
allowed me to relicense parts IdleX for the Python Software Foundation.

--

___
Python tracker 

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



[issue17874] ProcessPoolExecutor in interactive shell doesn't work in Windows

2013-04-29 Thread Decade

Decade added the comment:

Oh, yeah, using Python 3.3.1 (v3.3.1:d9893d13c628, Apr  6 2013, 20:30:21) [MSC 
v.1600 64 bit (AMD64)] on win32

--

___
Python tracker 

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



[issue17874] ProcessPoolExecutor in interactive shell doesn't work in Windows

2013-04-29 Thread Theodore Randolph

New submission from Theodore Randolph:

ProcessPoolExecutor doesn't work in an interactive shell in Windows, such as 
IDLE or the command prompt. It does work in Unix, and it works if I use the 
ThreadPoolExecutor instead.

For example, let's use the tutorial at 
http://eli.thegreenplace.net/2013/01/16/python-paralellizing-cpu-bound-tasks-with-concurrent-futures/

I get:
>>> pool_factorizer_chunked([1,2,3,456,7,8],8)
Exception in thread Thread-1:
Traceback (most recent call last):
  File "C:\Python33\lib\threading.py", line 639, in _bootstrap_inner
self.run()
  File "C:\Python33\lib\threading.py", line 596, in run
self._target(*self._args, **self._kwargs)
  File "C:\Python33\lib\concurrent\futures\process.py", line 248, in 
_queue_management_worker
shutdown_worker()
  File "C:\Python33\lib\concurrent\futures\process.py", line 208, in 
shutdown_worker
call_queue.put_nowait(None)
  File "C:\Python33\lib\multiprocessing\queues.py", line 132, in put_nowait
return self.put(obj, False)
  File "C:\Python33\lib\multiprocessing\queues.py", line 79, in put
raise Full
queue.Full

Traceback (most recent call last):
  File "", line 1, in 
pool_factorizer_chunked([1,2,3,456,7,8],8)
  File "", line 14, in pool_factorizer_chunked
resultdict.update(f.result())
  File "C:\Python33\lib\concurrent\futures\_base.py", line 392, in result
return self.__get_result()
  File "C:\Python33\lib\concurrent\futures\_base.py", line 351, in __get_result
raise self._exception
concurrent.futures.process.BrokenProcessPool: A process in the process pool was 
terminated abruptly while the future was running or pending.
>>> pool_factorizer_map([1,2,3,456,7,8],8)
Exception in thread Thread-2:
Traceback (most recent call last):
  File "C:\Python33\lib\threading.py", line 639, in _bootstrap_inner
self.run()
  File "C:\Python33\lib\threading.py", line 596, in run
self._target(*self._args, **self._kwargs)
  File "C:\Python33\lib\concurrent\futures\process.py", line 248, in 
_queue_management_worker
shutdown_worker()
  File "C:\Python33\lib\concurrent\futures\process.py", line 208, in 
shutdown_worker
call_queue.put_nowait(None)
  File "C:\Python33\lib\multiprocessing\queues.py", line 132, in put_nowait
return self.put(obj, False)
  File "C:\Python33\lib\multiprocessing\queues.py", line 79, in put
raise Full
queue.Full

Traceback (most recent call last):
  File "", line 1, in 
pool_factorizer_map([1,2,3,456,7,8],8)
  File "", line 6, in pool_factorizer_map
executor.map(factorize_naive, nums))}
  File "", line 4, in 
return {num:factors for num, factors in
  File "C:\Python33\lib\concurrent\futures\_base.py", line 546, in 
result_iterator
yield future.result()
  File "C:\Python33\lib\concurrent\futures\_base.py", line 399, in result
return self.__get_result()
  File "C:\Python33\lib\concurrent\futures\_base.py", line 351, in __get_result
raise self._exception
concurrent.futures.process.BrokenProcessPool: A process in the process pool was 
terminated abruptly while the future was running or pending.
>>>

--
components: Windows
messages: 188122
nosy: Decade
priority: normal
severity: normal
status: open
title: ProcessPoolExecutor in interactive shell doesn't work in Windows
type: crash
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



[issue17642] IDLE add font resizing hot keys

2013-04-29 Thread Alejandro Rodas

Changes by Alejandro Rodas :


Added file: http://bugs.python.org/file30074/ZoomInOut.patch

___
Python tracker 

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



[issue13721] ssl.wrap_socket on a connected but failed connection succeeds and .peer_certificate gives AttributeError

2013-04-29 Thread Ben Darnell

Ben Darnell added the comment:

That proposal sounds good to me.  I agree that any change here should target 
3.4, not backports to older versions.

--

___
Python tracker 

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



[issue12458] Tracebacks should contain the first line of continuation lines

2013-04-29 Thread Terry J. Reedy

Terry J. Reedy added the comment:

This is an enhancement request (at best), not a bug report. I would close it 
because I think it somewhat dubious, unreasonable, and not helpful.

First, I think tracebacks *should* report 'the spot of the foul' for each call 
frame. What would sometimes be helpful when multiple operations are performed 
in one line would be to also have the column number reported, along with a ^ to 
indicate the exact point of error. So I think instead misreporting the location 
of an instruction pointer could be deceptive and not helpful.

I think it unreasonable to ask the traceback reporter to guess which one line 
would be most helpful to report. The OP suggests somehow tracing back to the 
*first* line of a multiline statement. But on python-ideas, G. Rodola noted the 
following

assert \
1 == 0, \
"error"
Traceback (most recent call last):
  File "foo.py", line 3, in 
"error"
AssertionError: error

and requested that the *second* or *middle* line should be reported. (But what 
if the asserted expression itself covered multiple lines?)

I say sometimes 'not helpful' since the traceback already says what function 
the pointer is in, if it is in one, and therefore what function what called by 
the previous frame. In the 'reproducer', 'raise Exception' is in fun1, so in 
fun2, 'par="value")' must have been preceded by 'fun1(...' on a previous line. 
So replacing 'par="value")' with 'fun1(...' would not add information.

I think debugging multiline statements will usually requires looking at the 
whole statement and a few more. To make this easy, one can use a more 
sophisticated environment than dumb consoles. For instance, if one executes a 
top-level script from an Idle edit window, one can right click on a traceback 
in the Shell window and select 'Go to file/line'. Idle will open the file, if 
necessary, and highlight the line.

--
nosy: +terry.reedy
type: behavior -> enhancement
versions: +Python 3.4 -Python 2.7, 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



[issue17700] Update Curses HOWTO for 3.4

2013-04-29 Thread A.M. Kuchling

A.M. Kuchling added the comment:

Victor: I would like to add a section about using Unicode characters with 
curses, but found little material about doing that in either Python or the 
underlying C API.  Do you have any suggested references or example code that I 
could look at?

(It's probably better to commit the current patch if it's suitable, and commit 
the wide-character changes in a separate patch once they're ready.)

--

___
Python tracker 

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



[issue17870] Python does not provide PyLong_FromIntMax_t() or PyLong_FromUintMax_t() function

2013-04-29 Thread STINNER Victor

STINNER Victor added the comment:

The problem is to support platforms not providing a intmax_t type.

I don't know if the following C code would be a good "approximation" of the 
maximum integral value (signed/unsigned).


#ifdef HAVE_INTMAX_T
typedef intmax_tPy_intmax_t;
typedef uintmax_t   Py_uintmax_t;
 
#elif defined(HAVE_LONG_LONG) && (SIZEOF_VOID_P <= SIZEOF_LONG_LONG)
typedef PY_LONG_LONGPy_intmax_t;
typedef unsigned PY_LONG_LONG   Py_uintmax_t;

#elif SIZEOF_VOID_P <= SIZEOF_LONG
typedef longPy_intmax_t;
typedef unsigned long   Py_uintmax_t;

#elif SIZEOF_VOID_P <= SIZEOF_INT
typedef int Py_intmax_t;
typedef unsigned intPy_uintmax_t;

#else
#   error "Python needs a typedef for Py_intmax_t in pyport.h."
#endif /* HAVE_INTMAX_T */


If it is not, conversion from/to other types like off_t, time_t, pid_t or uid_t 
would loose information.

It is the same question than yours: is there a platform with an integer type 
wider than a pointer (intptr_t/void*)?

--

___
Python tracker 

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



[issue17797] Visual C++ 11.0 reports fileno(stdin) == 0 for non-console program

2013-04-29 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue17797] Visual C++ 11.0 reports fileno(stdin) == 0 for non-console program

2013-04-29 Thread Mateusz Loskot

Mateusz Loskot added the comment:

I've just got an update on the bug report [1] I submitted to Microsoft.
The Visual C++ team confirmed "It does appear to be a regression from Visual 
Studio 2010."

So, it's not a bug in Python, but I think it may be important for Python to 
consider applying some reliable workaround (i.e. use of check_fd() function)

[1] http://connect.microsoft.com/VisualStudio/feedback/details/785119/

--

___
Python tracker 

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



[issue17873] _ctypes/libffi missing bits for aarch64 support

2013-04-29 Thread Andreas Schwab

New submission from Andreas Schwab:

ctype modules doesn't build for aarch64 due to missing bits in the fficonfig.py 
script.

--
components: ctypes
files: ctypes-libffi-aarch64.patch
keywords: patch
messages: 188116
nosy: schwab
priority: normal
severity: normal
status: open
title: _ctypes/libffi missing bits for aarch64 support
type: compile error
versions: Python 3.3
Added file: http://bugs.python.org/file30073/ctypes-libffi-aarch64.patch

___
Python tracker 

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



[issue17870] Python does not provide PyLong_FromIntMax_t() or PyLong_FromUintMax_t() function

2013-04-29 Thread STINNER Victor

Changes by STINNER Victor :


--
title: Python does not provide a PyLong_FromIntptr_t() function -> Python does 
not provide PyLong_FromIntMax_t() or PyLong_FromUintMax_t() function

___
Python tracker 

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



[issue8231] Unable to run IDLE without write-access to home directory

2013-04-29 Thread Ned Deily

Ned Deily added the comment:

Issue17864 is a duplicate of this.  Also, note the error reported here is a 
result of IDLE not having write access in the user's home directory and thus 
cannot create the .idlerc directory.  IDLE seems to handle more gracefully the 
case of .idlerc existing but not writable.

--
nosy: +ned.deily
title: Unable to run IDLE without write-access to config directory -> Unable to 
run IDLE without write-access to home directory
versions: +Python 3.4 -Python 2.6, Python 3.2

___
Python tracker 

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



[issue17864] IDLE fails to launch when it cannot create .idlerc directory

2013-04-29 Thread Ned Deily

Ned Deily added the comment:

Ah, yes, it is a duplicate, thanks.  Let's move any further discussion to 
Issue8231.

--
resolution:  -> duplicate
stage:  -> committed/rejected
status: open -> closed
title: IDLE won't run -> IDLE fails to launch when it cannot create .idlerc 
directory

___
Python tracker 

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



[issue17870] Python does not provide a PyLong_FromIntptr_t() function

2013-04-29 Thread Devin Jeanpierre

Devin Jeanpierre added the comment:

Isn't it possible for a >64-bit architecture to have intptr_t be wider than 
long long?

As for my use-case, I am wrapping the C-API for Rust. Rust can call and be 
called by C (and therefore Python), but a Rust "int" is a C "intptr_t", and a 
Rust "uint" is a C "uintptr_t".

--

___
Python tracker 

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



[issue17870] Python does not provide a PyLong_FromIntptr_t() function

2013-04-29 Thread Devin Jeanpierre

Devin Jeanpierre added the comment:

With regards to the title change, I would prefer a FromIntMax_t (and 
FromUintMax_t) to a FromIntPtr_t. The former covers every use case of the 
latter, and more.

--

___
Python tracker 

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



[issue17870] Python does not provide a PyLong_FromIntptr_t() function

2013-04-29 Thread STINNER Victor

Changes by STINNER Victor :


--
title: Hard to create python longs from arbitrary C integers -> Python does not 
provide a PyLong_FromIntptr_t() function

___
Python tracker 

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



[issue17870] Hard to create python longs from arbitrary C integers

2013-04-29 Thread STINNER Victor

STINNER Victor added the comment:

"PyLong_FromVoidPtr works for uintptr_t, but not intptr_t."

Ok correct. You should use something like:

PyObject*
PyLong_FromIntptr_t(intptr_t value)
{
if (sizeof(intptr_t) == sizeof(long))
return PyLong_FromLong(value);
else {
assert(sizeof(intptr_t) <= sizeof(PY_LONG_LONG));
return PyLong_FromLongLong((PY_LONG_LONG)value);
}
}

The "if (sizeof(intptr_t) == sizeof(long))" should be optimized by your 
compiler.

I don't know if Python should provide such function. What is your use case for 
intptr_t?

It looks like intptr_t is only really used in the implementation of os.spawnv() 
and os.spawnve(). Extract:

#if SIZEOF_LONG == SIZEOF_VOID_P
return Py_BuildValue("l", (long) spawnval);
#else
return Py_BuildValue("L", (PY_LONG_LONG) spawnval);
#endif

--

___
Python tracker 

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



[issue17700] Update Curses HOWTO for 3.4

2013-04-29 Thread STINNER Victor

STINNER Victor added the comment:

window.get_wch() and curses.unget_wch(ch) should be used instead of 
window.getch() and curses.ungetch(ch), when available. They work much better 
with non-ASCII characters.

--
nosy: +haypo

___
Python tracker 

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



[issue17810] Implement PEP 3154 (pickle protocol 4)

2013-04-29 Thread Antoine Pitrou

Antoine Pitrou added the comment:

And here is an implementation of PREFETCH over Alexandre's work.
As you can see the code complexity compared to framing is mostly a wash, but I 
think fixing pickletools.optimize() will be easier with PREFETCH (still needs 
confirmation, of course :-)).

--
Added file: http://bugs.python.org/file30072/prefetch.patch

___
Python tracker 

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



[issue17700] Update Curses HOWTO for 3.4

2013-04-29 Thread A.M. Kuchling

A.M. Kuchling added the comment:

Updated version of the patch, applying many changes suggested by merwok:

* use ~curses.funcname notation for links.
* use 3-hyphen em-dash
* minor fixes to various examples
* rewrap long paragraphs (this makes the diff larger -- sorry!)

--
Added file: http://bugs.python.org/file30071/update-curses-howto.txt

___
Python tracker 

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



[issue17872] Crash in marshal.load() with bad reader

2013-04-29 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


--
nosy: +barry

___
Python tracker 

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



[issue17872] Crash in marshal.load() with bad reader

2013-04-29 Thread Dmi Baranov

Changes by Dmi Baranov :


--
nosy: +dmi.baranov

___
Python tracker 

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



[issue11632] difflib.unified_diff loses context

2013-04-29 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
versions: +Python 3.4 -Python 3.1

___
Python tracker 

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



[issue17872] Crash in marshal.load() with bad reader

2013-04-29 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

There is a buffer overflow in marshal.load() when len(read(n)) > n.

Here is a sample.

--
components: Interpreter Core
files: marshal_bad_reader.py
messages: 188107
nosy: serhiy.storchaka
priority: normal
severity: normal
stage: needs patch
status: open
title: Crash in marshal.load() with bad reader
type: behavior
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file30070/marshal_bad_reader.py

___
Python tracker 

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



[issue17871] Wrong signature of TextTestRunner's init function

2013-04-29 Thread Ezio Melotti

Changes by Ezio Melotti :


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

___
Python tracker 

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



[issue17870] Hard to create python longs from arbitrary C integers

2013-04-29 Thread Devin Jeanpierre

Devin Jeanpierre added the comment:

PyLong_FromVoidPtr works for uintptr_t, but not intptr_t.

--

___
Python tracker 

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



[issue17870] Hard to create python longs from arbitrary C integers

2013-04-29 Thread STINNER Victor

STINNER Victor added the comment:

Did you try PyLong_FromVoidPtr()?

--
nosy: +haypo

___
Python tracker 

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



[issue17871] Wrong signature of TextTestRunner's init function

2013-04-29 Thread Piotr Dobrogost

New submission from Piotr Dobrogost:

TextTestRunner's init as of 3.3.1 has 
(http://hg.python.org/cpython/file/d9893d13c628/Lib/unittest/runner.py#l128) 
the following parameters:
stream, descriptions, verbosity, failfast, buffer, resultclass, warnings 
whereas docs 
(http://docs.python.org/3.3/library/unittest.html?highlight=unittest#loading-and-running-tests)
 show only the following parameters:
stream, descriptions, verbosity, runnerclass, warnings

'Failfast' and 'buffer' parameters are missing in the docs and there's 
'runnerclass' parameter instead of 'resultclass' parameter.

--
assignee: docs@python
components: Documentation
messages: 188104
nosy: docs@python, ezio.melotti, michael.foord, piotr.dobrogost
priority: normal
severity: normal
status: open
title: Wrong signature of TextTestRunner's init function
versions: Python 3.4

___
Python tracker 

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



[issue17870] Hard to create python longs from arbitrary C integers

2013-04-29 Thread Devin Jeanpierre

New submission from Devin Jeanpierre:

As far as I can tell, the only safe and correct way to convert a (for example) 
intptr_t to a python long is something akin to the following:

size_t repsize = sizeof(intmax_t)*8 + 2;
char i_buf[repsize]; // enough to fit base 2 with sign, let alone base 1
snprintf(i_buf, repsize, "%ij", (intmax_t) myinteger);
return PyLong_FromString(i_buf, NULL, 10);

Does this not seem absurd?

PyLong_FromIntMax_t(myinteger) would be great. Or maybe even better would be 
PyLong_FromBytes(&myinteger, sizeof(myinteger)) ?

This is problematic because many things that can interact with the Python C-API 
do not use the C types like "long long" or "int". Instead they might use the 
equivalents of intptr_t and int32_t, which are more reliably sized.

--
messages: 188103
nosy: Devin Jeanpierre
priority: normal
severity: normal
status: open
title: Hard to create python longs from arbitrary C integers
versions: Python 3.4

___
Python tracker 

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



[issue17810] Implement PEP 3154 (pickle protocol 4)

2013-04-29 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> With framing it isn't annoying.

Slightly less, but you still have to wrap readline() calls in the
unpickler.

I have started experimenting with PREFETCH, but making the opcode
optional is a bit annoying in the C pickler, which means it's simpler to
always emit it, which means it's not very different from framing in the
end :-)

--

___
Python tracker 

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



[issue16754] Incorrect shared library extension on linux

2013-04-29 Thread Éric Araujo

Éric Araujo added the comment:

False alarm, disregard my previous message.

--

___
Python tracker 

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



[issue17869] distutils - TypeError in command/build_ext.py

2013-04-29 Thread Éric Araujo

Éric Araujo added the comment:

:)

--
stage:  -> committed/rejected

___
Python tracker 

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



[issue17869] distutils - TypeError in command/build_ext.py

2013-04-29 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

I'm sorry, you're right.

--
resolution:  -> invalid
status: open -> closed

___
Python tracker 

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



[issue17810] Implement PEP 3154 (pickle protocol 4)

2013-04-29 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

Antoine, I removed STACK_GLOBAL when I found performance issues with the 
implementation. The changeset that added it had some unrelated changes that 
made it harder to debug than necessary. I am planning to re-add it when I 
worked out the kinks.

--

___
Python tracker 

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



[issue17869] distutils - TypeError in command/build_ext.py

2013-04-29 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis added the comment:

Your Python seems to be built incorrectly. Maybe you forgot to re-run 
'./configure ...; make' after updating working copy. Could you try in a new 
working copy?

(I cannot reproduce this bug.)

--
nosy: +Arfrever

___
Python tracker 

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



[issue17810] Implement PEP 3154 (pickle protocol 4)

2013-04-29 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

With framing it isn't annoying.

--

___
Python tracker 

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



[issue17852] Built-in module _io can loose data from buffered files at exit

2013-04-29 Thread STINNER Victor

STINNER Victor added the comment:

>> It looks to be a feature of the standard C library, at least the GNU libc.
> Yes, it's guaranteed by POSIX/ANSI (see man exit).

Hum, POSIX (2004) is not so strict:
"Whether open streams are flushed or closed, or temporary files are
removed is implementation-defined."
http://pubs.opengroup.org/onlinepubs/009695399/functions/exit.html

2013/4/29 Charles-François Natali :
>
> Charles-François Natali added the comment:
>
>> "When you say Python 2, I assume you mean CPython 2, right?
>> Because - AFAICT - files got flushed only by accident, not by design."
>>
>> It looks to be a feature of the standard C library, at least the GNU libc. 
>> Its libio library installs an exit handler flushing all open files. You can 
>> see it if you set a breaking on write() using gdb:
>
> Yes, it's guaranteed by POSIX/ANSI (see man exit).
> I was refering to the fact that the automatic flushing of files upon
> exit is a mere side effect of the implementation based atop stdio
> stream in cpython 2. It's no guaranteed by any Python spec (and I
> can't really think of any platform other than C that makes such
> guarantee).
>
> --
>
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue16754] Incorrect shared library extension on linux

2013-04-29 Thread Éric Araujo

Éric Araujo added the comment:

This change may be responsible for #17869

--

___
Python tracker 

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



[issue17646] traceback.py has a lot of code duplication

2013-04-29 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 84cef4f1999a by Benjamin Peterson in branch 'default':
refactor traceback.py to reduce code duplication (closes #17646)
http://hg.python.org/cpython/rev/84cef4f1999a

--
nosy: +python-dev
resolution:  -> fixed
stage:  -> 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



[issue17869] distutils - TypeError in command/build_ext.py

2013-04-29 Thread Giampaolo Rodola'

New submission from Giampaolo Rodola':

Traceback (most recent call last):
  File "setup.py", line 221, in 
...  and much more ;)"""
  File "/home/giampaolo/svn/python/3.4/Lib/distutils/core.py", line 148, in 
setup
dist.run_commands()
  File "/home/giampaolo/svn/python/3.4/Lib/distutils/dist.py", line 917, in 
run_commands
self.run_command(cmd)
  File "/home/giampaolo/svn/python/3.4/Lib/distutils/dist.py", line 936, in 
run_command
cmd_obj.run()
  File "/home/giampaolo/svn/python/3.4/Lib/distutils/command/build.py", line 
126, in run
self.run_command(cmd_name)
  File "/home/giampaolo/svn/python/3.4/Lib/distutils/cmd.py", line 313, in 
run_command
self.distribution.run_command(command)
  File "/home/giampaolo/svn/python/3.4/Lib/distutils/dist.py", line 936, in 
run_command
cmd_obj.run()
  File "/home/giampaolo/svn/python/3.4/Lib/distutils/command/build_ext.py", 
line 349, in run
self.build_extensions()
  File "/home/giampaolo/svn/python/3.4/Lib/distutils/command/build_ext.py", 
line 458, in build_extensions
self.build_extension(ext)
  File "/home/giampaolo/svn/python/3.4/Lib/distutils/command/build_ext.py", 
line 474, in build_extension
ext_path = self.get_ext_fullpath(ext.name)
  File "/home/giampaolo/svn/python/3.4/Lib/distutils/command/build_ext.py", 
line 633, in get_ext_fullpath
filename = self.get_ext_filename(modpath[-1])
  File "/home/giampaolo/svn/python/3.4/Lib/distutils/command/build_ext.py", 
line 672, in get_ext_filename
return os.path.join(*ext_path) + ext_suffix
TypeError: Can't convert 'NoneType' object to str implicitly


I'm getting this while building PyOpenSSL on Linux with laterst cset of Python 
3.4.
Everything's fine on Python 3.3.
Possibly related with issue #16754?

--
assignee: eric.araujo
components: Distutils
messages: 188092
nosy: doko, eric.araujo, giampaolo.rodola, tarek
priority: normal
severity: normal
status: open
title: distutils - TypeError in command/build_ext.py
versions: Python 3.4

___
Python tracker 

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



[issue17714] str.encode('base64') add trailing new line character. It is not documented.

2013-04-29 Thread Dmi Baranov

Dmi Baranov added the comment:

Added a patch

--
keywords: +patch
nosy: +dmi.baranov
Added file: http://bugs.python.org/file30069/issue17714.patch

___
Python tracker 

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



[issue17810] Implement PEP 3154 (pickle protocol 4)

2013-04-29 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> What is wrong with GLOBAL?

It uses the lame "text mode" that scans for newlines, and is generally
annoying to optimize. This is like C strings vs. Pascal strings.
http://www.python.org/dev/peps/pep-3154/#binary-encoding-for-all-opcodes

--

___
Python tracker 

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



[issue17810] Implement PEP 3154 (pickle protocol 4)

2013-04-29 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

What is wrong with GLOBAL?

--

___
Python tracker 

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



[issue13721] ssl.wrap_socket on a connected but failed connection succeeds and .peer_certificate gives AttributeError

2013-04-29 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Ok, so this is a slightly annoying issue, but which isn't critical since 
there's a workaround (catch the AttributeError). Therefore I'm inclined not to 
change the behaviour in a bugfix release, for fear of regressions for people 
who are used to the workaround.

In 3.4, it makes sense to improve behaviour. I would propose the following: 
when self._sslobj is None, call getpeername() on the underlying socket, and let 
it raise, so that the user gets an appropriate exception for the situation 
(ENOTCONN mostly, but who knows?). If getpeername() doesn't raise, raise a 
ValueError instead (since it's akin to calling read() or fileno() on a closed 
file).

What do you think?

--
versions: +Python 3.4 -Python 2.7, 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



[issue17810] Implement PEP 3154 (pickle protocol 4)

2013-04-29 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Here is a framing patch on top of Alexandre's work.

There is one thing that framing breaks: pickletools.optimize(). I think it 
would be non-trivial to fix it. Perhaps the PREFETCH opcode is a better idea 
for this.

Alexandre, I don't understand why you removed STACK_GLOBAL. GLOBAL is a PITA 
that we should not use in protocol 4 anymore, so we need either STACK_GLOBAL or 
some kind of BINGLOBAL.

--
Added file: http://bugs.python.org/file30068/framing.patch

___
Python tracker 

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



[issue17868] pprint long non-printable bytes as hexdump

2013-04-29 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Yes, I think a separate function would be better. There's another issue for 
pprint() of bytes with line continuations:

http://bugs.python.org/issue17530

--

___
Python tracker 

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



[issue13742] Add a key parameter (like sorted) to heapq.merge

2013-04-29 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

There is already one heap class in the stdlib: queue.PriorityQueue. Why create 
a duplicate instead extend queue.PriorityQueue with desired features?

May be name the maxheap parameter as reverse?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue17868] pprint long non-printable bytes as hexdump

2013-04-29 Thread Fred L. Drake, Jr.

Changes by Fred L. Drake, Jr. :


--
nosy:  -fdrake

___
Python tracker 

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



[issue17868] pprint long non-printable bytes as hexdump

2013-04-29 Thread Ezio Melotti

Ezio Melotti added the comment:

A couple of comments:
 1) A separate function might be better.  I think this kind of output would be 
more useful while inspecting individual byte objects, rather than having it for 
arbitrary byte objects (that might be inside other containers).
 2) I don't know if the output of pprint is supposed to be eval()uable, but I 
don't like too much the base64.b16decode(...).replace(' ', '') in the output 
(especially if the byte objects are short).  If a separate function is used as 
suggested in 1) this won't be a problem.  Using the hex_codec might be another 
option.

--
nosy: +ezio.melotti

___
Python tracker 

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



[issue17857] sqlite modules doesn't build with 2.7.4 on Mac OS X 10.4

2013-04-29 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

Thanks, Serhiy.

--

___
Python tracker 

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



[issue12458] Tracebacks should contain the first line of continuation lines

2013-04-29 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


--
nosy: +giampaolo.rodola

___
Python tracker 

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



[issue1475692] replacing obj.__dict__ with a subclass of dict

2013-04-29 Thread Kushal Das

Kushal Das added the comment:

In Objects/typeobject.c we have subtype_setdict function, in which at line 1830 
we have PyDict_Check() macro call, which checks if it is a subclass of dict or 
not.

The definition is in Include/dictobject.h

#define PyDict_Check(op) \
 PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_DICT_SUBCLASS)

We can stop assigning anything other than dict in typesobject.c but that will 
break other things like http://bugs.python.org/issue1475692

--
nosy: +kushaldas

___
Python tracker 

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



[issue17857] sqlite modules doesn't build with 2.7.4 on Mac OS X 10.4

2013-04-29 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
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



[issue17868] pprint long non-printable bytes as hexdump

2013-04-29 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Here is a patch with which pprint formats long bytes objects which contain 
non-ascii or non-printable bytes as a hexdump.

Inspired by Antoine's wish 
(http://permalink.gmane.org/gmane.comp.python.ideas/20329).

--
components: Library (Lib)
files: pprint_bytes_hex.patch
keywords: patch
messages: 188081
nosy: fdrake, pitrou, serhiy.storchaka, techtonik
priority: normal
severity: normal
stage: patch review
status: open
title: pprint long non-printable bytes as hexdump
type: behavior
versions: Python 3.4
Added file: http://bugs.python.org/file30067/pprint_bytes_hex.patch

___
Python tracker 

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



[issue13742] Add a key parameter (like sorted) to heapq.merge

2013-04-29 Thread Mark Dickinson

Mark Dickinson added the comment:

Looks pretty good to me.

- There's a bonus print call in the diff.

- Should the "len(self._data)" call be protected by the lock?  I can't 
immediately think of any reason why that would be necessary (e.g., pushpop nd 
poppush never change the size of self._data, so there's no risk of getting a 
bogus length there), but the lack of the lock makes me nervous.

- Support for iter() seems a bit out of place to me.  What are the use-cases 
for this?  Would it make sense to leave this out (for now)?

--

___
Python tracker 

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



[issue12458] Tracebacks should contain the first line of continuation lines

2013-04-29 Thread Ian Cordasco

Changes by Ian Cordasco :


--
nosy: +icordasc

___
Python tracker 

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



[issue17861] put opcode information in one place

2013-04-29 Thread Kushal Das

Kushal Das added the comment:

Version 2 of the patchset edited as per review.

--
Added file: http://bugs.python.org/file30066/issue17861_v2.patch

___
Python tracker 

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



[issue16518] add "buffer protocol" to glossary

2013-04-29 Thread Ezio Melotti

Ezio Melotti added the comment:

Here's a patch that adds "bytes-like object" to the glossary, links to the 
buffer protocol docs[0] and provides bytes and bytearray as examples.

[0]: http://docs.python.org/dev/c-api/buffer.html#buffer-protocol

--
keywords: +patch
stage: needs patch -> patch review
versions: +Python 2.7 -Python 3.2
Added file: http://bugs.python.org/file30065/issue16518.diff

___
Python tracker 

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



[issue17852] Built-in module _io can loose data from buffered files at exit

2013-04-29 Thread Charles-François Natali

Charles-François Natali added the comment:

> "When you say Python 2, I assume you mean CPython 2, right?
> Because - AFAICT - files got flushed only by accident, not by design."
>
> It looks to be a feature of the standard C library, at least the GNU libc. 
> Its libio library installs an exit handler flushing all open files. You can 
> see it if you set a breaking on write() using gdb:

Yes, it's guaranteed by POSIX/ANSI (see man exit).
I was refering to the fact that the automatic flushing of files upon
exit is a mere side effect of the implementation based atop stdio
stream in cpython 2. It's no guaranteed by any Python spec (and I
can't really think of any platform other than C that makes such
guarantee).

--

___
Python tracker 

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



[issue17861] put opcode information in one place

2013-04-29 Thread Ezio Melotti

Changes by Ezio Melotti :


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

___
Python tracker 

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



[issue17857] sqlite modules doesn't build with 2.7.4 on Mac OS X 10.4

2013-04-29 Thread Ben Harper

Ben Harper added the comment:

This issue, like 14572, is also effecting Python 2.7.4 on CentOS 5.  I can 
confirm the patch fixes this issue on CentOS5.

--
nosy: +bharper

___
Python tracker 

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



[issue17852] Built-in module _io can loose data from buffered files at exit

2013-04-29 Thread STINNER Victor

STINNER Victor added the comment:

"In Python 2, a buffered file opened for writing is flushed by the C library 
when the process exit."


"When you say Python 2, I assume you mean CPython 2, right?
Because - AFAICT - files got flushed only by accident, not by design."

It looks to be a feature of the standard C library, at least the GNU libc. Its 
libio library installs an exit handler flushing all open files. You can see it 
if you set a breaking on write() using gdb:


Breakpoint 5, write () at ../sysdeps/unix/syscall-template.S:82
82  ../sysdeps/unix/syscall-template.S: Aucun fichier ou dossier de ce type.

(gdb) where
#0  write () at ../sysdeps/unix/syscall-template.S:82
#1  0xb7e33ba5 in _IO_new_file_write (f=0x8254ef0, data=0x81f9798, n=3) at 
fileops.c:1289
#2  0xb7e33a84 in new_do_write (fp=0x8254ef0, data=0x81f9798 
"bar\267\300\207\366\267\220\227\037\b\220\227\037\b\004d", to_do=3) at 
fileops.c:543
#3  0xb7e350fe in _IO_new_do_write (fp=0x8254ef0, data=0x81f9798 
"bar\267\300\207\366\267\220\227\037\b\220\227\037\b\004d", to_do=3) at 
fileops.c:516
#4  0xb7e354b5 in _IO_new_file_overflow (f=0x8254ef0, ch=-1) at fileops.c:894
#5  0xb7e36c40 in _IO_flush_all_lockp (do_lock=0) at genops.c:849
#6  0xb7e36d8e in _IO_cleanup () at genops.c:1010
#7  0xb7df5f92 in __run_exit_handlers (status=0, listp=0xb7f683e4, 
run_list_atexit=true) at exit.c:91
#8  0xb7df5fdd in __GI_exit (status=0) at exit.c:100
#9  0xb7ddc4db in __libc_start_main (main=0x8058f90 , argc=2, 
ubp_av=0xb1b4, init=0x8156960 <__libc_csu_init>, fini=0x81569d0 
<__libc_csu_fini>, rtld_fini=0xb7fed280 <_dl_fini>, stack_end=0xb1ac)
at libc-start.c:258
#10 0x08058fd1 in _start ()

Source of _IO_flush_all_lockp() in the GNU libc:

http://sourceware.org/git/?p=glibc.git;a=blob;f=libio/genops.c;h=390d8d24b5fb04f6a35b8fec27e700b9a9d641d4;hb=HEAD#l816

So the glibc maintains a list of open "FILE*" files: _IO_list_all, which is 
protected by list_all_lock lock.

--

___
Python tracker 

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



[issue17861] put opcode information in one place

2013-04-29 Thread Kushal Das

Kushal Das added the comment:

As we discussed on #python-dev channel this new patch includes the script in 
Tools/scripts/generate_opcode_h.py and it also contains the required 
Makefile.pre.in change so that it gets auto(re)generated at compile time if 
required.

--
keywords: +patch
Added file: http://bugs.python.org/file30064/issue17861_v1.patch

___
Python tracker 

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



[issue17852] Built-in module _io can loose data from buffered files at exit

2013-04-29 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue2704] IDLE: Patch to make PyShell behave more like a Terminal interface

2013-04-29 Thread Sarah

Changes by Sarah :


--
nosy: +Sarah

___
Python tracker 

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



[issue17673] add `copy_from` argument to temporaryfile

2013-04-29 Thread Kyle Roberts

Kyle Roberts added the comment:

Thanks for the comments Antoine. I didn't have a good reason for using the file 
name at the time, although even when using the file name I should have used the 
"file" variable that was already created. I tried using the file descriptor, 
but I encountered a "[Errno 9] Bad file descriptor" once the methods using 
_mkstemp_inner call _io.open on the returned fd. This leads me to believe that 
the fd is being closed somehow, but as you can see from my copy function, I 
don't implicitly or explicitly close the file using the file descriptor. I'm 
not sure yet why the file name works as expected but the fd does not. Am I 
missing something simple?

As for points 2-4 I have most of that done. What's the pythonic way for 
determining if an argument is file-like? I've seen isinstance, hasattr, etc.

--

___
Python tracker 

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



[issue17864] IDLE won't run

2013-04-29 Thread Roger Serwy

Roger Serwy added the comment:

This looks like a duplicate of issue8231.

--
nosy: +roger.serwy
type: crash -> behavior

___
Python tracker 

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



[issue17839] base64 module should use memoryview

2013-04-29 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue17861] put opcode information in one place

2013-04-29 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue17863] Bad sys.stdin assignment hangs interpreter.

2013-04-29 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 68d1ac152b5d by Benjamin Peterson in branch '3.3':
ignore errors when trying to fetch sys.stdin.encoding (closes #17863)
http://hg.python.org/cpython/rev/68d1ac152b5d

New changeset 97522b189c79 by Benjamin Peterson in branch 'default':
merge 3.3 (#17863)
http://hg.python.org/cpython/rev/97522b189c79

--
nosy: +python-dev
resolution:  -> fixed
stage: needs patch -> 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



[issue17863] Bad sys.stdin assignment hangs interpreter.

2013-04-29 Thread Florent Xicluna

Changes by Florent Xicluna :


--
nosy: +flox
title: Bad sys.stdin assignment hands interpreter. -> Bad sys.stdin assignment 
hangs interpreter.

___
Python tracker 

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




[issue17867] Deleting __import__ from builtins can crash Python3

2013-04-29 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 08ce30768003 by Benjamin Peterson in branch '3.3':
raise an ImportError (rather than fatal) when __import__ is not found in 
__builtins__ (closes #17867)
http://hg.python.org/cpython/rev/08ce30768003

--
nosy: +python-dev
resolution:  -> fixed
stage: test needed -> 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



[issue17867] Deleting __import__ from builtins can crash Python3

2013-04-29 Thread Benjamin Peterson

Benjamin Peterson added the comment:

Technically its not a crash but a fatal error. That's not to say its desirable, 
of course. :)

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue17867] Deleting __import__ from builtins can crash Python3

2013-04-29 Thread Dmi Baranov

Dmi Baranov added the comment:

Another example of post-effects:

>>> del __builtins__.__dict__['__import__']
>>> 1/0
Traceback (most recent call last):
  File "", line 1, in 
Fatal Python error: __import__ missing

Current thread 0x7f3db64fd700:
Aborted

--

___
Python tracker 

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



[issue13742] Add a key parameter (like sorted) to heapq.merge

2013-04-29 Thread Mark Dickinson

Mark Dickinson added the comment:

Ah, I see the new file now (I'd failed to refresh my browser);  sorry for the 
noise.

--

___
Python tracker 

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



[issue13742] Add a key parameter (like sorted) to heapq.merge

2013-04-29 Thread Mark Dickinson

Mark Dickinson added the comment:

heap2.diff contains only a single line's change.  Wrong file attached?

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue13742] Add a key parameter (like sorted) to heapq.merge

2013-04-29 Thread Raymond Hettinger

Changes by Raymond Hettinger :


Removed file: http://bugs.python.org/file30062/heap2.diff

___
Python tracker 

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



[issue13742] Add a key parameter (like sorted) to heapq.merge

2013-04-29 Thread Raymond Hettinger

Changes by Raymond Hettinger :


Added file: http://bugs.python.org/file30063/heap2.diff

___
Python tracker 

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



[issue15535] Fix pickling efficiency of named tuples in 2.7.3

2013-04-29 Thread Florent Xicluna

Changes by Florent Xicluna :


--
nosy: +flox

___
Python tracker 

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



[issue17867] Deleting __import__ from builtins can crash Python3

2013-04-29 Thread Florent Xicluna

Changes by Florent Xicluna :


--
nosy: +flox

___
Python tracker 

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



[issue17834] Add Heap (and DynamicHeap) classes to heapq module

2013-04-29 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
Removed message: http://bugs.python.org/msg188062

___
Python tracker 

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



[issue17834] Add Heap (and DynamicHeap) classes to heapq module

2013-04-29 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Daniel, I'm going to close this one so we can continue work in just a single 
tracker item:  http://bugs.python.org/issue13742   

I'll see if anything in your code should be merged in to mine and will list you 
as a co-contributor when it all goes in.

--

___
Python tracker 

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



[issue15535] Fix pickling efficiency of named tuples in 2.7.3

2013-04-29 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
Removed message: http://bugs.python.org/msg188063

___
Python tracker 

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



[issue15535] Fix pickling efficiency of named tuples in 2.7.3

2013-04-29 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Amaury, please go ahead and apply your patch.

--
assignee: rhettinger -> amaury.forgeotdarc

___
Python tracker 

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



[issue13742] Add a key parameter (like sorted) to heapq.merge

2013-04-29 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
priority: low -> normal
Added file: http://bugs.python.org/file30062/heap2.diff

___
Python tracker 

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



[issue15535] Fix pickling efficiency of named tuples in 2.7.3

2013-04-29 Thread Raymond Hettinger

Raymond Hettinger added the comment:

[Antoine]
> I would like to call this a critical regression.

I concur.  
I will post the suggested fix with tests.

--

___
Python tracker 

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



[issue17834] Add Heap (and DynamicHeap) classes to heapq module

2013-04-29 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
Removed message: http://bugs.python.org/msg188061

___
Python tracker 

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



[issue17834] Add Heap (and DynamicHeap) classes to heapq module

2013-04-29 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Daniel, I'm going to close this one so we can continue work in just a single 
tracker item:  http://bugs.python.org/issue17794   

I'll see if anything in your code should be merged in to mine and will list you 
as a co-contributor when it all goes in.

--
resolution:  -> duplicate
status: open -> closed

___
Python tracker 

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



[issue17834] Add Heap (and DynamicHeap) classes to heapq module

2013-04-29 Thread Raymond Hettinger

Raymond Hettinger added the comment:

See also http://bugs.python.org/issue17794

--

___
Python tracker 

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



[issue17834] Add Heap (and DynamicHeap) classes to heapq module

2013-04-29 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Daniel, I've already been in the process of adding a class to the heapq module 
and have done substantial work on it over the last few months.  I'll look at 
your code to see if there are any ideas that should be merged with it before I 
finish it up.

Am attaching my current draft for Heap().  A PriorityQueue() variant would also 
be added to 3.4.

--
Added file: http://bugs.python.org/file30061/heap2.diff

___
Python tracker 

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



  1   2   >