[issue16142] ArgumentParser inconsistent with parse_known_args

2013-04-29 Thread paul j3

paul j3 added the comment:

Correction: The patch I gave in the last message produces:

>>> parser.parse_known_args(['-ku'])
(Namespace(known=False), ['u'])

It doesn't take action on the '-k', and puts 'u' in extras, not '-u'.

This new patch gets it right:

>>> parser.parse_known_args(['-ku'])
(Namespace(known=True), ['-u'])

We need more test cases, including ones that work as expected with optparse or 
other unix parsers.

--
Added file: http://bugs.python.org/file30056/dashku.patch

___
Python tracker 

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



[issue16631] tarfile.extractall() doesn't extract everything if .next() was used

2013-04-29 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka
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



[issue17865] PowerPC exponentiation and round() interaction

2013-04-29 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I can't reproduce this on 2.7.4. Could you please test 2.7.4?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue17865] PowerPC exponentiation and round() interaction

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



[issue17865] PowerPC exponentiation and round() interaction

2013-04-29 Thread Mark Dickinson

Mark Dickinson added the comment:

Hmm:  it's not an obvious Python bug, either:  both math.exp and math.ceil are 
simple wrappers around the libm functions, so there's little room for things to 
go wrong between Python and the OS.

Are you in a position to compile Python from source on your platform?

What was the equivalent C program you tried?  What's the compiler on this 
platform?  Note that gcc (I believe) evaluates math function calls for 
constants at compile time (using MPFR), rather than run time, which would mean 
if your C program simply does "exp(-2.0);" then it's not even using the OS libm.

--

___
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 Ben Read

Ben Read added the comment:

I've tried this and it looks like write access is already enabled, but I 
entered the commands you listed all the same - here's the output:

Bens-iMac:~ ben$ cd
Bens-iMac:~ ben$ ls -lde
drwxr-xr-x  28 temp  staff  952 28 Apr 18:46 .
Bens-iMac:~ ben$ mkdir /.idlerc
mkdir: /.idlerc: Permission denied
Bens-iMac:~ ben$ chmod u+w
usage:  chmod [-fhv] [-R [-H | -L | -P]] [-a | +a | =a  [i][# [ n]]] mode|entry 
file ...
chmod [-fhv] [-R [-H | -L | -P]] [-E | -C | -N | -i | -I] file ...
Bens-iMac:~ ben$ mkdir /.idlerc
mkdir: /.idlerc: Permission denied

On 28 Apr 2013, at 23:43, Ned Deily  wrote:

> 
> Ned Deily added the comment:
> 
> That's really odd.  It looks you have a permissions problem with your home 
> directory. On startup, IDLE attempts to create the directory .idlerc in your 
> home directory, /Users/ben, if it doesn't exist already.  If for some reason 
> the directory creation fails, IDLE aborts.  Interestingly, if the directory 
> exists but IDLE lacks write permission to create files in it, it does not 
> abort but posts a warning message in a window.  Perhaps it could be a little 
> more consistent about that.  But still, this appears to be avery unusual 
> situation.  I can't think of any reason why IDLE would be unable to create a 
> directory unless you have some security system installed or some unusual 
> access control list setting.  The most likely reason is just a plain old 
> permission problem on your home directory.  Try this in a terminal session:
> 
> cd ~
> ls -lde ~
> 
> You should see something similar to this:
> drwxr-xr-x+ 38 nad  staff  2992 Apr 28 15:26 /Users/nad/
> 0: group:everyone deny delete
> 
> if the permissions string is missing the "w" ("dr-xr-x"), that means you do 
> not have write permission to your home directory and can't create new 
> directories there.  In that case, 
> 
> mkdir ~/.idlerc
> 
> should fail.  (This is essentially what IDLE is trying to do.)
> 
> If you are missing write permission on your home directory, you *should* be 
> able to fix it by doing:
> 
> chmod u+w ~
> 
> --
> 
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue17865] PowerPC exponentiation and round() interaction

2013-04-29 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Oh, sorry, I missed PowerPC. Please ignore my previous comment.

--

___
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 Miguel Latorre

Miguel Latorre added the comment:

This bug is still present in python 2.7.4 and python 3.3.1.
I attach another example, the result differs depending on number of lines to 
process (see test.py).

--
nosy: +mal
versions: +Python 2.7, Python 3.3
Added file: http://bugs.python.org/file30057/test.zip

___
Python tracker 

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



[issue17865] PowerPC exponentiation and round() interaction

2013-04-29 Thread Ellen Wang

Ellen Wang added the comment:

OK.  My bad.  I should have been tipped off that the program didn't need -lm to 
link.  Output from C code:

0.135335
1
0.239022

Feel free to close.  I'll have to look into this on my own.  Thanks and sorry.

--

___
Python tracker 

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



[issue17866] TestCase.assertItemsEqual exists in 2.7, not in 3.3

2013-04-29 Thread Ronald Oussoren

New submission from Ronald Oussoren:

assertItemsEqual was added to unittest.TestCase in Python 2.7 (according to the 
documentation), but is not present in Python 3.3.

I'd expect it to be present in 3.3 as well, or for it to be mentioned in 
documentation as not being present (either in the 2.7 documentation or the 
Misc/NEWS file for py3k)

--
components: Library (Lib)
messages: 188045
nosy: ronaldoussoren
priority: normal
severity: normal
status: open
title: TestCase.assertItemsEqual exists in 2.7, not in 3.3
versions: 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



[issue17866] TestCase.assertItemsEqual exists in 2.7, not in 3.3

2013-04-29 Thread Ezio Melotti

Ezio Melotti added the comment:

I don't remember how it went exactly, but there were a few similar methods 
(assertItemsEqual, assertSameElements, assertCountEqual).  In 3.x we eventually 
decide to remove the first 2 because it wasn't clear what they were doing, and 
only assertCountEqual survived.  In 2.7 this wasn't possible, so 
assertItemsEqual survived.
assertDictContainsSubset is another method that was in 2.7 but is not in 3.x 
anymore.
Do you think the docs for 2.x should mention this?

--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python, ezio.melotti
type:  -> enhancement

___
Python tracker 

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



[issue17866] TestCase.assertItemsEqual exists in 2.7, not in 3.3

2013-04-29 Thread Ronald Oussoren

Ronald Oussoren added the comment:

I do think this should be mentioned in the 2.7 docs, assertDictContainsSubset 
is mentioned as "deprecated since 3.2" in the 2.7 docs.  The only problem with 
that is that there doesn't seem to be a "versionremoved" directive in sphinx, 
the best alternative seems to be deprecated-removed.

I'm not to happy about the removal though, assertCountEqual is not in 2.7 which 
means it is unnecessarily hard to port tests from 2.7 to 3.3. I also don't 
quite understand the difference between assertCountEqual and assetItemsEqual, 
the documentation for the two (in the 3.3 and 2.7 docs) appears to indicate 
they have the same behavior (both assert that two sequence have the same 
contents when the order of items is ignored).

--

___
Python tracker 

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



[issue17865] PowerPC exponentiation and round() interaction

2013-04-29 Thread Mark Dickinson

Mark Dickinson added the comment:

No problem; thanks for the update.  By the way, if you do file an OS bug report 
of some form, it would be great if you could add a link to this issue.  That 
might help anyone who encounters this in Python in the future.

Closing.

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

___
Python tracker 

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



[issue17866] TestCase.assertItemsEqual exists in 2.7, not in 3.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



[issue17866] TestCase.assertItemsEqual exists in 2.7, not in 3.3

2013-04-29 Thread Ezio Melotti

Ezio Melotti added the comment:

I think they might actually be the same (i.e. the name changed but not the 
implementation).  See #10242.
If this is true the new name could be mentioned in 2.7.

--

___
Python tracker 

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



[issue10242] unittest's assertItemsEqual() method makes too many assumptions about its input

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



[issue17849] Missing size argument in readline() method for httplib's class LineAndFileWrapper

2013-04-29 Thread Miroslav Stampar

Miroslav Stampar added the comment:

This trivial "patch" solved the issue (reported back by user):

def _(self, *args):
return self._readline()

httplib.LineAndFileWrapper._readline = httplib.LineAndFileWrapper.readline
httplib.LineAndFileWrapper.readline = _

--

___
Python tracker 

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



[issue17866] TestCase.assertItemsEqual exists in 2.7, not in 3.3

2013-04-29 Thread Ronald Oussoren

Ronald Oussoren added the comment:

You're right, according to #10242 the method was renamed in 3.2.

Something like the attached patch?


I'm somewhat flabbergasted that #10242 came to the conclusion that it would be 
a good idea to rename this method, given the folks that contributed the 
discussion.   It not that the new name is very good, I've seen it in the 3.3 
docs and didn't notice that it was relevant for what I was trying to do until 
you mentioned the method and I actually read the description. When I first saw 
the method I thought it was related to list.count.

--
Added file: http://bugs.python.org/file30058/issue17866.txt

___
Python tracker 

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



[issue17866] TestCase.assertItemsEqual exists in 2.7, not in 3.3

2013-04-29 Thread Ezio Melotti

Ezio Melotti added the comment:

Apparently assertItemsEqual was added to 2.7 and 3.2 and, after the release of 
2.7 but before the release of 3.2, assertItemsEqual has been renamed 
assertCountEqual (596239da3db7) and initially the assertItemsEqual was 
available too.  However, since the method was new in 3.2 the old alias got 
removed shortly after (bdd57841f5e2).  Eventually 3.2 was released with only 
assertCountEqual.

--
keywords: +patch
Added file: http://bugs.python.org/file30059/issue17866.diff

___
Python tracker 

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



[issue17866] TestCase.assertItemsEqual exists in 2.7, not in 3.3

2013-04-29 Thread Ezio Melotti

Ezio Melotti added the comment:

Looks like we wrote a similar patch at the same time :)
We don't usually use versionchanged in the 2.x docs for things that changed in 
3.x.  Using "named" instead of "renamed" is better, since in 3.x the name was 
assertCountEqual since the beginning, however saying "In Python 3.2" might be 
confusing (people might think that it's different for 3.3+).  I suggest to 
replace it with simply "Python 3", or perhaps "Python 3.2+".

--
Added file: http://bugs.python.org/file30060/issue17866-2.diff

___
Python tracker 

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



[issue17866] TestCase.assertItemsEqual exists in 2.7, not in 3.3

2013-04-29 Thread Ronald Oussoren

Ronald Oussoren added the comment:

Your patch looks good.

--

___
Python tracker 

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



[issue17866] TestCase.assertItemsEqual exists in 2.7, not in 3.3

2013-04-29 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d9921cb6e3cd by Ezio Melotti in branch '2.7':
#17866: mention that in Python 3, assertItemsEqual is named assertCountEqual.
http://hg.python.org/cpython/rev/d9921cb6e3cd

--
nosy: +python-dev

___
Python tracker 

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



[issue17866] TestCase.assertItemsEqual exists in 2.7, not in 3.3

2013-04-29 Thread Ezio Melotti

Ezio Melotti added the comment:

Applied.

--
assignee: docs@python -> ezio.melotti
components:  -Library (Lib)
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed
versions: +Python 2.7 -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



[issue17864] IDLE won't run

2013-04-29 Thread Ned Deily

Ned Deily added the comment:

The "ls" shows that, for some reason, your home directory is owned by user 
"temp", not by user "ben". That's not good.  Try doing this:

sudo chown ben /Users/ben/

But we're way past an IDLE or Python problem here.  This is a basic Unix system 
administration issue.

--

___
Python tracker 

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



[issue17851] Grammar errors in threading.Lock documentation

2013-04-29 Thread Ramchandra Apte

Ramchandra Apte added the comment:

I'm saying that they aren't valid grammar mistakes (there is no grammar
mistake). I agree with Georg Brandl's comment.

On 27 April 2013 20:18, Andriy Mysyk  wrote:

>
> Andriy Mysyk added the comment:
>
> Ramachandra, if I understand you correctly, I think what you are saying
> that both are grammar mistakes and the first one could addressed by adding
> "s" to block.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
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

New submission from Dmi Baranov:

Simple case - let's delete __import__ and try to import anything

$ python3.3
Python 3.3.0 (default, Oct  7 2012, 11:03:52) 
[GCC 4.4.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> del __builtins__.__dict__['__import__']
>>> import os
Traceback (most recent call last):
  File "", line 1, in 
Fatal Python error: __import__ missing

Current thread 0x7f07c9ebc700:
Aborted

But in python2.x

$ python2.7
Python 2.7.3 (default, Sep 22 2012, 02:37:18) 
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> del __builtins__.__dict__['__import__']
>>> import os
Traceback (most recent call last):
  File "", line 1, in 
ImportError: __import__ not found
>>>

--
components: Interpreter Core
messages: 188059
nosy: Dmi.Baranov
priority: normal
severity: normal
status: open
title: Deleting __import__ from builtins can crash Python3
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



[issue17867] Deleting __import__ from builtins can crash Python3

2013-04-29 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +brett.cannon, ezio.melotti
stage:  -> test needed

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


--
assignee:  -> rhettinger

___
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



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

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



[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



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

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



[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



[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



[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



[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



[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



[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



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



[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



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



[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




[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



[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



[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



[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



[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



[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



[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



[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

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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



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



[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



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



[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



[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



[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



[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



[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



[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



[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



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



[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



[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



[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



[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



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



[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



[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



[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



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



[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



[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



[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



  1   2   >