[issue13801] The Python 3 Docs don't highlight nonlocal

2012-08-25 Thread Ezio Melotti

Ezio Melotti added the comment:

Sphinx is configured to use Python3Lexer (highlight_language is set to 
'python3' in Doc/conf.py).
'nonlocal' is not highlighted because in the pygments version that we are using 
'nonlocal' is missing in Python3Lexer.tokens['keywords'] see 
(Doc/tools/pygments/lexers/agile.py:196).
If this is fixed in more recent pygments versions, we only have to update our 
version.

--

___
Python tracker 

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



[issue15767] add ModuleNotFoundError

2012-08-25 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



[issue12890] cgitb displays tags when executed in text mode

2012-08-25 Thread Ezio Melotti

Ezio Melotti added the comment:

What about closing the  too (see attached patch)?
(I know the  is not necessary, but I prefer to add it.)

--
Added file: http://bugs.python.org/file27005/issue12890.diff

___
Python tracker 

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



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

2012-08-25 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Here is a patch that documents and adds tests for the existing behavior (i.e. 
keeping the current behavior the same).

I also expanded the patch slightly to cover related edge cases that involve the 
interplay between whitespace, empty lines, and indenting (some of which came 
out of the discussions above).

--
keywords: +needs review
type: behavior -> enhancement
Added file: http://bugs.python.org/file27004/issue-15510-3.patch

___
Python tracker 

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



[issue11776] Constructor signatures missing in types module documentation

2012-08-25 Thread Ezio Melotti

Ezio Melotti added the comment:

> We decided to leave it to the review process to determine the exact wording.

The problem with the current wording is that it explain how to use it (in case 
it's used to create a new mapping proxy), but doesn't say much about the object 
itself (in case it's used for isinstance/issubclass checks).

This consideration can also be applied to the rest of the patch.  Currently the 
types are documented as if they were only useful for isinstance/issuclass 
checks and the arguments are omitted from the doc.  Given that this is the main 
use case IMHO, it makes sense having a lightweight list of types with a short 
description of what they are.
OTOH these types can also be used to create new objects, so for this use case 
the arguments should be listed and documented.

I'm not sure if these two use cases should be kept separate or not though.  One 
possible way to do this is to have a table, followed by the full doc with 
arguments and explanation.  The table will also be useful as an index to jump 
to the full doc, and as a quick overview of the available types.

Something like:

The following table summarizes the types defined in the types module.  
Typical use is of these names is for isinstance() or issubclass() checks.

--- 
Type Name   Type of
--- 
MethodType  methods of user-defined instances
CodeTypecode objects such as returned by :func:`compile`
... ...
--- 


These types can also be used to create new objects:

.. class:: MethodType(function, instance)

   Create a bound instance method object.

.. class:: CodeType(argcount, kwonlyargcount, nlocals, stacksize, flags, 
codestring, constants, names, varnames, filename, name, firstlineno, lnotab)

   Create a code object. Not for the faint of heart.

--

___
Python tracker 

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



[issue11776] Constructor signatures missing in types module documentation

2012-08-25 Thread Mike Hoy

Mike Hoy added the comment:

Ezio Melotti was the one that offered to change the wording on MappingProxyType 
doc

--

___
Python tracker 

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



[issue15749] cgitb prints html for text when display disabled.

2012-08-25 Thread aliles

aliles added the comment:

Not an exact duplicate, although I should have seen that issue. Oops.

The 'display' and 'logdir' arguments are independent. Although I do appear to 
have gone a little overboard and fixed 12890 issue as well. Should I wait for 
that fix to be merged then reissue the patch?

--

___
Python tracker 

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



[issue11776] Constructor signatures missing in types module documentation

2012-08-25 Thread Mike Hoy

Mike Hoy added the comment:

I've added a completed patch for review. There was some talk on IRC that the 
wording for MappingProxyType should be changed to: "Return a read-only view of 
the given mapping."

We decided to leave it to the review process to determine the exact wording.

--
Added file: http://bugs.python.org/file27003/signatures-full-patch.diff

___
Python tracker 

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



[issue15749] cgitb prints html for text when display disabled.

2012-08-25 Thread Éric Araujo

Éric Araujo added the comment:

Thanks for the report and patch.  Is this a duplicate of #12890?

--
nosy: +eric.araujo

___
Python tracker 

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



[issue15753] No-argument super in method with variable arguments raises SystemError

2012-08-25 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



[issue15720] move __import__() out of the default lookup chain

2012-08-25 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



[issue15781] test_threaded_import fails with -j4

2012-08-25 Thread Stefan Krah

Stefan Krah added the comment:

On the i7 machine with hyper-threading the issue occurs since
edb9ce3a6c2e.


The tests also got slower:

3430d7329a3b:

$ time ./python -m test -uall -v  test_threaded_import

real0m3.195s
user0m0.656s
sys 0m0.284s


edb9ce3a6c2e:

$ time ./python -m test -uall -v  test_threaded_import

real0m24.032s
user0m0.880s
sys 0m0.744s


Here most of the time is spent in test_parallel_meta_path.


DISCLAIMER: This machine runs Debian Wheezy, which is not
stable yet! On the other hand the Windows bot also reproduced
the issue.

--

___
Python tracker 

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



[issue15784] OSError.__str__() should distinguish between errno and winerror

2012-08-25 Thread Richard Oudkerk

Changes by Richard Oudkerk :


Removed file: http://bugs.python.org/file27001/winerror.patch

___
Python tracker 

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



[issue15784] OSError.__str__() should distinguish between errno and winerror

2012-08-25 Thread Richard Oudkerk

Changes by Richard Oudkerk :


Added file: http://bugs.python.org/file27002/winerror.patch

___
Python tracker 

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



[issue15784] OSError.__str__() should distinguish between errno and winerror

2012-08-25 Thread Richard Oudkerk

New submission from Richard Oudkerk:

Since WindowsError became an alias of OSError, the error number shown in the 
stringification of an OSError err can either be a windows error code 
(err.winerror) or a posix style error number (err.errno), with no way to tell 
which.

For instance in

  >>> os.read(999, 0)
  Traceback (most recent call last):
File "", line 1, in 
  OSError: [Errno 9] Bad file descriptor

err.errno == EBADF == 9 and err.winerror == None, but in

  >>> _winapi.ReadFile(999, 0)
  Traceback (most recent call last):
File "", line 1, in 
  OSError: [Error 6] The handle is invalid

err.errno == EBADF == 9 and err.winerror == ERROR_INVALID_HANDLE == 6.  
(winerror gets priority over errno if it exists.)

With the attached patch the second will be shown as

  >>> _winapi.ReadFile(999, 0)
  Traceback (most recent call last):
File "", line 1, in 
  OSError: [WinError 6] The handle is invalid
^^^

Since this issue only applies to 3.3 and the patch is trivial, it would be nice 
to get this in before 3.3 is released.

--
files: winerror.patch
keywords: patch
messages: 169153
nosy: pitrou, sbt
priority: normal
severity: normal
status: open
title: OSError.__str__() should distinguish between errno and winerror
Added file: http://bugs.python.org/file27001/winerror.patch

___
Python tracker 

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



[issue14649] doctest.DocTestSuite error misleading when module has no docstrings

2012-08-25 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Small tweak to a code comment in the patch (`tests` is not itself a 
unittest.TestSuite instance).

--
Added file: http://bugs.python.org/file27000/issue-14649-4.patch

___
Python tracker 

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



[issue15781] test_threaded_import fails with -j4

2012-08-25 Thread Eric Snow

Eric Snow added the comment:

(sorry, only saw the first couple messages)

--

___
Python tracker 

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



[issue15781] test_threaded_import fails with -j4

2012-08-25 Thread Eric Snow

Eric Snow added the comment:

So this was a random one-off (hardly even intermittent) failed test that passed 
on the retry.  Ah, threads.  Is there an easy way to find all other failures in 
test_threaded_import in the past, for this and for all buildbots?  Do we have 
information about load during tests?  Is there an easy way to run the test 
suite under load on a build bot?

With a large enough sample size we can make more sense of this.  For instance, 
do failures predate the addition of per-module import locks or the importlib 
migration in 3.3?  Are failures limited to particular platforms?  Is the 
problem load related?

BTW, test_threaded_import had another (different) failure a week ago on 
FreeBSD: issue15599.

--
nosy: +eric.snow

___
Python tracker 

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



[issue15222] mailbox.mbox writes without empty line after each message

2012-08-25 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
keywords: +needs review
stage:  -> patch review
Added file: 
http://bugs.python.org/file26999/issue15222_v1_0002_insert_blank_after_each_message_in_mbox.patch

___
Python tracker 

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



[issue15222] mailbox.mbox writes without empty line after each message

2012-08-25 Thread Petri Lehtinen

Petri Lehtinen added the comment:

Attaching two patches.

Patch 1 changes the common message template in mailbox tests to end in a 
newline. If this wasn't done, more or less all common mailbox tests would have 
to be special cased for mbox.

Patch 2 adds a single blank line after each message in mbox. A single blank 
line is added if the added message doesn't end in a newline or ends in a single 
newline. When read back, a single newline is added to the end o the message if 
it wasn't there (and this is the reason why patch 1 is needed).

--
keywords: +patch
Added file: 
http://bugs.python.org/file26998/issue15222_v1_0001_end_test_msg_template_in_newline.patch

___
Python tracker 

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



[issue15136] Decimal accepting Fraction

2012-08-25 Thread Terry J. Reedy

Terry J. Reedy added the comment:

After reading the comments, I am ambivalent about a conversion function, and 
given the lack of consensus or even a clear majority, -1. (Which implies a 
change in issue title.)

I am +1 on using the new .format() machinery to have fractions format 
themselves. (Unless Python already does so for other purposes, it should do so 
without importing decimal.) The uploaded function passes the included test 
cases. I guess the rounding should be whatever we do for floats. I fudged that 
in the example.

--
Added file: http://bugs.python.org/file26997/fracdec.py

___
Python tracker 

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



[issue14649] doctest.DocTestSuite error misleading when module has no docstrings

2012-08-25 Thread Chris Jerdonek

Chris Jerdonek added the comment:

> Personally I prefer to have the test case create the file(s) used in the test 
> dynamically, writing them to the temporary working directory.

I prefer that too, but when I approached this issue, I found that test_doctest 
doesn't use unittest.  It uses only doctest tests to test itself, and it uses 
checked-in files to test things like DocTestSuite and DocFileSuite.  For 
example, test_DocFileSuite has this:

>>> suite = doctest.DocFileSuite('test_doctest.txt',
...  'test_doctest2.txt',
...  'test_doctest4.txt')

(Hence the eight supporting files I mentioned in my previous comment, of which 
these are three.)

Should I break the current way of doing things for this module and introduce 
unittest and the first dynamically created files?

> We have in the past put notes in the doc that say "this may change in the 
> future", though that is usually about desired enhancements.

That's interesting.  It's like a "Will change in version ..." counterpart to 
"Changed in version "  Come to think of it, that could be a useful practice 
in general because it would let people future-proof their code more easily and 
give them incentives to upgrade.

To simplify things for the purposes of this issue, we can discuss adding such 
wording to earlier versions only if and when we actually change the future 
behavior.  I can create a separate issue to discuss changing future behavior 
once this issue is complete.

--

___
Python tracker 

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



[issue15783] decimal.localcontext(None) fails when using the C accelerator module

2012-08-25 Thread Mark Dickinson

Mark Dickinson added the comment:

Adding Raymond to the nosy, since he may know more about what was intended.

--
nosy: +rhettinger

___
Python tracker 

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



[issue15783] decimal.localcontext(None) fails when using the C accelerator module

2012-08-25 Thread Mark Dickinson

Mark Dickinson added the comment:

This doesn't strike me as something it's essential to resolve before 3.3.1.

And I agree that decimal.localcontext(None) looks peculiar.  I noticed this 
yesterday when looking at #15136 and dismissed it as an artifact of the 
implementation---I didn't think to check what the docs said.  I think it's a 
bit unfortunate that the docs specify "ctx=None".  I doubt that too much 
thought went into that;  without knowing the history, I suspect that at the 
time it was just a way to indicate that the context was an optional argument.

IOW, my vote would be not to require that None is accepted, and to treat this 
as an minor error in the documentation.

--

___
Python tracker 

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



[issue15783] decimal.localcontext(None) fails when using the C accelerator module

2012-08-25 Thread Stefan Krah

Stefan Krah added the comment:

This is the complete list of context=None divergences. It would
be possible to change that, since most of the functions are
generated by macro wrappers.


# This is the only place where 'ctx' is used
localcontext(ctx=None)

canonical(self, context=None)
compare(self, other, context=None)
compare_signal(self, other, context=None)
exp(self, context=None)
fma(self, other, third, context=None)
is_normal(self, context=None)
is_subnormal(self, context=None)
ln(self, context=None)
log10(self, context=None)
logb(self, context=None)
logical_and(self, other, context=None)
logical_invert(self, context=None)
logical_or(self, other, context=None)
logical_xor(self, other, context=None)
max(self, other, context=None)
max_mag(self, other, context=None)
min(self, other, context=None)
min_mag(self, other, context=None)
next_minus(self, context=None)
next_plus(self, context=None)
normalize(self, context=None)
number_class(self, context=None)
quantize(self, exp, rounding=None, context=None, watchexp=True)
remainder_near(self, other, context=None)
rotate(self, other, context=None)
scaleb(self, other, context=None)
shift(self, other, context=None)
sqrt(self, context=None)
to_eng_string(self, context=None)
to_integral(self, rounding=None, context=None)
to_integral_value(self, rounding=None, context=None)
to_integral_exact(self, rounding=None, context=None)

context.power(self, a, b, modulo=None)

--

___
Python tracker 

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



[issue15783] decimal.localcontext(None) fails when using the C accelerator module

2012-08-25 Thread Mark Dickinson

Changes by Mark Dickinson :


--
nosy: +mark.dickinson

___
Python tracker 

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



[issue15783] decimal.localcontext(None) fails when using the C accelerator module

2012-08-25 Thread Stefan Krah

Stefan Krah added the comment:

> Can't this be fixed in the CONTEXT_CHECK_VA macro?

No, the macro should only allow contexts. E.g. in the case of localcontext(None)
context_copy(local, NULL) would be called on local=Py_None, which is undefined.

What would perhaps be needed for a nice C-API is a function like

   PyArg_ParseTupleSkipNone()

that treats None arguments in the same way as optional args that are
not given.

--

___
Python tracker 

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



[issue15783] decimal.localcontext(None) fails when using the C accelerator module

2012-08-25 Thread Stefan Krah

Stefan Krah added the comment:

OK, but for example:

Help on function __truediv__ in module decimal:

__truediv__(self, other, context=None)
Return self / other.

Here I think it's undisputed that a C version should not cram a context
argument into a number method. There are many functions in decimal where
some arguments are just implementation details, or worse, leftovers
(see #10650).

So I simply don't know if localcontext(None) was intended or (once)
an implementation detail.

localcontext(None) by itself looks kind of awkward to me. The only valid
use case I can see is indeed the one from #15136.

I don't particularly mind either way for localcontext(), but in more
speed sensitive areas I would care.

--

___
Python tracker 

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



[issue10650] decimal.py: quantize(): excess digits with watchexp=0

2012-08-25 Thread Stefan Krah

Changes by Stefan Krah :


--
keywords: +patch
Added file: http://bugs.python.org/file26996/issue10650.diff

___
Python tracker 

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



[issue10650] decimal.py: quantize(): excess digits with watchexp=0

2012-08-25 Thread Stefan Krah

Stefan Krah added the comment:

Here's a patch deprecating watchexp.

--

___
Python tracker 

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



[issue15783] decimal.localcontext(None) fails when using the C accelerator module

2012-08-25 Thread Ezio Melotti

Ezio Melotti added the comment:

Can't this be fixed in the CONTEXT_CHECK_VA macro?
With the attached patch decimal.localcontext(None) works and there aren't any 
failures, however I don't think there are tests that pass None explicitly, so 
this approach might not work.

--
keywords: +patch
nosy: +ezio.melotti
Added file: http://bugs.python.org/file26995/issue15783.diff

___
Python tracker 

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



[issue15783] decimal.localcontext(None) fails when using the C accelerator module

2012-08-25 Thread Nick Coghlan

Nick Coghlan added the comment:

While it's undocumented in the main docs [1], help(decimal.localcontext) in 3.2 
starts with:

localcontext(ctx=None)
Return a context manager for a copy of the supplied context

We essentially have two votes in favour of "it should work" (the pure Python 
impl and the docstring), and two in favour of "meh" (the prose docs and the 
lack of a test case)

I think we should fix it, but I don't mind if Georg wants it to wait until 3.3.1

[1] http://docs.python.org/py3k/library/decimal#decimal.localcontext

--

___
Python tracker 

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



[issue15783] decimal.localcontext(None) fails when using the C accelerator module

2012-08-25 Thread Stefan Krah

Stefan Krah added the comment:

The feature is undocumented though. Is it a regression?

There are other places as well. The topic was raised in msg153447 and
msg153506, with no further comments. So I concluded that None argument
support wasn't important.

--

___
Python tracker 

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



[issue15136] Decimal accepting Fraction

2012-08-25 Thread Nick Coghlan

Nick Coghlan added the comment:

There is indeed a regression in decimal.localcontext with the C accelerator: 
omitting the argument entirely still works, but passing None explicitly now 
fails. I created #15783 for that.

On the topic of this thread, I'm also -1 on conversion methods, but +1 on 
string formatting support.

There's an obvious benefit in providing the latter in order to get a better 
"feel" for the value of a rational number by displaying a Decimal 
approximation, but questionable benefit in providing the former.

Explicit conversion is sufficiently rare that I'm OK with the idea of either 
going via a string (as used to be necessary for binary floats) or by explicitly 
casting the numerator to Decimal, then dividing by the denominator (no need to 
cast them both).

--
nosy: +ncoghlan

___
Python tracker 

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



[issue15783] decimal.localcontext(None) fails when using the C accelerator module

2012-08-25 Thread Nick Coghlan

Nick Coghlan added the comment:

Georg, a regression in the decimal API relative to 3.2 got picked up by #15136. 
Are you OK with cherrypicking a fix for this into rc2?

--
nosy: +georg.brandl

___
Python tracker 

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



[issue15783] decimal.localcontext(None) fails when using the C accelerator module

2012-08-25 Thread Nick Coghlan

New submission from Nick Coghlan:

decimal.localcontext() works correctly with both the pure Python decimal module 
and the C accelerator.

decimal.localcontext(None) only works with the pure Python version. The C 
accelerator throws an exception instead of treating it as equivalent to 
omitting the argument.

--
keywords: 3.3regression
messages: 169135
nosy: ncoghlan, skrah
priority: normal
severity: normal
stage: test needed
status: open
title: decimal.localcontext(None) fails when using the C accelerator module
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



[issue15781] test_threaded_import fails with -j4

2012-08-25 Thread Stefan Krah

Stefan Krah added the comment:

Oh, and as usual, my machines have all CPUs at 100% load.

--

___
Python tracker 

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



[issue15781] test_threaded_import fails with -j4

2012-08-25 Thread Stefan Krah

Stefan Krah added the comment:

I can also reproduce it on the Core 2 machine with a ridiculuously
low switch interval:


 diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py
--- a/Lib/test/regrtest.py
+++ b/Lib/test/regrtest.py
@@ -198,6 +198,8 @@
 except ImportError:
 multiprocessing = None
 
+sys.setswitchinterval(0.0001)
+
 
 # Some times __path__ and __file__ are not absolute (e.g. while running from
 # Lib/) and, if we change the CWD to run the tests in a temporary dir, some

--

___
Python tracker 

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



[issue15781] test_threaded_import fails with -j4

2012-08-25 Thread Nick Coghlan

Nick Coghlan added the comment:

Up to 2279 runs without a failure here - yay for elusive hardware specific 
threading bugs :P

I'll leave it running overnight and see what happens.

--

___
Python tracker 

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



[issue15724] Add "versionchanged" to memoryview docs

2012-08-25 Thread Stefan Krah

Stefan Krah added the comment:

This was less work than expected. I suppose docs can always go in
even after rc1 is out, so I'll wait for that.

--
keywords: +patch
Added file: http://bugs.python.org/file26994/issue15724.diff

___
Python tracker 

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



[issue15776] Allow pyvenv to work in existing directory

2012-08-25 Thread Andrew Svetlov

Changes by Andrew Svetlov :


--
priority: release blocker -> critical
stage:  -> needs patch

___
Python tracker 

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



[issue15776] Allow pyvenv to work in existing directory

2012-08-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b200acb6bed4 by Andrew Svetlov in branch 'default':
Delete Misc/NEWS record for reverted #15776.
http://hg.python.org/cpython/rev/b200acb6bed4

--

___
Python tracker 

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



[issue15781] test_threaded_import fails with -j4

2012-08-25 Thread Stefan Krah

Stefan Krah added the comment:

I can only reproduce this on a Core i7. Native OS is Debian Wheezy,
also reproduced earlier on a FreeBSD VM hosted on that machine
(see msg167989). The machine has 4 physical cores, perhaps we
can blame hyper-threading. ;)


$ cat /proc/cpuinfo | grep "model name"
model name  : Intel(R) Core(TM) i7 CPU 930  @ 2.80GHz
model name  : Intel(R) Core(TM) i7 CPU 930  @ 2.80GHz
model name  : Intel(R) Core(TM) i7 CPU 930  @ 2.80GHz
model name  : Intel(R) Core(TM) i7 CPU 930  @ 2.80GHz
model name  : Intel(R) Core(TM) i7 CPU 930  @ 2.80GHz
model name  : Intel(R) Core(TM) i7 CPU 930  @ 2.80GHz
model name  : Intel(R) Core(TM) i7 CPU 930  @ 2.80GHz
model name  : Intel(R) Core(TM) i7 CPU 930  @ 2.80GHz



I can't reproduce it on a Core 2 Duo running Ubuntu natively.

--

___
Python tracker 

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



[issue12834] memoryview.to_bytes() and PyBuffer_ToContiguous() incorrect for non-contiguous arrays

2012-08-25 Thread Stefan Krah

Stefan Krah added the comment:

I agree that for 3.2 this isn't so important given that non-contiguous
arrays have multiple issues there.

Christian, does a fix for 3.2 benefit FreeImage? Don't you run into
other problems with memoryview?


If it helps, I can try to write a patch for 3.2.

--

___
Python tracker 

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



[issue12834] memoryview.to_bytes() and PyBuffer_ToContiguous() incorrect for non-contiguous arrays

2012-08-25 Thread Nick Coghlan

Nick Coghlan added the comment:

(Not saying this shouldn't be fixed, just saying it's not a disaster if it 
isn't)

--

___
Python tracker 

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



[issue12834] memoryview.to_bytes() and PyBuffer_ToContiguous() incorrect for non-contiguous arrays

2012-08-25 Thread Nick Coghlan

Nick Coghlan added the comment:

Despite my earlier comments, I'm now inclined to agree with Martin here - 
upgrading to 3.3 fixes so many other problems with memoryview, that's a more 
compelling solution.

And, of course, using NumPy instead always remains an option for more robust 
buffer API support in older versions.

--
priority: release blocker -> high

___
Python tracker 

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



[issue12834] memoryview.to_bytes() and PyBuffer_ToContiguous() incorrect for non-contiguous arrays

2012-08-25 Thread Martin v . Löwis

Martin v. Löwis added the comment:

The last bugfix release of 3.2 will happen "shortly" after the release of 3.3, 
so in a not-too-far future (compared to the age of this issue, which just had 
its first birthday yesterday).

So if this issue should really block 3.2 (which I still think it should not), 
I'd urge possible contributors to start working on it now - especially if this 
is going to be a large patch. If such patch introduces new bugs, it won't be 
possible to ever fix them (unless they are security-critical). Also note that 
this is almost the only release blocker for the 3.2 release, next to a 
easy-to-implement request to update the expat code.

--

___
Python tracker 

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



[issue15781] test_threaded_import fails with -j4

2012-08-25 Thread Nick Coghlan

Nick Coghlan added the comment:

No joy here either - currently at 704 successful runs and counting with 
Stefan's command line.

$ uname -a
Linux lancre 3.5.1-1.fc17.x86_64 #1 SMP Thu Aug 9 17:50:43 UTC 2012 x86_64 
x86_64 x86_64 GNU/Linux

$ cat /proc/cpuinfo | grep "model name"
model name  : Intel(R) Core(TM) i7-2677M CPU @ 1.80GHz
model name  : Intel(R) Core(TM) i7-2677M CPU @ 1.80GHz
model name  : Intel(R) Core(TM) i7-2677M CPU @ 1.80GHz
model name  : Intel(R) Core(TM) i7-2677M CPU @ 1.80GHz

--

___
Python tracker 

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



[issue15782] Compile error for a number of Mac modules with recent Xcode

2012-08-25 Thread Ronald Oussoren

New submission from Ronald Oussoren:

Recent versions of Xcode on OSX 10.7 and 10.8 fail to compile 3 of the 
extension modules in Mac/Modules: the modules for fm, qd and qdoffs.

That's because those extensions wrap APIs that are long deprecated and are no 
longer present.

The attached patch "fixes" the miscompilation by making most of the body of the 
extension empty when compiling with the 10.7 (or later) SDK.

This changes the API of these extension modules, but that cannot be helped 
because the platform APIs that are wrapped by these extensions are no longer 
present.

(Patch is not relevant for python 3.x because these extensions have been 
removed in python 3.0)

--
assignee: ronaldoussoren
components: Build, Macintosh
files: miscompile-mac-modules.txt
keywords: needs review
messages: 169123
nosy: ned.deily, ronaldoussoren
priority: normal
severity: normal
stage: patch review
status: open
title: Compile error for a number of Mac modules with recent Xcode
type: compile error
versions: Python 2.7
Added file: http://bugs.python.org/file26993/miscompile-mac-modules.txt

___
Python tracker 

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



[issue15781] test_threaded_import fails with -j4

2012-08-25 Thread Antoine Pitrou

Antoine Pitrou added the comment:

With
$ ./python -m test -uall -F -j16 -v test_threaded_import
I couldn't reproduce after 1000 test passes.

--

___
Python tracker 

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



[issue13370] test_ctypes fails when building python with clang

2012-08-25 Thread Ronald Oussoren

Ronald Oussoren added the comment:

The issue should be gone in the upcoming 3.3rc1 release and  the next stable 
releases of 3.2 and 2.7.

--
resolution:  -> fixed
status: open -> pending

___
Python tracker 

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



[issue13370] test_ctypes fails when building python with clang

2012-08-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 58a87c02692c by Ronald Oussoren in branch '2.7':
Fix issue 13370: Ensure that ctypes works on Mac OS X when Python is compiled 
using the clang compiler
http://hg.python.org/cpython/rev/58a87c02692c

New changeset a425f2697273 by Ronald Oussoren in branch '3.2':
Fix issue 13370: Ensure that ctypes works on Mac OS X when Python is compiled 
using the clang compiler
http://hg.python.org/cpython/rev/a425f2697273

New changeset bed8dd30309d by Ronald Oussoren in branch 'default':
Fix issue 13370: Ensure that ctypes works on Mac OS X when Python is
http://hg.python.org/cpython/rev/bed8dd30309d

--
nosy: +python-dev

___
Python tracker 

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



[issue15765] test_getcwd_long_pathnames (in test_posix) kills NetBSD

2012-08-25 Thread Stefan Krah

Stefan Krah added the comment:

I completely forgot about that issue. The patch looks good to me.

--

___
Python tracker 

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



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

2012-08-25 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
resolution:  -> invalid
status: open -> closed

___
Python tracker 

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



[issue15781] test_threaded_import fails with -j4

2012-08-25 Thread Stefan Krah

Stefan Krah added the comment:

The buildbot in question uses -j4, and I can reproduce this on Linux
with:

./python -m test -uall -F -j4 -v test_threaded_import


==
FAIL: test_parallel_meta_path (test.test_threaded_import.ThreadedImportTests)
--
Traceback (most recent call last):
  File "/home/stefan/hg/cpython/Lib/test/test_threaded_import.py", line 131, in 
test_parallel_meta_path
self.check_parallel_module_init()
  File "/home/stefan/hg/cpython/Lib/test/test_threaded_import.py", line 120, in 
check_parallel_module_init
self.assertFalse(errors)
AssertionError: [AttributeError("'module' object has no attribute 
'randrange'",), AttributeError("'module' object has no attribute 
'randrange'",)] is not false

--
Ran 6 tests in 4.221s

--
title: test_threaded_import fails on Windows -> test_threaded_import fails with 
-j4

___
Python tracker 

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



[issue15781] test_threaded_import fails on Windows

2012-08-25 Thread Nick Coghlan

Changes by Nick Coghlan :


--
nosy: +ncoghlan

___
Python tracker 

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



[issue15756] subprocess.poll() does not handle errno.ECHILD "No child processes"

2012-08-25 Thread Tshepang Lekhonkhobe

Changes by Tshepang Lekhonkhobe :


--
nosy: +tshepang

___
Python tracker 

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



[issue13370] test_ctypes fails when building python with clang

2012-08-25 Thread Ronald Oussoren

Ronald Oussoren added the comment:

Duh... 

3.3 without patch fails when I leave out '--with-pydebug'. I'm now running  the 
testsuite for 2.7 and 3.2 with patch and will commit once those are ready, 
which should be within an hour from now.

--

___
Python tracker 

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



[issue15781] test_threaded_import fails on Windows

2012-08-25 Thread Stefan Krah

New submission from Stefan Krah:

test_parallel_module_init() fails on Windows-64:

http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%203.x/builds/553/steps/test/logs/stdio

==
FAIL: test_parallel_module_init (test.test_threaded_import.ThreadedImportTests)
--
Traceback (most recent call last):
  File 
"C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\test_threaded_import.py",
 line 125, in test_parallel_module_init
self.check_parallel_module_init()
  File 
"C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\test_threaded_import.py",
 line 120, in check_parallel_module_init
self.assertFalse(errors)
AssertionError: [AttributeError("'module' object has no attribute 
'randrange'",)] is not false

--

--
components: Tests
messages: 169116
nosy: brett.cannon, haypo, jkloth, pitrou, skrah
priority: normal
severity: normal
status: open
title: test_threaded_import fails on Windows
type: behavior
versions: Python 3.3, Python 3.4

___
Python tracker 

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



[issue15573] Support unknown formats in memoryview comparisons

2012-08-25 Thread Stefan Krah

Stefan Krah added the comment:

Except for Misc/NEWS the patch can be committed unchanged. Please
go ahead!

[The remaining doc changes are tracked elsewhere.]

--

___
Python tracker 

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



[issue15573] Support unknown formats in memoryview comparisons

2012-08-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset afa3dedfee18 by Nick Coghlan in branch 'default':
Close #15573: use value-based memoryview comparisons (patch by Stefan Krah)
http://hg.python.org/cpython/rev/afa3dedfee18

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



[issue7475] codecs missing: base64 bz2 hex zlib hex_codec ...

2012-08-25 Thread Nick Coghlan

Changes by Nick Coghlan :


--
priority: release blocker -> high

___
Python tracker 

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



[issue15573] Support unknown formats in memoryview comparisons

2012-08-25 Thread Nick Coghlan

Nick Coghlan added the comment:

Stefan, was there something specific you wanted to do before committing? 
Otherwise I can commit it as soon as this full test run finishes.

--

___
Python tracker 

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



[issue15573] Support unknown formats in memoryview comparisons

2012-08-25 Thread Nick Coghlan

Nick Coghlan added the comment:

I'm currently on IRC and double checking the patch locally.

--

___
Python tracker 

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



[issue15573] Support unknown formats in memoryview comparisons

2012-08-25 Thread Stefan Krah

Stefan Krah added the comment:

Great, give me 20 minutes or so.

--

___
Python tracker 

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



[issue15573] Support unknown formats in memoryview comparisons

2012-08-25 Thread Stefan Krah

Stefan Krah added the comment:

> You can look at the attached memoryobject.c.gcov: *All* failure paths
> are taken since Python API functions are wrapped in macros that
> set PyExc_FailAPIError and return failure at predefined points
> the test suite.

That should read: With a patch that wraps Python API functions ...

Obviously the macros aren't in by default.

--

___
Python tracker 

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



[issue15573] Support unknown formats in memoryview comparisons

2012-08-25 Thread Georg Brandl

Georg Brandl added the comment:

Well, I'm not against you committing it as long as you commit it *right now*.  
I'm about to cut the tag.

--

___
Python tracker 

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



[issue15573] Support unknown formats in memoryview comparisons

2012-08-25 Thread Nick Coghlan

Nick Coghlan added the comment:

With Stefan's major improvements to the test suite for 3.3, the risk is low and 
I *really* don't want to spend the life of the 3.3 series excusing the current 
comparison behaviour.

By contrast, explaining the shift in definition as moving from raw memory 
comparisons to by value comparisons is relatively easy.

--

___
Python tracker 

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



[issue15573] Support unknown formats in memoryview comparisons

2012-08-25 Thread Stefan Krah

Stefan Krah added the comment:

The effect of the change is pretty minimal though: Previously
"not equal" was returned for unknown formats, now the struct
module figures it out.

memoryobject.c has 100% coverage except for a couple of lines
that are either impossible to reach or very hard to reach.

The new code is among the most heavily exercised lines, since
in test_buffer.py the verify() function always asserts equality.


You can look at the attached memoryobject.c.gcov: *All* failure paths
are taken since Python API functions are wrapped in macros that
set PyExc_FailAPIError and return failure at predefined points
the test suite.

--
Added file: http://bugs.python.org/file26992/memoryobject.c.gcov

___
Python tracker 

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



[issue15573] Support unknown formats in memoryview comparisons

2012-08-25 Thread STINNER Victor

STINNER Victor added the comment:

Even if I would prefer to see a fully working new implementation of the
buffer interface, I agree with Georg: it's too late for such huge change in
Python 3.3. Can' we wait Python 3.4 to change the equality operator?

It also took me three major releases to fix all Unicode issues (and it's
probably not finished :-)).
Le 24 août 2012 23:05, "Georg Brandl"  a écrit :

>
> Georg Brandl added the comment:
>
> I'm not very keen to hold up the release for long times again, especially
> for a patch of this size and lots of potential breakage.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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