[issue15853] IDLE crashes selecting Preferences menu with OS X ActiveState Tcl/Tk 8.5.12.1

2012-09-03 Thread Ned Deily

Ned Deily added the comment:

Hmm, sorry, I don't know of an easy fool-proof way to automatically log 
everything you type in IDLE.  But it's pretty easy to manually save the 
contents of the IDLE shell window at the end: with the keyboard focus on the 
Python Shell window, select the File - Save menu option.  Good luck with 
exploring!

--

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



[issue13992] Segfault in PyTrash_destroy_chain

2012-09-03 Thread Manu Cupcic

Manu Cupcic added the comment:

Hi,

Antoine, thank you for the patch you proposed. It indeed fixed the bug I was 
seeing (I ran a job that usually crashes in one to two hours over the week end 
and it is still running).

I am not sure what we should do now. Can this patch be integrated as is ? What 
can I do to help ?

Thanks

Manu

--

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



[issue15850] list.count() results wrong if both booleans 1's/0's are present in the list

2012-09-03 Thread Varun Masuraha

Varun Masuraha added the comment:

Hey Martin,

I think I got the point.
Meanwhile I created my own myCount() for my problem ;-)

Thanks.

--

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



[issue14223] curses addch broken on Python3.3a1

2012-09-03 Thread Nicholas Cole

Nicholas Cole added the comment:

Unless I'm getting the build process wrong (possible, because I haven't tried 
testing fixes before), this fix isn't working for me.

--

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



[issue13992] Segfault in PyTrash_destroy_chain

2012-09-03 Thread Antoine Pitrou

Antoine Pitrou added the comment:

 I am not sure what we should do now. Can this patch be integrated as is 
 ? What can I do to help ?

Well, you already helped by testing it, thank you.
I have to add a test case to the patch, then hopefully it can be committed.

--
stage:  - patch review
versions: +Python 3.2, Python 3.3

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



[issue14223] curses addch broken on Python3.3a1

2012-09-03 Thread Nicolas Schodet

Changes by Nicolas Schodet nico-pyt...@ni.fr.eu.org:


--
nosy:  -schodet

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



[issue15785] curses.get_wch() returns keypad codes incorrectly

2012-09-03 Thread Nicolas Schodet

Changes by Nicolas Schodet nico-pyt...@ni.fr.eu.org:


--
nosy:  -schodet

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



[issue15814] memoryview: equality-hash invariant

2012-09-03 Thread Nick Coghlan

Nick Coghlan added the comment:

The main issue is that it's not quite clear how to deal with problems like 
C-style vs FORTRAN-style memory layouts and strides vs suboffsets in defining 
multidimensional hash equality. Without a use case, it's easier to just punt on 
the question and declare it illegal.

The 1D hashing case really just comes from wanting to have 1D bytes views 
behave as much like a bytes object as is practical.

--

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



[issue15814] memoryview: equality-hash invariant

2012-09-03 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c9c9d890400c by Nick Coghlan in branch 'default':
Issue #15814: Add NEWS entry regarding intended memoryview hashing restrictions
http://hg.python.org/cpython/rev/c9c9d890400c

--

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



[issue14223] curses addch broken on Python3.3a1

2012-09-03 Thread STINNER Victor

STINNER Victor added the comment:

 Unless I'm getting the build process wrong (possible, because
 I haven't tried testing fixes before), this fix isn't working for me.

Oh did you compile Python? Did you install it?

Do you have libncursesw? = do you have the function curses.unget_wch?

What is the version of your libcurses[w] library? There are issues on 
libncurses 5.7. I think Ned Bat changed the script to compile Python on Mac to 
use a builtin copy of libncurses 5.9. See:
http://bugs.python.org/issue14225#msg163323

--
nosy: +ned.deily

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



[issue14223] curses addch broken on Python3.3a1

2012-09-03 Thread Christian Hofstaedtler

Changes by Christian Hofstaedtler ch+pythonb...@zeha.at:


--
nosy:  -zeha

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



[issue15814] memoryview: equality-hash invariant

2012-09-03 Thread Stefan Krah

Stefan Krah added the comment:

Small nitpick: multi-dimensional hashing wasn't really accidental,
it was perfectly aligned with the previous statically typed equality
definition.

When I suggested PyBuffer_Hash = hash(obj.tobytes()) on python-dev for
non-contiguous and multi-dimensional arrays, I got a +1 from Raymond
(which I now see was a private message).


I don't see what could possibly be ill-defined about using the
tobytes() definition for ND-arrays. In all places memoryview now
uses the logical array, which is displayed by tolist().

Leaving aside static typing, both the previous and the new equality
definitions regarded C and Fortran arrays with the same list outputs
as equal.

--

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



[issue15748] Various symlink test failures in test_shutil on FreeBSD

2012-09-03 Thread Trent Nelson

Trent Nelson added the comment:

Link to discussion (initiated by Andriy) on z...@lists.illumos.org: 
http://thread.gmane.org/gmane.os.illumos.zfs/69

--

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



[issue14223] curses addch broken on Python3.3a1

2012-09-03 Thread Nicholas Cole

Nicholas Cole added the comment:

 Unless I'm getting the build process wrong (possible, because
 I haven't tried testing fixes before), this fix isn't working for me.

Oh did you compile Python? Did you install it?

Yes, I tried compiling it.  

#./configure MACOSX_DEPLOYMENT_TARGET=10.8 --enable-framework 
--with-universal-archs=64-bit CFLAGS=-arch x86_64 LDFLAGS=-arch x86_64  
make -j6  make install

Do you have libncursesw? = do you have the function curses.unget_wch?

yes...

Python 3.3.0rc1+ (default, Sep  3 2012, 09:45:35) 
[GCC 4.2.1 Compatible Apple Clang 4.0 ((tags/Apple/clang-421.0.57))] on darwin
Type help, copyright, credits or license for more information.
 import curses
 curses.unget_wch()
Traceback (most recent call last):
  File stdin, line 1, in module
_curses.error: must call initscr() first
 curses.version
b'2.2'
 


What is the version of your libcurses[w] library? There are issues on 
libncurses 5.7. I think Ned Bat changed the script to compile Python on Mac to 
use a builtin copy of libncurses 5.9. See:
http://bugs.python.org/issue14225#msg163323

How do I check which version it was built against?  The messages from 
./configure just say that the tests pass, not which version it has found.

--

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



[issue15814] memoryview: equality-hash invariant

2012-09-03 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

On Mon, Sep 3, 2012 at 8:38 AM, Stefan Krah rep...@bugs.python.org wrote:
 I don't see what could possibly be ill-defined about using the
 tobytes() definition for ND-arrays. In all places memoryview now
 uses the logical array, which is displayed by tolist().

+1.  The key restriction is that to byte views.  ND aspect does not
complicate the logic once .tobytes() is properly implemented.

--

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



[issue15814] memoryview: equality-hash invariant

2012-09-03 Thread Stefan Behnel

Changes by Stefan Behnel sco...@users.sourceforge.net:


--
nosy:  -scoder

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



[issue15557] Tests for webbrowser module

2012-09-03 Thread Anton Barkovsky

Anton Barkovsky added the comment:

I think you forgot to write `test_open_with_autoraise_false` for Chrome tests.

--

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



[issue15855] memoryview methods are missing docstrings

2012-09-03 Thread Alexander Belopolsky

New submission from Alexander Belopolsky:

With attached patch python -mpydoc memoryview display looks as follows:

...
 |  cast(...)
 |  M.cast(format[, shape]) - memoryview
 |  
 |  Cast a memoryview to a new format or shape.
 |  
 |  release(...)
 |  M.release() - None
 |  
 |  Release the underlying buffer exposed by the memoryview object.
 |  
 |  tobytes(...)
 |  M.tobytes() - bytes
 |  
 |  Return the data in the buffer as a bytestring.
 |  
 |  tolist(...)
 |  M.tobytes() - list
 |  
 |  Return the data in the buffer as a list of elements.

--
files: memoryobject-docstrings.diff
keywords: patch
messages: 169762
nosy: belopolsky, skrah
priority: normal
severity: normal
status: open
title: memoryview methods are missing docstrings
type: behavior
versions: Python 3.4
Added file: http://bugs.python.org/file27109/memoryobject-docstrings.diff

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



[issue15836] unittest assertRaises should verify excClass is actually a BaseException class

2012-09-03 Thread Daniel Wagner-Hall

Daniel Wagner-Hall added the comment:

Cool, my contributor agreement has been received, please merge if happy!

--

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



[issue14223] curses addch broken on Python3.3a1

2012-09-03 Thread STINNER Victor

STINNER Victor added the comment:

 How do I check which version it was built against?

On Linux, I use:

$ ldd /usr/lib/python2.7/lib-dynload/_curses.so |grep curses
libncursesw.so.5 = /lib/i386-linux-gnu/libncursesw.so.5 (0xb76d)
$ ls -l /lib/i386-linux-gnu/libncursesw.so.5
lrwxrwxrwx 1 root root 18 nov.  18  2011
/lib/i386-linux-gnu/libncursesw.so.5 - libncursesw.so.5.9

= version 5.9

--

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



[issue14223] curses addch broken on Python3.3a1

2012-09-03 Thread Nicholas Cole

Nicholas Cole added the comment:

On Mon, Sep 3, 2012 at 3:15 PM, STINNER Victor rep...@bugs.python.org wrote:

 STINNER Victor added the comment:

 How do I check which version it was built against?

 On Linux, I use:

 $ ldd /usr/lib/python2.7/lib-dynload/_curses.so |grep curses
 libncursesw.so.5 = /lib/i386-linux-gnu/libncursesw.so.5 (0xb76d)
 $ ls -l /lib/i386-linux-gnu/libncursesw.so.5
 lrwxrwxrwx 1 root root 18 nov.  18  2011
 /lib/i386-linux-gnu/libncursesw.so.5 - libncursesw.so.5.9

 = version 5.9

I get Version 5.4, which seems very out of date (I'm running the
latest release of OS X) but:

nicholas$ ls -l /usr/lib/libncurses.
libncurses.5.4.dylib  libncurses.5.dyliblibncurses.dylib
NPSC:mnpyscreen nicholas$ ls -l /usr/lib/libncurses.dylib
lrwxr-xr-x  1 root  wheel  20 25 Jul 18:32 /usr/lib/libncurses.dylib
- libncurses.5.4.dylib

nicholas$ ldd /usr/lib/python2.7/lib-dynload/_curses.so |grep curses
/usr/lib/python2.7/lib-dynload/_curses.so:
/usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current
version 5.4.0)

Can that possibly be right??

--

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



[issue15557] Tests for webbrowser module

2012-09-03 Thread R. David Murray

R. David Murray added the comment:

I did indeed.

--
Added file: http://bugs.python.org/file27110/test_webbrowser.patch

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



[issue15856] inspect.getsource(SomeClass) doesn't show @decorators

2012-09-03 Thread Thomas Kluyver

New submission from Thomas Kluyver:

Since bug #1006219 was fixed, inspect.getsource(func) has returned the source 
of a function including any decorators on the function. But doing the same with 
a class, the returned source doesn't include decorators.

With functions, the co_firstlineno attribute of the code object points to the 
start of the decorators. With classes, that's not possible, so it's likely that 
a bit more regex trickery will be needed to scan back to decorators.

I've confirmed the same thing happens in 3.2 and 2.7, and looking at the code 
of inspect.py in trunk, it looks like it will do the same thing.

--
components: Library (Lib)
messages: 169767
nosy: takluyver
priority: normal
severity: normal
status: open
title: inspect.getsource(SomeClass) doesn't show @decorators
type: behavior
versions: Python 3.2

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



[issue15557] Tests for webbrowser module

2012-09-03 Thread Chris Jerdonek

Chris Jerdonek added the comment:

I added some comments on the latest patch on the review tool.

--

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



[issue15855] memoryview methods and data members are missing docstrings

2012-09-03 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

In the new patch, I added docstrings for the data members and now the list of 
memoryview data descriptors looks as follows in pydoc:

 |  --
 |  Data descriptors defined here:
 |  
 |  c_contiguous
 |  A bool indicating whether the memory is C contiguous.
 |  
 |  contiguous
 |  A bool indicating whether the memory is contiguous.
 |  
 |  f_contiguous
 |  A bool indicating whether the memory is Fortran contiguous.
 |  
 |  format
 |  A string containing the format (in struct module style)
 |  for each element in the view.
 |  
 |  itemsize
 |  The size in bytes of each element of the memoryview.
 |  
 |  nbytes
 |  The amount of space in bytes that the array would use in
 |  a contiguous representation.
 |  
 |  ndim
 |  An integer indicating how many dimensions of a multi-dimensional
 |  array the memory represents.
 |  
 |  obj
 |  The underlying object of the memoryview.
 |  
 |  readonly
 |  A bool indicating whether the memory is read only.
 |  
 |  shape
 |  A tuple of ndim integers giving the shape of the memory
 |  as a N-dimensional array.
 |  
 |  strides
 |  A tuple of ndim integers giving the size in bytes to access
 |  each element for each dimension of the array or None for C
 |  contiguous.
 |  
 |  suboffsets
 |  A tuple of ndim integers used internally for PIL-style arrays
 |  or None.

--
title: memoryview methods are missing docstrings - memoryview methods and data 
members are missing docstrings
Added file: http://bugs.python.org/file27111/issue15855.diff

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



[issue15855] memoryview methods and data members are missing docstrings

2012-09-03 Thread Alexander Belopolsky

Changes by Alexander Belopolsky alexander.belopol...@gmail.com:


Removed file: http://bugs.python.org/file27109/memoryobject-docstrings.diff

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



[issue15509] webbrowser.open sometimes passes zero-length argument to the browser.

2012-09-03 Thread R. David Murray

R. David Murray added the comment:

Given the logic of webbrowser, I think Anton's patch is correct.  The null 
strings are produced by the somewhat twisted logic of UnixBrowser.open, and the 
problem doesn't apply to the other cases of argument list generation.  (In 
those other cases, getting null strings would indicate a configuration error, 
which this case is not.)

--
nosy: +r.david.murray

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



[issue15509] UnixBrowser.open sometimes passes zero-length argument to the browser.

2012-09-03 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
title: webbrowser.open sometimes passes zero-length argument to the browser. - 
UnixBrowser.open sometimes passes zero-length argument to the browser.

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



[issue15857] memoryview of a ctypes struct has incompatible invalid format

2012-09-03 Thread Alexander Belopolsky

New submission from Alexander Belopolsky:

Starting with the example in memoryview documentation:

 from ctypes import BigEndianStructure, c_long
 class BEPoint(BigEndianStructure):
... _fields_ = [(x, c_long), (y, c_long)]
...
 point = BEPoint(100, 200)
 a = memoryview(point)

I am trying to unpack the resulting view:

 a.tolist()
Traceback (most recent call last):
  File stdin, line 1, in module
NotImplementedError: memoryview: unsupported format T{l:x:l:y:}

 struct.unpack_from(a.format,a)
Traceback (most recent call last):
  File stdin, line 1, in module
struct.error: bad char in struct format

 struct.unpack_from('ll',a)
(0, 100)


It looks like there is one or more bugs in play here.

--
messages: 169771
nosy: belopolsky, skrah
priority: normal
severity: normal
status: open
title: memoryview of a ctypes struct has incompatible invalid format
type: behavior
versions: Python 3.3, Python 3.4

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



[issue15855] memoryview methods and data members are missing docstrings

2012-09-03 Thread Antoine Pitrou

Antoine Pitrou added the comment:

This should also be fixed in 3.2 (at least for those methods/members which are 
in 3.2).

--
nosy: +pitrou
versions: +Python 3.2, Python 3.3 -Python 3.4

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



[issue15855] memoryview methods and data members are missing docstrings

2012-09-03 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

I am going to commit this tonight.  Stefan, please let me know if you have any 
comments.  I copied most of the descriptions from ReST manual with a few minor 
changes.  See shape/strides/suboffsets.

--
stage:  - commit review

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



[issue15447] A file is not properly closed by webbrowser._invoke

2012-09-03 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 901c790e4417 by R David Murray in branch 'default':
#15447: Use subprocess.DEVNULL in webbrowser, instead of opening
http://hg.python.org/cpython/rev/901c790e4417

New changeset 5da3b2df38b3 by R David Murray in branch 'default':
#15557,#15447,#15509: webbrowser test suite added.
http://hg.python.org/cpython/rev/5da3b2df38b3

--
nosy: +python-dev

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



[issue15557] Tests for webbrowser module

2012-09-03 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5da3b2df38b3 by R David Murray in branch 'default':
#15557,#15447,#15509: webbrowser test suite added.
http://hg.python.org/cpython/rev/5da3b2df38b3

--
nosy: +python-dev

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



[issue15509] UnixBrowser.open sometimes passes zero-length argument to the browser.

2012-09-03 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6768aa70c2d3 by R David Murray in branch '3.2':
#15509: If %action substitution produces a null string, drop it.
http://hg.python.org/cpython/rev/6768aa70c2d3

New changeset 323ca2f0e382 by R David Murray in branch 'default':
Merge #15509: If %action substitution produces a null string, drop it.
http://hg.python.org/cpython/rev/323ca2f0e382

New changeset 5da3b2df38b3 by R David Murray in branch 'default':
#15557,#15447,#15509: webbrowser test suite added.
http://hg.python.org/cpython/rev/5da3b2df38b3

--
nosy: +python-dev

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



[issue15857] memoryview: complete support for struct packing/unpacking

2012-09-03 Thread Stefan Krah

Stefan Krah added the comment:

It's deliberately not implemented (and documented): Since memoryview is a 
complete rewrite, I tried go easy on new features in order to facilitate
review.

My plan was to implement struct packing/unpacking in 3.3.1 in the same
manner as in the new equality function.


The struct error you see is tracked in #3132.

--
components: +Interpreter Core
stage:  - needs patch
title: memoryview of a ctypes struct has incompatible invalid format - 
memoryview: complete support for struct packing/unpacking
type: behavior - enhancement
versions:  -Python 3.4

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



[issue15509] UnixBrowser.open sometimes passes zero-length argument to the browser.

2012-09-03 Thread R. David Murray

R. David Murray added the comment:

Thanks, Anton.

--
resolution:  - fixed
stage: test needed - committed/rejected
status: open - closed

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



[issue15447] A file is not properly closed by webbrowser._invoke

2012-09-03 Thread R. David Murray

R. David Murray added the comment:

Thanks, Anton.

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

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



[issue15557] Tests for webbrowser module

2012-09-03 Thread R. David Murray

R. David Murray added the comment:

Thanks, Anton.  And thank you Chris for the initial reviews.

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

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



[issue14223] curses addch broken on Python3.3a1

2012-09-03 Thread Ned Deily

Ned Deily added the comment:

 Can that possibly be right??

Yes. That's the version of ncurses that Apple ships with current versions of OS 
X. You can build it yourself and install into /usr/local and rebuild python.  
For ncurses 5.9, something like:

./configure  --enable-widec --enable-shared --with-shared --without-normal
 make  sudo make install

should work.  FWIW, when I run your test script with tip, I now do see the two 
horizontal bars.

--

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



[issue15857] memoryview: complete support for struct packing/unpacking

2012-09-03 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

What about

 struct.unpack_from('ll',a)
(0, 100)

shouldn't that return (100, 200)?

--

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



[issue15855] memoryview methods and data members are missing docstrings

2012-09-03 Thread Stefan Krah

Stefan Krah added the comment:

I've left a couple of comments. -- Personally I'd also prefer if all
docstrings go into a separate section. I always perceive docstrings
as noise that takes up precious vertical space, so for _decimal I even
banned them into docstrings.h.

I don't know if there's any kind of convention for that though.

--

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



[issue15557] Tests for webbrowser module

2012-09-03 Thread R. David Murray

R. David Murray added the comment:

Hmm.  For some reason I did not get emailed these review comments, and I did 
not see your note before I did the checkin.  I will take a look.

--

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



[issue13518] configparser can’t read file objects from urlopen

2012-09-03 Thread moijes12

Changes by moijes12 moije...@gmail.com:


--
nosy:  -moijes12

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



[issue15557] Tests for webbrowser module

2012-09-03 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Thanks, David.  I wasn't sure if you had seen the comments.  They're mostly 
stylistic, though, so it's not too big of a deal.

--

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



[issue15557] Tests for webbrowser module

2012-09-03 Thread R. David Murray

R. David Murray added the comment:

Yeah, you make some good points, but I think I may already have spent more time 
on this that is justified by the amount of usage webbrowser gets :)  So I think 
I'm going to leave it as is, as being 'good enough'.

--

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



[issue15557] Tests for webbrowser module

2012-09-03 Thread R. David Murray

R. David Murray added the comment:

Oh, I see.  I did get the email, it's just that my email filter put it into a 
different folder from what I was expected.

--

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



[issue15857] memoryview: complete support for struct packing/unpacking

2012-09-03 Thread Stefan Krah

Stefan Krah added the comment:

'' in struct syntax implies standard size for 'l', which is 4 bytes.
ctypes uses machine size for c_long, so on an LP64 machine you can unpack 
the data as:

 struct.unpack_from('qq', a)
(100, 200)

--

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



[issue15557] Tests for webbrowser module

2012-09-03 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Fair enough. :)  I may keep a couple of those changes in mind if I ever have a 
chance to visit this module myself in the future.

--

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



[issue8911] regrtest.main should have a test skipping argument

2012-09-03 Thread moijes12

Changes by moijes12 moije...@gmail.com:


--
nosy: +moijes12

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



[issue15837] Added test to test_random.py testing Random.shuffle

2012-09-03 Thread Alessandro Moura

Alessandro Moura added the comment:

Comparing the execution time with and without the int=int argument of this 
command:

amoura@amoura-laptop:~/cpython$ time ./python -c from random import shuffle; 
lst=list(range(100)); shuffle(lst); print (len(lst))

I get with int=int:

real0m13.755s
user0m13.777s
sys 0m0.124s

and without it:

real0m13.876s
user0m13.701s
sys 0m0.116s

So it makes no difference in practice. On the other hand, removing this has a 
chance of braking existing code, if someone somewhere actually uses the third 
argument for something - I can't image what, but still...

--

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



[issue15855] memoryview methods and data members are missing docstrings

2012-09-03 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

On Sep 3, 2012, at 1:22 PM, Stefan Krah rep...@bugs.python.org wrote:

 Personally I'd also prefer if all
 docstrings go into a separate section. I always perceive docstrings
 as noise that takes up precious vertical space, so for _decimal I even
 banned them into docstrings.h.
 
 I don't know if there's any kind of convention for that though.

I've seen two types of convention: a docs trying before function definition and 
docstring after function body. I prefer the first because the docstring doubles 
as a short comment describing the function that follows.  If we put docstrings 
in a separate section, we may see comments above functions diverge from 
docstrings over time. 

On the other hand, this is not that important and consolidating the changes in 
one section will make 3.2 to 3.3 merge easier.  I'll consolidate and wait for 
someone else to complain. :-)

--
nosy: +Alexander.Belopolsky

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



[issue14922] mailbox.Maildir.get_message() may fail when Maildir dirname is a unicode string

2012-09-03 Thread Petri Lehtinen

Petri Lehtinen added the comment:

This would be considered a new feature, and is thus out of scope for 2.7. An 
easy workaround is to encode the unicode path to str using the file system 
encoding first (sys.getfilesystemencoding()).

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

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



[issue8911] regrtest.main should have a test skipping argument

2012-09-03 Thread Chris Jerdonek

Changes by Chris Jerdonek chris.jerdo...@gmail.com:


--
nosy: +cjerdonek

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



[issue8911] regrtest.main should have a test skipping argument

2012-09-03 Thread Chris Jerdonek

Chris Jerdonek added the comment:

 If you look at importlib.regrtest you will notice it has to muck with 
 sys.argv in order to get certain tests skipped.

This is reminiscent of issue 15132 which I filed, but for 
unittest.TestProgram() rather than regrtest.main().

 6. Switch regrtest.py to use argparse instead of optparse.

By the way, there is a patch for this from a couple months ago at issue 15302.  
It is waiting to be reviewed.

--

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



[issue15855] memoryview methods and data members are missing docstrings

2012-09-03 Thread Stefan Krah

Stefan Krah added the comment:

 On the other hand, this is not that important and consolidating the changes 
 in one section will make 3.2 to 3.3 merge easier.  I'll consolidate and wait 
 for someone else to complain. :-)

Thanks! I'm certain someone will complain, probably on python-dev right after
you commit. :)

--

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



[issue15533] subprocess.Popen(cwd) documentation

2012-09-03 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Update patch.

--
Added file: http://bugs.python.org/file27112/issue-15533-4-default.patch

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



[issue15533] subprocess.Popen(cwd) documentation

2012-09-03 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Thanks, Andrew.  Regarding your comment, it was a deliberate choice not to do 
the additional check because I wanted each test to check only one thing.  But I 
am okay with adding the additional check.

Regarding the patch, should all of the methods now do something similar to what 
test_cwd() does?

+# We cannot use os.path.realpath to canonicalize the path,
+# since it doesn't expand Tru64 {memb} strings. See bug 1063571.
+cwd = os.getcwd()
+os.chdir(tmpdir)
+tmpdir = os.getcwd()

It looks like test_cwd() may have needed to apply this treatment to have more 
reliable string-matching in the assert.  Otherwise, why is tmpdir being 
re-assigned to?

--

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



[issue15510] textwrap.wrap('') returns empty list

2012-09-03 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Thanks a lot for the very thorough review, David.  I should be able to update 
the patch and respond to a couple of your points later today or tomorrow at the 
latest.

--

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



[issue8911] regrtest.main should have a test skipping argument

2012-09-03 Thread moijes12

Changes by moijes12 moije...@gmail.com:


--
nosy:  -moijes12

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



[issue15340] OSError with import random when /dev/urandom doesn't exist (regression from 2.6)

2012-09-03 Thread Antoine Pitrou

Antoine Pitrou added the comment:

As for the patch: looks good on the principle. However, 
PyExc_NotImplementedError has no errno or filename, attribute, so you 
shouldn't use PyErr_SetFromErrnoWithFilename. Instead, simply call 
PyErr_SetString.

--

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



[issue15858] tarfile missing entries due to omitted uid/gid fields

2012-09-03 Thread Tom Lynn

New submission from Tom Lynn:

The tarfile module silently truncates the list of entries when reading a tar 
file if it sees an entry with a uid/gid field containing only spaces/NULs.  I 
got such a tarball from Java Maven/plexus-archiver.  I don't know whether they 
write such fields deliberately, but it seems reasonable to me, especially since 
they were providing the user/group names textually.

I'd like to see two fixes - a None/-1/0 value for the uid/gid and not silently 
swallowing HeaderErrors in TarFile.next() (or at least documenting why it's 
being done).  0 would be consistent with the default value when writing, but 
None seems more honest.  -1 seems hard to defend.

Only tested on silly Python versions (2.6, PyPy-1.8), sorry.  It's what I've 
got to hand, but I think this issue also applies to recent Python too going by 
looking at the hg trunk.

--
components: Library (Lib)
messages: 169799
nosy: tlynn
priority: normal
severity: normal
status: open
title: tarfile missing entries due to omitted uid/gid fields
type: behavior
versions: 3rd party, Python 2.6

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



[issue15814] memoryview: equality-hash invariant

2012-09-03 Thread Martin v . Löwis

Martin v. Löwis added the comment:

Am 02.09.2012 16:21, schrieb Alexander Belopolsky:
 I have refrained from voting because in my line of work buffers or
 memoryviews deal with large objects that rarely serve as dictionary
 keys.  As a result, I have zero experince with hashing of buffers.
 This observation supports the current consensus to limit hashing to
 1d and 0d cases.  My only concern is that with hash(m) ==
 hash(m.tobytes()) implementing multidimensional restriction will
 require artificial  if ndim  1 check and an extra sentence in the
 docs while not simplifying anything.

As for the not simplifying argument: if hashing was restricted
to contiguous bytes, then the implementation would certainly be
simplified quite a bit: currently, if it's not contiguous, it needs
to make a separate copy and hash that. This code could go away
if hashing would only work for true memory blocks.

--

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



[issue15744] missing tests for {RawIO,BufferedIO,TextIO}.writelines

2012-09-03 Thread Antoine Pitrou

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


--
keywords: +easy

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



[issue15814] memoryview: equality-hash invariant

2012-09-03 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

On Mon, Sep 3, 2012 at 3:59 PM, Martin v. Löwis rep...@bugs.python.org wrote:
 if hashing was restricted
 to contiguous bytes, then the implementation would certainly be
 simplified quite a bit: currently, if it's not contiguous, it needs
 to make a separate copy and hash that.

I would be happy if this whole business of strided memory layouts
would go away.  I find it to be a failed attempt of
over-generalization.  It is failed because it does not cover many
important formats even in 2-d: sparse matrices, symmetrical matrices,
banded matrices, etc., etc.  (Check level 3 BLAS or NAG for a longer
list.)  It is an over-generalizarion because in practice it is often
more efficient to gather your data in contiguous memory, perform
vector calculations and then scatter the results than to operate on
scattered data to avoid copying.

I would much rather see a generalization of suboffsets that would
allow me to have views into arrays of pointers to variable width
arrays than strides.

--

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



[issue15855] memoryview methods and data members are missing docstrings

2012-09-03 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c49f89261d65 by Alexander Belopolsky in branch '3.2':
Issue #15855: added docstrings for memoryview methods and data descriptors.
http://hg.python.org/cpython/rev/c49f89261d65

--
nosy: +python-dev

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



[issue15855] memoryview methods and data members are missing docstrings

2012-09-03 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 16a69ccff5ce by Alexander Belopolsky in branch 'default':
Issue #15855: added docstrings for memoryview methods and data descriptors 
(merge 3.2).
http://hg.python.org/cpython/rev/16a69ccff5ce

--

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



[issue15855] memoryview methods and data members are missing docstrings

2012-09-03 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ba2c1def3710 by Alexander Belopolsky in branch 'default':
Issue #15855: added docstrings for memoryview methods and data descriptors new 
in 3.3.
http://hg.python.org/cpython/rev/ba2c1def3710

--

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



[issue15855] memoryview methods and data members are missing docstrings

2012-09-03 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

A few remaining comments:

1) shape being None for 0-d views in 3.2 is probably a bug.  I did not mention 
that behavior in docstring.

2) a N-dimensional array typo was copied from ReST.  Fixing it does not 
deserve a separate tracker entry, but I would like to review the whole section 
and add new/changed in 3.3 as necessary once we resolve (1) above.

--

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



[issue15837] Added test to test_random.py testing Random.shuffle

2012-09-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Third parameter (int) plays a role only in the presence of a second one 
(random).

--

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



[issue15855] memoryview methods and data members are missing docstrings

2012-09-03 Thread Stefan Krah

Stefan Krah added the comment:

 1) shape being None for 0-d views in 3.2 is probably a bug.

Probably. I don't know whether it's worth fixing. Several test cases in ctypes
as well as in NumPy rely on it. So I guess we should just leave it for 3.2.

 2) a N-dimensional array typo was copied from ReST.  Fixing it does
 not deserve a separate tracker entry, but I would like to review the
 whole section and add new/changed in 3.3 as necessary once we resolve
 (1) above.

There are definitely some places where new/changed could be added
(e.g. the empty tuple for 0-d views is not mentioned).

--

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



[issue15855] memoryview methods and data members are missing docstrings

2012-09-03 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 82ae284cd5f1 by Alexander Belopolsky in branch 'default':
Issue #15855: updated related manual entries.
http://hg.python.org/cpython/rev/82ae284cd5f1

--

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



[issue15837] Added test to test_random.py testing Random.shuffle

2012-09-03 Thread R. David Murray

R. David Murray added the comment:

No, it always has an effect.  It means that the name 'int' is bound in locals 
instead of being looked up via globals.  That is what makes it a 
micro-optimization (LOAD_FAST vs LOAD_GLOBAL, if you do a dis on the two 
variants).

--

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



[issue15837] Added test to test_random.py testing Random.shuffle

2012-09-03 Thread R. David Murray

R. David Murray added the comment:

Oh, I see what you are saying.  The lookup of int is only done if random is not 
None.  Yes, that is true.

--

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



[issue15837] Added test to test_random.py testing Random.shuffle

2012-09-03 Thread R. David Murray

R. David Murray added the comment:

If the optimization is actually useful, it can be preserved by just putting 
'int=int' (with an 'optimization' comment :) before the loop.

--

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



[issue15837] Added test to test_random.py testing Random.shuffle

2012-09-03 Thread Alessandro Moura

Alessandro Moura added the comment:

The int=int still makes no difference, but if the second argument is set to 
random.random, we get a big speedup, regardless of whether the third argument 
is there:

without int=int:

amoura@amoura-laptop:~/cpython$ time ./python -c import random; 
lst=list(range(100)); random.shuffle(lst,random.random); print (len(lst))
100

real0m7.082s
user0m6.952s
sys 0m0.116s

With int=int:

amoura@amoura-laptop:~/cpython$ time ./python -c import random; 
lst=list(range(100)); random.shuffle(lst,random.random); print (len(lst))
100

real0m7.281s
user0m7.156s
sys 0m0.100s

Without second argument:

amoura@amoura-laptop:~/cpython$ time ./python -c import random; 
lst=list(range(100)); random.shuffle(lst); print (len(lst))
100

real0m13.783s
user0m13.609s
sys 0m0.108s

This could be because of the many tests of whether the 2nd argument is None in 
the loop.

--

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



[issue15837] Added test to test_random.py testing Random.shuffle

2012-09-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

 This could be because of the many tests of whether the 2nd argument is None
 in the loop.

This is because Random._randbelow (and therefore randrange, randint) is 
relatively slow.

--

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



[issue15837] Added test to test_random.py testing Random.shuffle

2012-09-03 Thread Alessandro Moura

Alessandro Moura added the comment:

Yup. This is the result of simply eliminating the condition in the loop and 
just using the second argument (for the purposes of testing this only):


amoura@amoura-laptop:~/cpython$ time ./python -c import random; 
lst=list(range(100)); random.shuffle(lst,random.random); print (len(lst))
100

real0m7.330s
user0m7.148s
sys 0m0.092s

--

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



[issue15858] tarfile missing entries due to omitted uid/gid fields

2012-09-03 Thread Ned Deily

Changes by Ned Deily n...@acm.org:


--
nosy: +lars.gustaebel

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



[issue15340] OSError with import random when /dev/urandom doesn't exist (regression from 2.6)

2012-09-03 Thread The Written Word

The Written Word added the comment:

Hi Antoine,

Thanks for the heads up.

I've attached a revised patch that doesn't misuse 
PyErr_SetFromErrnoWithFilename.

--
Added file: 
http://bugs.python.org/file27113/hash-randomization-not-implemented.patch

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



[issue15859] PyUnicode_EncodeFSDefault win32 inconsistancy.

2012-09-03 Thread Campbell Barton

Changes by Campbell Barton ideasma...@gmail.com:


--
components: +Unicode, Windows
nosy: +ezio.melotti
versions: +Python 3.2, Python 3.3

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



[issue15859] PyUnicode_EncodeFSDefault win32 inconsistancy.

2012-09-03 Thread Campbell Barton

New submission from Campbell Barton:

There is an inconsistency in PyUnicode_EncodeFSDefault(), on Linux its argument 
is checked to be unicode, and NULL is returned when its not. On windows 
however, this throws an assertion.

The problem with this is, in some CAPI code you may pass an argument and check 
for NULL as an error case, and allow the python API's exception to be exposed 
to the script author.

The problem here is a linux developer can use PyUnicode_EncodeFSDefault() this 
way, but not a windows developer.

A simplified use case below of a case where PyUnicode_EncodeFSDefault would 
fail.

Attached a fix so windows and posix systems behave the same.

---
const char *PyC_UnicodeAsByte(PyObject *py_str, PyObject **coerce)
{
if (PyBytes_Check(py_str)) {
return PyBytes_AS_STRING(py_str);
}
else if ((*coerce = PyUnicode_EncodeFSDefault(py_str))) {
return PyBytes_AS_STRING(*coerce);
}
---

Also: heres a list to the bug report in blenders tracker, where the bug was 
found.

https://projects.blender.org/tracker/index.php?func=detailaid=31856group_id=9atid=498

--
files: fix_unicode.diff
keywords: patch
messages: 169816
nosy: ideasman42
priority: normal
severity: normal
status: open
title: PyUnicode_EncodeFSDefault win32 inconsistancy.
Added file: http://bugs.python.org/file27114/fix_unicode.diff

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