[issue12589] test_long.test_nan_inf() failed on OpenBSD (powerpc)

2011-07-21 Thread Landry Breuil

Landry Breuil  added the comment:

Python 3.2.1 (default, Jul 18 2011, 10:56:33) 
[GCC 4.2.1 20070719 ] on openbsd4
Type "help", "copyright", "credits" or "license" for more information.
>>> import ctypes
>>> import ctypes.util
>>> libc = ctypes.cdll.LoadLibrary(ctypes.util.find_library('c'))
>>> isinf = libc.isinf
>>> isinf.argtypes = (ctypes.c_double,)
>>> isinf(0.0)
0
>>> isinf(float('inf'))
1

--

___
Python tracker 

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



[issue12556] Disable size checks in mmap.mmap()

2011-07-21 Thread Sergei Lebedev

Sergei Lebedev  added the comment:

> Passing mmap(2) a 0 length doesn't make much sense anyway - for
example, Linux returns EINVAL.
Yup, but passing mmap(2) a zero-sized file and a non-zero length works just 
fine.

> Why do you want a mmap? Why not using a file?
Because Xen requires me to mmap it. Anyway, you're right, the use-case is too 
uncommon.

--
resolution:  -> rejected
status: open -> closed

___
Python tracker 

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



[issue12556] Disable size checks in mmap.mmap()

2011-07-21 Thread Ross Lagerwall

Ross Lagerwall  added the comment:

> That's what I thought, it's really uncommon: in that case, I'm
> reluctant to making such a change, for the reason explained above.
> Ross, Victor?

Even if Linux did accept a a length of 0 (which it doesn't since 2.6.12), what 
would be the point? Wouldn't you be mapping *nothing*?

Yeah, I'm against this change.

--

___
Python tracker 

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



[issue12581] Increased test coverage of test_urlparse

2011-07-21 Thread Petter Haggholm

Petter Haggholm  added the comment:

Added suggested changes from review, removed (rather useless) repr test; left 
parse.py changes alone (see review comments for rationale)

--
Added file: http://bugs.python.org/file22715/urlparsetest.patch

___
Python tracker 

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



[issue12266] str.capitalize contradicts oneself

2011-07-21 Thread Ezio Melotti

Ezio Melotti  added the comment:

L = set(sum([Ll, Lu, Lt, Lo, Lm], []))

--

___
Python tracker 

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



[issue12266] str.capitalize contradicts oneself

2011-07-21 Thread py.user

py.user  added the comment:

>>> [c for c in all_chars if c not in L and ...

L ?

--

___
Python tracker 

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



[issue12266] str.capitalize contradicts oneself

2011-07-21 Thread Ezio Melotti

Ezio Melotti  added the comment:

>>> import sys; hex(sys.maxunicode)
'0x10'
>>> import unicodedata; unicodedata.unidata_version
'6.0.0'

import unicodedata
all_chars = list(map(chr, range(0x11)))
Ll = [c for c in all_chars if unicodedata.category(c) == 'Ll']
Lu = [c for c in all_chars if unicodedata.category(c) == 'Lu']
Lt = [c for c in all_chars if unicodedata.category(c) == 'Lt']
Lo = [c for c in all_chars if unicodedata.category(c) == 'Lo']
Lm = [c for c in all_chars if unicodedata.category(c) == 'Lm']

>>> [len(x) for x in [Ll, Lu, Lt, Lo, Lm]]
[1759, 1436, 31, 97084, 210]
>>> sum(1 for c in Lu if c.lower() == c)
471  # uppercase chars with no lower
>>> sum(1 for c in Lt if c.lower() == c)
0# titlecase chars with no lower
>>> sum(1 for c in Ll if c.upper() == c)
760  # lowercase chars with no upper
>>> sum(1 for c in Lo if c.upper() != c or c.title() != c or c.lower() != c)
0# "Letter, other" chars with a different upper/title/lower case
>>> sum(1 for c in Lm if c.upper() != c or c.title() != c or c.lower() != c)
0# "Letter, modifier" chars with a different upper/title/lower case
>>> sum(1 for c in all_chars if c not in L and (c.upper() != c or c.title() != 
>>> c or c.lower() != c))
85   # non-letter chars with a different upper/title/lower case
>>> [c for c in all_chars if c not in L and (c.upper() != c or c.title() != c 
>>> or c.lower() != c)]
['', 'Ⅰ', 'Ⅱ', 'Ⅲ', 'Ⅳ', 'Ⅴ', 'Ⅵ', 'Ⅶ', 'Ⅷ', 'Ⅸ', 'Ⅹ', 'Ⅺ', 'Ⅻ', 'Ⅼ', 'Ⅽ', 'Ⅾ', 
'Ⅿ', 'ⅰ', 'ⅱ', 'ⅲ', 'ⅳ', 'ⅴ', 'ⅵ', 'ⅶ', 'ⅷ', 'ⅸ', 'ⅹ', 'ⅺ', 'ⅻ', 'ⅼ', 'ⅽ', 'ⅾ', 
'ⅿ', 'Ⓐ', 'Ⓑ', 'Ⓒ', 'Ⓓ', 'Ⓔ', 'Ⓕ', 'Ⓖ', 'Ⓗ', 'Ⓘ', 'Ⓙ', 'Ⓚ', 'Ⓛ', 'Ⓜ', 'Ⓝ', 'Ⓞ', 
'Ⓟ', 'Ⓠ', 'Ⓡ', 'Ⓢ', 'Ⓣ', 'Ⓤ', 'Ⓥ', 'Ⓦ', 'Ⓧ', 'Ⓨ', 'Ⓩ', 'ⓐ', 'ⓑ', 'ⓒ', 'ⓓ', 'ⓔ', 
'ⓕ', 'ⓖ', 'ⓗ', 'ⓘ', 'ⓙ', 'ⓚ', 'ⓛ', 'ⓜ', 'ⓝ', 'ⓞ', 'ⓟ', 'ⓠ', 'ⓡ', 'ⓢ', 'ⓣ', 'ⓤ', 
'ⓥ', 'ⓦ', 'ⓧ', 'ⓨ', 'ⓩ']
>>> list(c.lower() for c in _)
['', 'ⅰ', 'ⅱ', 'ⅲ', 'ⅳ', 'ⅴ', 'ⅵ', 'ⅶ', 'ⅷ', 'ⅸ', 'ⅹ', 'ⅺ', 'ⅻ', 'ⅼ', 'ⅽ', 'ⅾ', 
'ⅿ', 'ⅰ', 'ⅱ', 'ⅲ', 'ⅳ', 'ⅴ', 'ⅵ', 'ⅶ', 'ⅷ', 'ⅸ', 'ⅹ', 'ⅺ', 'ⅻ', 'ⅼ', 'ⅽ', 'ⅾ', 
'ⅿ', 'ⓐ', 'ⓑ', 'ⓒ', 'ⓓ', 'ⓔ', 'ⓕ', 'ⓖ', 'ⓗ', 'ⓘ', 'ⓙ', 'ⓚ', 'ⓛ', 'ⓜ', 'ⓝ', 'ⓞ', 
'ⓟ', 'ⓠ', 'ⓡ', 'ⓢ', 'ⓣ', 'ⓤ', 'ⓥ', 'ⓦ', 'ⓧ', 'ⓨ', 'ⓩ', 'ⓐ', 'ⓑ', 'ⓒ', 'ⓓ', 'ⓔ', 
'ⓕ', 'ⓖ', 'ⓗ', 'ⓘ', 'ⓙ', 'ⓚ', 'ⓛ', 'ⓜ', 'ⓝ', 'ⓞ', 'ⓟ', 'ⓠ', 'ⓡ', 'ⓢ', 'ⓣ', 'ⓤ', 
'ⓥ', 'ⓦ', 'ⓧ', 'ⓨ', 'ⓩ']
>>> len(_)
85
>>> {unicodedata.category(c) for c in all_chars if c not in L and (c.upper() != 
>>> c or c.title() != c or c.lower() != c)}
{'So', 'Mn', 'Nl'}

So == Symbol, Other
Mn == Mark, Nonspacing
Nl == Number, Letter

--

___
Python tracker 

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



[issue12591] text files returned by subprocess.Popen with universal_newlines=True are not iterable

2011-07-21 Thread R. David Murray

R. David Murray  added the comment:

So this is a doc bug in subprocess?  Explaining this clearly doesn't sound like 
much fun...

--

___
Python tracker 

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



[issue12204] str.upper converts to title

2011-07-21 Thread Ezio Melotti

Ezio Melotti  added the comment:

I think it's an invention, but its meaning is quite clear to me.

--

___
Python tracker 

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



[issue11055] OS X IDLE 3.2 Save As menu accelerator opens two Save windows

2011-07-21 Thread Ned Deily

Ned Deily  added the comment:

A fix for this problem has been released in ActiveTcl 8.5.10.1 as of 2011-07-21.

--
resolution:  -> out of date
stage: needs patch -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue12204] str.upper converts to title

2011-07-21 Thread Éric Araujo

Éric Araujo  added the comment:

Patch looks good, with one issue: I’ve never encountered “cased character” 
before, is it an accepted term or an invention in our docs?

--

___
Python tracker 

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



[issue12302] packaging test command needs access to .dist-info

2011-07-21 Thread Éric Araujo

Éric Araujo  added the comment:

For #8668 (develop command), higery has written code that reuses 
install_distinfo to create the dist-info dir in the build dir.  It requires 
#12344, which I will commit when Thomas has time to finish his patch.  We also 
need to make install_distinfo more flexible: For example, on #12279 we 
discussed about the RECORD file, which should be empty when created by the test 
command (nothing is installed), and we mentioned RESOURCES, which should 
probably be created, with relative paths.  (The resources API is intended to 
work with zero config in a source checkout or unpacked tarball, even though it 
currently doesn’t, but given that test runs in the build dir, we’re not in the 
source dir anymore, so RESOURCES should probably be written.)

--
dependencies: +Add **kwargs to get_reinitialized_command
nosy: +higery

___
Python tracker 

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



[issue11435] Links to source code should now point to hg repo

2011-07-21 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy:  -pitrou

___
Python tracker 

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



[issue12279] Add build_distinfo command to packaging

2011-07-21 Thread Éric Araujo

Éric Araujo  added the comment:

I kept this report open to address “test command needs dist-info”, but there’s 
already a report about that (#12302) and I think it’s clearer to keep this one 
closed as a discussion archive linked from the develop bug.

--
resolution: later -> rejected
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue11435] Links to source code should now point to hg repo

2011-07-21 Thread Éric Araujo

Éric Araujo  added the comment:

Georg or Benjamin: The PEP/documents/scripts used for releases should also 
mention/edit the version in Doc/tools/sphinxext/pyspecific.py.

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue12591] text files returned by subprocess.Popen with universal_newlines=True are not iterable

2011-07-21 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

The "universal_newlines" feature is rather poorly named in Python 3.x, since it 
does much more than that (the resulting files yield and expect unicode strings 
rather than bytes objects).

The problem is that io.TextIOWrapper needs a buffered I/O object, but bufsize 
is 0 by default in subprocess.Popen(). In the meantime, you can workaround it 
using a non-zero bufsize in the Popen() constructor. Of course, this has the 
side-effect of forcing you to call flush() on the stdin stream (if you are 
using it).

--

___
Python tracker 

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



[issue8668] Packaging: add a 'develop' command

2011-07-21 Thread Éric Araujo

Éric Araujo  added the comment:

Great.  I’ve been re-reading some old threads in the spirit of “pth files are 
evil”, so I wondered whether we could/should avoid them, but I think the 
criticism was directed against pth files edited after the initial installation, 
and pth files abusing the format (import causes exec), IOW setuptools’ pth 
files; our current ideas avoid these two problems.

--

___
Python tracker 

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



[issue12394] packaging: generate scripts from callable (dotted paths)

2011-07-21 Thread Éric Araujo

Éric Araujo  added the comment:

Failure on POSIX (linux2):

ERROR: test_install_wrapper_scripts 
(packaging.tests.test_command_build_scripts.BuildScriptsTestCase)
--
Traceback (most recent call last):
  File "Lib/packaging/tests/test_command_build_scripts.py", line 64, in 
test_install_wrapper_scripts
cmd.run()
  File "Lib/packaging/command/build_scripts.py", line 64, in run
self._check_entries()
  File "Lib/packaging/command/build_scripts.py", line 81, in _check_entries
raise PackagingOptionError("your specific entry '%s' does not exist!" % 
entry)
packaging.errors.PackagingOptionError: your specific entry 
'script1=foo.bar.main1.main' does not exist!

If you can’t easily test on POSIX, I’ll investigate later.

--

___
Python tracker 

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



[issue12606] Mutable Sequence Type works different for lists and bytearrays in slice[i:j:k]

2011-07-21 Thread py.user

py.user  added the comment:

the former could be like:
del cmpr[0][::-2], cmpr[1][::2], cmpr[2][1::2]

it's ok

how to implement this with del ?
>>> cmpr
[bytearray(b'abcd'), bytearray(b'efgh'), bytearray(b'ijkl')]
>>> cmpr[0][::-2], cmpr[1][::2] = (), cmpr[2][1::2]
>>> cmpr
[bytearray(b'ac'), bytearray(b'jflh'), bytearray(b'ijkl')]
>>>

--

___
Python tracker 

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



[issue12606] Mutable Sequence Type works different for lists and bytearrays in slice[i:j:k]

2011-07-21 Thread py.user

py.user  added the comment:

> I happen to prefer del myself
> but I agree that the two mutable sequence classes should behave the same.

del is not so flexible as assignement

>>> cmpr = [bytearray(i.encode('ascii')) for i in ('abcd', 'efgh', 'ijkl')]
>>> cmpr
[bytearray(b'abcd'), bytearray(b'efgh'), bytearray(b'ijkl')]
>>> cmpr[0][::-2] = cmpr[1][::2] = cmpr[2][1::2] = ()
>>> cmpr
[bytearray(b'ac'), bytearray(b'fh'), bytearray(b'ik')]
>>>

--

___
Python tracker 

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



[issue12591] text files returned by subprocess.Popen with universal_newlines=True are not iterable

2011-07-21 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +eric.araujo

___
Python tracker 

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



[issue7897] Support parametrized tests in unittest

2011-07-21 Thread Andrew Bennetts

Andrew Bennetts  added the comment:

You may be interested an existing, unittest-compatible library that provides 
this: http://pypi.python.org/pypi/testscenarios

--
nosy: +spiv

___
Python tracker 

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



[issue7897] Support parametrized tests in unittest

2011-07-21 Thread Éric Araujo

Éric Araujo  added the comment:

> Well, pyflakes will tell you about name clashes within a TestCase
Seen that :)

> (unless you're shadowing a test on a base class which I guess is
> rarely the case)...
That too, in our own test suite (test_list or test_tuple, I have that change in 
a Subversion or old hg clone somewhere).  I agree about “rarely”, however.

--

___
Python tracker 

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



[issue12528] Implement configurable bitfield allocation strategy

2011-07-21 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

My review of the patch: http://bugs.python.org/review/12528/show

--
nosy: +amaury.forgeotdarc
stage:  -> patch review

___
Python tracker 

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



[issue12394] packaging: generate scripts from callable (dotted paths)

2011-07-21 Thread Éric Araujo

Éric Araujo  added the comment:

Great to hear these news!  I will pull from your clone and test on linux2 as 
soon as possible.

In your Mercurial configuration file, you should set the git option so that 
diffs can display editions to binary files.  See 
http://hgtip.com/tips/beginner/2009-10-22-always-use-git-diffs/

> Usage: Just add a 'wrapper-scripts-entries' variable in setup.cfg,
The new scripts feature should reuse the already existing scripts field, in the 
files section.

> which takes a list type as its value. For instance,
> wrapper-scripts-entries = ['hello=demo.foo.bar:main']
Config files don’t have lists, but they have multi-line values.  See the 
packaging/setupcfg doc for more info; here’s an example:

  scripts =
  hello = demo.foo.bar.main

(we use dotted paths throughout packaging, not paths with dots and colons, BTW)

> Current patch can generte executable script with no extension on
> POSIX, and .exe file on Windows but have not yet added gui support.
Looks like a great start!  As I said in private email, have a look at the 
distribute fork of setuptools to see if they have tests for these features.

> In the 'test_command_build_scripts.py', how to test the generated
> .exe wrapper to see if it can run and generate correct output or not?
> The only way I can remember is to use os.system(), but if we use
> os.system() to execute the .exe file, then it will not get the what
> we want, because it will run in another thread, thus can not get the
> right sys.path which I have set in my test function.
os.system runs a process, not a thread.  You should use the subprocess module, 
it’s better than os.system.  To pass a custom sys.path, set up a PYTHONPATH 
environment variable in the env argument of subprocess.Popen.  test_sys and 
test_site have examples of how to use subprocess.

(Before someone suggests using the helpers in test.support, know that I prefer 
to use only subprocess, to ease the future backport.)

--

___
Python tracker 

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



[issue11435] Links to source code should now point to hg repo

2011-07-21 Thread Éric Araujo

Éric Araujo  added the comment:

Thanks for the commit, I intended to do it these days.

For 2.7, I was indeed talking about updated all manual links.  sed is my friend 
:)

--
status: closed -> open

___
Python tracker 

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



[issue11975] Fix referencing of built-in types (list, int, ...)

2011-07-21 Thread Éric Araujo

Éric Araujo  added the comment:

Georg, could index directives be used to create link targets?  (see 
http://bugs.python.org/issue11975#msg137447)

--

___
Python tracker 

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



[issue7897] Support parametrized tests in unittest

2011-07-21 Thread Nick Coghlan

Nick Coghlan  added the comment:

In my example, I needed a word to cover each entry in the collection of 
parameter tuples. 'case' fit the bill.

The reason I like the builder approach is that it means the simplest usage is 
to just create a list (or other iterable) of parameter tuples to be tested, 
then pass that list to the decorator factory. The sequential naming will then 
let you find the failing test cases in the sequence.

Custom builders then cover any cases where better naming is possible and 
desirable (such as explicitly naming each case as part of the parameters).

One refinement that may be useful is for the builders to produce (name, 
description, parameters) 3-tuple rather than 2-tuples, though. Then the default 
builder could just insert repr(params) as the description, while David's custom 
builder could either leave the description blank, or include a relevant subset 
of the parameters.

--

___
Python tracker 

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



[issue7897] Support parametrized tests in unittest

2011-07-21 Thread Nick Coghlan

Nick Coghlan  added the comment:

Sorry, misclicked and removed this comment from David:

Oh, I see.  Make the name the first element of the argtuple and then strip it 
off.  Well, that will work, it just seems bass-ackwards to me :)

And why is it 'case'?  I thought we were talking about tests.

--

___
Python tracker 

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



[issue7897] Support parametrized tests in unittest

2011-07-21 Thread Nick Coghlan

Changes by Nick Coghlan :


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

___
Python tracker 

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



[issue12589] test_long.test_nan_inf() failed on OpenBSD (powerpc)

2011-07-21 Thread STINNER Victor

STINNER Victor  added the comment:

You may try:

$ ./python
>>> import ctypes
>>> import ctypes.util
>>> libc = ctypes.cdll.LoadLibrary(ctypes.util.find_library('c'))
>>> isinf = libc.isinf
>>> isinf.argtypes = (ctypes.c_double,)
>>> isinf(0.0)
0
>>> isinf(float('inf'))
1

(try ctypes.util.find_library('m') if isinf is not in libc)

--

___
Python tracker 

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



[issue12606] Mutable Sequence Type works different for lists and bytearrays in slice[i:j:k]

2011-07-21 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

I happen to prefer del myself, but I agree that the two mutable sequence 
classes should behave the same. The manual 4.6.4 says

s[i:j:k] = t the elements of s[i:j:k] are replaced by those of t (1) 
1. t must have the same length as the slice it is replacing.

So the list behavior is not a bug. Extending its behavior is a feature request 
that could only happen in the 'next' release, now 3.3.

It is not usually considered a bug for something to do something beyond what is 
promised; in any case, you are *not* requesting that bytearrays be restricted 
as lists are. But that could be the fix to remove the 'bug' of inconsistency.  
That also could not happen until a next release.

Since deletion of contiguous slices works and since deletion of extended slices 
can work and since I found the restriction slightly surprising, I am in favor 
of extending list behavior unless there is some internal reason why it cannot 
be.

The rationale for the restriction is that replacing a contiguous slice with a 
different number of items makes sense but replacing non-contiguous items with a 
different number does not -- except in the special case where the number is 0. 
So what you are really asking is that the footnote be changed to

1. t must have the same length as the slice it is replacing or be empty

That is the current behavior of bytearrays.

--
nosy: +terry.reedy
stage:  -> test needed
type: behavior -> feature request
versions: +Python 3.3 -Python 3.1

___
Python tracker 

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



[issue12556] Disable size checks in mmap.mmap()

2011-07-21 Thread Ralf Schmitt

Changes by Ralf Schmitt :


--
nosy: +schmir

___
Python tracker 

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



[issue12556] Disable size checks in mmap.mmap()

2011-07-21 Thread STINNER Victor

STINNER Victor  added the comment:

> That's what I thought, it's really uncommon: in that case, I'm
> reluctant to making such a change, for the reason explained above.
> Ross, Victor?

Why do you want a mmap? Why not using a file?

--

___
Python tracker 

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



[issue6068] ctypes is not correctly handling bitfields backed by 64 bit integers on Windows

2011-07-21 Thread Vlad Riscutia

Vlad Riscutia  added the comment:

Ping? This also fixes 6493 (I believe in a cleaner way)

--

___
Python tracker 

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



[issue12555] PEP 3151 implementation

2011-07-21 Thread Antoine Pitrou

Changes by Antoine Pitrou :


Removed file: http://bugs.python.org/file22705/40ae82fafaed.diff

___
Python tracker 

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



[issue12555] PEP 3151 implementation

2011-07-21 Thread Antoine Pitrou

Changes by Antoine Pitrou :


Added file: http://bugs.python.org/file22714/1d8b7f158721.diff

___
Python tracker 

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



[issue12606] Mutable Sequence Type works different for lists and bytearrays in slice[i:j:k]

2011-07-21 Thread py.user

New submission from py.user :

>>> barr = bytearray(b'abcde')
>>> lst = list('abcde')
>>> barr[::-3] = ()
>>> barr
bytearray(b'acd')
>>> lst[::-3] = ()
Traceback (most recent call last):
  File "", line 1, in 
ValueError: attempt to assign sequence of size 0 to extended slice of size 2
>>> del lst[::-3]
>>> lst
['a', 'c', 'd']
>>>

lst[::-3] = () - is more convenient way for deletion

--
components: Interpreter Core
messages: 140832
nosy: py.user
priority: normal
severity: normal
status: open
title: Mutable Sequence Type works different for lists and bytearrays in 
slice[i:j:k]
type: behavior
versions: Python 3.1

___
Python tracker 

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



[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-07-21 Thread Charles-François Natali

Charles-François Natali  added the comment:

> Still -1. It should be renamed to 'linux' in future releases, and
> back-patched to 'linux2' for maintenance releases.
>

I really don't see any advantage to this solution:
- sys.platform currently has a clear and documented value (OS name +
major release), this change would break that
- sys.platform is actually really simple, it returns MACHDEP: this
change would require complicating the code
- code testing sys.platform for equality is already broken: there's
the exact same problem with FreeBSD, OpenBSD and any other operating
system I can think of: 99% of the time, people checking sys.platform
really mean sys.platform.startswith(), os.uname()[0] or
platform.system(), i.e. the OS name, and don't care about the release
- this change would introduce an inconsistency between Python
releases, which would make the problem worse
- this information is already provided by os.uname() and platform.system()
- finally, this would not solve the problem at hand

> As for releases that are already out - users should be informed to
> not use those on Linux 3 (or not use Linux 3 on systems where they
> have the old Python releases).
>

Advise users to not use Python on Linux 3 - which doesn't break break
backward compatibility in any way - sounds like a really bad idea, and
would give Python a bad press for no reason.
I mean, it's just a version number, and a really minor bug:
Chromium and matplotlib already fixed this in their code using
sys.platform.startswith('linux') [1] [2].
It's that simple, I don't see what there's so much to talk about here.

[1] http://codereview.chromium.org/7172016
[2] 
https://github.com/matplotlib/matplotlib/commit/aaef94485cf71ed3181e0adc5577d1a8911f6544

--

___
Python tracker 

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



[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-07-21 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

> I'm still in favor of keeping sys.platform == 'linux3', and you?

Still -1. It should be renamed to 'linux' in future releases, and
back-patched to 'linux2' for maintenance releases.

As for releases that are already out - users should be informed to
not use those on Linux 3 (or not use Linux 3 on systems where they
have the old Python releases).

--

___
Python tracker 

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



[issue12605] Enhancements to gdb 7 debugging hooks

2011-07-21 Thread Dave Malcolm

Dave Malcolm  added the comment:

(On 2.7, I needed import_site=True to get the new tests to work from a fresh 
build: "import time" wasn't being found otherwise)

--
Added file: http://bugs.python.org/file22713/more-frames-in-gdb-hooks-2.7.patch

___
Python tracker 

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



[issue12605] Enhancements to gdb 7 debugging hooks

2011-07-21 Thread Dave Malcolm

Changes by Dave Malcolm :


--
keywords: +patch
Added file: http://bugs.python.org/file22712/more-frames-in-gdb-hooks-py3k.patch

___
Python tracker 

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



[issue12605] Enhancements to gdb 7 debugging hooks

2011-07-21 Thread Dave Malcolm

New submission from Dave Malcolm :

I'm attaching patches to handle some more "events" in the gdb7 debugging hooks 
for CPython (aka Tools/gdb/libpython.py).

Currently, the hooks only care about C frames that are the bytecode interpreter 
(i.e. PyEval_EvalFrameEx)

This patch changes this, dividing C frames into:
  - "python frames":
- "bytecode frames" i.e. PyEval_EvalFrameEx
- "other python frames": C frames that are of interest from a python
  perspective, but aren't bytecode
  - everything else

so that the "py-bt", "py-up" and "py-down" commands will now work on the other 
kinds of "python" frames, in addition to the bytecode frames.

Specifically, the following new kinds of C frame are displayed:
  - waiting on the GIL
  - garbage-collection
  - CFunctions (these weren't displayed before)

This should assist when debugging multithreaded crashes, to more easily get a 
sense of what every thread is doing.

Examples:
Showing a garbage-collection:
(gdb) py-bt
  Garbage-collecting
  
  File "", line 4, in foo
  File "", line 6, in bar
  File "", line 7, in 

(gdb) py-bt-full
#1 Garbage-collecting
#2 
#5 Frame 0x720d6d48, for file , line 4, in foo ()
#8 Frame 0x720d6b70, for file , line 6, in bar ()
#11 Frame 0x77fb1d80, for file , line 7, in  ()

Showing an invocation of "time.sleep()":
(gdb) py-bt-full
#0 
#3 Frame 0x718aa060, for file , line 3, in foo ()
#6 Frame 0x720d6b70, for file , line 5, in bar ()
#9 Frame 0x77fb1d80, for file , line 6, in  ()
  

Showing multiple threads, where all but one are waiting for the GIL:

Thread 5 (Thread 0x7fffeb5fe700 (LWP 10716)):
Traceback (most recent call first):
  Waiting for the GIL
  File "", line 10, in run
  File 
"/home/david/coding/python-hg/cpython-more-gdb/build-debug/../Lib/threading.py",
 line 737, in _bootstrap_inner
self.run()
  File 
"/home/david/coding/python-hg/cpython-more-gdb/build-debug/../Lib/threading.py",
 line 710, in _bootstrap
self._bootstrap_inner()

Thread 4 (Thread 0x7fffebfff700 (LWP 10715)):
Traceback (most recent call first):
  Waiting for the GIL
  File "", line 10, in run
  File 
"/home/david/coding/python-hg/cpython-more-gdb/build-debug/../Lib/threading.py",
 line 737, in _bootstrap_inner
self.run()
  File 
"/home/david/coding/python-hg/cpython-more-gdb/build-debug/../Lib/threading.py",
 line 710, in _bootstrap
self._bootstrap_inner()

Thread 3 (Thread 0x70dea700 (LWP 10714)):
Traceback (most recent call first):
  Waiting for the GIL
  File "", line 10, in run
  File 
"/home/david/coding/python-hg/cpython-more-gdb/build-debug/../Lib/threading.py",
 line 737, in _bootstrap_inner
self.run()
  File 
"/home/david/coding/python-hg/cpython-more-gdb/build-debug/../Lib/threading.py",
 line 710, in _bootstrap
self._bootstrap_inner()

Thread 2 (Thread 0x717eb700 (LWP 10713)):
Traceback (most recent call first):
  Waiting for the GIL
  File "", line 10, in run
  File 
"/home/david/coding/python-hg/cpython-more-gdb/build-debug/../Lib/threading.py",
 line 737, in _bootstrap_inner
self.run()
  File 
"/home/david/coding/python-hg/cpython-more-gdb/build-debug/../Lib/threading.py",
 line 710, in _bootstrap
self._bootstrap_inner()

Thread 1 (Thread 0x77fdb700 (LWP 10709)):
Traceback (most recent call first):
  File "", line 18, in 

--
assignee: dmalcolm
components: Demos and Tools
keywords: needs review
messages: 140828
nosy: dmalcolm, haypo
priority: normal
severity: normal
status: open
title: Enhancements to gdb 7 debugging hooks
versions: Python 2.7, Python 3.2, Python 3.3

___
Python tracker 

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



[issue12604] VTRACE macro in _sre.c should use do {} while (0)

2011-07-21 Thread Josh Triplett

New submission from Josh Triplett :

In _sre.c, the VTRACE macro normally gets defined to nothing.  It later gets 
used as the body of control structures such as "else" without braces, which 
causes many compilers to warn (to catch stray semicolons like "else;").  This 
makes it difficult to compile Python as part of a project which uses -Werror, 
such as GRUB.  Please consider defining VTRACE as do {} while(0) instead, as 
the standard convention for an empty function-like macro with no return value.

--
messages: 140827
nosy: joshtriplett
priority: normal
severity: normal
status: open
title: VTRACE macro in _sre.c should use do {} while (0)
versions: Python 2.7

___
Python tracker 

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



[issue12603] pydoc.synopsis breaks if filesystem returns mtime of 0 (common for filesystems without mtime)

2011-07-21 Thread Josh Triplett

New submission from Josh Triplett :

In Python 2.7.2, pydoc.py's synopsis contains this code implementing a cache:

mtime = os.stat(filename).st_mtime
lastupdate, result = cache.get(filename, (0, None))
if lastupdate < mtime:

Many filesystems don't have any concept of mtime or don't have it available, 
including many FUSE filesystems, as well as our implementation of stat for GRUB 
in BITS.  Such systems typically return an mtime of 0.  (In addition, 0 
represents a valid mtime.)  Since the cache in pydoc.synopsis initializes 
lastupdate to 0 for entries not found in the cache, this causes synopsis to 
always return None.  I'd suggest either extending the conditional to check 
"lastupdate != 0 and lastupdate < mtime" (which would always treat an mtime of 
0 as requiring an update, which would make sense for filesystems without valid 
mtimes) or changing the .get to return (None, None) and checking "lastupdate is 
not None and lastupdate < mtime", which would treat an mtime of 0 as valid but 
still handle the case of not having a cache entry the first time.

--
components: Library (Lib)
messages: 140826
nosy: joshtriplett
priority: normal
severity: normal
status: open
title: pydoc.synopsis breaks if filesystem returns mtime of 0 (common for 
filesystems without mtime)
versions: Python 2.7

___
Python tracker 

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



[issue12581] Increased test coverage of test_urlparse

2011-07-21 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue12589] test_long.test_nan_inf() failed on OpenBSD (powerpc)

2011-07-21 Thread Landry Breuil

Landry Breuil  added the comment:

>>> import struct
>>> struct.pack("d", float("inf"))
b'\x7f\xf0\x00\x00\x00\x00\x00\x00'
>>> struct.pack("f", float("inf"))
b'\x7f\x80\x00\x00'

And yes, HAVE_DECL_ISINF is defined to 1 in pyconfig.h

--

___
Python tracker 

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



[issue12556] Disable size checks in mmap.mmap()

2011-07-21 Thread Charles-François Natali

Charles-François Natali  added the comment:

> By the way, I've checked mmap(2) manpage -- it looks like the C-version has
> nothing
> against mmaping 0-sized files, Why does Python's `mmap` still checks file
> size?

It doesn't check explicitely that the size is non-0, but rather that
the offset is is less than the file size.
Passing mmap(2) a 0 length doesn't make much sense anyway - for
example, Linux returns EINVAL:
http://lxr.free-electrons.com/source/mm/mmap.c?a=avr32#L979
"""
unsigned long do_mmap_pgoff(...)
[...]
if (!len)
 return -EINVAL;
"""

>> Do you have an example of a /proc entry with st_size == 0 that can be
>> mmapped
>> (mapping /proc/sys/debug/exception-trace fails with EACCESS)?
> Yes, I've ran into the issue, while trying to mmap /proc/xen/xsd_kva, which
> is an
> interface to XenBus [1]. Unfortunately, I'm not aware of any other cases.

That's what I thought, it's really uncommon: in that case, I'm
reluctant to making such a change, for the reason explained above.
Ross, Victor?

--

___
Python tracker 

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



[issue12555] PEP 3151 implementation

2011-07-21 Thread Andreas Stührk

Changes by Andreas Stührk :


--
nosy: +Trundle

___
Python tracker 

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



[issue12372] semaphore errors on AIX 7.1

2011-07-21 Thread Charles-François Natali

Charles-François Natali  added the comment:

Patch committed: this should fix POSIX semaphores failures on AIX.
Reshmi, thanks for reporting this!

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

___
Python tracker 

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



[issue12372] semaphore errors on AIX 7.1

2011-07-21 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 44a02d6b74e4 by Charles-François Natali in branch 'default':
Merge - Issue #12372: POSIX semaphores are broken on AIX: don't use them.
http://hg.python.org/cpython/rev/44a02d6b74e4

--

___
Python tracker 

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



[issue12372] semaphore errors on AIX 7.1

2011-07-21 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset f0475f78d45c by Charles-François Natali in branch '3.2':
Issue #12372: POSIX semaphores are broken on AIX: don't use them.
http://hg.python.org/cpython/rev/f0475f78d45c

--

___
Python tracker 

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



[issue12372] semaphore errors on AIX 7.1

2011-07-21 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset f5a7d413638d by Charles-François Natali in branch '2.7':
Issue #12372: POSIX semaphores are broken on AIX: don't use them.
http://hg.python.org/cpython/rev/f5a7d413638d

--
nosy: +python-dev

___
Python tracker 

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



[issue12436] Provide reference to detailed installation instructions

2011-07-21 Thread Adam Woodbeck

Changes by Adam Woodbeck :


--
nosy: +adam.woodbeck

___
Python tracker 

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



[issue10503] os.getuid() documentation should be clear on what kind of uid it is referring

2011-07-21 Thread Adam Woodbeck

Changes by Adam Woodbeck :


--
nosy: +adam.woodbeck

___
Python tracker 

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



[issue7897] Support parametrized tests in unittest

2011-07-21 Thread R. David Murray

R. David Murray  added the comment:

Oh, I see.  Make the name the first element of the argtuple and then strip it 
off.  Well, that will work, it just seems bass-ackwards to me :)

And why is it 'case'?  I thought we were talking about tests.

--

___
Python tracker 

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



[issue7897] Support parametrized tests in unittest

2011-07-21 Thread Michael Foord

Michael Foord  added the comment:

David, I don't understand - it looks like Nick's suggestion would allow you to 
create a name per case, that's the point of it!

You could even do this:

def _name_from_case(name, cases):
for idx, case in enumerate(cases, start=1):
test_name = case[0]
params = case[1:]
yield (test_name, params)

--

___
Python tracker 

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



[issue12589] test_long.test_nan_inf() failed on OpenBSD (powerpc)

2011-07-21 Thread Mark Dickinson

Mark Dickinson  added the comment:

The result of:

struct.pack("d", float("inf"))

would also be interesting.  I'd expect to see:

'\x7f\xf0\x00\x00\x00\x00\x00\x00'

--

___
Python tracker 

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



[issue12600] Support parameterized TestCases in unittest

2011-07-21 Thread Michael Foord

Michael Foord  added the comment:

Yeah, without some clear advantages and a clean api / implementation I'm -1.

--

___
Python tracker 

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



[issue12394] packaging: generate scripts from callable (dotted paths)

2011-07-21 Thread higery

higery  added the comment:

I hope people can help me test this patch especially on non-Windows platforms.

The main implementation resides in build_scripts.py.

Usage: Just add a 'wrapper-scripts-entries' variable in setup.cfg, which takes 
a list type as its value. For instance,

wrapper-scripts-entries = ['hello=demo.foo.bar:main']

There is only one entry named 'hello' in current setup.cfg, the 'demo.foo.bar' 
is the dotted module path, and the 'main' is the main function name which will 
be called to execute.



Current patch can generte executable script with no extension on POSIX, and 
.exe file on Windows but have not yet added gui support. 

I also have another problem here looking for help:

In the 'test_command_build_scripts.py', how to test the generated .exe wrapper 
to see if it can run and generate correct output or not? The only way I can 
remember is to use os.system(), but if we use os.system() to execute the .exe 
file, then it will not get the what we want, because it will run in another 
thread, thus can not get the right sys.path which I have set in my test 
function.

--

___
Python tracker 

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



[issue12600] Support parameterized TestCases in unittest

2011-07-21 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Note that this is fairly simple to do now via subclassing, so any
> proposed API would need to show a clear benefit over that approach to
> be worth the extra complexity in the unittest code base.

Agreed. Let's not add cruft to unittest.

--

___
Python tracker 

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



[issue12602] Missing using docs cross-references

2011-07-21 Thread Nick Coghlan

Nick Coghlan  added the comment:

Should also be an outgoing link to http://bugs.python.org/issue1739468
from the 

[issue12394] packaging: generate scripts from callable (dotted paths)

2011-07-21 Thread higery

Changes by higery :


--
keywords: +patch
Added file: http://bugs.python.org/file22711/6382acfb1685.diff

___
Python tracker 

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



[issue12602] Missing using docs cross-references

2011-07-21 Thread Nick Coghlan

Changes by Nick Coghlan :


--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python
versions: +Python 2.7, Python 3.2, Python 3.3

___
Python tracker 

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



[issue12602] Missing using docs cross-references

2011-07-21 Thread Nick Coghlan

New submission from Nick Coghlan :

General untidiness in the anchor names (and lack of same for entries like 

[issue12556] Disable size checks in mmap.mmap()

2011-07-21 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue7897] Support parametrized tests in unittest

2011-07-21 Thread R. David Murray

R. David Murray  added the comment:

Please implement name+argtuple first and build auto-naming on top of that.  
Nick's approach would not allow me to specify a custom (hand coded) name for 
each set of arguments, which is my normal use case.  I also would not like the 
arguments auto-generated into the docstring unless that was optional, since I 
often have quite substantial argument tuples and it would just clutter the 
output to have them echoed in the docstring.  In my use cases the custom name 
is more useful than seeing the actual parameters.

--

___
Python tracker 

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



[issue7879] Too narrow platform check in test_datetime

2011-07-21 Thread R. David Murray

Changes by R. David Murray :


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

___
Python tracker 

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



[issue7879] Too narrow platform check in test_datetime

2011-07-21 Thread R. David Murray

R. David Murray  added the comment:

Please implement name+argtuple first and build auto-naming on top of that.  
Nick's approach would not allow me to specify a custom (hand coded) name for 
each set of arguments, which is my normal use case.  I also would not like the 
arguments auto-generated into the docstring unless that was optional, since I 
often have quite substantial argument tuples and it would just clutter the 
output to have them echoed in the docstring.  In my use cases the custom name 
is more useful than seeing the actual parameters.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue7897] Support parametrized tests in unittest

2011-07-21 Thread Michael Foord

Michael Foord  added the comment:

Note that name clashes *would* result in non-unique testcase ids, so we need to 
prevent that.

--

___
Python tracker 

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



[issue12600] Support parameterized TestCases in unittest

2011-07-21 Thread R. David Murray

R. David Murray  added the comment:

Note that this is fairly simple to do now via subclassing, so any proposed API 
would need to show a clear benefit over that approach to be worth the extra 
complexity in the unittest code base.

--

___
Python tracker 

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



[issue12545] Incorrect handling of return codes in the posix_lseek function in posixmodule.c

2011-07-21 Thread Kuberan Naganathan

Kuberan Naganathan  added the comment:

Hi.  I'm unable ( or have to jump through lots of hoops ) to submit this patch 
myself for regulatory reasons.  Can someone else submit this please?  Thanks.

--

___
Python tracker 

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



[issue12556] Disable size checks in mmap.mmap()

2011-07-21 Thread Sergei Lebedev

Sergei Lebedev  added the comment:

> Do you have an example of a /proc entry with st_size == 0 that can be mmapped 
> (mapping /proc/sys/debug/exception-trace fails with EACCESS)?
Yes, I've ran into the issue, while trying to mmap /proc/xen/xsd_kva, which is 
an 
interface to XenBus [1]. Unfortunately, I'm not aware of any other cases. 

By the way, I've checked mmap(2) manpage -- it looks like the C-version has 
nothing 
against mmaping 0-sized files, Why does Python's `mmap` still checks file size?

[1] http://wiki.xensource.com/xenwiki/XenBus

--

___
Python tracker 

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



[issue12556] Disable size checks in mmap.mmap()

2011-07-21 Thread Ross Lagerwall

Ross Lagerwall  added the comment:

> I don't like the idea of adding an argument which doesn't have a
> counterpart in the POSIX version (especially to address such corner
> cases).

Indeed, it seems rather messy for a corner case that may well not exist.

If there are definite cases where this usage is needed, a solution may then 
have to be considered.

--

___
Python tracker 

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



[issue7897] Support parametrized tests in unittest

2011-07-21 Thread Michael Foord

Michael Foord  added the comment:

Well, pyflakes will tell you about name clashes within a TestCase (unless 
you're shadowing a test on a base class which I guess is rarely the case)...

When we generate the tests we could add the parameter reprs to the docstring. A 
decorator factor that takes arguments and an optional name builder seem like a 
reasonable api to me.

Actually, name clashes *aren't* a problem - as we're generating TestCase 
instances these generated tests won't shadow existing tests (you'll just have 
two tests with the same name - does this mean id() may not be unique - worth 
checking).

--

___
Python tracker 

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



[issue12576] urlib.request fails to open some sites

2011-07-21 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue12589] test_long.test_nan_inf() failed on OpenBSD (powerpc)

2011-07-21 Thread STINNER Victor

STINNER Victor  added the comment:

Is HAVE_DECL_ISINF defined in pyconfig.h? PyLong_FromDouble() uses 
Py_IS_INFINITY(x):
--
/* Py_IS_INFINITY(X)
 * Return 1 if float or double arg is an infinity, else 0.
 * Caution:
 *X is evaluated more than once.
 *This implementation may set the underflow flag if |X| is very small;
 *it really can't be implemented correctly (& easily) before C99.
 *Override in pyconfig.h if you have a better spelling on your platform.
 *  Py_FORCE_DOUBLE is used to avoid getting false negatives from a
 *non-infinite value v sitting in an 80-bit x87 register such that
 *v becomes infinite when spilled from the register to 64-bit memory.
 * Note: PC/pyconfig.h defines Py_IS_INFINITY as _isinf
 */
#ifndef Py_IS_INFINITY
#  if defined HAVE_DECL_ISINF && HAVE_DECL_ISINF == 1
#define Py_IS_INFINITY(X) isinf(X)
#  else
#define Py_IS_INFINITY(X) ((X) &&   \
   (Py_FORCE_DOUBLE(X)*0.5 == Py_FORCE_DOUBLE(X)))
#  endif
#endif
--

main() in Modules/python.c starts with:
--
/* 754 requires that FP exceptions run in "no stop" mode by default,
 * and until C vendors implement C99's ways to control FP exceptions,
 * Python requires non-stop mode.  Alas, some platforms enable FP
 * exceptions by default.  Here we disable them.
 */
#ifdef __FreeBSD__
fp_except_t m;

m = fpgetmask();
fpsetmask(m & ~FP_X_OFL);
#endif
--

You may try to enable this code on OpenBSD, replace "#ifdef __FreeBSD__" by 
"#if 1".

Can you also please try the following code?

$ python
>>> import struct
>>> struct.pack("f", float("inf"))
b'\x00\x00\x80\x7f'

--

___
Python tracker 

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



[issue12589] test_long.test_nan_inf() failed on OpenBSD (powerpc)

2011-07-21 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +mark.dickinson

___
Python tracker 

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



[issue11669] Clarify Lang Ref "Compound statements" footnote

2011-07-21 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ncoghlan

___
Python tracker 

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



[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-07-21 Thread STINNER Victor

STINNER Victor  added the comment:

> It seems currently that in python 3.2 sys.platform is linux2
> even though it is running linux 3

It's maybe because you ran ./configure with Linux 2.x.y (see msg138254). Try 
make distclean && ./configure --with-debug && make.

--

___
Python tracker 

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



[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-07-21 Thread maniram maniram

maniram maniram  added the comment:

It seems currently that in python 3.2 sys.platform is linux2 even though it is 
running linux 3

--
nosy: +maniram.maniram

___
Python tracker 

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



[issue12601] Spelling error in the comments in the webbrowser module.

2011-07-21 Thread maniram maniram

maniram maniram  added the comment:

Thanks for the fast response.

--

___
Python tracker 

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



[issue12266] str.capitalize contradicts oneself

2011-07-21 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

Ezio Melotti wrote:
> 
> Ezio Melotti  added the comment:
> 
> Do you mean  "if (!Py_UNICODE_ISLOWER(*s)) {"  (with the '!')?

Sorry, here's the correct version:

if (!Py_UNICODE_ISUPPER(*s)) {
*s = Py_UNICODE_TOUPPER(*s);
status = 1;
}
s++;
while (--len > 0) {
if (!Py_UNICODE_ISLOWER(*s)) {
*s = Py_UNICODE_TOLOWER(*s);
status = 1;
}
s++;
}

> This sounds fine to me, but with this approach all the uncased characters 
> will go through a Py_UNICODE_TO* macro, whereas with the current code only 
> the cased ones are converted.  I'm not sure this matters too much though.
> 
> OTOH if the non-lowercase cased chars are always either upper or titlecased, 
> checking for both should be equivalent.

AFAIK, there are characters that don't have a case mapping at all.
It may also be the case, that a non-cased character still has a
lower/upper case mapping, e.g. for typographical reasons.

Someone would have to check this against the current Unicode database.

--

___
Python tracker 

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



[issue12266] str.capitalize contradicts oneself

2011-07-21 Thread Ezio Melotti

Ezio Melotti  added the comment:

Do you mean  "if (!Py_UNICODE_ISLOWER(*s)) {"  (with the '!')?

This sounds fine to me, but with this approach all the uncased characters will 
go through a Py_UNICODE_TO* macro, whereas with the current code only the cased 
ones are converted.  I'm not sure this matters too much though.

OTOH if the non-lowercase cased chars are always either upper or titlecased, 
checking for both should be equivalent.

--

___
Python tracker 

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



[issue12583] More detailed ImportError messages

2011-07-21 Thread Ram Rachum

Ram Rachum  added the comment:

Thanks for explaining, I guess it's too complicated.

--

___
Python tracker 

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



[issue12266] str.capitalize contradicts oneself

2011-07-21 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

I think it would be better to use this code:

if (!Py_UNICODE_ISUPPER(*s)) {
*s = Py_UNICODE_TOUPPER(*s);
status = 1;
}
s++;
while (--len > 0) {
if (Py_UNICODE_ISLOWER(*s)) {
*s = Py_UNICODE_TOLOWER(*s);
status = 1;
}
s++;
}

Since this actually implements what the doc-string says.

Note that title case is not the same as upper case. Title case is
a special case that get's applied when using a string as a title
of a text and may well include characters that are lower case
but which are only used in titles.

--

___
Python tracker 

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



[issue12590] First line and cursor not visible when opening files

2011-07-21 Thread Tal Einat

Changes by Tal Einat :


--
nosy: +taleinat

___
Python tracker 

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



[issue12601] Spelling error in the comments in the webbrowser module.

2011-07-21 Thread Ezio Melotti

Ezio Melotti  added the comment:

Fixed, thanks for the report!

--
assignee:  -> ezio.melotti
nosy: +ezio.melotti
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue12601] Spelling error in the comments in the webbrowser module.

2011-07-21 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 3bc80b6f7cd8 by Ezio Melotti in branch '3.2':
#12601: fix typo.
http://hg.python.org/cpython/rev/3bc80b6f7cd8

New changeset d26c7b18fc9d by Ezio Melotti in branch 'default':
#12601: merge with 3.2.
http://hg.python.org/cpython/rev/d26c7b18fc9d

New changeset 0127716200c7 by Ezio Melotti in branch '2.7':
#12601: fix typo.
http://hg.python.org/cpython/rev/0127716200c7

--
nosy: +python-dev

___
Python tracker 

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



[issue12601] Spelling error in the comments in the webbrowser module.

2011-07-21 Thread maniram maniram

New submission from maniram maniram :

At line 235 there is a comment which contains "secons" which should be changed 
to seconds.

--
components: Library (Lib)
messages: 140793
nosy: maniram.maniram
priority: normal
severity: normal
status: open
title: Spelling error in the comments in the webbrowser module.
versions: Python 3.2

___
Python tracker 

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



[issue6820] Redefinition of HAVE_STRFTIME can cause compiler errors.

2011-07-21 Thread rgpitts

rgpitts  added the comment:

As Python 2.6 is now security only and 2.7 is last major release I've patched 
this against Python 3.2 because pyconfig.h hadn't changed much since 2.6.

I've done as Amaury suggested and changed the HAVE_XXX symbols to define 1 like 
autoconf. 'make patchcheck' has fixed some general formatting issues included 
in the patch.

--
keywords: +patch
Added file: http://bugs.python.org/file22710/issue-6820.patch

___
Python tracker 

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