[issue12568] Add functions to get the width in columns of a character

2011-07-20 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



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

2011-07-20 Thread Ezio Melotti

Ezio Melotti  added the comment:

I fixed the URL in 3.2.

> The 2.7 docs link to the Subversion repo.  Can I update them?

2.7 doesn't have the source directive, do you want to replace all the svn links 
manually?
If so, either reopen this issue or create a new one.

--

___
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-20 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 79d2682c4fc5 by Ezio Melotti in branch '3.2':
#11435: link to the correct branch.
http://hg.python.org/cpython/rev/79d2682c4fc5

New changeset 3028b5ab92c0 by Ezio Melotti in branch 'default':
#11435: dummy merge with 3.2.
http://hg.python.org/cpython/rev/3028b5ab92c0

--

___
Python tracker 

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



[issue11629] Reference implementation for PEP 397

2011-07-20 Thread Mark Hammond

Mark Hammond  added the comment:

The most recent version of PEP397 has removed all mentioned of this reference 
implementation - the C implementation at 
https://bitbucket.org/vinay.sajip/pylauncher/ is now the reference.

--
resolution:  -> out of date
status: open -> closed

___
Python tracker 

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



[issue10271] warnings.showwarning should allow any callable object

2011-07-20 Thread lekma

lekma  added the comment:

Thank you very much for your help

--

___
Python tracker 

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



[issue11363] Curses - add missing functions to doc

2011-07-20 Thread Ezio Melotti

Ezio Melotti  added the comment:

FWIW the typo has been fixed in 13c9b93e97ad.
If the example is failing another issue should be created.

--
status: open -> closed

___
Python tracker 

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



[issue12540] "Restart Shell" command leaves pythonw.exe processes running

2011-07-20 Thread Aneesh

Aneesh  added the comment:

We are also noticed same issue and reverted to Python 3.1. Whenever we run a 
script, two new pythonw.exe process is started and it is really irritating to 
see all in Windows Task Manager. 

Last day I killed around 14 Pythonw.exe to clean up everything.

--
nosy: +Aneesh

___
Python tracker 

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



[issue12401] unset PYTHON* environment variables when running tests

2011-07-20 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +haypo

___
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-20 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +Yaroslav.Halchenko, brian.curtin, eric.araujo, ericsnow, exarkun, 
ezio.melotti, fperez, michael.foord, nchauvat, ncoghlan, pitrou, r.david.murray
versions: +Python 3.3 -Python 2.7, Python 3.2

___
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-20 Thread Austin Bingham

Austin Bingham  added the comment:

OK, I created issue 12600 for dealing with parameterized TestCases as
opposed to individual tests.

On Wed, Jul 20, 2011 at 4:03 PM, R. David Murray  wrote:
> Unless someone sees a clever way to implement both with the same mechanism, 
> parameterizing test cases should probably be a separate issue.  Doing it via 
> subclassing is straightforward, which also argues for a separate issue, since 
> an 'is this worth it' discussion should be done separately for that feature.

--

___
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-20 Thread Austin Bingham

New submission from Austin Bingham :

In the discussion about adding support for parameterized tests (issue 7897), it 
seemed clear that parameterizing individual tests was a different issue from 
parameterizing TestCases. This, then, is a request to support parameterization 
of TestCases.

The fundamental idea is that one should be able to define a TestCase - 
fixtures, individual tests, etc. - and then be able to reuse that TestCase with 
different sets of parameters. This should all mesh cleanly with the rest of the 
unittest system, though it's not entirely clear what that entails.

As a motivation, consider a TestCase that tests the public API for a database 
abstraction system. The abstraction may work against any of a number of 
backends, but the public API remains the same for each. A parameterized 
TestCase would let you write one test for the public API and then run it for 
each of the backends.

--
components: Tests
messages: 140784
nosy: abingham
priority: normal
severity: normal
status: open
title: Support parameterized TestCases in unittest
type: feature request
versions: Python 2.7, Python 3.2

___
Python tracker 

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



[issue12298] Sphinx glitch in library/functions

2011-07-20 Thread Ezio Melotti

Changes by Ezio Melotti :


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

___
Python tracker 

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



[issue8887] "pydoc str" works but not "pydoc str.translate"

2011-07-20 Thread Ezio Melotti

Changes by Ezio Melotti :


--
stage: patch review -> commit review
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



[issue11113] html.entities mapping dicts need updating?

2011-07-20 Thread Ezio Melotti

Ezio Melotti  added the comment:

Having them in different mappings would be good, but I expect that for most 
real world application a single mappings that includes them all is the way to 
go.  If I'm parsing a supposedly HTML page that contains an ' I'd rather 
have it converted even if it's not an HTML entity.
If the set of entities supported by HTML5 is a superset of the HTML4 and XHTML 
ones, than we might just use that (I haven't checked though).

--

___
Python tracker 

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



[issue3665] Support \u and \U escapes in regexes

2011-07-20 Thread Ezio Melotti

Changes by Ezio Melotti :


--
keywords: +needs review
stage:  -> patch review

___
Python tracker 

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



[issue12301] Use :data:`sys.thing` instead of ``sys.thing`` throughout

2011-07-20 Thread Ezio Melotti

Ezio Melotti  added the comment:

+1

--
keywords: +easy

___
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-20 Thread Ezio Melotti

Ezio Melotti  added the comment:

To distinguish the 'int' in functions.rst from the one in stdtypes.rst (if it 
works...).

--

___
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-20 Thread Ezio Melotti

Ezio Melotti  added the comment:

Indeed this seems a different issue, and might be worth fixing it.
Given this definition:
  str.capitalize()¶
  Return a copy of the string with its first character capitalized and the 
rest lowercased.
we might implement capitalize like:
>>> def mycapitalize(s):
... return s[0].upper() + s[1:].lower()
... 
>>> 'fOoBaR'.capitalize()
'Foobar'
>>> mycapitalize('fOoBaR')
'Foobar'

And this would yield the correct result:
>>> s = u'\u1ff3\u1ff3\u1ffc\u1ffc'
>>> print s
ῳῳῼῼ
>>> print s.capitalize()
ῼῳῼῼ
>>> print mycapitalize(s)
ῼῳῳῳ
>>> s.capitalize().istitle()
False
>>> mycapitalize(s).istitle()
True

This doesn't happen because the actual implementation of str.capitalize checks 
if a char is uppercase (and not if it's titlecase too) before converting it to 
lowercase.  This can be fixed doing:
diff -r cb44fef5ea1d Objects/unicodeobject.c
--- a/Objects/unicodeobject.c   Thu Jul 21 01:11:30 2011 +0200
+++ b/Objects/unicodeobject.c   Thu Jul 21 07:57:21 2011 +0300
@@ -6739,7 +6739,7 @@
 }
 s++;
 while (--len > 0) {
-if (Py_UNICODE_ISUPPER(*s)) {
+if (Py_UNICODE_ISUPPER(*s) || Py_UNICODE_ISTITLE(*s)) {
 *s = Py_UNICODE_TOLOWER(*s);
 status = 1;
 }

--
assignee:  -> ezio.melotti
status: closed -> open
versions: +Python 2.7, Python 3.2, 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



[issue12204] str.upper converts to title

2011-07-20 Thread Ezio Melotti

Ezio Melotti  added the comment:

New patch that factors out the definition of cased characters adding it to a 
footnote.

--
Added file: http://bugs.python.org/file22709/issue12204-2.diff

___
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-20 Thread Ezio Melotti

Ezio Melotti  added the comment:

Here's a patch.
I don't think it's necessary to update the docstring.

--
assignee: docs@python -> ezio.melotti
keywords: +patch
stage:  -> commit review
Added file: http://bugs.python.org/file22708/issue12204.diff

___
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-20 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +belopolsky, eric.araujo, ezio.melotti, lemburg

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



[issue7897] Support parametrized tests in unittest

2011-07-20 Thread R. David Murray

R. David Murray  added the comment:

Personally I would be happy if I could pass in a dictionary that maps names to 
argument tuples, or an iterator yielding (name, (argtuple)) pairs, and just 
have the failure report the name.  That is, make me responsible for generating 
meaningful names, don't autogenerate them.  Then someone could provide a name 
autogenerate helper on top of that base interface. 

Checking for name clashes would be nice, but it would be nice to have that for 
non-parameterized test cases, too (I've been bitten by that a number of time ;)

--

___
Python tracker 

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



[issue12540] "Restart Shell" command leaves pythonw.exe processes running

2011-07-20 Thread Eli Bendersky

Changes by Eli Bendersky :


--
nosy: +eli.bendersky

___
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-20 Thread Nick Coghlan

Nick Coghlan  added the comment:

Here's a sketch for a possible decorator factory:

def parameters(params, *, builder=_default_param_builder):
def make_parameterized_test(f):
return ParameterizedTest(f, params, builder)
return make_parameterized_test

(default builder would be the one I sketched earlier)

Example usage:

ExampleParams = namedtuple('ExampleParams', 'x y')
all_cases = [ExampleParams(x, y) for x in range(3) for y in range(3)]

def x_y_naming(name, cases):
for idx, case in enumerate(cases, start=1):
x, y = case
yield ("{}_{}_{}_{}".format(name, idx, x, y), case)

class ExampleTestCase(TestCase):
  @parameters(all_cases)
  def test_example_auto_naming(self, x, y):
  self.assertNotEqual(x, y) # fails sometimes :)

  @parameters(all_cases, builder=x_y_naming)
  def test_example_custom_naming(self, x, y):
  self.assertNotEqual(x, y) # fails sometimes :)

Once defined, you're far better equipped than I am to decide how TestLoader and 
TestCase can best cooperate to generate appropriate test operations and error 
messages.

--

___
Python tracker 

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



[issue12540] "Restart Shell" command leaves pythonw.exe processes running

2011-07-20 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Restart is not required to create a zombie. Just start IDLE and quit, and the 
second, user process does not disappear.

Reverting completely does not seem possible. I first just ran the 3.2 installer 
and it did not complain, that I noticed, about replacing a newer version, but 
apparently only replaced .exe and .dll and a few other files but not Lib/*.py. 
Idle or command prompt window said it was still 3.2.1 and the bug remained.

So I uninstalled, deleted everything left except my .py files in site-packages 
and another subdirectory, and reinstalled 3.2. Now everything seems to predate 
2/22/2011. BUT IDLE and command prompt window *still* report "Python 3.2.1 
(default, Jul 10 2011, 21:51:15) [MSC v.1500 32 bit (Intel)] on win32". This is 
sys.version. Something somewhere (registry?) seems to not be deleted by 
uninstall.  And the bug remains. Could a registry entry possibly affect this?

My system is 7 years old with updated win xp 32 bit.

I then checked the never updated 64 bit Py 3.2 on an 18 month old 64 bit Win 7 
laptop and detached user processes *do* disappear as I remember on this 
machine. It did, however, take 8 sec over restart and 12 after closing, which 
is longer than I remember for my older and definitely slower machine.

--

___
Python tracker 

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



[issue11197] information leakage with SimpleHTTPServer

2011-07-20 Thread Ori Livneh

Ori Livneh  added the comment:

Yes, I seem to have gotten confused about this. Sorry for the confusion, and 
thanks for clearing it up.

--

___
Python tracker 

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



[issue12540] "Restart Shell" command leaves pythonw.exe processes running

2011-07-20 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

This nasty bug really can cause severe problems. If a zombie process ran a 
tkinter (tk) window, then attempting to logout/restart/shutdown eventually 
brings up a window I have never seen before: End Process -- EmbeddedMenuWindow. 
The message window shows a countdown timer that implies that it will shutdown 
the process automatically when the timer reaches 0. But it does not because the 
process does not respond. It will sit there indefinitely. One has to click a 
shutdown button to get rid of it.  Then a few seconds later, another window for 
the next zombie appears. And so on. It there are 50 zombies, then one would 
have to repeat 50 times. Not acceptible to me.

Since IDLE is my Python workspace and since I plan to soon start running lots 
of tkinter tests and experiments soon, I am reverting to 3.2.0 until there is a 
fixed Windows binary.

Adding the two listed Windows experts.

--
nosy: +brian.curtin, tim.golden

___
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-20 Thread Michael Foord

Michael Foord  added the comment:

Oh, and if we're not going to get clever with naming, how is the TestResult 
going to include the parameter repr in the failure report? That information 
will have to be stored on the TestCase. 

I would prefer this feature not to touch the TestResult - so any failure 
message cleverness should be done in the TestCase. It will be harder to 
maintain if this feature is spread out all the way through unittest.

--

___
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-20 Thread Michael Foord

Michael Foord  added the comment:

That all sounds good to me Nick. Some notes / questions.

How should parameterised tests be marked? I'm happy with a 
unittest.parameterized decorator (it would do no work other than mark the test 
method, with the parameterisation being done in the TestLoader).

What could the "name customisation hook" look like? A module level hook (yuck) 
/ a class method hook on the TestCase that must handle every parameterised test 
on that TestCase / a decorator for the parameterised test method?

If we do it at load time should we require parameterised methods to be class 
methods? The alternative is to instantiate the test case when loading and 
collecting the tests. Class methods won't play well with the other unittest 
decorators as you can't attach attributes to classmethods. (So I guess instance 
methods it is!)

If collecting tests fails part way through we should generate a failing test 
that reports the exception. Should the tests collected "so far" be kept?

Should skip / expectedFail decorators still work with them? If so they'll need 
custom support I expect.

If we're generating test names and then attaching these tests to TestCase 
instances (so that normal test case execution will run them), should we check 
for name clashes? What should we do if there is a name clash? (The generated 
name would shadow an existing name.) We could prevent that by using a 
non-identifier name - e.g. "${}_{}".format(name, idx)

--

___
Python tracker 

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



[issue12599] Use 'is not None' where appropriate in importlib

2011-07-20 Thread Nick Coghlan

New submission from Nick Coghlan :

Problems noted by PJE on import-sig:

For example, PathFinder's find_module treats an empty path the same as 
sys.path, and will also fail if for some reason the bool() of a PEP 302 finder 
or loader object is False.  Also, module_for_loader() will create a new module 
object, if you have a False module subclass in sys.modules.

...

These distinctions could be more problematic than they appear, as it's possible 
to inadvertently make your loader or your module subclass capable of being 
False (for example, if you subclassed a sequence type or implemented a 
__len__), and this could lead to some very subtle bugs, albeit very rare ones 
as well.  ;-)
===

The import test cases should include some examples of such pathological 
objects, with importlib then updated appropriately.

--
assignee: brett.cannon
messages: 140770
nosy: brett.cannon, ncoghlan
priority: normal
severity: normal
stage: test needed
status: open
title: Use 'is not None' where appropriate in importlib
type: behavior
versions: 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



[issue7897] Support parametrized tests in unittest

2011-07-20 Thread Eric Snow

Changes by Eric Snow :


--
nosy: +ericsnow

___
Python tracker 

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



[issue12598] Move sys variable initialization from import.c to sysmodule.c

2011-07-20 Thread Nick Coghlan

Changes by Nick Coghlan :


--
nosy: +brett.cannon, ncoghlan

___
Python tracker 

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



[issue12598] Move sys variable initialization from import.c to sysmodule.c

2011-07-20 Thread Eric Snow

New submission from Eric Snow :

Several import-related sys variables are set in _PyImportHooks_Init (in 
Python/import.c), which is called in Python/pythonrun.c.  I have included a 
patch that moves that initialization from _PyImportHooks_Init to a new 
_SysImportState_Init function in Python/sysmodule.c, which is then called from 
_PyImportHooks_Init.

This may seem like an unnecessary change, but sysmodule.c is the obvious place 
to find the initialization of sys variables.  Other than in pythonrun.c, 
import.c is the only place that sys variables are set outside of sysmodule.c.

Finally, several import related projects[1] are coming up that will impact 
import.c and _PyImportHooks_Init specifically.  This change helps clean up 
import.c a little in preparation for those projects, and isolates out of 
import.c at least one thing that should be kept safe during any import.c 
refactoring.

[1] see issue #2377, PEP 402, and the GSOC import engine project.

--
files: sys_import_state.diff
keywords: patch
messages: 140769
nosy: ericsnow
priority: normal
severity: normal
status: open
title: Move sys variable initialization from import.c to sysmodule.c
Added file: http://bugs.python.org/file22707/sys_import_state.diff

___
Python tracker 

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



[issue12551] Provide data for TLS channel binding

2011-07-20 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Patch is now committed. Thanks for your contribution!

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

___
Python tracker 

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



[issue12551] Provide data for TLS channel binding

2011-07-20 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset cb44fef5ea1d by Antoine Pitrou in branch 'default':
Issue #12551: Provide a get_channel_binding() method on SSL sockets so as
http://hg.python.org/cpython/rev/cb44fef5ea1d

--
nosy: +python-dev

___
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-20 Thread Nick Coghlan

Nick Coghlan  added the comment:

Load time parameterisation seems more of a worthwhile addition to me, too. As 
David noted, runtime parameterisation is pretty easy to do by looping and 
consolidating failures into the one error message via self.fail().

For test naming, trying to get too clever seems fraught with peril. I'd be 
happy with something like:
1. Parameterised tests are just numbered sequentially by default
2. The repr of the test parameters is included when displaying detailed error 
messages
3. A hook is provided to allow customisation of the naming scheme and test 
parameters. This hook receives an iterable of test parameters and is expected 
to create a new iterable producing 2-tuples of test names and parameters.

The default behaviour of the parameterised test generator could then be 
something like:

def parameterised_test_info(name, cases):
for idx, case in enumerate(cases, start=1):
yield ("{}_{}".format(name, idx), case)

The new machinery (however provided) would then take care of checking the names 
are unique, adding those methods to the test case, and storing the parameters 
somewhere convenient (likely as attributes of the created methods) for use when 
running the test and when displaying error messages.

--

___
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-20 Thread Brett Cannon

Brett Cannon  added the comment:

For the ImportWarning docs, there could stand to be more; patches welcome. =)

As for ImportError being postmortem on an error, that is not always true as 
plenty of people use the trick, e.g.:

try: import json
except ImportError: import simplejson as json

As for detecting circular imports, flagging it somehow might work, but directly 
analyzing the stack won't do since that is extremely costly on some VMs.

--

___
Python tracker 

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



[issue12588] test_capi.test_subinterps() failed on OpenBSD (powerpc)

2011-07-20 Thread Landry Breuil

Landry Breuil  added the comment:

You get the same issue :


[23:08] mikey:/usr/obj/ports/Python-3.2.1/Python-3.2.1/ $cp Modules/_testembed 
. 
[23:08] mikey:/usr/obj/ports/Python-3.2.1/Python-3.2.1/ $LD_LIBRARY_PATH=. gdb 
_testembed
GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "powerpc-unknown-openbsd4.9"...(no debugging symbols 
found)

(gdb) r
Starting program: /usr/obj/ports/Python-3.2.1/Python-3.2.1/_testembed 
--- Pass 0 ---
interp 0x90d4a440, thread state 0x81855380: id(modules) = 2201418320
interp 0x90d4a580, thread state 0x81855600: id(modules) = 2259298752
interp 0x90d4a880, thread state 0x81855480: id(modules) = 2246904544
interp 0x90d4acc0, thread state 0x81855500: id(modules) = 2328741616
interp 0x90d4a440, thread state 0x81855380: id(modules) = 2201418320
--- Pass 1 ---
interp 0x0, thread state 0x81855380: 
Program received signal SIGSEGV, Segmentation fault.
0x8eb95094 in PyImport_GetModuleDict () from ./libpython3.2m.so.1.0
(gdb) bt
#0  0x8eb95094 in PyImport_GetModuleDict () from ./libpython3.2m.so.1.0
#1  0x8eb95070 in PyImport_GetModuleDict () from ./libpython3.2m.so.1.0
#2  0x8eb95070 in PyImport_GetModuleDict () from ./libpython3.2m.so.1.0
#3  0x8eb95070 in PyImport_GetModuleDict () from ./libpython3.2m.so.1.0
#4  0x8eb95070 in PyImport_GetModuleDict () from ./libpython3.2m.so.1.0
#5  0x8eb95070 in PyImport_GetModuleDict () from ./libpython3.2m.so.1.0
#6  0x8eb95070 in PyImport_GetModuleDict () from ./libpython3.2m.so.1.0
Previous frame inner to this frame (corrupt stack?)

--

___
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-20 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

I think this is also a regression in Python 2.7, as reported here:

https://bugs.launchpad.net/ubuntu/+source/python2.7/+bug/813295

--
nosy: +barry
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



[issue12588] test_capi.test_subinterps() failed on OpenBSD (powerpc)

2011-07-20 Thread Roumen Petrov

Roumen Petrov  added the comment:

Hi Landry , what is result if you move _testembed to upper directory and run it 
with environment so that shared python library from upper to be loaded 
(LD_LIBRARY_PATH= )?

--
nosy: +rpetrov

___
Python tracker 

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



[issue12594] Docs for py3k still refer to "MacPython 2.5 folder"

2011-07-20 Thread Ned Deily

Ned Deily  added the comment:

Thanks for the report.  The whole "Using Python on a Macintosh" section is very 
out-of-date and needs a major update.

--
assignee: docs@python -> ned.deily
nosy: +ned.deily
stage:  -> needs patch
versions: +Python 2.7, 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



[issue12597] List created by multiplication behaves different

2011-07-20 Thread R. David Murray

R. David Murray  added the comment:

I'm not sure what your example is trying to achieve, but the list(tuple(...)) 
looks redundant.

Your initial example could be written:

  b = [[0] for i in range(3)]

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



[issue12588] test_capi.test_subinterps() failed on OpenBSD (powerpc)

2011-07-20 Thread Landry Breuil

Landry Breuil  added the comment:

(gdb) r
Starting program: /usr/obj/ports/Python-3.2.1/Python-3.2.1/Modules/_testembed 
--- Pass 0 ---
interp 0x90ae7300, thread state 0x87b48a00: id(modules) = 2363177552
interp 0x90ae7a40, thread state 0x87b48a80: id(modules) = 2243881408
interp 0x90ae7cc0, thread state 0x87b48100: id(modules) = 2216467744
interp 0x90ae7ec0, thread state 0x87b48180: id(modules) = 2221503376
interp 0x90ae7300, thread state 0x87b48a00: id(modules) = 2363177552
--- Pass 1 ---
interp 0x0, thread state 0x87b48a00: 
Program received signal SIGSEGV, Segmentation fault.
0x8cb70094 in PyImport_GetModuleDict () from /usr/local/lib/libpython3.2m.so.1.0
(gdb) bt
#0  0x8cb70094 in PyImport_GetModuleDict () from 
/usr/local/lib/libpython3.2m.so.1.0
#1  0x8cb70070 in PyImport_GetModuleDict () from 
/usr/local/lib/libpython3.2m.so.1.0
#2  0x8cb70070 in PyImport_GetModuleDict () from 
/usr/local/lib/libpython3.2m.so.1.0
#3  0x8cb70070 in PyImport_GetModuleDict () from 
/usr/local/lib/libpython3.2m.so.1.0
#4  0x8cb70070 in PyImport_GetModuleDict () from 
/usr/local/lib/libpython3.2m.so.1.0
#5  0x8cb70070 in PyImport_GetModuleDict () from 
/usr/local/lib/libpython3.2m.so.1.0
#6  0x8cb70070 in PyImport_GetModuleDict () from 
/usr/local/lib/libpython3.2m.so.1.0
Previous frame inner to this frame (corrupt stack?)

--
nosy: +landry

___
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-20 Thread Landry Breuil

Landry Breuil  added the comment:

$python3.2
Python 3.2.1 (default, Jul 18 2011, 10:56:33) 
[GCC 4.2.1 20070719 ] on openbsd4
>>> int(float('inf'))
0
$sysctl hw
hw.machine=macppc

--
nosy: +landry

___
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-20 Thread Carl Meyer

Carl Meyer  added the comment:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

> Éric Araujo  added the comment:
> 
> [Carl]
>> there's an implicit assumption that a .pth file is the most likely
>> strategy.
> If you have other ideas, please share them.

No, I think that's the most promising strategy. The "implicit
assumption" comment was not criticism, just explanation for Michael.
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk4nF2wACgkQ1j/fhc23WEDvlwCeK3Y+MJGyb3uoEzYzJWaSCrTy
WewAoI7UdW+nqP2SEtquvQXCndXX57VO
=UFOY
-END PGP SIGNATURE-

--

___
Python tracker 

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



[issue12597] List created by multiplication behaves different

2011-07-20 Thread Сергій Загорія

Сергій Загорія  added the comment:

So the workaround is

for i in range(len(list_generated)):
  list_generated[i]=list(tuple(list_generated[i]))

--

___
Python tracker 

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



[issue2259] Poor support other than 44.1khz, 16bit audio files?

2011-07-20 Thread R. David Murray

R. David Murray  added the comment:

Well, if the test doesn't fail before applying the remainder of the patch, then 
it doesn't test the bits that haven't been applied yet.

I don't know enough about aifc to construct a test that fails or to understand 
the remainder of the fix well enough to feel comfortable committing it 
*without* a test that fails first.  So I'm hoping someone else will be able to 
figure it out :)  Thanks for trying.

--

___
Python tracker 

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



[issue12597] List created by multiplication behaves different

2011-07-20 Thread Sandro Tosi

Sandro Tosi  added the comment:

Hi,
no it's not a bug :)

What you actually get with [[0]]*3 is a list of 3 references to the same list, 
[0]:

>>> a = [[0], [0], [0]]
>>> b = [[0]]*3
>>> for i in a: print(id(i))
... 
139807725184032
139807725300280
139807725300520
>>> for i in b: print(id(i))
... 
139807725324016
139807725324016
139807725324016

--
nosy: +sandro.tosi
resolution:  -> invalid
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



[issue12597] List created by multiplication behaves different

2011-07-20 Thread Сергій Загорія

New submission from Сергій Загорія :

Next code:

def ill(row):
  row[1]=1
list_manual=[[0,0,0],[0,0,0],[0,0,0]]
list_generated=[[0,0,0]]*3
ill(list_manual[1])
print(list_manual)
ill(list_generated[1])
print(list_generated)

Will output:

[[0, 0, 0], [0, 1, 0], [0, 0, 0]]
[[0, 1, 0], [0, 1, 0], [0, 1, 0]]

Is it a bug?

--
messages: 140753
nosy: xintx-ua
priority: normal
severity: normal
status: open
title: List created by multiplication behaves different
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1, 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



[issue12596] cPickle - stored data differ for same dictionary

2011-07-20 Thread Philipp Mölders

Philipp Mölders  added the comment:

The file on disk matters for a replication service, so if a file is touched but 
not changed it will not be replicated, but in this special case the data change 
even when the structures have not changed. So if this happens very often it 
could cause a lot of replication which is not needed because nothing changed.

--

___
Python tracker 

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



[issue12596] cPickle - stored data differ for same dictionary

2011-07-20 Thread R. David Murray

R. David Murray  added the comment:

If the load produces the same result, why does it matter that what is on disk 
differs?

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



[issue12596] cPickle - stored data differ for same dictionary

2011-07-20 Thread Philipp Mölders

Changes by Philipp Mölders :


--
type:  -> behavior

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



[issue12596] cPickle - stored data differ for same dictionary

2011-07-20 Thread Philipp Mölders

New submission from Philipp Mölders :

I think there is a problem within cPickle. I wanted to store a dictionary with 
only one entry with cPickle.dump() this works fine and can be loaded with 
cPickle.load(). But if you store the loaded data with cPickle.dump() again, the 
stored data differ from the first stored data. But the load works fine only the 
written data on disk differ. I've written a sample script, that shows the 
problem within code. 
This problem occurs only in the 2.7 version of Python and only with 
dictionaries with one entry.

--
components: None
files: cPickletest.py
messages: 140750
nosy: Philipp.Mölders
priority: normal
severity: normal
status: open
title: cPickle - stored data differ for same dictionary
versions: Python 2.7
Added file: http://bugs.python.org/file22706/cPickletest.py

___
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-20 Thread Éric Araujo

Éric Araujo  added the comment:

I temporarily retract my request for addition of build_distinfo.

Other build_spam/install_spam commands have clear responsibilities: build 
creates files, install moves them.  This is the classic make/make install 
division of work, where you may want to run build frequently when updating C 
code, and you may want to run install as root.

For the dist-info files, we’ve seen that the RECORD file cannot be generated at 
build time, only install time, so splitting a build_distinfo command out of 
install_distinfo does not make sense.

The develop command can continue to call install_distinfo in the build dir, 
writing a RECORD file containing only the path to the pth file.  (Let’s 
continue that discussion on the develop bug.)

For the test command, we could either require people to run develop, or run 
install_distinfo in the build dir.  I think the latter is nicer.  Who wants to 
make a patch for that?

For the resources API, which should work even in an unbuilt checkout or 
unarchived tarball, that’s another bug.

--
resolution:  -> later
stage: needs patch -> 

___
Python tracker 

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



[issue665194] datetime-RFC2822 roundtripping

2011-07-20 Thread R. David Murray

R. David Murray  added the comment:

Fixed a bug (parsedate_to_datetime wasn't producing naive datetimes for -) 
and checked this in.

Note that I have added Alexander's 'localtime' function to email.utils in my 
feature branch/pypi release, to facilitate testing date headers.  If localtime 
gets added to datetime before 3.3 I'll remove it from email.utils.  The email 
package itself does not depend on having localtime, but it will be wanted by 
application programs that use email.

--
dependencies:  -Add aware local time support to datetime module
resolution:  -> accepted
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue12581] Increased test coverage of test_urlparse

2011-07-20 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +eric.araujo
versions: +Python 2.7, Python 3.2

___
Python tracker 

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



[issue665194] datetime-RFC2822 roundtripping

2011-07-20 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 5f7b03dcd523 by R David Murray in branch 'default':
#665194: support roundtripping RFC2822 date stamps in the email.utils module
http://hg.python.org/cpython/rev/5f7b03dcd523

--
nosy: +python-dev

___
Python tracker 

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



[issue12595] python.h redundant redeclarations

2011-07-20 Thread Tobias Pfaff

New submission from Tobias Pfaff :

Compiling 'Python.h' with g++ and -Wredundant-decls produces warnings

Testcase:

test.cpp:
#include 
int main() { return 0; }

g++ test.cpp -I/usr/include/python3.2mu/ -Wredundant-decls
In file included from /usr/include/python3.2mu/Python.h:106,
 from test.cpp:1:
/usr/include/python3.2mu/pyerrors.h:73: warning: redundant redeclaration of 
‘void Py_FatalError(const char*)’ in same scope
/usr/include/python3.2mu/pydebug.h:29: warning: previous declaration of ‘void 
Py_FatalError(const char*)’

--
components: Build
messages: 140746
nosy: verticalduck
priority: normal
severity: normal
status: open
title: python.h redundant redeclarations
type: compile error
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



[issue11176] give more meaningful argument names in argparse documentation

2011-07-20 Thread Éric Araujo

Éric Araujo  added the comment:

> I worked on this some time ago; the problem was the size of the
> documentation, i.e. it was difficult to stay consistent.
I think it’s okay to improve the docs one patch at a time, starting with the 
simple example referenced in the first message in this bug report, and 
gradually improving other sections.  Do you have a diff with your work, so that 
your efforts can serve as a base for someone else?

> Do I have time for this?  Yes, but I wouldn't get it done anytime
> soon, and the results could be anywhere from good to bad.
That’s why we do reviews :)  It’s okay if you don’t have time, I’m interested 
in working on this some time in the future.

--
assignee: docs@python -> eric.araujo

___
Python tracker 

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



[issue12594] Docs for py3k still refer to "MacPython 2.5 folder"

2011-07-20 Thread Christoph Schindler

New submission from Christoph Schindler :

In http://docs.python.org/py3k/using/mac.html#getting-and-installing-macpython 
and 
http://docs.python.org/py3k/using/mac.html#distributing-python-applications-on-the-mac
 .

--
assignee: docs@python
components: Documentation
messages: 140744
nosy: docs@python, hop
priority: normal
severity: normal
status: open
title: Docs for py3k still refer to "MacPython 2.5 folder"
versions: Python 3.1, Python 3.2

___
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-20 Thread Éric Araujo

Éric Araujo  added the comment:

The patch looks good.  I can’t comment on details of the C code, but I’ve seen 
the changed Python code and the tests and I like this.

--
nosy: +eric.araujo

___
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-20 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
components: +Library (Lib)
stage:  -> patch review

___
Python tracker 

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



[issue7620] Vim syntax highlight

2011-07-20 Thread Éric Araujo

Éric Araujo  added the comment:

Thanks for your willingness to contribute to Python and your work on a patch.  
We’re currently debating whether we should update or remove the Misc/Vim files, 
on #9893, so if we reach an agreement that maintaining these files is too 
costly for little benefit, you will have worked in vain.  Sorry if that 
happens, and I hope you’ll find other bugs where your patches will be accepted.

--
nosy: +eric.araujo

___
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-20 Thread Éric Araujo

Changes by Éric Araujo :


Added 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



[issue8728] 2.7 regression in httplib.py: AttributeError: 'NoneType' object has no attribute 'makefile'

2011-07-20 Thread Éric Araujo

Éric Araujo  added the comment:

If possible, the code example would use only Python, not httplib2 or Active 
State Python :)

--
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-20 Thread Michael Foord

Michael Foord  added the comment:

So if we do import time *or* test load time parameterisation then we can do 
separate failure reporting. We may still want to improve "test selection" for 
parameterised tests.

There are use cases for run time parameterisation (for example generating tests 
from a database that is only available during the test run was one use case 
someone has that can't be met by early parameterisation).

If we do run time parameterisation then I think we can only maintain 
compatibility with existing uses of test suites by having a single test case 
instance per parameterised test, and single combined failure report.

I would prefer *not* to add run time parameterisation.

--

___
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-20 Thread Michael Foord

Michael Foord  added the comment:

Dammit, I've reversed my thinking in some of those messages. Load time 
parameterisation *does* give you separate test reporting. It is run time 
parameterisation that doesn't.

Depending on how you do it (i.e. if the decorator generates the tests and 
attaches them as TestCase methods) you can do it at import time. And then 
normal test selection works if you know the test name.

--

___
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-20 Thread Michael Foord

Michael Foord  added the comment:

Test selection would require load time parameterisation - although the current 
test selection mechanism is through importing which would probably *not* work 
without a specific fix. Same for run time parameterisation.

Well how *exactly* you generate the names is an open question, and once you've 
solved that problem it should be no harder to show them clearly in the failure 
message with a "single test report" than with multiple test reports.

The way to generate the names is to number each test *and* show the 
parameterised data as part of the name (which can lead to *huge* names if 
you're not careful - or just object reprs in names which isn't necessarily 
useful). I have a decorator example that does runtime parameterisation, 
concatenating failures to a single report but still keeping the generated name 
for each failure.

Another issue is whether or not parameterised tests share a TestCase instance 
or have separate ones. If you're doing load time generation it makes sense to 
have a separate test case instance, with setUp and tearDown run individually. 
This needs to be clearly documented as the parameter generation would run 
against an uninitialised (not setUp) testcase.

Obviously reporting multiple test failures separately (run time 
parameterisation) is a bit nicer, but runtime test generation doesn't play well 
with anything that works with test suites - where you expect all tests to be 
represented by a single test case instance in the suite. I'm not sure that's a 
solveable problem.

--

___
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-20 Thread R. David Murray

R. David Murray  added the comment:

The reporting piece, and ideally being able to use the arguments to unittest to 
run a single one of the parameterized tests.  (I can get the reporting piece 
now using the locals() hack, but that doesn't support test selection).  Does 
test selection support required load time parameterization?

--

___
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-20 Thread R. David Murray

R. David Murray  added the comment:

Michael, would your "single test" clearly indicate all the individual failures 
by name?  If not, then I would not find it useful.  I can already easily 
"parameterize" inside a single test using a loop, it's the detailed reporting 
piece that I want support for.

--

___
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-20 Thread Michael Foord

Michael Foord  added the comment:

And yes, parameterising test cases is a different issue. bzr does this IIRC. 
This is easier in some ways, and can be done through load_tests, or any other 
test load time mechanism.

--

___
Python tracker 

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



[issue12524] change httplib docs POST example

2011-07-20 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

Thanks for the patch, Bharadwaj.

--

___
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-20 Thread Michael Foord

Michael Foord  added the comment:

*If* we add this to unittest then we need to decide between test load time 
parameterised tests and test run time parameterisation. 

Load time is more backwards compatible / easier (all tests can be generated at 
load time and the number of tests can be known). Run time is more useful. (With 
load time parameterisation the danger is that test generation can fail so we 
need to have the test run not bomb out in this case.)

A hack for run time parameterisation is to have all tests represented by a 
single test but generate a single failure that represents all the failures. I 
think this would be an acceptable approach. It could still be done with a 
decorator.

--

___
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-20 Thread R. David Murray

R. David Murray  added the comment:

Brian, if you don't have time to work on it in the next little while, maybe you 
could post your partial patch in case someone else wants to work on it?  Might 
be a good project for someone on the mentoring list.

Unless someone sees a clever way to implement both with the same mechanism, 
parameterizing test cases should probably be a separate issue.  Doing it via 
subclassing is straightforward, which also argues for a separate issue, since 
an 'is this worth it' discussion should be done separately for that feature.

--

___
Python tracker 

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



[issue12524] change httplib docs POST example

2011-07-20 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset ab4d403cb0c0 by Senthil Kumaran in branch '3.2':
Fix closes issue12524 - update http.client POST example with a working example.
http://hg.python.org/cpython/rev/ab4d403cb0c0

New changeset bc71fff2b6c7 by Senthil Kumaran in branch 'default':
merge from 3.2 - Fix closes issue12524 - update http.client POST example with a 
working example.
http://hg.python.org/cpython/rev/bc71fff2b6c7

New changeset b754641a429f by Senthil Kumaran in branch '2.7':
merge from 3.2 - Fix closes issue12524 - update http.client POST example with a 
working example. - Patch contributed by Bharadwaj
http://hg.python.org/cpython/rev/b754641a429f

--
nosy: +python-dev
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue7897] Support parametrized tests in unittest

2011-07-20 Thread R. David Murray

Changes by R. David Murray :


--
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-20 Thread Brian Curtin

Brian Curtin  added the comment:

By this issue existing, that's the decision that we should probably do this, 
and I think the discussion shows we agree it should happen. How it's done is 
another way, and we have roughly a year to get it figured out before 3.3 gets 
closer.

I have a patch that implements this as a decorator, but it's out of date by now 
and not feature complete. It's on my todo list of patches to revive.

--
components: +Tests
stage:  -> needs patch
versions: +Python 3.3 -Python 2.7, Python 3.2

___
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-20 Thread Austin Bingham

Austin Bingham  added the comment:

Has a decision been made to implement some form of parametric tests? Is working 
being done?

Along with parameterizing individual test methods, I'd also like to throw out a 
request for parametric TestCases. In some cases I find that I want the behavior 
of setUp() or tearDown() to vary based on some set of parameters, but the 
individual tests are not parametric per se.

--
nosy: +abingham

___
Python tracker 

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



[issue12560] libpython.so not built on OpenBSD

2011-07-20 Thread Stefan Krah

Changes by Stefan Krah :


--
nosy: +rpointel

___
Python tracker 

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



[issue12593] define OpenBSD in configure.in if Py_ENABLE_SHARED == 1

2011-07-20 Thread Stefan Krah

Stefan Krah  added the comment:

This is a duplicate of #12560.

--
nosy: +skrah
resolution:  -> duplicate
stage:  -> committed/rejected
status: open -> closed
superseder:  -> libpython.so not built on OpenBSD
type:  -> behavior

___
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-20 Thread R. David Murray

R. David Murray  added the comment:

It might.  Although I did miss your message about the flag, my point really was 
that you'll find that import is very complicated when you try to write the 
patch to do it.  There may not be one central place you can set and query that 
flag, because of the various ways import can happen and the byzantine nature of 
the import code.  It doesn't seem likely that anyone on the current team is 
going to tackle tying this, but you are welcome to.  We always need more 
contributors.  Just bear in mind that we weigh the benefits of patches against 
the additional code complexity they introduce (if they do; the most fortunate 
patches simplify things).  I think that's what Brett meant by "probably not 
worth it".

Brett wrote importlib to move a lot of the complication into Python code where 
it would be easier to work with.  That transition hasn't happened yet.  I hear 
that the import-sig is talking about doing some interesting things to 
(hopefully) make life better for everyone, so you might want to sign on there 
and find out what is going on before starting on a patch.

--
priority: normal -> low
stage:  -> needs patch
type:  -> feature request

___
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-20 Thread R. David Murray

R. David Murray  added the comment:

This isn't a problem with ConfigParser, it's a problem with the text file 
object returned by Subprocess.  You can reproduce the bug by trying to iterate 
over the TextIOWrapper returned by subprocess.

(It is true, however, that the ConfigParser docs should be specific that it 
isn't "any file", but "any text file".  If you would like to open a separate 
issue about that, that would be great).

--
nosy: +gregory.p.smith, haypo, lukasz.langa, pitrou, r.david.murray
stage:  -> needs patch
title: configparser can't read_file the output of subprocess.Popen -> text 
files returned by subprocess.Popen with universal_newlines=True are not iterable
type:  -> behavior
versions: +Python 3.3

___
Python tracker 

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



[issue12593] define OpenBSD in configure.in if Py_ENABLE_SHARED == 1

2011-07-20 Thread rpointel

New submission from rpointel :

Hi,

Could you define OpenBSD in enable_shared section of the configure.in ?

I just tested with Python 3.2.1, but it could be usefull to add it in the other 
versions of Python 3.x.

This is the diff which seems to work :

--- configure.in.orig   Sat Jul  9 08:58:56 2011
+++ configure.inWed Jul 20 10:19:37 2011
@@ -755,7 +755,7 @@
  PY3LIBRARY=libpython3.so
  fi
   ;;
-Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*)
+Linux*|GNU*|NetBSD*|FreeBSD*|OpenBSD*|DragonFly*)
  LDLIBRARY='libpython$(LDVERSION).so'
  BLDLIBRARY='-L. -lpython$(LDVERSION)'
  RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}

Thanks a lot,

Remi.

--
components: Installation
messages: 140725
nosy: rpointel
priority: normal
severity: normal
status: open
title: define OpenBSD in configure.in if Py_ENABLE_SHARED == 1
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



[issue12592] modify configure.in to detect OpenBSD 5.x

2011-07-20 Thread rpointel

New submission from rpointel :

Hi,
I tested to build Python 2.7 and Python 3.2.1 (it would be the same with others 
versions of Python) and it failed to build on OpenBSD 5.0 (beta version).

This is the diff to correctly work on OpenBSD 5.x:

--- configure.in.orig   Sat Jul  9 08:58:56 2011
+++ configure.inWed Jul 20 10:19:37 2011
@@ -320,7 +320,7 @@
 # As this has a different meaning on Linux, only define it on OpenBSD
 AC_DEFINE(_BSD_SOURCE, 1, [Define on OpenBSD to activate all library 
features])
 ;;
-  OpenBSD/4.@<:@789@:>@)
+  OpenBSD/4.@<:@789@:>@ | OpenBSD/5.*)
 # OpenBSD undoes our definition of __BSD_VISIBLE if _XOPEN_SOURCE is
 # also defined. This can be overridden by defining _BSD_SOURCE
 # As this has a different meaning on Linux, only define it on OpenBSD

Could you add this modification in the different versions of Python ?

Thanks a lot,

Remi.

--
components: Installation
messages: 140724
nosy: rpointel
priority: normal
severity: normal
status: open
title: modify configure.in to detect OpenBSD 5.x
versions: Python 2.7, Python 3.2

___
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-20 Thread STINNER Victor

STINNER Victor  added the comment:

> So I'd suggest forgetting about this part.

If someone really wants this feature (relative seek of more than 2^63), he/she 
should open a new issue.

This issue remembers me a mktime() issue: mktime() may return -1 even if it is 
not an error. time_mktime() uses now a sentinel to detect an error:

buf.tm_wday = -1;  /* sentinel; original value ignored */
tt = mktime(&buf);
/* Return value of -1 does not necessarily mean an error, but tm_wday
 * cannot remain set to -1 if mktime succeeded. */
if (tt == (time_t)(-1) && buf.tm_wday == -1) /* OverflowError */

For lseek, we can rely on errno. Try something like that:

errno = 0;
offset = lseek(...);
if (offset == (off_t)-1 && errno) /* error */

We can write a test using a sparse file... Or maybe a mmap object?

--

___
Python tracker 

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



[issue12524] change httplib docs POST example

2011-07-20 Thread Bharadwaj

Changes by Bharadwaj :


Added file: http://bugs.python.org/file22704/http_example2.diff

___
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-20 Thread Ram Rachum

Ram Rachum  added the comment:

David, I don't think you've read my message carefully enough. I'm well aware 
that there are other ways in Python to import than the `import` statement. I'm 
proposing that it doesn't matter.

I asked, "isn't a circular import when you try to import a module `foo` while 
in a lower stack level you haven't finished importing `foo` yet?" If this is 
true, then you just need to have some kind of flag for each module saying "This 
module is currently being imported", which you set to `True` when you start 
importing and back to `False` when you finished importing. (It doesn't have to 
look exactly like this, it could be a context manager, or alternatively a 
centralized list of all module that are currently in the middle of an import.) 
Then when you have an `ImportError`, you check whether the module that the user 
tried to import has that flag raised, and if so notify him that it's probably a 
circular import problem.

Will that work?

--

___
Python tracker 

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