[issue12567] curses implementation of Unicode is wrong in Python 3

2012-06-21 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 2035c5ad4239 by Ned Deily in branch 'default':
Issue #14225: Fix Unicode support for curses (#12567) on OS X:
http://hg.python.org/cpython/rev/2035c5ad4239

--

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



[issue14225] _cursesmodule compile error in OS X 32-bit-only installer build

2012-06-21 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 2035c5ad4239 by Ned Deily in branch 'default':
Issue #14225: Fix Unicode support for curses (#12567) on OS X:
http://hg.python.org/cpython/rev/2035c5ad4239

--
nosy: +python-dev

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



[issue14225] _cursesmodule compile error in OS X 32-bit-only installer build

2012-06-21 Thread Ned Deily

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

It turns out that the Unicode support for curses did not build correctly on OS 
X at all.  There were two issues:

1. On OS X, unlike many systems, does not supply separate libncurses and 
libncursesw in /usr/lib; same for libpanel/libpanelw. So the tests in setup.py 
based on the presence of the w libs failed, thus disabling the wide-char 
support in the extension modules even though the OS X libs supported it.  The 
tests in setup.py are now fixed to handle building on OS X with either the 
system libs or locally-supplied copies.

2. The 32-bit-only installer has historically built and supplied its own copy 
of libncursesw so that installer build did find a wide lib.  However, the wide 
code support within ncurses is conditional depending on _XOPEN_SOURCE_EXTENDED 
which is specifically not defined for OS X  (platform=='darwin') builds.  That 
caused the compile errors (things like cchar_t from the ncurses include files 
were not getting defined).  The solution for that is to supply 
_XOPEN_SOURCE_EXTENDED locally to the _curses* extension module builds.

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

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



[issue12567] curses implementation of Unicode is wrong in Python 3

2012-06-21 Thread Ned Deily

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

It turns out that the Unicode support introduced by this issue didn't build 
correctly on OS X, either silently failing to build (explaining the problem 
seen by Nicholas) or causing a compile error (as seen in Issue14225).  This 
should be working OK (as of 3.3.0b1).

BTW, a test of the wide char functions would be nice and might have caught this.

--

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



[issue9530] integer undefined behaviors

2012-06-21 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Thanks.  It looks like that = report has uncovered a bug in the way that 
ctypes lays out bitfields:  in the following, BITS.M should (I believe) look 
like: Field type=c_short, ofs=4:0, bits=1.  Instead, ctypes is trying to 
store a bitfield starting at bit position 17 of a short, which doesn't make 
much sense.

iwasawa:cpython mdickinson$ ./python.exe
Python 3.3.0a4+ (default:2035c5ad4239+, Jun 21 2012, 08:30:36) 
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type help, copyright, credits or license for more information.
 from ctypes import Structure, c_int, c_short
 class BITS(Structure):
... _fields_ = [(A, c_int, 17), (M, c_short, 1)]
... 
 BITS.M
Field type=c_short, ofs=2:17, bits=1

--

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



[issue9530] integer undefined behaviors

2012-06-21 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Meador:  I see that you've been working on some ctypes issues; does the ctypes 
bitfield problem above fall under any of the existing issues, or should I open 
a new one?

--
nosy: +meador.inge

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



[issue9530] integer undefined behaviors

2012-06-21 Thread Amaury Forgeot d'Arc

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

Issue3547 looks similar.

--
nosy: +amaury.forgeotdarc

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



[issue14626] os module: use keyword-only arguments for dir_fd and nofollow to reduce function count

2012-06-21 Thread Larry Hastings

Larry Hastings la...@hastings.org added the comment:

New patch!  What's new:

* The big change: I removed the fd= parameters.  Now, functions that
  accept either a path or a file descriptor simply take either as their
  path argument.  I ran it by Guido and he thought it sounded fine,
  so I tried it--and I think it's a definite improvement.  (Thanks to
  Jim Jewett for suggesting it--tbh I'd considered it before, but
  looking at it through fresh eyes helped!)

* Also new in this patch: you can now LBYL for the fd, dir_fd, and
  follow_symlinks parameters.  Just check to see if the function is
  in os.supports_name of parameter.  For example:
 if os.chown in os.supports_dir_fd:
 os.chown(path, dir_fd=whatnot)

* The third big bit of news: the patch works under Windows!

* I attempted to support Mac OS X 10.3, specifically the weak linking
  to statvfs, fstatvfs, and lchown.  However I don't have a Mac (much
  less one running 10.3) so I can't test this.

I *think* the docstrings are all fixed.  The only thing I know that
needs to be done are the docs (and Misc/NEWS).

I really wanna get this in before the feature freeze.  I promise to
support it through the betas... can I puh-leez check it in?

--
Added file: 
http://bugs.python.org/file26063/larry.os.keyword.arguments.collapse.4.diff

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



[issue14225] _cursesmodule compile error in OS X 32-bit-only installer build

2012-06-21 Thread STINNER Victor

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

Cool, thanks for the fix!

--
nosy: +haypo

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



[issue14769] Add test to automatically detect missing format units in skipitem()

2012-06-21 Thread Larry Hastings

Larry Hastings la...@hastings.org added the comment:

Incorporates Benjamin's self-admitted pedantic changes ;-)

Will it survive?  Will it get checked in?  Tune in... soon, I hope!

--
Added file: http://bugs.python.org/file26064/larry.test_skipitem_parity.4.diff

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



[issue15119] Bug in ctypes bitfield layout?

2012-06-21 Thread Mark Dickinson

New submission from Mark Dickinson dicki...@gmail.com:

It looks as though there's a bug in the ctypes bitfield layout algorithm.  
After:

 from ctypes import Structure, c_int, c_short
 class BITS(Structure):
... _fields_ = [(A, c_int, 17), (M, c_short, 1)]
... 

I get:

 BITS.M
Field type=c_short, ofs=2:17, bits=1

which doesn't make a lot of sense (17th bit of a short?)  This causes a 
negative shift operation when trying to access the .M field of an instance of 
this structure (see issue 9530 and in particular msg163303).

On this machine (OS X 10.6, 64-bit build of Python using the system gcc (4.2) 
with no special compiler flags), the corresponding struct in a simple C test 
program has size 4:

#include stdio.h

struct {
  int A : 17;
  short B: 1;
} flags;

int main(void) {
  printf(sizeof flags is: %ld\n, sizeof(flags));
  return 0;
}

So it looks like everything gets packed into that first int.  At a guess, 
BITS.M should therefore look like Field type=c_int, ofs=0:17, bits=1 instead.



System info:

Python 3.3.0a4+ (default:2035c5ad4239+, Jun 21 2012, 08:30:36) 
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type help, copyright, credits or license for more information.

--
components: ctypes
messages: 163315
nosy: mark.dickinson, meador.inge
priority: normal
severity: normal
status: open
title: Bug in ctypes bitfield layout?
type: behavior
versions: Python 3.3

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



[issue9530] integer undefined behaviors

2012-06-21 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Thanks, Amaury.  I see a whole bunch of related issues, but none of them quite 
seems to capture this exact issue.  So I've opened a new bug report: see issue 
15119.

--

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



[issue15118] uname and other os functions should return a struct sequence instead of a tuple

2012-06-21 Thread Larry Hastings

Larry Hastings la...@hastings.org added the comment:

Patch implementing struct sequences for os.uname() and os.times().  Those two 
are a slam dunk, so let's try and get 'em into 3.3.

Patch includes docs!  Maybe it's ready!  Who knows!

--
keywords: +patch
Added file: 
http://bugs.python.org/file26065/larry.uname.and.times.structseq.1.diff

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



[issue15120] Different behavior of html.parser.HTMLParser

2012-06-21 Thread hansokumake

New submission from hansokumake hansokum...@seznam.cz:

I tried this example from the documentation:

from html.parser import HTMLParser

class MyHTMLParser(HTMLParser):
def handle_starttag(self, tag, attrs):
print(Encountered a start tag:, tag)
def handle_endtag(self, tag):
print(Encountered an end tag :, tag)
def handle_data(self, data):
print(Encountered some data  :, data)

parser = MyHTMLParser(strict=False)
parser.feed('htmlheadtitleTest/title/head'
'bodyh1Parse me!/h1/body/html')



According to documentation the output should be like this:
Encountered a start tag: html
Encountered a start tag: head
Encountered a start tag: title
Encountered some data  : Test
Encountered an end tag : title
Encountered an end tag : head
Encountered a start tag: body
Encountered a start tag: h1
Encountered some data  : Parse me!
Encountered an end tag : h1
Encountered an end tag : body
Encountered an end tag : html

but Python produced this:
Encountered some data  : html
Encountered some data  : head
Encountered some data  : title
Encountered some data  : Test
Encountered an end tag : title
Encountered an end tag : head
Encountered some data  : body
Encountered some data  : h1
Encountered some data  : Parse me!
Encountered an end tag : h1
Encountered an end tag : body
Encountered an end tag : html


If strict is set to True, it works correctly.

--
assignee: docs@python
components: Documentation
messages: 163318
nosy: docs@python, hansokumake
priority: normal
severity: normal
status: open
title: Different behavior of html.parser.HTMLParser
type: behavior
versions: Python 3.2

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



[issue15119] Bug in ctypes bitfield layout?

2012-06-21 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

 At a guess, BITS.M should therefore look like Field type=c_int, 
 ofs=0:17, bits=1 instead.

Refined guess:  it should be Field type=c_short, ofs=2:1, bits=1.

Tests for this issue should also cover cases like:

_fields_ = [(A, c_int, 13), (M, c_short, 5)]

where M should end up being described as Field type=c_short, ofs=2:0, bits=5.

--

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



[issue15120] Different behavior of html.parser.HTMLParser

2012-06-21 Thread R. David Murray

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


--
nosy: +ezio.melotti

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



[issue15120] Different behavior of html.parser.HTMLParser

2012-06-21 Thread Fred L. Drake, Jr.

Changes by Fred L. Drake, Jr. f...@fdrake.net:


--
nosy: +fdrake

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



[issue15037] test_curses fails with OverflowError

2012-06-21 Thread Ned Deily

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

I just ran into this problem on another platform.  I believe the problem is due 
to a sign-extension bug in the ncurses library unget_wch function (see link 
below).  It was apparently fixed in nurses 5.8; I've tested with the current 
ncurses 5.9 and test_ncurses now runs without error.

Are you using a version of libncurses/libncursew older than 5.8?  If so, can 
you try building with 5.8 or 5.9?

Another question is how to handle this for the 3.3.0 release.  It looks like 
not all platforms have the latest ncurses and, if not, the unget_wch function 
and test_curses are likely to fail.  Unfortunately, there doesn't seem to be an 
attribute available in the curses module that gives the version of the 
underlying curses/ncurses library.  At the least, the problem should probably 
be documented somewhere.

http://invisible-island.net/ncurses/NEWS.html#t20091010

--
nosy: +georg.brandl, haypo, ned.deily
priority: normal - high

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



[issue15121] devguide doesn't document all bug tracker components

2012-06-21 Thread Petri Lehtinen

New submission from Petri Lehtinen pe...@digip.org:

http://docs.python.org/devguide/triaging.html#components

The undocumented components are:
- None
- Cross-Build
- email

--
components: Devguide
messages: 163321
nosy: ezio.melotti, petri.lehtinen
priority: normal
severity: normal
status: open
title: devguide doesn't document all bug tracker components

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



[issue15122] Add an option to always rewrite single-file mailboxes in-place.

2012-06-21 Thread Petri Lehtinen

New submission from Petri Lehtinen pe...@digip.org:

This seems like a common feature request. Many people suffer from the fact that 
upon flush, the contents of single-file mailboxes are written into a new file 
which is then renamed over the old file.

For example: #1599254, #5346, #7359, #7360, #9559, 

The original design rationale was probably to prepare for crashes. When changes 
are made like this, a power loss, other sytem crash, or even a bug in the 
mailbox.py code in the middle of writing the mailbox, cannot destroy all the 
data in the mailbox file.

We could add a flag to the constructors of all single-file mailboxes that 
changes this behavior to in-place rewriting. This would of course need 
accompanying documentation that warns about that the same safety guarantees 
don't apply with this flag.

--
messages: 163322
nosy: petri.lehtinen
priority: normal
severity: normal
status: open
title: Add an option to always rewrite single-file mailboxes in-place.
type: enhancement
versions: Python 3.4

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



[issue15122] Add an option to always rewrite single-file mailboxes in-place.

2012-06-21 Thread Petri Lehtinen

Changes by Petri Lehtinen pe...@digip.org:


--
components: +email
nosy: +barry, r.david.murray

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



[issue14225] _cursesmodule compile error in OS X 32-bit-only installer build

2012-06-21 Thread Ned Deily

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

P.S. All is not perfect.  I initially missed re-running test_curses with the 
system ncurses library on OS X where ncurses is at 5.4 or with the 
32-bit-installer which builds ncurses 5.5.  When I did, test_curses failed as 
described in Issue15037.  test_curses passes when Python is built with a 
MacPorts ncurses 5.9.  The best solution would be to update the installer 
builds to build and use the latest ncurses 5.9.  That may have to wait until 
after 3.3.0b1.

--

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



[issue13698] Mailbox module should support other mbox formats in addition to mboxo

2012-06-21 Thread Petri Lehtinen

Changes by Petri Lehtinen pe...@digip.org:


--
nosy: +petri.lehtinen
versions: +Python 3.4 -Python 3.3

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



[issue15122] Add an option to always rewrite single-file mailboxes in-place.

2012-06-21 Thread R. David Murray

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

It would be nice to do some research on what MUAs that support mbox format do 
here.  (eg: mutt, pine if it still exists, etc).

--

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



[issue15123] float().__format__() disregards given field width

2012-06-21 Thread Luís Gomes

Changes by Luís Gomes luismsgo...@gmail.com:


--
nosy: luismsgomes
priority: normal
severity: normal
status: open
title: float().__format__() disregards given field width
versions: Python 3.2

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



[issue15123] float().__format__() disregards given field width

2012-06-21 Thread Luís Gomes

New submission from Luís Gomes luismsgo...@gmail.com:

Python 3.2.3 (default, May  3 2012, 15:51:42) 
[GCC 4.6.3] on linux2
Type help, copyright, credits or license for more information.
 1.2.__format__('2.2')
'1.2'

I expected:
' 1.2'

--

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



[issue15123] float().__format__() disregards given field width

2012-06-21 Thread Luís Gomes

Changes by Luís Gomes luismsgo...@gmail.com:


--
resolution:  - invalid
status: open - closed

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



[issue15122] Add an option to always rewrite single-file mailboxes in-place.

2012-06-21 Thread Petri Lehtinen

Petri Lehtinen pe...@digip.org added the comment:

I actually already researched mutt 1.5.21 (on Ubuntu), and it seems to 
overwrite the file in-place. At least the inode number doesn't change when I 
append and/or delete files from an mbox file and save it.

--

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



[issue15122] Add an option to always rewrite single-file mailboxes in-place.

2012-06-21 Thread Petri Lehtinen

Petri Lehtinen pe...@digip.org added the comment:

Now I also tested rmail (the Emacs email client). It seems to write-and-rename, 
at least the inode number changes. It seems to even use the mboxo format 
nowadays (used to use Babyl).

--

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



[issue15122] Add an option to always rewrite single-file mailboxes in-place.

2012-06-21 Thread Petri Lehtinen

Petri Lehtinen pe...@digip.org added the comment:

Alpine (the successor of pine) also seems to overwrite in-place, just like mutt.

--

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



[issue15061] hmac.secure_compare() leaks information about length of strings

2012-06-21 Thread Antoine Pitrou

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

 Shall explore option 2b) optionally create a C implementation as it's much 
 easier to check C code for timing issues

Definitely. I'm not sure whether that can go in 3.3 post-beta, though.

--

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



[issue15037] test_curses fails with OverflowError

2012-06-21 Thread John Bollinger

John Bollinger john.bollin...@stjude.org added the comment:

The system on which I encountered the test failure uses ncurses 5.7, so that's 
consistent with the theory that the test is tickling an ncurses bug.

I'll have a look at testing with ncurses 5.8, but it is not available from 
RedHat or CentOS (and it never will be for the current and past versions of 
those systems), so that's not a good solution for most users.

On the other hand, it's not clear to me how serious is the bug revealed by the 
test failures, nor whether there is any viable workaround on the Python side.

--

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



[issue15120] Different behavior of html.parser.HTMLParser

2012-06-21 Thread Ezio Melotti

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

What exact version of python have you used?
The example works here with 3.2.3+.

--
assignee: docs@python - ezio.melotti

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



[issue15121] devguide doesn't document all bug tracker components

2012-06-21 Thread Ezio Melotti

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

I wonder why None exists, given that there's already no selection (maybe to 
distinguish issues that have been triaged already from the ones who haven't?).
email refers to issue related to the email package, and I'm not sure what 
exactly classify as cross-build issues.

--

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



[issue15061] hmac.secure_compare() leaks information about length of strings

2012-06-21 Thread Maciej Fijalkowski

Maciej Fijalkowski fij...@gmail.com added the comment:

Hi.

This is what we did with Armin: http://bpaste.net/show/32123/

It seems there is still *some* information leaking via side-channels, although 
it's a bit unclear what. Feel free to play with it (try swapping, having 
different object etc.)

--

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



[issue15037] test_curses fails with OverflowError

2012-06-21 Thread John Bollinger

John Bollinger john.bollin...@stjude.org added the comment:

Clarification: so that's not a good solution for most users ... of 
RedHat-family distros, version 6.2 and earlier.

In fact, it looks like RedHat is sticking with its current version of ncurses 
for RHEL 6.3, too, so no help is coming from that direction any time soon.

--

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



[issue15124] _thread.LockType: Optimize lock deletion, acquisition of uncontested lock and release of lock.

2012-06-21 Thread Kristján Valur Jónsson

New submission from Kristján Valur Jónsson krist...@ccpgames.com:

_thread.LockType contains code for sanity checking when the lock is released, 
and for unlocking it when it is deleted.  Both operations involve actually 
try-lock operations that are costly.  Use a flag on the log to keep track of 
its locking state instead.

Also, acquiring a lock now first tries a try-aqcuire without releasing the  
GIL, same as _thread.RLock().  This is done by moving logic from RLock.acquire 
to acquire_timed() so that both locks benefit.


Improvement, on a 64 bit windows machine:
Before:
D:\pydev\hg\cpython3\PCbuild\amd64.\python.exe -m timeit -s from _thread 
import allocate_lock allocate_lock()
100 loops, best of 3: 0.725 usec per loop
D:\pydev\hg\cpython3\PCbuild\amd64.\python.exe -m timeit -s from _thread 
import allocate_lock; l=allocate_lock() l.acquire();l.release()
100 loops, best of 3: 0.315 usec per loop

After:
D:\pydev\hg\cpython3\PCbuild\amd64.\python.exe -m timeit -s from _thread 
import allocate_lock allocate_lock()
100 loops, best of 3: 0.691 usec per loop
D:\pydev\hg\cpython3\PCbuild\amd64.\python.exe -m timeit -s from _thread 
import allocate_lock; l=allocate_lock() l.acquire();l.release()
100 loops, best of 3: 0.294 usec per loop

This amounts to 5% and 7% improvement, respectively.

--
files: lock.patch
keywords: patch
messages: 163335
nosy: kristjan.jonsson
priority: normal
severity: normal
status: open
title: _thread.LockType: Optimize lock deletion, acquisition of uncontested 
lock and release of lock.
Added file: http://bugs.python.org/file26066/lock.patch

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



[issue15124] _thread.LockType: Optimize lock deletion, acquisition of uncontested lock and release of lock.

2012-06-21 Thread Kristján Valur Jónsson

Changes by Kristján Valur Jónsson krist...@ccpgames.com:


--
components: +Interpreter Core
type:  - performance
versions: +Python 3.3

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



[issue15037] test_curses fails with OverflowError

2012-06-21 Thread John Bollinger

John Bollinger john.bollin...@stjude.org added the comment:

Ok, I confirm that the test passes after the system's ncurses library is 
upgraded to ncurses 5.8, and fails again when ncurses is downgraded back to 
version 5.7.

--

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



[issue15114] Deprecate strict mode of HTMLParser

2012-06-21 Thread Ezio Melotti

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

The attached patch include these changes:
* strict=False default
* strict arg deprecated in the doc
* strict=True deprecated (raises a warning)
* HTMLParseError deprecated in the doc
* some calls to HTMLParser.error converted to asserts [0]

Regarding
* HTMLParser.error deprecated (raises a warning)
I'm not sure anymore that's a good idea.  The method is not documented, so in 
theory it could be removed without deprecation warnings, but that might break 
things if someone is using it.

[0] I made a mistake in my first message: some of the calls should actually be 
converted to assert, the others will stay as long as the strict mode exists 
(i.e. they will be removed in 3.5)

--
keywords: +patch
Added file: http://bugs.python.org/file26067/issue15114.diff

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



[issue4489] shutil.rmtree is vulnerable to a symlink attack

2012-06-21 Thread Hynek Schlawack

Hynek Schlawack h...@ox.cx added the comment:

I'll try to get it in before beta1 then.

--

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



[issue14684] zlib set dictionary support inflateSetDictionary

2012-06-21 Thread Jim Jewett

Jim Jewett jimjjew...@gmail.com added the comment:

Just saw this on the checkins list; where are the other options documented? 


  PyDoc_STRVAR(compressobj__doc__,
-compressobj([level]) -- Return a compressor object.\n
+compressobj([level[, method[, wbits[, memlevel[, strategy[, zdict]])\n
+ -- Return a compressor object.\n
 \n
-Optional arg level is the compression level, in 1-9.);
+Optional arg level is the compression level, in 1-9.\n
+\n
+Optional arg zdict is the predefined compression dictionary - a sequence of\n
+bytes containing subsequences that are likely to occur in the input data.);


I'm honestly not certain what they should be, but the following is my best 
guess:


 PyDoc_STRVAR(compressobj__doc__,
 compressobj([level[, method[, wbits[, memlevel[, strategy[, zdict]])\n
  -- Return a compressor object.\n
 \n
-Optional arg level is the compression level, in 1-9.\n
+Optional arg level (1-9) is the compression level.\n
+Larger numbers take longer, but produce smaller results.\n
 \n
+Optional arg method is the compression method.\n
+The only currently supported method is zlib.DEFLATED.\n
+\n
+Optional arg wbits determines the window buffer size.\n
+Normal values are 8 (least memory) to 15 (best compression).\n
+\n
+Optional arg memlevel (1-9) controls working memory size.\n
+Larger numbers use more memory, but produce smaller results more quickly.\n
+\n
+Optional arg strategy tunes the compression algorithm.\n
+Supported options include zlib.Z_DEFAULT_STRATEGY, zlib.Z_FILTERED, and 
zlib.Z_HUFFMAN_ONLY.\n
+\n
+Optional arg zdict is the predefined compression dictionary - a sequence of\n
+bytes containing subsequences that are likely to occur in the input data.);


--
nosy: +Jim.Jewett

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



[issue15125] argparse: positional arguments containing - in name not handled well

2012-06-21 Thread Nicu Stiurca

New submission from Nicu Stiurca supernic2...@gmail.com:

To reproduce, try the following code:
from argparse import ArgumentParser
a = ArgumentParser()
a.add_argument(foo-bar)
args = a.parse_args([biz])
print args, args.foo_bar

Expected output:
Namespace(foo_bar='biz') biz

Actual output:
Namespace(foo-bar='biz')
Traceback (most recent call last):
  File stdin, line 1, in module
AttributeError: 'Namespace' object has no attribute 'foo_bar'

Other comments:
The positional argument 'foo-bar' becomes impossible to retrieve without 
explicitly passing keyword argument dest='foo_bar'. Hyphens in positional 
arguments should be automatically replaced with underscores just as with other 
arguments.

I have not tested if this problem occurs in Python versions newer than 2.6.

--
messages: 163340
nosy: nstiurca
priority: normal
severity: normal
status: open
title: argparse: positional arguments containing - in name not handled well
type: behavior
versions: Python 2.6

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



[issue14684] zlib set dictionary support inflateSetDictionary

2012-06-21 Thread Nadeem Vawda

Nadeem Vawda nadeem.va...@gmail.com added the comment:

 Just saw this on the checkins list; where are the other options documented? 

They aren't, AFAIK. I've been planning on adding them when I've got time
(based on the zlib manual at http://zlib.net/manual.html), but with the
upcoming feature freeze for 3.3, this issue was higher priority.

--

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



[issue15122] Add an option to always rewrite single-file mailboxes in-place.

2012-06-21 Thread R. David Murray

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

Any chance you'd be willing to look in the source code and see if they do any 
locking mailbox doesn't?  The evidence you've already gathered is probably 
enough to justify adding the option, though.

--

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



[issue15061] hmac.secure_compare() leaks information about length of strings

2012-06-21 Thread Christian Heimes

Christian Heimes li...@cheimes.de added the comment:

I've attached a header for that implements a single C function timingsafe_eq(a, 
b). The file is targeted for Objects/stringlib/timingsafe.h. Please review the 
file.

Comments


- I only handle exact byte or unicode types (no subclasses) since a user may 
have overwritten __eq__ and I don't want to special case it.

- The unicode path works only with compact ASCII strings. I'm not familiar with 
the new API so please scream if I did it wrong.

- length difference is currently optimized, length 0 isn't. I could easily 
un-optimize the len(a) != len(b) case or optimize the len(a) == len(b) == 0 
case.

Open questions
--

Where should I place the function? hashlib would be a nice place but there are 
multiple backends for hashlib. _hashopenssl.c seems wrong.

--
Added file: http://bugs.python.org/file26068/timingsafe.h

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



[issue15126] Theading isAlive() missing version note

2012-06-21 Thread Damian

New submission from Damian atag...@gmail.com:

The threading module's isAlive() method had an is_alive() alias first created 
in python 2.6. The documentation page doesn't mention this...
http://docs.python.org/library/threading.html#threading.Thread.is_alive

However, this is noted for other methods like the Event's is_set()...
http://docs.python.org/library/threading.html#threading.Event.is_set

Very minor issue, just meant that I needed to do a bit of experimentation to 
figure it out.

--
assignee: docs@python
components: Documentation
messages: 163344
nosy: atagar1, docs@python
priority: normal
severity: normal
status: open
title: Theading isAlive() missing version note
versions: Python 2.6

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



[issue15120] Different behavior of html.parser.HTMLParser

2012-06-21 Thread hansokumake

hansokumake hansokum...@seznam.cz added the comment:

I'm sorry. It's my fault. I still use Python 3.2.2.

--
status: open - closed

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



[issue15126] Theading isAlive() missing version note

2012-06-21 Thread Damian

Damian atag...@gmail.com added the comment:

I'm gonna hazard the guess that other methods like currentThread() and 
current_thread() are the same...
http://docs.python.org/library/threading.html#threading.current_thread

--

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



[issue15120] Different behavior of html.parser.HTMLParser

2012-06-21 Thread Ezio Melotti

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


--
resolution:  - invalid
stage:  - committed/rejected

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



[issue15061] hmac.secure_compare() leaks information about length of strings

2012-06-21 Thread Antoine Pitrou

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

 The file is targeted for Objects/stringlib/timingsafe.h.

stringlib is for type-generic functions, so I don't think it should be
put there.

 - I only handle exact byte or unicode types (no subclasses) since a
 user may have overwritten __eq__ and I don't want to special case it.

We could handle all bytes-compatible objects, using the buffer API.

 - The unicode path works only with compact ASCII strings. I'm not
 familiar with the new API so please scream if I did it wrong.

It looks ok to me.

 Where should I place the function? hashlib would be a nice place but
 there are multiple backends for hashlib. _hashopenssl.c seems wrong.

Well, if it's meant to be a private function called from hmac, where
it's defined is an implementation detail. I think practicality beats
purity, so _hashopenssl is a good enough place.

--

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



[issue15124] _thread.LockType: Optimize lock deletion, acquisition of uncontested lock and release of lock.

2012-06-21 Thread Richard Oudkerk

Richard Oudkerk shibt...@gmail.com added the comment:

On 32 bit linux in a VM I get 

BEFORE
  allocation   0.125
  acquire/release  0.434

AFTER
  allocation   0.109  (-13%)
  acquire/release  0.346  (-20%)

--
nosy: +sbt

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



[issue15127] Supressing warnings with -w whether gcc supports ParseTuple

2012-06-21 Thread Samuel John

New submission from Samuel John pyt...@samueljohn.de:

In configrue.in, Python checks if the compiler supports 
__attribute__((format(PyArg_ParseTuple, 2, 3))) and sets the CFLAGS to CFLAGS 
-Werror to decide this test.

When you build Python with CFLAGS=-w (homebrew's default), configure reports 

whether gcc supports ParseTuple ... yes

which is not supported for clang (I was told).

I know it's hard to remove a certain flag from the CFLAGS, but perhaps there 
should be better documentation about this issue.

--
components: Build
messages: 163349
nosy: samueljohn
priority: normal
severity: normal
status: open
title: Supressing warnings with -w  whether gcc supports ParseTuple
type: compile error
versions: Python 3.2

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



[issue13483] Use VirtualAlloc to allocate memory arenas

2012-06-21 Thread Martin v . Löwis

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

Here is a benchmark. Based on my assumption that this patch may reduce 
allocation overheads due to minimizing padding+fragmentation, it allocates a 
lot of memory, and then waits 20s so you can check in the process explorer what 
the Commit Size of the process is.

For the current 3.3 tree, in 32-bit mode, on a 64-bit Windows 7 installation, I 
get 464,756K for the unpatched version, and 450,436K for the patched version.

This is a 3% saving, which seems good enough for me.

--
Added file: http://bugs.python.org/file26069/tuples.py

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



[issue13483] Use VirtualAlloc to allocate memory arenas

2012-06-21 Thread Martin v . Löwis

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

Here is an updated patch.

--
Added file: http://bugs.python.org/file26070/va.diff

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



[issue15008] PEP 362 Signature Objects reference implementation

2012-06-21 Thread Yury Selivanov

Yury Selivanov yseliva...@gmail.com added the comment:

New patch - pep362.7.patch

Summary:

1. Signature  Parameter objects are now immutable

2. Signature.replace() and Parameter.replace()

3. Signature has a new default constructor, which
accepts parameters list and a return_annotation; and
a new 'from_function', which create a Signature object
for the passed function.

4. Parameter.__str__

The implementation has 100% test coverage and is stable.
Please review.

Thanks!

--
Added file: http://bugs.python.org/file26071/pep362.7.patch

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



[issue15119] ctypes mixed-types bitfield layout nonsensical; doesn't match compiler.

2012-06-21 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

There are two separate issues here.  The first is that the layout that ctypes 
chooses for a struct of bitfields fails basic sanity checks, like having each 
bitfield actually fit in the corresponding type.  As a result, the C-level 
bitshifting code used to get bitfields ends up invoking undefined behaviour.

A secondary problem is that the ctypes layout doesn't match what the compiler 
does, at least for the system supplied gcc (4.2) on OS X 10.6.

The attached patch fixes the first issue, but not the second.

--
keywords: +patch
title: Bug in ctypes bitfield layout? - ctypes mixed-types bitfield layout 
nonsensical; doesn't match compiler.
Added file: http://bugs.python.org/file26072/ctypes_mixed_bitfields.patch

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



[issue15119] ctypes mixed-types bitfield layout nonsensical; doesn't match compiler.

2012-06-21 Thread Meador Inge

Meador Inge mead...@gmail.com added the comment:

Thanks for digging into this Mark.  I will have a look too later in the day.

--

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



[issue15128] inspect raises exception when frames are misleading about source line numbers

2012-06-21 Thread Kevin M. Turner

New submission from Kevin M. Turner acapno...@users.sourceforge.net:

The attached example shows how inspect.findsource fails when given a stack 
frame that points to a non-existent source line, and how inspect.getframeinfo 
and getinnerframes do not handle that failure.

On the one hand, yes, this code was asking for it by building such a broken 
frame.  On the other hand, having code that examines tracebacks result in 
tracebacks of its own sucks a whole bunch.

The inspect findget source methods are documented as returning IOError if they 
cannot find the source, and the calling code handles that case, so that's 
probably what should happen here.

(Actually, that seems straightforward enough, I can make a patch for that 
shortly.)

This may help with issue #1628987 as well.

--
components: Library (Lib)
files: inspectLineNumber.py
messages: 163355
nosy: acapnotic
priority: normal
severity: normal
status: open
title: inspect raises exception when frames are misleading about source line 
numbers
versions: Python 2.6, Python 2.7
Added file: http://bugs.python.org/file26073/inspectLineNumber.py

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



[issue14769] Add test to automatically detect missing format units in skipitem()

2012-06-21 Thread Benjamin Peterson

Benjamin Peterson benja...@python.org added the comment:

Okay

--

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



[issue14776] Add SystemTap static markers

2012-06-21 Thread Dave Malcolm

Dave Malcolm dmalc...@redhat.com added the comment:

I'm attaching an updated version of the patch; I hope there's still time before 
Saturday to get it into 3.3

I found a bug in the configure script in the old patch: /usr/bin/dtrace was 
required, even without requesting systemtap.  I've fixed it by adding a new 
SYSTEMTAPDEPS to the configure.a/Makefile.pre.in  A minor subtlety: within 
the configure.ac's --with-systemtap branch it is set up like this:
   SYSTEMTAPDEPS=\$(srcdir)/Python/pysystemtap.h
where the leading backslash is needed so that $(srcdir) doesn't get interpreted 
by the shell when running configure as run the command named 'srcdir'.

I also added removal of $(srcdir)/Python/pysystemtap.h to the clean target

I made a slight change to the static markers themselves: they now pass a 4th 
argument, the PyFrameObject*, since it's possible to make use of this to 
inspect locals etc from systemtap, which might be of use to people.  This 
doesn't introduce any further complexity to the ceval.c code.

I moved the documentation from the devguide back to the cpython source tree, 
rewrote it as a HOWTO (Doc/howto/instrumentation.rst), adding some extra 
material (e.g. about tapsets).   I also added a NEWS item.

Tested on a Fedora 15 box with these configurations:
  * --with-pydebug (implicit --without-systemtap)
  * explicitly --without-systemtap
  * --with-pydebug --with-systemtap
  * --with-pydebug --enable-shared --with-systemtap
  * --enable-shared --with-systemtap
(note that because of issue 14774 I had to rebuild _sysconfigdata.py each time, 
or the tests fail due to being confused about whether we were configured with 
--enable-shared)

How is this looking?

--
Added file: 
http://bugs.python.org/file26074/cpython-systemtap-2012-06-21-001.patch

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



[issue15122] Add an option to always rewrite single-file mailboxes in-place.

2012-06-21 Thread Petri Lehtinen

Petri Lehtinen pe...@digip.org added the comment:

I looked at the source code of mutt to see how it rewrites mbox files. It does 
roughly this:

1. Block some signals.

2. Lock the mbox file (with dotlock, fcntl and flock).

3. Create a temporary file in /tmp.

4. Write messages to the temporary file, from the point where the first change 
is up to the end of the mbox file. This saves a lot of writing when the first 
change is near the end of the file.

5. Write changes from the temporary file to the mbox file, modifying the mbox 
file in-place.

6. Truncate the mbox file to the correct length.

7. Unblock signals.

If writing the changes back to the mbox file fails, the temporary file is 
copied from /tmp to near the mbox file.

--

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



[issue13698] Mailbox module should support other mbox formats in addition to mboxo

2012-06-21 Thread Petri Lehtinen

Petri Lehtinen pe...@digip.org added the comment:

I'm a little concerned about backwards compatibility. Someone might get upset 
if extra 's start appearing in the messages when they read the mailbox 
contents with an application that uses the mboxo format.

A little analysis on the possible corruptions that happen with these formats:

- When the mailbox is both read and written using the mboxo format, lines 
starting with From  are changed to From .

- When the mailbox is both read and written using the mboxrd format, no 
corruption happens.

- If the mailbox is written using the mboxo format and read using the mboxrd 
format, lines that were meant to start with From  are changed to From . So 
we essentially get a sligthly different corruption.

- If the mailbox is written using the mboxrd format and read using the mboxo 
format, lines that were meant to start with From  are changed to From . 
This is a new type of corruption.

--

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



[issue10053] Don’t close fd when FileIO.__init__ fails

2012-06-21 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 981ad5254d07 by Hynek Schlawack in branch '2.7':
#10053: Don't close FDs when FileIO.__init__ fails
http://hg.python.org/cpython/rev/981ad5254d07

New changeset d042bd8625f3 by Hynek Schlawack in branch '3.2':
#10053: Don't close FDs when FileIO.__init__ fails
http://hg.python.org/cpython/rev/d042bd8625f3

New changeset 464cf523485e by Hynek Schlawack in branch 'default':
#10053: Don't close FDs when FileIO.__init__ fails
http://hg.python.org/cpython/rev/464cf523485e

--
nosy: +python-dev

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



[issue15037] curses.unget_wch and test_curses fail when linked with ncurses 5.7 and earlier

2012-06-21 Thread Ned Deily

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

Thanks for the testing.

Georg, haypo: I think a call should be made on what, if anything, to do about 
this prior to 3.3.0-final.  It seems that there are still OS distributions out 
there with older versions of ncurses.  Is documenting this bug sufficient?  If 
so, where?

--
priority: high - deferred blocker
title: test_curses fails with OverflowError - curses.unget_wch and test_curses 
fail when linked with ncurses 5.7 and earlier

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



[issue12567] curses implementation of Unicode is wrong in Python 3

2012-06-21 Thread Ned Deily

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

See also Issue15037 which documents a broken curses.unget_wch and, hence, 
test_curses when Python is built with ncurses 5.7 or earlier.

--

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



[issue15129] file.readline() cannot read weird ascii character in file

2012-06-21 Thread Tony Malykh

New submission from Tony Malykh anton.mal...@gmail.com:

readline() or readlines() method can read the file up to the line where weird 
character ascii code 26 appears. I would like to read the entire file though. A 
simple example attached.

--
components: IO
files: testpy.zip
messages: 163363
nosy: Tony.Malykh
priority: normal
severity: normal
status: open
title: file.readline() cannot read weird ascii character in file
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file26075/testpy.zip

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



[issue15130] remove redundant paragraph in socket howto

2012-06-21 Thread Tshepang Lekhonkhobe

New submission from Tshepang Lekhonkhobe tshep...@gmail.com:

same text used on Abstract is used in the beginning of the main text

--
assignee: docs@python
components: Documentation
files: redundancy.diff
keywords: patch
messages: 163364
nosy: docs@python, tshepang
priority: normal
severity: normal
status: open
title: remove redundant paragraph in socket howto
versions: Python 2.7, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file26076/redundancy.diff

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



[issue15061] hmac.secure_compare() leaks information about length of strings

2012-06-21 Thread Serhiy Storchaka

Serhiy Storchaka storch...@gmail.com added the comment:

  - I only handle exact byte or unicode types (no subclasses) since a
  user may have overwritten __eq__ and I don't want to special case it.
 We could handle all bytes-compatible objects, using the buffer API.

It is timing unsafe.

  - The unicode path works only with compact ASCII strings. I'm not
  familiar with the new API so please scream if I did it wrong.
 It looks ok to me.

The user can just do timingsafe_eq(a.decode('ascii'),
b.decode('ascii')). I do not see a necessity in support of unicode
strings. Support ASCII strings will create the false impression that all
strings are supported.

About code. Instead (PyBytes_CheckExact(a)  PyBytes_CheckExact(b)) you
should use ((PyBytes_CheckExact(a) != 0)  (PyBytes_CheckExact(b) !=
0)).

--

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



[issue15061] hmac.secure_compare() leaks information about length of strings

2012-06-21 Thread Martin v . Löwis

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

 The user can just do timingsafe_eq(a.decode('ascii'),
 b.decode('ascii')). 

You mean .encode()?

 I do not see a necessity in support of unicode
 strings. Support ASCII strings will create the false impression that all
 strings are supported.

I agree.

 About code. Instead (PyBytes_CheckExact(a)  PyBytes_CheckExact(b)) you
 should use ((PyBytes_CheckExact(a) != 0)  (PyBytes_CheckExact(b) !=
 0)).

What's the difference? They are the same.

--

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



[issue10053] Don’t close fd when FileIO.__init__ fails

2012-06-21 Thread Hynek Schlawack

Hynek Schlawack h...@ox.cx added the comment:

Should be fixed now.

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

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



[issue15061] hmac.secure_compare() leaks information about length of strings

2012-06-21 Thread Serhiy Storchaka

Serhiy Storchaka storch...@gmail.com added the comment:

 You mean .encode()?

Yes, of cause. timingsafe_eq(a.encode('ascii'), b.encode('ascii')).

  About code. Instead (PyBytes_CheckExact(a)  PyBytes_CheckExact(b)) you
  should use ((PyBytes_CheckExact(a) != 0)  (PyBytes_CheckExact(b) !=
  0)).
 
 What's the difference? They are the same.

Laziness. If a (a secret key) is not bytes then PyBytes_CheckExact(b)
(b is a user input) is not called. It exposes secret key type. I'm not
sure if it is real secret however.

--

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



[issue3982] support .format for bytes

2012-06-21 Thread Uoti Urpala

Uoti Urpala uoti.urp...@pp1.inet.fi added the comment:

I've hit this limitation a couple more times, and none of the proposed 
workarounds are adequate. Working with protocols and file formats that use 
human-readable markup is significantly clumsier than it was with Python 2 
(using either the % operator, which also lost its support for byte strings in 
Python 3, or .format()).

This bug report was closed by its original creator, after early posts where IMO 
nobody made as good a case for the feature as they could have. Is it possible 
to reopen this bug or is it necessary to file a new one?

Is there any clear argument AGAINST having .format() for bytes, other than work 
needed to implement it? Some posts mention mixing characters and bytes, but I 
see no reason why this would be much of a real practical concern if it's a 
method on bytes objects producing bytes output.

--

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



[issue15128] inspect raises exception when frames are misleading about source line numbers

2012-06-21 Thread Kevin M. Turner

Kevin M. Turner acapno...@users.sourceforge.net added the comment:

patch attached (against python 2.7 tip)

--
keywords: +patch
Added file: http://bugs.python.org/file26077/15128-inspect-source-linenum.diff

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



[issue15061] hmac.secure_compare() leaks information about length of strings

2012-06-21 Thread Antoine Pitrou

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

   - I only handle exact byte or unicode types (no subclasses) since a
   user may have overwritten __eq__ and I don't want to special case it.
  We could handle all bytes-compatible objects, using the buffer API.
 
 It is timing unsafe.

How so?

   - The unicode path works only with compact ASCII strings. I'm not
   familiar with the new API so please scream if I did it wrong.
  It looks ok to me.
 
 The user can just do timingsafe_eq(a.decode('ascii'),
 b.decode('ascii')).

I don't think that's the right answer, because people will instead e.g.
encode('utf-8'), and suddently the encodingly will not be timing-safe.

--

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



[issue15126] Theading isAlive() missing version note

2012-06-21 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

Since the news aliases are all over the module, the version change notice is at 
the top of the page:


Note

Starting with Python 2.6, this module provides PEP 8 compliant aliases and 
properties to replace the camelCase names that were inspired by Java’s 
threading API. This updated API is compatible with that of the multiprocessing 
module. However, no schedule has been set for the deprecation of the camelCase 
names and they remain fully supported in both Python 2.x and 3.x.


--
nosy: +georg.brandl
resolution:  - works for me
status: open - closed

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



[issue15129] file.readline() cannot read weird ascii character in file

2012-06-21 Thread Amaury Forgeot d'Arc

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

Your problem is similar to this discussion:
http://stackoverflow.com/questions/405058/line-reading-chokes-on-0x1a
On Python2, files are based on the fopen() C function, and on Windows files 
opened in text mode stop reading on the first character 26 (^Z, or EOF)

The best solution here is probably to open the file in universal mode:
f = open(test.txt, rU)
...Or use Python3, which has a completely new implementation of the open() 
function.

--
nosy: +amaury.forgeotdarc
resolution:  - wont fix
status: open - closed

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



[issue15131] Document py/pyw launchers

2012-06-21 Thread Brian Curtin

New submission from Brian Curtin br...@python.org:

As of http://hg.python.org/cpython/rev/a7ecbb2ad967, the PEP 397 launchers are 
included. Their functionality should be documented.

--
assignee: docs@python
components: Documentation, Windows
messages: 163374
nosy: brian.curtin, docs@python
priority: critical
severity: normal
stage: needs patch
status: open
title: Document py/pyw launchers
type: enhancement
versions: Python 3.3

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



[issue15131] Document py/pyw launchers

2012-06-21 Thread Brian Curtin

Changes by Brian Curtin br...@python.org:


--
assignee: docs@python - brian.curtin

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



[issue10053] Don’t close fd when FileIO.__init__ fails

2012-06-21 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

Shouldn’t the fix be ported to _pyio?

--
nosy: +eric.araujo

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



[issue444582] Finding programs in PATH, adding shutil.which

2012-06-21 Thread Brian Curtin

Brian Curtin br...@python.org added the comment:

Here's a patch that also works on linux. A pathext specific test is now skipped 
since that only matters on Windows, and I forgot a chmod that was making two 
tests fail on linux.

--
Added file: http://bugs.python.org/file26078/issue444582_v3.diff

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



[issue15061] hmac.secure_compare() leaks information about length of strings

2012-06-21 Thread Christian Heimes

Christian Heimes li...@cheimes.de added the comment:

I'm a bit rusty and I hope I got it right. The ASCII unicode case is a good 
idea and IMO timing safe. The buffer path is also timing safe once I have both 
views. 

The function leaks some timing information when an error occurs. Since the 
timing just reveals minimal information about the involved types and none about 
the bytes it's IMO safe. The acquiring of the buffer views may leak an unknown 
amount of timing data which may be an issue. The comparison is still safe.

I've introduced a new module _hashlibfb (fb = fallback) for systems without 
openssl. I'm also open for a completely new module for future implementation of 
other digest, key derivation (PBKDF2) and password related C code.

--
Added file: http://bugs.python.org/file26079/timingsafe_cmp.patch

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



[issue15061] hmac.secure_compare() leaks information about length of strings

2012-06-21 Thread Christian Heimes

Christian Heimes li...@cheimes.de added the comment:

The patch has another flaw. The compiler may choose to fold and optimize code 
in _tscmp(). I'm going to declare the length of the right side and both char* 
as volatile. That should stop any compiler.

I could also add some pragmas:

MSVC:
#pragma optimize(, off)
code
#pragma optimize(, on)

GCC 4.4+:
#pragma GCC push_options
#pragma GCC optimize (O0)
code
#pragma GCC pop_options

--

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



[issue3982] support .format for bytes

2012-06-21 Thread Terry J. Reedy

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

If you want to discuss this issue further, I think you post to python-ideas 
list with concrete examples.

--

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



[issue14684] zlib set dictionary support inflateSetDictionary

2012-06-21 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 1cfa44cb5af0 by Nadeem Vawda in branch 'default':
Document the rest of zlib.compressobj()'s arguments.
http://hg.python.org/cpython/rev/1cfa44cb5af0

--

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



[issue14653] Improve mktime_tz to use calendar.timegm instead of time.mktime

2012-06-21 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset ffc048f43a70 by Alexander Belopolsky in branch '3.2':
Issue #14653: email.utils.mktime_tz() no longer relies on system
http://hg.python.org/cpython/rev/ffc048f43a70

New changeset 9f88c38318ac by Alexander Belopolsky in branch 'default':
Issue #14653: email.utils.mktime_tz() no longer relies on system
http://hg.python.org/cpython/rev/9f88c38318ac

--
nosy: +python-dev

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



[issue14653] Improve mktime_tz to use calendar.timegm instead of time.mktime

2012-06-21 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset a283563c8cc4 by Alexander Belopolsky in branch '2.7':
Issue #14653: email.utils.mktime_tz() no longer relies on system
http://hg.python.org/cpython/rev/a283563c8cc4

--

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



[issue14653] Improve mktime_tz to use calendar.timegm instead of time.mktime

2012-06-21 Thread Alexander Belopolsky

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


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

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



[issue7584] datetime.rfcformat() for Date and Time on the Internet

2012-06-21 Thread Alexander Belopolsky

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


--
status: pending - closed

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



[issue15125] argparse: positional arguments containing - in name not handled well

2012-06-21 Thread R. David Murray

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

It does.

--
keywords: +easy
nosy: +bethard, r.david.murray
stage:  - needs patch
versions: +Python 2.7, Python 3.2, Python 3.3 -Python 2.6

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



[issue10053] Don’t close fd when FileIO.__init__ fails

2012-06-21 Thread Hynek Schlawack

Hynek Schlawack h...@ox.cx added the comment:

Hmmm, I thought Lib/_pyio.py actually uses Lib/_io/_fileio.c? At least I can't 
find the logic inside. There's no error handling at all.

It just uses the FileIO object in Lib/_pyio.py:189 which it seems to get from 
Lib/_pyio.py:585 which I presumed was from Lib/_io/_fileio.c.

What am I missing and how would I be supposed to port that?

--

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