[issue19957] Minor refactor of Lib/email/encoders.py

2013-12-11 Thread Vajrasky Kok

New submission from Vajrasky Kok:

In Lib/email/encoders.py:

def encode_7or8bit(msg):
"""Set the Content-Transfer-Encoding header to 7bit or 8bit."""
orig = msg.get_payload(decode=True)
if orig is None:
# There's no payload.  For backwards compatibility we use 7bit
msg['Content-Transfer-Encoding'] = '7bit'
return
# We play a trick to make this go fast.  If encoding/decode to ASCII
# succeeds, we know the data must be 7bit, otherwise treat it as 8bit.
try:
if isinstance(orig, str):
orig.encode('ascii')
else:
orig.decode('ascii')
except UnicodeError:
charset = msg.get_charset()


msg.get_payload(decode=True) always return bytes so there is no point of these 
lines:

if isinstance(orig, str):
orig.encode('ascii')
else:
orig.decode('ascii')

Attached the patch to refactor this function.

--
components: email
files: minor_refactor_encoders_in_email_lib.patch
keywords: patch
messages: 205944
nosy: barry, r.david.murray, vajrasky
priority: normal
severity: normal
status: open
title: Minor refactor of Lib/email/encoders.py
versions: Python 3.4
Added file: 
http://bugs.python.org/file33099/minor_refactor_encoders_in_email_lib.patch

___
Python tracker 

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



[issue19944] Make importlib.find_spec load packages as needed

2013-12-11 Thread Nick Coghlan

Nick Coghlan added the comment:

Actually, I think you make a good point. importlib.find_spec should use the
*import_module* signature (no path parameter, but with support for relative
imports). If it is exposed at all, the "one level only" single step version
should appear in importlib.machinery, not at the top level.

The current API exposes an implementation detail most users aren't going to
care about, but a "let me know if it exists but don't import it yet" API
that parallels the full dynamic import API is far more intuitive.

--

___
Python tracker 

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



[issue19955] When adding .PY and .PYW to PATHEXT, it replaced string instead of appending

2013-12-11 Thread Ned Deily

Changes by Ned Deily :


--
components: +Windows
nosy: +loewis

___
Python tracker 

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



[issue19956] inspect.getsource(obj.foo) fails when foo is an injected method constructed from another method

2013-12-11 Thread Muhammad Tauqir Ahmad

New submission from Muhammad Tauqir Ahmad:

If a method `foo` of object instance `obj` is injected into it using a method 
from a different object instance, `inspect.getsource(obj.foo)` fails with the 
error message:

TypeError: > is 
not a module, class, method, function, traceback, frame, or code object

in inspect.py:getfile()

What basically is happening is that if you have `obj1`, `obj2` and `obj2` has 
method `foo`, setting `obj1.foo = types.MethodType(obj2.foo, obj1)` succeeds 
but is "double-bound-method" if that's a term. So during `getsource()`, it 
fails because `obj1.foo.__func__` is a method not a function as is expected.

Possible solutions:
1. Error message should be more clear if this is the intended behavior - right 
now it claims it's not a method,function etc. when it is indeed a method.
2. MethodType() should fail if the first argument is not a function.
3. inspect.getsource() should recursively keep "unpacking" till it finds an 
object that it can get the source for. 

Reproducer attached.

--
components: Library (Lib)
files: reproducer.py
messages: 205942
nosy: mtahmed
priority: normal
severity: normal
status: open
title: inspect.getsource(obj.foo) fails when foo is an injected method 
constructed from another method
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file33098/reproducer.py

___
Python tracker 

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



[issue19955] When adding .PY and .PYW to PATHEXT, it replaced string instead of appending

2013-12-11 Thread nickhil rokkam

New submission from nickhil rokkam:

Following installer overwrote the PATHEXT string after selecting the "add to 
path" installation option.
http://www.python.org/ftp/python/3.3.3/python-3.3.3.amd64.msi

--
components: Installation
files: python-3.3.3.amd64.msi
messages: 205941
nosy: nickhil.rokkam
priority: normal
severity: normal
status: open
title: When adding .PY and .PYW to PATHEXT, it replaced string instead of 
appending
type: behavior
versions: Python 3.3
Added file: http://bugs.python.org/file33097/python-3.3.3.amd64.msi

___
Python tracker 

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



[issue15027] Faster UTF-32 encoding

2013-12-11 Thread Gregory P. Smith

Gregory P. Smith added the comment:

one comment to address on the review, otherwise after addressing that I believe 
this is ready to go in for 3.4.

--
nosy: +gregory.p.smith
priority: low -> normal

___
Python tracker 

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



[issue19828] test_site fails with -S flag

2013-12-11 Thread Zachary Ware

Zachary Ware added the comment:

Fixed.  Thank you Vajrasky for raising the issue, and David for the much better 
wording.

--
assignee:  -> zach.ware
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed
versions: +Python 3.3

___
Python tracker 

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



[issue19828] test_site fails with -S flag

2013-12-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 40884256f8dd by Zachary Ware in branch '3.3':
Issue #19828: Fixed test_site when the whole suite is run with -S.
http://hg.python.org/cpython/rev/40884256f8dd

New changeset 90834ad91d56 by Zachary Ware in branch 'default':
Issue #19828: Merge with 3.3
http://hg.python.org/cpython/rev/90834ad91d56

--
nosy: +python-dev

___
Python tracker 

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



[issue19944] Make importlib.find_spec load packages as needed

2013-12-11 Thread Eric Snow

Eric Snow added the comment:

It looks like there are two concepts at play though:

1. side-effect-free vs. may-have-side-effects
2. just-find-the-spec-dangit vs. 
find-the-spec-relative-to-submodule-search-locations-I-already-know

In the case of #1, providing the path is just a means to an end.  In contrast, 
for #2 providing the path is the whole point and side effects are something to 
which you may not have given any thought (but you probably aren't expecting 
them).

In both cases, it still boils down to (module name -> module spec).  To me, 
handling both with a single function and a keyword-only "path" parameter seems 
sufficient, as long as people don't miss the fact that there are side effects 
in the default case.

The tricky part is that this is not a high-use API, so I'm trying not to think 
in terms of common case.  (I'm tempted to say things like "in the common case 
you just want the spec and you don't care about that other stuff".)

--

___
Python tracker 

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



[issue19915] int.bit_at(n) - Accessing a single bit in O(1)

2013-12-11 Thread anon

anon added the comment:

Thank you! I will try to help in ways that I can such as testing.

--

___
Python tracker 

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



[issue19570] distutils' Command.ensure_dirname fails on Unicode

2013-12-11 Thread Doug Hellmann

Changes by Doug Hellmann :


--
nosy: +doughellmann

___
Python tracker 

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



[issue19921] Path.mkdir(0, True) always fails

2013-12-11 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> pitrou

___
Python tracker 

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



[issue19918] PureWindowsPath.relative_to() is not case insensitive

2013-12-11 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> pitrou

___
Python tracker 

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



[issue19887] Path.resolve() fails on complex symlinks

2013-12-11 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> pitrou

___
Python tracker 

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



[issue19928] Implement cell repr test

2013-12-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Zachary.

--

___
Python tracker 

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



[issue15027] Faster UTF-32 encoding

2013-12-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is updated patch, synchronized with trunk. UTF-32 encoder now checks 
surrogates and therefore speedup is less (only up to 5 times). But this 
compensates regression in 3.4.

On 32-bit Linux, Intel Atom N570 @ 1.66GHz:

Py3.3Py3.4patched

531 (+245%)  489 (+274%)  1831   encode  utf-32le  'A'*1
383 (+158%)  223 (+344%)  990encode  utf-32le  '\u0100'*1
325 (+262%)  229 (+414%)  1177   encode  utf-32le  '\U0001'*1

544 (+166%)  494 (+193%)  1448   encode  utf-32be  'A'*1
384 (+67%)   223 (+188%)  642encode  utf-32be  '\u0100'*1
323 (+108%)  229 (+193%)  671encode  utf-32be  '\U0001'*1

--
Added file: http://bugs.python.org/file33096/encode_utf32_3.patch

___
Python tracker 

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



[issue19732] python fails to build when configured with --with-system-libmpdec

2013-12-11 Thread Stefan Krah

Stefan Krah added the comment:

Matthias, my target is to release mpdecimal-2.4 on January 9th 2014.
I saw that you started to package mpdecimal-2.3:

http://packages.debian.org/pt/source/sid/misc/mpdecimal

I hope that it can be changed to 2.4:  Packaging 2.3 would create
some confusion, since one or two functions are not binary compatible
with 2.4 and of course 2.3 cannot be used for Python.

Starting from 2.4, the remainder of the 2.x.y series will stay
binary (and decimal.py) compatible.

--

___
Python tracker 

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



[issue19732] python fails to build when configured with --with-system-libmpdec

2013-12-11 Thread Stefan Krah

Stefan Krah added the comment:

Antoine Pitrou  wrote:
> Should be done now. Can you check they work fine?

Thank you! Works OK.

--

___
Python tracker 

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



[issue16669] Docstrings for namedtuple

2013-12-11 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
versions: +Python 3.5 -Python 3.4

___
Python tracker 

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



[issue18983] Specify time unit for timeit CLI

2013-12-11 Thread Julian Gindi

Julian Gindi added the comment:

Updated documentation and fixed a few lines that were too long.

--
Added file: http://bugs.python.org/file33095/issue18983_v6.patch

___
Python tracker 

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



[issue19063] Python 3.3.3 encodes emails containing non-ascii data as 7bit

2013-12-11 Thread R. David Murray

R. David Murray added the comment:

Well, it's a fair while after "tomorrow", but now it is committed.

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

___
Python tracker 

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



[issue19063] Python 3.3.3 encodes emails containing non-ascii data as 7bit

2013-12-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d842bc07d30b by R David Murray in branch '3.3':
#19063: partially fix set_payload handling of non-ASCII string input.
http://hg.python.org/cpython/rev/d842bc07d30b

New changeset 02cb48459b58 by R David Murray in branch 'default':
Null merge for #19063 (3.4 fix is different).
http://hg.python.org/cpython/rev/02cb48459b58

New changeset e20f98a8ed71 by R David Murray in branch 'default':
#19063: fix set_payload handling of non-ASCII string input.
http://hg.python.org/cpython/rev/e20f98a8ed71

--
nosy: +python-dev

___
Python tracker 

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



[issue19934] collections.Counter.most_common does not document `None` as acceptable input.

2013-12-11 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee: docs@python -> rhettinger

___
Python tracker 

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



[issue19828] test_site fails with -S flag

2013-12-11 Thread R. David Murray

R. David Murray added the comment:

I would just change the comment to "it is not useful to run the tests if we 
were called with -S".  Otherwise it looks fine.

If someone adds tests that are meaningful with -S is specified, we can put them 
in a different class, and move the skip to the class level.  You could mention 
that in the comment as well.

--

___
Python tracker 

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



[issue19944] Make importlib.find_spec load packages as needed

2013-12-11 Thread Nick Coghlan

Nick Coghlan added the comment:

Look at it from a conceptual point of view, though, there are two quite
different operations:

- find a spec at the current level, using the specified path (which may be
empty, implying a top level import)
- find a spec according to the full import cycle, including any parent
module imports

When you call it, you're going to want one behaviour or the other, since
the two operations are not slight variants, they have major conceptual
differences (with one being a substep of the other).

--

___
Python tracker 

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



[issue19828] test_site fails with -S flag

2013-12-11 Thread Zachary Ware

Zachary Ware added the comment:

Looking more closely, there's not much that looks like it really should be 
tested if explicitly called with -S, so perhaps the toplevel skip is still best 
after all.  Any other thoughts?

Attached patch fixes `python -S Lib/test` and cleans up an unused import. I'm a 
bit iffy on the added comment.

--
Added file: http://bugs.python.org/file33094/issue19828.diff

___
Python tracker 

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



[issue19954] test_tk floating point exception on my gentoo box running tk 8.6.1

2013-12-11 Thread R. David Murray

New submission from R. David Murray:

A while ago I started getting a floating point exception from test_tk in the 
tip in all active versions, but I'm only now getting around to reporting it.  
I've tracked this down to the tests introduced in issue 19085, which it looks 
like revealed some other tk issues.

Gentoo has some patches against stock 8.6.1; I don't know if they are the 
source of the failure or not.  I haven't updated the gentoo buildbots for a 
while, and since they are passing the tests it could well be that it was my 
upgrade from tk 8.6.0 to 8.6.1 on my dev box that triggered the failures.  The 
timing of that upgrade is somewhat after the patch was committed, but I hadn't 
been running the test suite regularly during that interval so I can't pinpoint 
it to one or the other.

There are also other test failures, by the way, but I'm not seeing the 
tracebacks because python crashes.

Here is the faulthandler traceback from 3.3:

test_indicatoron (tkinter.test.test_tkinter.test_widgets.MenubuttonTest) ... 
Fatal Python error: Floating point exception

Current thread 0xb75416c0:
  File "/home/rdmurray/python/p33/Lib/tkinter/__init__.py", line 1257 in 
_configure
  File "/home/rdmurray/python/p33/Lib/tkinter/__init__.py", line 1266 in 
configure
  File "/home/rdmurray/python/p33/Lib/tkinter/__init__.py", line 1273 in 
__setitem__
  File "/home/rdmurray/python/p33/Lib/tkinter/test/widget_tests.py", line 47 in 
checkParam
  File "/home/rdmurray/python/p33/Lib/tkinter/test/widget_tests.py", line 116 
in checkBooleanParam
  File "/home/rdmurray/python/p33/Lib/tkinter/test/widget_tests.py", line 422 
in test_indicatoron
  File "/home/rdmurray/python/p33/Lib/unittest/case.py", line 384 in 
_executeTestPart
  File "/home/rdmurray/python/p33/Lib/unittest/case.py", line 439 in run
  File "/home/rdmurray/python/p33/Lib/unittest/case.py", line 491 in __call__
  File "/home/rdmurray/python/p33/Lib/unittest/suite.py", line 105 in run
  File "/home/rdmurray/python/p33/Lib/unittest/suite.py", line 67 in __call__
  File "/home/rdmurray/python/p33/Lib/unittest/suite.py", line 105 in run
  File "/home/rdmurray/python/p33/Lib/unittest/suite.py", line 67 in __call__
  File "/home/rdmurray/python/p33/Lib/test/support/__init__.py", line 1560 in 
run
  File "/home/rdmurray/python/p33/Lib/test/support/__init__.py", line 1661 in 
_run_suite
  File "/home/rdmurray/python/p33/Lib/test/support/__init__.py", line 1695 in 
run_unittest
  File "/home/rdmurray/python/p33/Lib/test/test_tk.py", line 22 in test_main
  File "/home/rdmurray/python/p33/Lib/test/regrtest.py", line 1222 in 
runtest_inner
  File "/home/rdmurray/python/p33/Lib/test/regrtest.py", line 944 in runtest
  File "/home/rdmurray/python/p33/Lib/test/regrtest.py", line 717 in main
  File "/home/rdmurray/python/p33/Lib/test/__main__.py", line 13 in 
  File "/home/rdmurray/python/p33/Lib/runpy.py", line 73 in _run_code
  File "/home/rdmurray/python/p33/Lib/runpy.py", line 160 in _run_module_as_main
zsh: floating point exception  ./python -m test -uall test_tk

--
components: Tests, Tkinter
messages: 205925
nosy: Arfrever, r.david.murray, serhiy.storchaka
priority: high
severity: normal
stage: needs patch
status: open
title: test_tk floating point exception on my gentoo box running tk 8.6.1
type: crash
versions: Python 2.7, Python 3.3, Python 3.4

___
Python tracker 

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



[issue19732] python fails to build when configured with --with-system-libmpdec

2013-12-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> Antoine, could you add --with-system-libmpdec to my FreeBSD and Fedora
> bots? Sorry for bothering you with all these obscure options. :)

Should be done now. Can you check they work fine?

--

___
Python tracker 

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



[issue18983] Specify time unit for timeit CLI

2013-12-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Ah, I forgot. This feature should be documented in Doc/library/timeit.rst.

--

___
Python tracker 

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



[issue18983] Specify time unit for timeit CLI

2013-12-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Besides too long line with sys.stderr.write last patch LGTM.

--

___
Python tracker 

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



[issue17576] PyNumber_Index() is not int-subclass friendly (or operator.index() docos lie)

2013-12-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Even with last patch int() can return non-int:

>>> class A(int):
... def __int__(self): return True
... def __repr__(self): return ''
... 
>>> class B:
... def __int__(self): return A()
... 
>>> class C:
... def __trunc__(self): return A()
... 
>>> int(B())

>>> int(C())
True

--

___
Python tracker 

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



[issue19953] __iadd__() doc not strictly correct

2013-12-11 Thread ferno

New submission from ferno:

Document in question is:

http://docs.python.org/3.3/reference/datamodel.html#object.__iadd__

The documentation states,

to execute the statement x += y, where x is an instance of a class that has 
an __iadd__() method, x.__iadd__(y) is called.

However, this doesn't appear to be strictly true. According to this, the 
following well-known example:

>>> a = (1, [2, 3])
>>> a[1] += [4, 5]
Traceback (most recent call last):
  File "", line 1, in 
TypeError: 'tuple' object does not support item assignment
>>> a
(1, [2, 3, 4, 5])

should give the same behaviour as:

>>> a = (1, [2, 3])
>>> a[1].__iadd__([4, 5])
[2, 3, 4, 5]
>>> a
(1, [2, 3, 4, 5])

However, this snippet DOES give the identical behaviour:

>>> a = (1, [2, 3])
>>> a[1] = a[1].__iadd__([4, 5])
Traceback (most recent call last):
  File "", line 1, in 
TypeError: 'tuple' object does not support item assignment
>>> a
(1, [2, 3, 4, 5])

which leads me to suggest that this line of the documentation should be 
adjusted to read:

to execute the statement x += y, where x is an instance of a class that has 
an __iadd__() method, x = x.__iadd__(y) is called.

This fix would incidentally harmonise with the documentation for 
operator.iadd() et al., 
(http://docs.python.org/3.3/library/operator.html#operator.iadd), which had a 
similar problem but was corrected following issue 7259 
(http://bugs.python.org/issue7259), now reading:

a = iadd(a, b) is equivalent to a += b.

--
assignee: docs@python
components: Documentation
messages: 205920
nosy: docs@python, ferno
priority: normal
severity: normal
status: open
title: __iadd__() doc not strictly correct
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 
3.4, Python 3.5

___
Python tracker 

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



[issue17576] PyNumber_Index() is not int-subclass friendly (or operator.index() docos lie)

2013-12-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I first committed safe part of patch, which doesn't change behavior, only adds 
warnings and tests. Here is other part (very simple), which change behavior (in 
sum they are equal to issue17576_v3.patch with minor changes).

* PyNumber_Index() now calls __index__() for int subclasses.

>>> class A(int):
... def __index__(self): return 1
... 
>>> import operator
>>> operator.index(A())

Returns 0 without patch and 1 with patch.

* PyNumber_Long() now calls __int__() on result of __trunc__() if it is int 
subclass instance.

>>> class A:
... def __trunc__(self): return True
... 
>>> int(A())

Returns True without patch and 1 with patch.

* PyLong_As*() functions (but not all) call __int__() for int subclasses (I'm 
not sure this is right).

>>> class A(int):
... def __int__(self): return 42
... 
>>> chr(A(43))

Returns '+' without patch and '*' with patch.

--
Added file: http://bugs.python.org/file33093/issue17576_v4.patch

___
Python tracker 

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



[issue19952] asyncio: test_wait_for_handle failure

2013-12-11 Thread Stefan Krah

Changes by Stefan Krah :


--
keywords: +buildbot

___
Python tracker 

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



[issue19952] asyncio: test_wait_for_handle failure

2013-12-11 Thread Stefan Krah

New submission from Stefan Krah:

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


==
FAIL: test_wait_for_handle (test.test_asyncio.test_windows_events.ProactorTests)
--
Traceback (most recent call last):
  File 
"C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\test_asyncio\test_windows_events.py",
 line 123, in test_wait_for_handle
self.assertTrue(0 <= elapsed < 0.02, elapsed)
AssertionError: False is not true : 0.092348074

--
components: Tests
messages: 205918
nosy: skrah
priority: normal
severity: normal
stage: needs patch
status: open
title: asyncio: test_wait_for_handle failure
type: behavior
versions: Python 3.4

___
Python tracker 

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



[issue17200] telnetlib.read_until() timeout uses the wrong units

2013-12-11 Thread Gregory P. Smith

Gregory P. Smith added the comment:

anyways, i went with just the simple fix and no specific test for this issue as 
the tests were painful and questionable reliability.

i appreciate the other refactoring suggestion within the code but for 2.7 and 
3.3 bugfixes where no significant changes are ever likely within telnetlib.py 
they didn't seem warranted.  3.4's code is cleaner thanks to the new selector 
stuff.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue19732] python fails to build when configured with --with-system-libmpdec

2013-12-11 Thread Stefan Krah

Stefan Krah added the comment:

Antoine, could you add --with-system-libmpdec to my FreeBSD and Fedora
bots? Sorry for bothering you with all these obscure options. :)

--
nosy: +pitrou

___
Python tracker 

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



[issue17576] PyNumber_Index() is not int-subclass friendly (or operator.index() docos lie)

2013-12-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 618cca51a27e by Serhiy Storchaka in branch '3.3':
Issue #17576: Deprecation warning emitted now when __int__() or __index__()
http://hg.python.org/cpython/rev/618cca51a27e

New changeset 59fb79d0411e by Serhiy Storchaka in branch 'default':
Issue #17576: Deprecation warning emitted now when __int__() or __index__()
http://hg.python.org/cpython/rev/59fb79d0411e

--
nosy: +python-dev

___
Python tracker 

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



[issue18983] Specify time unit for timeit CLI

2013-12-11 Thread Julian Gindi

Julian Gindi added the comment:

Re-uploaded the patch to remove duplication.

--

___
Python tracker 

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



[issue19951] parse_qsl fails on empty query argument without =

2013-12-11 Thread R. David Murray

R. David Murray added the comment:

I did some research on this for a previous issue, and every description of 
query strings I could find agreed that the format was '='.  That 
is, that the '=' is not optional, even though some servers (note, *not* 
browsers, they just transmit or display the URI provided by the user or server) 
will accept parameters without the '=' and treat them as if they had one.

So I think this being rejected by strict_parsing is correct.  I'm closing this 
as invalid.

As for what strict_parsing, controls, you can check the source.  It looks like 
this and empty arguments (ie: &&) are the only things it controls.

--
nosy: +r.david.murray
resolution:  -> invalid
stage:  -> committed/rejected
status: open -> closed
type:  -> behavior

___
Python tracker 

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



[issue15027] Faster UTF-32 encoding

2013-12-11 Thread Mark Lawrence

Mark Lawrence added the comment:

>From http://kmike.ru/python-data-structures/ under heading DATrie "Python 
>wrapper uses utf_32_le codec internally; this codec is currently slow and it 
>is the bottleneck for datrie. There is a ticket with a patch in the CPython 
>bug tracker (http://bugs.python.org/issue15027) that should make this codec 
>fast, so there is a hope datrie will become faster with future Pythons."

--
nosy: +BreamoreBoy

___
Python tracker 

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



[issue19951] parse_qsl fails on empty query argument without =

2013-12-11 Thread David Pizzuto

New submission from David Pizzuto:

Using an empty query argument with no = fails in urlparse.parse_qsl. Chrome and 
Firefox accept it without the =, so a navigation to google.com/search?q=foo&bar 
appears in the address bar as google.com/search?q=foo&bar=. Neither RFC 1738 
nor RFC 3986 define the format of query strings. Wikipedia is similarly silent.

I can reproduce in 2.7.3 and 3.2.3, as shown below. I'm told this is also true 
of 3.3 but don't have easy access to a 3.3 interpreter to confirm.

The obvious workaround is to simply set strict_parsing=False, but I don't know 
what other checks that's disabling. Would it be reasonable to change parse_qsl 
to add the = if it's not present?

$ python
Python 2.7.3 (default, Sep 26 2013, 20:03:06) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import urlparse
>>> query = 'foo&bar=baz'
>>> urlparse.parse_qs(query, strict_parsing=True, keep_blank_values=True)
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python2.7/urlparse.py", line 353, in parse_qs
for name, value in parse_qsl(qs, keep_blank_values, strict_parsing):
  File "/usr/lib/python2.7/urlparse.py", line 387, in parse_qsl
raise ValueError, "bad query field: %r" % (name_value,)
ValueError: bad query field: 'foo'

$ python3
Python 3.2.3 (default, Sep 25 2013, 18:22:43) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import urllib.parse
>>> query = 'foo&bar=baz'
>>> urllib.parse.parse_qs(query, strict_parsing=True, keep_blank_values=True)
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.2/urllib/parse.py", line 556, in parse_qs
encoding=encoding, errors=errors)
  File "/usr/lib/python3.2/urllib/parse.py", line 596, in parse_qsl
raise ValueError("bad query field: %r" % (name_value,))
ValueError: bad query field: 'foo'

--
messages: 205911
nosy: David.Pizzuto
priority: normal
severity: normal
status: open
title: parse_qsl fails on empty query argument without =
versions: Python 2.7, Python 3.2

___
Python tracker 

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



[issue19714] Add tests for importlib.machinery.WindowsRegistryFinder

2013-12-11 Thread Eric Snow

Changes by Eric Snow :


--
nosy: +loewis

___
Python tracker 

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



[issue18864] Implementation for PEP 451 (importlib.machinery.ModuleSpec)

2013-12-11 Thread Eric Snow

Changes by Eric Snow :


--
dependencies:  -Implement _imp.exec_builtin and exec_dynamic

___
Python tracker 

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



[issue19100] Use backslashreplace in pprint

2013-12-11 Thread Fred L. Drake, Jr.

Changes by Fred L. Drake, Jr. :


--
assignee:  -> fdrake

___
Python tracker 

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



[issue19948] POSIX semantics of PATH search in execvpe is not respected

2013-12-11 Thread Eric V. Smith

Eric V. Smith added the comment:

I know that. This is mostly just a note to myself so I can remember what I've 
looked at the next time I have a few moments to look at the bug. Or, anyone 
else who wants to track it down.

--

___
Python tracker 

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



[issue19948] POSIX semantics of PATH search in execvpe is not respected

2013-12-11 Thread Stéphane Glondu

Stéphane Glondu added the comment:

> os.execvp calls os._execvpe which calls posix.execv which calls execv. At 
> least that's how I think it works.

I am not contesting that. This bug is about the "search the command in PATH" 
part. More precisely, the fact that os.execvp continues the search after execv 
fails.

--

___
Python tracker 

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



[issue19948] POSIX semantics of PATH search in execvpe is not respected

2013-12-11 Thread Eric V. Smith

Eric V. Smith added the comment:

os.execvp calls os._execvpe which calls posix.execv which calls execv. At least 
that's how I think it works.

--

___
Python tracker 

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



[issue19100] Use backslashreplace in pprint

2013-12-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

pprint is not print.

>>> print('\u20ac')
€
>>> import pprint; pprint.pprint('\u20ac')
'€'

Default sys.displayhook doesn't fail on unencodable output.

$ LANG=C ./python
Python 3.4.0b1 (default:e961a166dc70+, Dec 11 2013, 13:57:17) 
[GCC 4.6.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> '\u20ac'
'\u20ac'

--

___
Python tracker 

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



[issue19944] Make importlib.find_spec load packages as needed

2013-12-11 Thread Brett Cannon

Brett Cannon added the comment:

I'm not saying get rid of the ability to guarantee no side-effects. All I'm 
saying is that the point of the function is to find a spec, whether that 
includes importing or implicitly using a parent package from sys.modules is 
just technical detail (and thus flags on the function). Put another way, the 
return value is no different and the basic arguments are the same, it's just 
internal details of how that return value is found that shifts. For me that's 
enough to control with keyword-only arguments instead of uniquely named 
functions.

And I'm willing to argue that import_module() not importing parent packages is 
annoying and should be controlled with a flag to make life easier since chances 
are you will want to import the parent packages anyway.

--

___
Python tracker 

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



[issue19942] UTF-8 encoding not enforced

2013-12-11 Thread Benjamin Peterson

Changes by Benjamin Peterson :


--
resolution: wont fix -> 
status: closed -> open
versions: +Python 3.4 -Python 2.7

___
Python tracker 

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



[issue4037] doctest.py should include method descriptors when looking inside a class __dict__

2013-12-11 Thread R. David Murray

Changes by R. David Murray :


--
nosy: +r.david.murray

___
Python tracker 

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



[issue4037] doctest.py should include method descriptors when looking inside a class __dict__

2013-12-11 Thread Filip Zyzniewski

Filip Zyzniewski added the comment:

It seems like there is also an issue with property classes defined in a 
different module.

In the example below Foo.x uses standard property, and Foo.y uses prop imported 
from the prop module.

This results in docstring for Foo.y to be missed:

filip@klocek:~/test$ cat prop.py
class prop(property):
pass
filip@klocek:~/test$ cat foo.py
from prop import prop

class Foo(object):

@property
def x(self):
"""
>>> Foo().x
'x'
"""
return 'x'

@prop
def y(self):
"""
>>> Foo().y
'y'
"""
return 'y'
filip@klocek:~/test$ python --version
Python 2.7.3
filip@klocek:~/test$ python -m doctest foo.py -v
Trying:
Foo().x
Expecting:
'x'
ok
2 items had no tests:
foo
foo.Foo
1 items passed all tests:
   1 tests in foo.Foo.x
1 tests in 3 items.
1 passed and 0 failed.
Test passed.
filip@klocek:~/test$ python3 --version
Python 3.2.3
filip@klocek:~/test$ python3 -m doctest foo.py -v
Trying:
Foo().x
Expecting:
'x'
ok
2 items had no tests:
foo
foo.Foo
1 items passed all tests:
   1 tests in foo.Foo.x
1 tests in 3 items.
1 passed and 0 failed.
Test passed.
filip@klocek:~/test$

--
nosy: +filip.zyzniewski

___
Python tracker 

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



[issue19946] Have multiprocessing raise ImportError when spawning a process that can't find the "main" module

2013-12-11 Thread Nick Coghlan

Nick Coghlan added the comment:

Rerunning main in the subprocess has always been a slightly dubious feature
of multiprocessing, but IIRC it's a necessary hack to ensure pickle
compatibility for things defined in __main__. Using "runpy.run_path" would
be a better solution, but we'll need to add the "target" parameter that
missed the beta1 deadline.

--

___
Python tracker 

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



[issue19944] Make importlib.find_spec load packages as needed

2013-12-11 Thread Nick Coghlan

Nick Coghlan added the comment:

One function (the current one) promises not to import anything. The other
(the new one) may have side effects, even if it fails to find the module
(any successfully imported parent modules will remain imported).

IIRC, that "no side effects" guarantee was the original reason for the
find_loader/get_loader split and it's a distinction I think is worth
preserving. I just think the obvious name should be closer to
importlib.import_module in semantics, with the "no side effects" version
being the more obscure one.

--

___
Python tracker 

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



[issue19100] Use backslashreplace in pprint

2013-12-11 Thread Walter Dörwald

Walter Dörwald added the comment:

This is not the fault of pprint. IMHO it doesn't make sense to fix anything 
here, at least not for pprint specifically. print() has the same "problem":

   $ LANG= ./python -c "print('\u20ac')"
 
   Traceback (most recent call last):
 File "", line 1, in 
   UnicodeEncodeError: 'ascii' codec can't encode character '\u20ac' in 
position 0: ordinal not in range(128)

--
nosy: +doerwalter

___
Python tracker 

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



[issue19942] UTF-8 encoding not enforced

2013-12-11 Thread Jakub Wilk

Jakub Wilk added the comment:

With a slightly adapted test case, I see the same behavior in Python 3.3.3. 
Perhaps it would be worth fixing the bug in Python 3.4?

--
Added file: http://bugs.python.org/file33092/test3.py

___
Python tracker 

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



[issue19948] POSIX semantics of PATH search in execvpe is not respected

2013-12-11 Thread Stéphane Glondu

Stéphane Glondu added the comment:

> What is the bad idea? Keep looking in subsequent directories in PATH when you 
> find a candidate for which execve() fails? Sorry, but I beg to differ, and 
> POSIX is on my side.

Sorry, I meant "Stop looking in subsequent [..]".

--

___
Python tracker 

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



[issue19948] POSIX semantics of PATH search in execvpe is not respected

2013-12-11 Thread Stéphane Glondu

Stéphane Glondu added the comment:

> What platform is this on?

I'm on Linux (Debian testing).

> Looking quickly through posix.execve (which is what I think gets called), it 
> looks like it just calls C's execve().

Yes, but I'm talking about os.execvp, here. With the search in PATH.

> Also, what's your use case for this?

I discovered that by accident while investigating another bug...

> I realize it might be a standard behavior, but it seems like a bad idea to me.

What is the bad idea? Keep looking in subsequent directories in PATH when you 
find a candidate for which execve() fails? Sorry, but I beg to differ, and 
POSIX is on my side.

--

___
Python tracker 

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



[issue19946] Have multiprocessing raise ImportError when spawning a process that can't find the "main" module

2013-12-11 Thread Olivier Grisel

Olivier Grisel added the comment:

Here is a patch that uses `imp.load_source` when the first importlib name-based 
lookup fails.

Apparently it fixes the issue on my box but I am not sure whether this is the 
correct way to do it.

--
keywords: +patch
Added file: http://bugs.python.org/file33091/issue19946.diff

___
Python tracker 

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



[issue19717] resolve() fails when the path doesn't exist

2013-12-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I think a patch in issue19887 first should be committed. It totally rewrites 
resolve().

--
dependencies: +Path.resolve() fails on complex symlinks

___
Python tracker 

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



[issue17576] PyNumber_Index() is not int-subclass friendly (or operator.index() docos lie)

2013-12-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

PyLong_AsUnsignedLong() and PyLong_AsLong() can return different values for 
same object. Why __int__ and __index__ should be used for int subclasses at 
all? I'm not sure this is right solution.

--

___
Python tracker 

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



[issue19946] Have multiprocessing raise ImportError when spawning a process that can't find the "main" module

2013-12-11 Thread Olivier Grisel

Olivier Grisel added the comment:

Note however that the problem is not specific to nose. If I rename my initial 
'check_forserver.py' script to 'check_forserver', add the '#!/usr/bin/env 
python' header and make it 'chmod +x' I get the same crash.

So the problem is related to the fact that under posix, valid Python programs 
can be executable scripts without the '.py' extension.

--

___
Python tracker 

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



[issue19946] Have multiprocessing raise ImportError when spawning a process that can't find the "main" module

2013-12-11 Thread Olivier Grisel

Olivier Grisel added the comment:

> what is sys.modules['__main__'] and sys.modules['__main__'].__file__ if you 
> run under nose?

$ cat check_stuff.py 
import sys

def test_main():
print("sys.modules['__main__']=%r"
  % sys.modules['__main__'])
print("sys.modules['__main__'].__file__=%r"
  % sys.modules['__main__'].__file__)


if __name__ == '__main__':
test_main()
(pyhead) ogrisel@is146148:~/tmp$ python check_stuff.py 
sys.modules['__main__']=
sys.modules['__main__'].__file__='check_stuff.py'
(pyhead) ogrisel@is146148:~/tmp$ nosetests -s check_stuff.py 
sys.modules['__main__']=
sys.modules['__main__'].__file__='/volatile/ogrisel/envs/pyhead/bin/nosetests'
.
--
Ran 1 test in 0.001s

OK

--

___
Python tracker 

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



[issue19946] Have multiprocessing raise ImportError when spawning a process that can't find the "main" module

2013-12-11 Thread Olivier Grisel

Olivier Grisel added the comment:

I agree that a failure to lookup the module should raise an explicit exception.

> Second, there is no way that 'nosetests' will ever succeed as an import 
> since, as Oliver pointed out, it doesn't end in '.py' or any other 
> identifiable way for a finder to know it can handle the file. So this is not 
> a bug and simply a side-effect of how import works. The only way around it 
> would be to symlink nosetests to nosetests.py or to somehow pre-emptively set 
> up 'nosetests' for supported importing.

I don't agree that (unix) Python programs that don't end with ".py" should be 
modified to have multiprocessing work correctly. I think it should be the 
multiprocessing responsibility to transparently find out how to spawn the new 
process independently of the fact that the program ends in '.py' or not.

Note: the fork mode works always under unix (with or without the ".py" 
extension). The spawn mode always work under windows as AFAIK there is no way 
to have Python programs that don't end in .py under windows and furthermore I 
think multiprocessing does execute the __main__ under windows (but I haven't 
tested if it's still the case in Python HEAD).

--

___
Python tracker 

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



[issue19717] resolve() fails when the path doesn't exist

2013-12-11 Thread Vajrasky Kok

Changes by Vajrasky Kok :


Added file: 
http://bugs.python.org/file33090/add_non_strict_resolve_pathlib_v3.patch

___
Python tracker 

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



[issue19717] resolve() fails when the path doesn't exist

2013-12-11 Thread Vajrasky Kok

Changes by Vajrasky Kok :


Removed file: 
http://bugs.python.org/file33089/add_non_strict_resolve_pathlib_v3.patch

___
Python tracker 

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



[issue19717] resolve() fails when the path doesn't exist

2013-12-11 Thread Vajrasky Kok

Vajrasky Kok added the comment:

Here is the patch with Windows support. I notice there is difference regarding 
resolving symbolic link with parent dir (linkA/..) between Posix and Windows.

On Windows, if linkY points to dirB, 'dirA\linkY\..' resolves to 'dirA' without 
resolving linkY first. It means, Windows resolves parent dir first before 
symbolic link.

C:\Users\vajrasky\Code\playplay\pycode>mkdir dirA

C:\Users\vajrasky\Code\playplay\pycode>mkdir dirB

C:\Users\vajrasky\Code\playplay\pycode>cd dirA

C:\Users\vajrasky\Code\playplay\pycode\dirA>mklink /D linkC ..\dirB
symbolic link created for linkC <<===>> ..\dirB

C:\Users\vajrasky\Code\playplay\pycode\dirA>cd ..\

C:\Users\vajrasky\Code\playplay\pycode>cd dirA\linkC\..

C:\Users\vajrasky\Code\playplay\pycode\dirA>

But on Posix, if linkY points to dirB, 'dirA\linkY\..' resolves to 'dirB\..' 
then to the parent dir of dirB. It means, Posix resolves symbolic link first 
before parent dir.

$ mkdir dirA
$ mkdir dirB
$ cd dirA
$ ln -s ../dirB linkC
$ cd ..
$ ls dirA/linkC/..
dirAdirB

--
Added file: 
http://bugs.python.org/file33089/add_non_strict_resolve_pathlib_v3.patch

___
Python tracker 

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



[issue19950] Document that unittest.TestCase.__init__ is called once per test

2013-12-11 Thread Claudiu.Popa

Claudiu.Popa added the comment:

How about the following:

"Each instance of the TestCase will only be used to run a single test method 
from it, so a new instance is created for each test method."


It replaces `fixture` with `instance` and it emphasizes that the called method 
belongs to that particular TestCase instance.

--

___
Python tracker 

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