[issue18043] No mention of `match.regs` in `re` documentation

2014-10-04 Thread Georg Brandl

Georg Brandl added the comment:

I'm wondering what "regs" is supposed to stand for.  It might be for "regions", 
but that term is used nowhere else.  It should really be named "spans" to be 
consistent.

--
nosy: +georg.brandl

___
Python tracker 

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



[issue22540] speed up isinstance and issubclass for the usual cases

2014-10-04 Thread Georg Brandl

Changes by Georg Brandl :


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



[issue18043] No mention of `match.regs` in `re` documentation

2014-10-04 Thread Ram Rachum

Ram Rachum added the comment:

Mark, I prefer to leave this to someone else.

--

___
Python tracker 

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



[issue22515] Implement partial order on Counter

2014-10-04 Thread Ram Rachum

Ram Rachum added the comment:

I don't really understand the refactoring. For example why is `len(self) <= 
len(other)` needed? For which case? Note that `len` would also catch keys with 
`0` value which shouldn't have an effect.

--

___
Python tracker 

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



[issue22526] file iteration SystemError for huge lines (2GiB+)

2014-10-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Test should be marked with dry_run=False, otherwise it is false passed. 
Allocation of growing buffer needs extra memory, in my experiments memuse=2.5 
is enough. And I think this test should require the largefile resource. Here is 
a patch. It also significantly speeds up a test on Linux.

--
keywords: +patch
nosy: +serhiy.storchaka
Added file: http://bugs.python.org/file36797/issue22526_test.patch

___
Python tracker 

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



[issue22546] Wrong default precision in documentation for format

2014-10-04 Thread Mark Dickinson

Mark Dickinson added the comment:

> It seems that str, repr, and '' are using precision 16

None of them is using a fixed precision: they're all using David Gay's 
implementation of the "shortest string" algorithm (à la Burger and Dybvig).   
For repr, this is the case since Python 3.1 / 2.7; for str and formatting with 
no type specifier, since Python 3.2.  The docs definitely do need updating here.

> I expected this last to be
> '33.14159265358979'

'33.1415926535898' is shorter, and rounds back to the same floating-point 
number, so that's what Gay's algorithm gives here.

--

___
Python tracker 

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



[issue22515] Implement partial order on Counter

2014-10-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

There are some properties of set comparison:

(a < b) == (a <= b and a != b)
(a <= b) == (a < b or a == b)
(a <= b and b <= a) == (a == b)
(a < b and b < a) == False
(a <= b) == (a - b == set())
if (a <= b and b <= c) then (a <= c)
(a <= b and a <= c) == (a <= (b & c))
(a <= c and b <= c) == ((a | b) <= c)

Is this true for Counter?

--

___
Python tracker 

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



[issue15244] Support for opening files with FILE_SHARE_DELETE on Windows

2014-10-04 Thread Nick Coghlan

Nick Coghlan added the comment:

"opener" was new in 3.3, so I suspect it didn't come up because *we're* still 
not entirely accustomed to having it available yet :)

I agree providing a suitable opener could be a good way to go.

--

___
Python tracker 

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



[issue22546] Wrong default precision in documentation for format

2014-10-04 Thread Tommy Andersen

Changes by Tommy Andersen :


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



[issue15244] Support for opening files with FILE_SHARE_DELETE on Windows

2014-10-04 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



[issue22546] Wrong default precision in documentation for format

2014-10-04 Thread Mark Dickinson

Mark Dickinson added the comment:

Here's a proposed fix.

--
keywords: +patch
Added file: http://bugs.python.org/file36798/missing_type_specifier.patch

___
Python tracker 

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



[issue22546] Wrong default precision in documentation for format

2014-10-04 Thread Mark Dickinson

Mark Dickinson added the comment:

Hmm;  it's only outputs in non-scientific notation that are guaranteed to have 
a decimal point.  Patch updated.

--
Added file: http://bugs.python.org/file36799/missing_type_specifier2.patch

___
Python tracker 

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



[issue22515] Implement partial order on Counter

2014-10-04 Thread Ram Rachum

Ram Rachum added the comment:

> There are some properties of set comparison:
> 
> (a < b) == (a <= b and a != b)

I don't think so, because counter equality is based on dict equality so it 
doesn't ignore zero values.

> (a <= b) == (a < b or a == b)

No, ditto.

> (a <= b and b <= a) == (a == b)

No, ditto.

> (a < b and b < a) == False

Yes.

> (a <= b) == (a - b == set())

Yes.

> if (a <= b and b <= c) then (a <= c)

Yes.

> (a <= b and a <= c) == (a <= (b & c))

Yes.

> (a <= c and b <= c) == ((a | b) <= c)

Yes.

--

___
Python tracker 

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



[issue22515] Implement partial order on Counter

2014-10-04 Thread Mark Dickinson

Changes by Mark Dickinson :


--
nosy: +mark.dickinson

___
Python tracker 

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



[issue22515] Implement partial order on Counter

2014-10-04 Thread Steven D'Aprano

Steven D'Aprano added the comment:

On Sat, Oct 04, 2014 at 07:57:16AM +, Serhiy Storchaka wrote:

> There are some properties of set comparison:
> 
> (a < b) == (a <= b and a != b)
> (a <= b) == (a < b or a == b)
> (a <= b and b <= a) == (a == b)
> (a < b and b < a) == False
> (a <= b) == (a - b == set())
> if (a <= b and b <= c) then (a <= c)
> (a <= b and a <= c) == (a <= (b & c))
> (a <= c and b <= c) == ((a | b) <= c)
> 
> Is this true for Counter?

I believe these are all true for multisets.

But Counter is not *just* a multiset (a.k.a. bag) since the "counts" are 
not limited to non-negative integers (the natural numbers).

py> C = Counter()
py> C['a'] = -3
py> C['b'] = 'spam'
py> C['c'] = 0.5
py> C
Counter({'c': 0.5, 'b': 'spam', 'a': -3})

I don't know of any standard definition for subset and superset for 
multisets like C above. I think that we should raise an exception in 
cases like that: TypeError for cases where any "count" is non-numeric, 
and ValueError for cases where any count is not a non-negative integer.

(Later, if somebody comes up with a sensible meaning for sub/superset of 
such a Counter, we can relax that restriction.)

Another issue: are missing elements treated as if they have count 0? 
E.g. what are these?

Counter({'a': 0, 'b': 1}) <= Counter({'a': 1, 'b': 1})
Counter({'a': 0, 'b': 1}) <= Counter({'b': 1})

According to these pages:

http://singularcontiguity.wordpress.com/2008/05/07/multiset-equality-and-submultisets/
http://singularcontiguity.wordpress.com/2008/04/28/multiset-membership/

I would argue that they should both return True (based on the idea that 
the "support" of a multiset is the set of those elements with non-zero 
count). But I don't know how authoritative that blog is. (The author 
even mentions that he only has a passing familiarity with some aspects 
of multisets.)

Anyone familiar with Haskell? What does this bag class do?

http://hackage.haskell.org/package/uulib-0.9.8/docs/UU-DData-IntBag.html

This may also be helpful. Sets and bags in Z language:

http://www.cs.ox.ac.uk/people/michael.wooldridge/teaching/soft-eng/lect08.pdf
http://www.cs.ox.ac.uk/people/michael.wooldridge/teaching/soft-eng/lect14.pdf

--

___
Python tracker 

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



[issue22515] Implement partial order on Counter

2014-10-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

At least this condition is false for current implementation:

(a < b and b < a) == False

Example: a = Counter({'a': -1}), b = Counter({'b': -1}).

--

___
Python tracker 

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



[issue22515] Implement partial order on Counter

2014-10-04 Thread Steven D'Aprano

Steven D'Aprano added the comment:

On Sat, Oct 04, 2014 at 08:38:17AM +, Ram Rachum wrote:
> 
> Ram Rachum added the comment:
> 
> > There are some properties of set comparison:
> > 
> > (a < b) == (a <= b and a != b)
> 
> I don't think so, because counter equality is based on dict equality so it 
> doesn't ignore zero values.

That's a very good point! That suggests that we shouldn't treat Counters 
as multisets (a.k.a. bags) and define subset/superset operators. They're 
*almost* multisets, but not quite the same, since:

Counter({'a': 0}) != Counter({})

but the formal definition of multiset suggests those should be equal:

https://en.wikipedia.org/wiki/Multiset#Formal_definition

Perhaps we should rethink this. I'm starting to wonder whether we need a 
PEP to define exactly how subset and superset should be defined for 
Counters. This is precisely the trouble with rushing to add code before 
we know what the code is supposed to do... :-)

--

___
Python tracker 

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



[issue22515] Implement partial order on Counter

2014-10-04 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Just because something is discussed doesn't mean it needs a PEP.
Also, see http://bugs.python.org/issue22515#msg227852

--

___
Python tracker 

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



[issue22515] Implement partial order on Counter

2014-10-04 Thread Ram Rachum

Ram Rachum added the comment:

I see that in my implementation for __lt__ and __gt__ I forgot to check whether 
the other counter has elements that this counter doesn't, which could flip 
`found_strict_difference`.

--

___
Python tracker 

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



[issue22219] python -mzipfile fails to add empty folders to created zip

2014-10-04 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 911da1072099 by Serhiy Storchaka in branch '2.7':
Issue #22219: The zipfile module CLI now adds entries for directories
https://hg.python.org/cpython/rev/911da1072099

New changeset 981d18930d6d by Serhiy Storchaka in branch '3.4':
Issue #22219: The zipfile module CLI now adds entries for directories
https://hg.python.org/cpython/rev/981d18930d6d

New changeset d61d2e5a0956 by Serhiy Storchaka in branch 'default':
Issue #22219: The zipfile module CLI now adds entries for directories
https://hg.python.org/cpython/rev/d61d2e5a0956

--
nosy: +python-dev

___
Python tracker 

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



[issue22518] integer overflow in encoding unicode

2014-10-04 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3f7519f633ed by Serhiy Storchaka in branch '2.7':
Issue #22518: Fixed integer overflow issues in "backslashreplace" and
https://hg.python.org/cpython/rev/3f7519f633ed

New changeset ec9b7fd246b6 by Serhiy Storchaka in branch '3.4':
Issue #22518: Fixed integer overflow issues in "backslashreplace",
https://hg.python.org/cpython/rev/ec9b7fd246b6

New changeset 2df4cc31c36e by Serhiy Storchaka in branch 'default':
Issue #22518: Fixed integer overflow issues in "backslashreplace",
https://hg.python.org/cpython/rev/2df4cc31c36e

--

___
Python tracker 

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



[issue22518] integer overflow in encoding unicode

2014-10-04 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d1be1f355f59 by Serhiy Storchaka in branch '2.7':
Fixed compilation error introduced in 3f7519f633ed (issue #22518).
https://hg.python.org/cpython/rev/d1be1f355f59

--

___
Python tracker 

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



[issue22219] python -mzipfile fails to add empty folders to created zip

2014-10-04 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue21883] relpath: Provide better errors when mixing bytes and strings

2014-10-04 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2ba2ee5713bd by Serhiy Storchaka in branch 'default':
Issue #21883: os.path.join() and os.path.relpath() now raise a TypeError with
https://hg.python.org/cpython/rev/2ba2ee5713bd

--
nosy: +python-dev

___
Python tracker 

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



[issue22470] Possible integer overflow in error handlers

2014-10-04 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a3e18dd8f267 by Serhiy Storchaka in branch '2.7':
Fixed issue number for issue #22470 in Misc/NEWS.
https://hg.python.org/cpython/rev/a3e18dd8f267

New changeset cba365e2117f by Serhiy Storchaka in branch '3.4':
Fixed issue number for issue #22470 in Misc/NEWS.
https://hg.python.org/cpython/rev/cba365e2117f

New changeset fc941169125e by Serhiy Storchaka in branch 'default':
Fixed issue number for issue #22470 in Misc/NEWS.
https://hg.python.org/cpython/rev/fc941169125e

--
nosy: +python-dev

___
Python tracker 

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



[issue21883] relpath: Provide better errors when mixing bytes and strings

2014-10-04 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue22470] Possible integer overflow in error handlers

2014-10-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Committed in 3f7519f633ed, ec9b7fd246b6, 2df4cc31c36e (and d1be1f355f59 fixes 
an error in 3f7519f633ed).

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue22194] access to cdecimal / libmpdec API

2014-10-04 Thread Stefan Krah

Stefan Krah added the comment:

libmpdec has always been a separate project, predating the integration
into Python-3.3.  Before the Python-3.3 release, Jim Jewett suggested
a cleaner library/module separation (and he was right, it made the
code much more readable).

Then distributors wanted --with-system-libmpdec, so here we are.


Let's discuss the _decimal capsule API in #15237.


As for the libmpdec symbols: I agree it is somewhat unclean to
do this on the Python side.

For *some* functions it is also tricky (but by no means impossible)
to use them directly and expect the same results as from _decimal.

Maybe a solution for numba is to just assume --with-system-libmpdec.
libmpdec is extremely easy to package, distributions just have to
ensure that their Python version matches the libmpdec version.

--

___
Python tracker 

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



[issue22194] access to cdecimal / libmpdec API

2014-10-04 Thread Stefan Krah

Stefan Krah added the comment:

Of course Windows is a problem. I do not know how to implement
--with-system-libmpdec on Windows.

--

___
Python tracker 

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



[issue7726] Remove required metadata warnings for sdist

2014-10-04 Thread Francis MB

Francis MB added the comment:

AFAICS, this is an enhancement issue for the currently in maintenance branches 
2.7 and 3.2. 

Does this still applies to 3.5? (otherwise this issue should/could be closed).

--
nosy: +francismb
type:  -> enhancement

___
Python tracker 

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



[issue22518] integer overflow in encoding unicode

2014-10-04 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 51317c9786f5 by Serhiy Storchaka in branch '3.3':
Issue #22518: Fixed integer overflow issues in "backslashreplace",
https://hg.python.org/cpython/rev/51317c9786f5

--

___
Python tracker 

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



[issue22518] integer overflow in encoding unicode

2014-10-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Sorry for noise, these changes are related to issue22470.

--

___
Python tracker 

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



[issue21883] relpath: Provide better errors when mixing bytes and strings

2014-10-04 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 85de13b746ac by Serhiy Storchaka in branch 'default':
Fixed tests on Windows for issue #21883.
https://hg.python.org/cpython/rev/85de13b746ac

--

___
Python tracker 

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



[issue22423] Errors in printing exceptions raised in a thread

2014-10-04 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue10764] sysconfig and alternative implementations

2014-10-04 Thread Francis MB

Francis MB added the comment:

Is this issue superseded and duplicated as stated in the history?

Thanks in advance!

--
nosy: +francismb
type:  -> behavior

___
Python tracker 

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



[issue20267] TemporaryDirectory does not resolve path when created using a relative path

2014-10-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> Should I use os.path.realpath?

I don't see other way.

But there is other issue. Following code works now, but will fail with the 
patch:

import os, tempfile
os.mkdir('parent')
os.chdir('parent')
t = tempfile.TemporaryDirectory(dir=".")
os.rename('../parent', '../parent2')
t.cleanup()

--

___
Python tracker 

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



[issue11145] '%o' % user-defined instance

2014-10-04 Thread Francis MB

Francis MB added the comment:

Just updating the type to 'behavior'.
 
I can still reproduce this issue:

$ python2.7
Python 2.7.8 (default, Sep  9 2014, 22:08:43) 
[GCC 4.9.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> class Y(long):
...   def __oct__(self):
... return 'abc'
... 
>>> '%o' % Y()
Traceback (most recent call last):
  File "", line 1, in 
SystemError: ../Objects/stringobject.c:4045: bad argument to internal function
>>>

--
nosy: +francismb
type:  -> behavior

___
Python tracker 

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



[issue22515] Implement partial order on Counter

2014-10-04 Thread Steven D'Aprano

Steven D'Aprano added the comment:

On Sat, Oct 04, 2014 at 10:43:02AM +, Antoine Pitrou wrote:

> Just because something is discussed doesn't mean it needs a PEP.

I know that in general discussions do not need a PEP, but we seem to be 
rushing awfully fast into writing code before we even know what the code 
is supposed to do. Perhaps "need a PEP" was too strong, but we surely 
need to do something to decide on constistent and well-defined 
behaviour. As you pointed out earlier, Counters aren't precisely 
multisets, they're more like a hybrid mapping/multiset. It's not clear 
what behaviour subset and superset should have for such a hybrid. By 
rushing into code before deciding on what the code is supposed to do, we 
end up with inconsistent behaviour.

Here are a pair of Counters which compare "is subset", but not "is 
subset or equal" using Ram's patch:

py> Counter(a=1, b=0) < Counter(a=2)
True
py> Counter(a=1, b=0) <= Counter(a=2)
False

On the other hand, here's a pair which compares "is subset or equal", 
but not ("is subset" or "equal"):

py> Counter(a=0) <= Counter(b=0)
True
py> (Counter(a=0) < Counter(b=0)) or (Counter(a=0) == Counter(b=0))
False

Adding elements with count=0 changes whether a set is a subset or not:

py> Counter(a=0) < Counter(b=0)
False
py> Counter(a=0) < Counter(b=0, c=0)
True
py> Counter(a=0, b=0) < Counter(b=0, c=0)
False

I'm not convinced that mixed Counter and regular dict comparisons should 
be supported, but Ram's patch supports any Mapping type. Is that a good 
idea? There's been no discussion on that question.

Can somebody explain to me what this means? How is this meaningfully a 
subset operation?

py> Counter(a="eggs") < Counter(a="spam")
True

I supported adding these operations to Counter, but the last thing I 
want is to enshrine a set of ad-hoc and inconsistent semantics that 
don't match standard multiset behaviour and are defined by the 
implementation, instead of having the implementation defined by the 
desired semantics.

--

___
Python tracker 

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



[issue22515] Implement partial order on Counter

2014-10-04 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Le 04/10/2014 17:24, Steven D'Aprano a écrit :
> 
> I know that in general discussions do not need a PEP, but we seem to be 
> rushing awfully fast into writing code before we even know what the code 
> is supposed to do.

Writing a patch is useful practice because it's a way to discover latent
problems (especially when writing unit tests).

> py> Counter(a=1, b=0) < Counter(a=2)
> True
> py> Counter(a=1, b=0) <= Counter(a=2)
> False

That looks wrong to me.

> py> Counter(a=0) <= Counter(b=0)
> True
> py> (Counter(a=0) < Counter(b=0)) or (Counter(a=0) == Counter(b=0))
> False

Ditto.

> py> Counter(a=0) < Counter(b=0)
> False
> py> Counter(a=0) < Counter(b=0, c=0)
> True

Yuck.

> I'm not convinced that mixed Counter and regular dict comparisons should 
> be supported, but Ram's patch supports any Mapping type. Is that a good 
> idea? There's been no discussion on that question.

That sounds wrong to me as well.

> Can somebody explain to me what this means? How is this meaningfully a 
> subset operation?
> 
> py> Counter(a="eggs") < Counter(a="spam")
> True

I agree this looks silly. However, the Counter doc says:

"""The multiset methods are designed only for use cases with positive
values. [...] There are no type restrictions, but the value type needs
to support addition, subtraction, and comparison."""

Which really sounds like an excuse to not perform any type checking and
silently allow nonsensical multiset behaviour with non-integer keys. We
can follow that lead :-)

--

___
Python tracker 

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



[issue22515] Implement partial order on Counter

2014-10-04 Thread Ram Rachum

Ram Rachum added the comment:

Hi everybody,

I agree we have a mess on our hands, with lots of cases where comparison is 
weird. To be honest I've given up on `collections.Counter` at this point. The 
fact that it's a "hybrid mapping/multiset" is the cause of all the problems, so 
I just made my own class that is defined as a multiset with only positive 
integer values, and I'm going to use that and define methods on it without 
having to worry about these weird cases. Unless someone else wants to champion 
this issue and resolve the edge cases, it can be closed as far as I'm concerned.

I really wish that `collections.Counter` wouldn't have been added to the 
standard library as a "hybrid mapping/multiset"; I think that it shows emphasis 
on the implementation rather than the usage, while the usage is more important. 
But there's nothing I can do about that. (If there was a place where we can 
make notes for Python 4, I'd put a note there about it.)

--

___
Python tracker 

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



[issue22553] Diagram issue

2014-10-04 Thread Eric Fulton

New submission from Eric Fulton:

I believe the diagram showing how slices works from 
https://docs.python.org/2/tutorial/introduction.html is incorrect.  There 
should be no 6.  

>>> word = 'Python'
>>> word[6]
IndexError: string index out of range


Original:
 +---+---+---+---+---+---+
 | P | y | t | h | o | n |
 +---+---+---+---+---+---+
 0   1   2   3   4   5   6
-6  -5  -4  -3  -2  -1

What it should be:
 +---+---+---+---+---+---+
 | P | y | t | h | o | n |
 +---+---+---+---+---+---+
 0   1   2   3   4   5   
-6  -5  -4  -3  -2  -1


--

One way to remember how slices work is to think of the indices as pointing 
between characters, with the left edge of the first character numbered 0. Then 
the right edge of the last character of a string of n characters has index n, 
for example:

 +---+---+---+---+---+---+
 | P | y | t | h | o | n |
 +---+---+---+---+---+---+
 0   1   2   3   4   5   6
-6  -5  -4  -3  -2  -1

--
assignee: docs@python
components: Documentation
messages: 228464
nosy: Eric.Fulton, docs@python
priority: normal
severity: normal
status: open
title: Diagram issue

___
Python tracker 

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



[issue22553] Diagram issue

2014-10-04 Thread Georg Brandl

Georg Brandl added the comment:

Hi Eric,

this paragraph is about slices, where you *can* do

>>> word[0:6]
'Python'

As such, the paragraph is correct.

--
nosy: +georg.brandl
resolution:  -> not a bug
status: open -> closed

___
Python tracker 

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



[issue11145] '%o' % user-defined instance

2014-10-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch which fixes this issue. Now ValueError with relevant message is 
raised instead of SystemError or crash.

--
nosy: +serhiy.storchaka
stage:  -> patch review
type: behavior -> crash

___
Python tracker 

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



[issue18043] No mention of `match.regs` in `re` documentation

2014-10-04 Thread Matthew Barnett

Matthew Barnett added the comment:

There's an interesting bit of history here:

http://www.gossamer-threads.com/lists/python/dev/236584

--

___
Python tracker 

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



[issue18043] No mention of `match.regs` in `re` documentation

2014-10-04 Thread Georg Brandl

Georg Brandl added the comment:

IOW: it was already intentionally undocumented back then, and only added for 
compatibility reasons.

Probably should be deprecated and removed at some point.

--
resolution:  -> wont fix
status: open -> closed

___
Python tracker 

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



[issue20516] Concurrent.futures base concurrency improvement (with patch)

2014-10-04 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Glenn, are you willing to update your patch to address the review comments?
(I'm assuming you have been notified of them... if not, you can access the code 
review tool by clicking the "review" links near your patch)

--

___
Python tracker 

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



[issue20516] Concurrent.futures base concurrency improvement (with patch)

2014-10-04 Thread Claudiu Popa

Claudiu Popa added the comment:

I'm not sure that Glenn receives this, he is not in the nosy list.

2014-07-18 16:45:36 glangford   set nosy: - glangford

--
nosy: +Claudiu.Popa

___
Python tracker 

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



[issue20516] Concurrent.futures base concurrency improvement (with patch)

2014-10-04 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Woops. Thanks for noticing, Claudiu. I guess someone can take over the patch 
and finish the work, then :-)

--

___
Python tracker 

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



[issue11271] concurrent.futures.ProcessPoolExecutor.map() doesn't batch function arguments by chunks

2014-10-04 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f87c2c4f03da by Antoine Pitrou in branch 'default':
Issue #11271: concurrent.futures.Executor.map() now takes a *chunksize*
https://hg.python.org/cpython/rev/f87c2c4f03da

--
nosy: +python-dev

___
Python tracker 

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



[issue11694] xdrlib raises ConversionError in inconsistent way

2014-10-04 Thread Claudiu Popa

Changes by Claudiu Popa :


--
nosy: +Claudiu.Popa

___
Python tracker 

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



[issue11271] concurrent.futures.ProcessPoolExecutor.map() doesn't batch function arguments by chunks

2014-10-04 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Sorry for the delay. I simplified the patch a tiny bit ("yield from" wasn't 
needed, it was sufficient to result the itertools.chain.from_iterable() 
result), and committed it. Thank you!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue22194] access to cdecimal / libmpdec API

2014-10-04 Thread Antoine Pitrou

Antoine Pitrou added the comment:

For the record, we have realized that pure C code brought less than a 2x 
speedup compared to straightforward Python code, so cdecimal support has become 
a low-priority concern for Numba. For the curious, the C code is from 
libmpdec's own benchmark (Web site seems down at the moment) and the Python 
code is here: https://gist.github.com/pitrou/9eb2a5651b99f2e3c4ce

--

___
Python tracker 

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



[issue19905] Add 128-bit integer support to ctypes

2014-10-04 Thread Mark Lawrence

Mark Lawrence added the comment:

This won't go anywhere until a patch is provided on #19904 as requested in 
msg205765.

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



[issue19960] MacOSX: Building 2.7 without the xcode command line tools installed

2014-10-04 Thread Mark Lawrence

Mark Lawrence added the comment:

Just a reminder that a patch review is needed here guys.

--
nosy: +BreamoreBoy

___
Python tracker 

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



[issue22515] Implement partial order on Counter

2014-10-04 Thread Ethan Furman

Ethan Furman added the comment:

We are not "rushing into code", we are getting some code, and tests, written to 
help define what we are talking about.

So far the feedback has given some more tests to add, and some things to change 
(such as only comparing with other Counters).

The big question I have is how do we handle <= and >= ?  Normal Counter == 
treats a key with a zero value as being unequeal to a Counter without that same 
key, but I don't think that makes sense for partial ordering.

--

___
Python tracker 

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



[issue11145] '%o' % user-defined instance

2014-10-04 Thread Francis MB

Francis MB added the comment:

Do have I overseen the patch? or may be doing something wrong?
or isn't anything uploaded?

--

___
Python tracker 

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



[issue21428] Python suddenly cares about EOLs formats on windows

2014-10-04 Thread Mark Lawrence

Mark Lawrence added the comment:

Can we please have a response to the question put in msg218050 so we can 
investigate?

--
nosy: +BreamoreBoy

___
Python tracker 

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



[issue1284316] Win32: Security problem with default installation directory

2014-10-04 Thread Mark Lawrence

Mark Lawrence added the comment:

I'm concerned that 3.5 is creeping ever closer and I wouldn't like to see work 
done on the installer backed out at the 11th hour because there has been no 
agreement here.  Does this need a discussion on python-dev?  For that matter 
has there been one already that I've forgotten about?

--
nosy: +BreamoreBoy

___
Python tracker 

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



[issue21965] Add support for Memory BIO to _ssl

2014-10-04 Thread Antoine Pitrou

Antoine Pitrou added the comment:

One issue with the "owner" is that there is now a reference cycle between 
SSLSocket and SSLObject (something which the original design is careful to 
avoid by using weakrefs in the _ssl module).

--

___
Python tracker 

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



[issue1284316] Win32: Security problem with default installation directory

2014-10-04 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Mark Lawrence, please stop acting like you are the project leader. If you want 
to make concrete contributions to Python, you're welcome. But we don't need 
your project management guidance.

--
nosy: +pitrou

___
Python tracker 

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



[issue1284316] Win32: Security problem with default installation directory

2014-10-04 Thread Mark Lawrence

Mark Lawrence added the comment:

Pardon me for breathing.  As you clearly don't like the way I work would you be 
so kind as to reopen the issues that I've helped close in the last few months.  
It might bugger the stats on the bug tracker but hey ho.

--

___
Python tracker 

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



[issue21428] Python suddenly cares about EOLs formats on windows

2014-10-04 Thread Georg Brandl

Georg Brandl added the comment:

No response, closing.

--
nosy: +georg.brandl
resolution:  -> out of date
status: open -> closed

___
Python tracker 

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



[issue1284316] Win32: Security problem with default installation directory

2014-10-04 Thread Georg Brandl

Georg Brandl added the comment:

Nobody doubts that pinging old issues helps getting some of them closed. But 
messages like msg228480 sound a bit pretentious, that's what Antoine is 
referring to.

--
nosy: +georg.brandl

___
Python tracker 

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



[issue11145] '%o' % user-defined instance

2014-10-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Oh, sorry. I again forgot to upload a patch.

--
keywords: +patch
Added file: http://bugs.python.org/file36800/issue11145.patch

___
Python tracker 

___diff -r a3e18dd8f267 Lib/test/test_format.py
--- a/Lib/test/test_format.py   Sat Oct 04 15:04:41 2014 +0300
+++ b/Lib/test/test_format.py   Sat Oct 04 20:07:18 2014 +0300
@@ -299,6 +299,39 @@ class FormatTest(unittest.TestCase):
 else:
 raise TestFailed, '"%*d"%(maxsize, -127) should fail'
 
+def test_invalid_special_methods(self):
+tests = []
+for f in 'sriduoxXfge':
+tests.append(('%' + f, 1, TypeError))
+for r in ['', '-', 'L', '-L']:
+for f in 'iduoxX':
+tests.append(('%' + f, r, ValueError))
+tests.append(('%o', 'abc', ValueError))
+for r in ('abc', '0abc', '0x', '0xL'):
+for f in 'xX':
+tests.append(('%' + f, r, ValueError))
+
+class X(long):
+def __repr__(self):
+return result
+def __str__(self):
+return result
+def __oct__(self):
+return result
+def __hex__(self):
+return result
+def __float__(self):
+return result
+for fmt, result, exc in tests:
+try:
+fmt % X()
+except exc:
+pass
+else:
+self.fail('%s not raised for %r format of %r' %
+  (exc.__name__, fmt, result))
+
+
 def test_main():
 test_support.run_unittest(FormatTest)
 
diff -r a3e18dd8f267 Objects/stringobject.c
--- a/Objects/stringobject.cSat Oct 04 15:04:41 2014 +0300
+++ b/Objects/stringobject.cSat Oct 04 20:07:18 2014 +0300
@@ -4015,17 +4015,22 @@ PyObject*
 Py_ssize_t llen;
 int numdigits;  /* len == numnondigits + numdigits */
 int numnondigits = 0;
+const char *method;
+int modify = (type == 'X');
 
 switch (type) {
 case 'd':
 case 'u':
+method = "str";
 result = Py_TYPE(val)->tp_str(val);
 break;
 case 'o':
+method = "oct";
 result = Py_TYPE(val)->tp_as_number->nb_oct(val);
 break;
 case 'x':
 case 'X':
+method = "hex";
 numnondigits = 2;
 result = Py_TYPE(val)->tp_as_number->nb_hex(val);
 break;
@@ -4041,25 +4046,39 @@ PyObject*
 return NULL;
 }
 
-/* To modify the string in-place, there can only be one reference. */
-if (Py_REFCNT(result) != 1) {
-PyErr_BadInternalCall();
-return NULL;
-}
-llen = PyString_Size(result);
+llen = PyString_GET_SIZE(result);
 if (llen > INT_MAX) {
 PyErr_SetString(PyExc_ValueError, "string too large in 
_PyString_FormatLong");
+Py_DECREF(result);
 return NULL;
 }
 len = (int)llen;
-if (buf[len-1] == 'L') {
+if (len > 0 && buf[len-1] == 'L') {
 --len;
-buf[len] = '\0';
+if (len == 0)
+goto error;
+modify = 1;
+}
+/* To modify the string in-place, there can only be one reference. */
+if (modify && (llen <= 1 || Py_REFCNT(result) != 1)) {
+/* Do not use PyString_FromStringAndSize(buf, len) because it can
+ * return existing object if len <= 1. */
+PyObject *r1 = PyString_FromStringAndSize(NULL, len);
+if (!r1) {
+Py_DECREF(result);
+return NULL;
+}
+assert(len == 0 || Py_REFCNT(r1) == 1);
+memcpy(PyString_AS_STRING(r1), buf, len);
+Py_DECREF(result);
+result = r1;
+buf = PyString_AS_STRING(result);
 }
 sign = buf[0] == '-';
 numnondigits += sign;
 numdigits = len - numnondigits;
-assert(numdigits > 0);
+if (numdigits <= 0)
+goto error;
 
 /* Get rid of base marker unless F_ALT */
 if ((flags & F_ALT) == 0) {
@@ -4067,7 +4086,8 @@ PyObject*
 int skipped = 0;
 switch (type) {
 case 'o':
-assert(buf[sign] == '0');
+if (buf[sign] != '0')
+goto error;
 /* If 0 is only digit, leave it alone. */
 if (numdigits > 1) {
 skipped = 1;
@@ -4076,8 +4096,9 @@ PyObject*
 break;
 case 'x':
 case 'X':
-assert(buf[sign] == '0');
-assert(buf[sign + 1] == 'x');
+if (buf[sign] != '0' ||
+buf[sign + 1] != 'x')
+goto error;
 skipped = 2;
 numnondigits -= 2;
 break;
@@ -4126,6 +4147,12 @@ PyObject*
 *pbuf = buf;
 *plen = len;
 return result;
+
+error:
+PyErr_Format(PyExc_ValueError, "%%%c format: invalid result of %s.__%s__",
+ type, Py_TYPE(

[issue16314] Support xz compression in distutils

2014-10-04 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
assignee: eric.araujo -> 

___
Python tracker 

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



[issue22515] Implement partial order on Counter

2014-10-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This implementation obeys more set properties.

--
Added file: 
http://bugs.python.org/file36801/issue22515_partial_order_counter_v3.diff

___
Python tracker 

___diff -r 85de13b746ac Lib/collections/__init__.py
--- a/Lib/collections/__init__.py   Sat Oct 04 16:09:02 2014 +0300
+++ b/Lib/collections/__init__.py   Sat Oct 04 22:16:52 2014 +0300
@@ -782,6 +782,64 @@ class Counter(dict):
 self[elem] = other_count
 return self._keep_positive()
 
+def __lt__(self, other):
+if not isinstance(other, Counter):
+return NotImplemented
+found_strict_difference = False
+for elem, count in self.items():
+other_count = other[elem]
+if other_count < count:
+return False
+elif count < other_count:
+found_strict_difference = True
+for elem, count in other.items():
+if elem not in self:
+if count < 0:
+return False
+elif count > 0:
+found_strict_difference = True
+return found_strict_difference
+
+def __le__(self, other):
+if not isinstance(other, Counter):
+return NotImplemented
+for elem, count in self.items():
+if other[elem] < count:
+return False
+for elem, count in other.items():
+if elem not in self and count < 0:
+return False
+return True
+
+def __gt__(self, other):
+if not isinstance(other, Counter):
+return NotImplemented
+found_strict_difference = False
+for elem, count in self.items():
+other_count = other[elem]
+if other_count > count:
+return False
+elif count > other_count:
+found_strict_difference = True
+for elem, count in other.items():
+if elem not in self:
+if count > 0:
+return False
+elif count < 0:
+found_strict_difference = True
+return found_strict_difference
+
+def __ge__(self, other):
+if not isinstance(other, Counter):
+return NotImplemented
+for elem, count in self.items():
+if other[elem] > count:
+return False
+for elem, count in other.items():
+if elem not in self and count > 0:
+return False
+return True
+
 
 
 ###  ChainMap (helper for configparser and string.Template)
diff -r 85de13b746ac Lib/test/test_collections.py
--- a/Lib/test/test_collections.py  Sat Oct 04 16:09:02 2014 +0300
+++ b/Lib/test/test_collections.py  Sat Oct 04 22:16:52 2014 +0300
@@ -1226,6 +1226,105 @@ class TestCounter(unittest.TestCase):
 set_result = setop(set(p.elements()), set(q.elements()))
 self.assertEqual(counter_result, dict.fromkeys(set_result, 1))
 
+def test_partial_order(self):
+counter_0 = Counter()
+counter_1 = Counter('c')
+counter_2 = Counter('abc')
+counter_3 = Counter('aabc')
+counter_4 = Counter('abbc')
+counter_5 = Counter('aabbcc')
+
+bad_d = {'a': 'a', 'b': 'b', 'c': 'c'}
+not_a_mapping = object()
+
+biggest = (
+(counter_5, (counter_4, counter_3, counter_2, counter_1, 
counter_0)),
+(counter_4, (counter_2, counter_1, counter_0)),
+(counter_3, (counter_2, counter_1, counter_0)),
+(counter_2, (counter_1, )),
+(counter_1, (counter_0, )),
+)
+smallest = (
+(counter_0, (counter_1, counter_2, counter_3, counter_4, 
counter_5)),
+(counter_1, (counter_2, counter_3, counter_4, counter_5)),
+(counter_2, (counter_3, counter_4, counter_5)),
+(counter_3, (counter_5, )),
+(counter_4, (counter_5, )),
+)
+for item, smaller_items in biggest:
+for smaller_item in smaller_items:
+self.assertFalse(item <= smaller_item)
+self.assertFalse(item < smaller_item)
+self.assertTrue(item >= smaller_item)
+self.assertTrue(item > smaller_item)
+self.assertTrue(item != smaller_item)
+for item, bigger_items in smallest:
+for bigger_item in bigger_items:
+self.assertFalse(item >= bigger_item)
+self.assertFalse(item > bigger_item)
+self.assertTrue(item <= bigger_item)
+self.assertTrue(item < bigger_item)
+self.assertTrue(item != bigger_item)
+for item in (counter_2, counter_3, counter_4, counter_5):
+ 

[issue21905] RuntimeError in pickle.whichmodule when sys.modules if mutated

2014-10-04 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Sorry for the delay, Olivier. Your patch is now pushed. Thank you!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue21905] RuntimeError in pickle.whichmodule when sys.modules if mutated

2014-10-04 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 86ba3bdfac15 by Antoine Pitrou in branch '3.4':
Issue #21905: Avoid RuntimeError in pickle.whichmodule() when sys.modules is 
mutated while iterating.
https://hg.python.org/cpython/rev/86ba3bdfac15

New changeset d748a3503ad5 by Antoine Pitrou in branch 'default':
Issue #21905: Avoid RuntimeError in pickle.whichmodule() when sys.modules is 
mutated while iterating.
https://hg.python.org/cpython/rev/d748a3503ad5

--
nosy: +python-dev

___
Python tracker 

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



[issue1284316] Win32: Security problem with default installation directory

2014-10-04 Thread Friedrich Spee von Langenfeld

Friedrich Spee von Langenfeld added the comment:

As mentioned before, many packages can not handle paths with spaces. I suppose 
that it is because of lacking knowledge on how to prevent such bugs. What would 
you think? Should this piece of information be in our documentation? Or is it 
already there?

--
nosy: +Friedrich.Spee.von.Langenfeld

___
Python tracker 

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



[issue1284316] Win32: Security problem with default installation directory

2014-10-04 Thread Georg Brandl

Georg Brandl added the comment:

> As mentioned before, many packages can not handle paths with spaces.

This is "common knowledge", yet may not be true anymore.  See this recent 
python-dev thread:

https://mail.python.org/pipermail/python-dev/2014-September/136434.html

--

___
Python tracker 

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



[issue22554] Idle: optionally auto-pop-up completion window for names

2014-10-04 Thread Terry J. Reedy

New submission from Terry J. Reedy:

Currently auto popup after delay only after '.' or in a string.

--
components: IDLE
messages: 228492
nosy: terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: Idle: optionally auto-pop-up completion window for names
type: enhancement
versions: Python 2.7, Python 3.4

___
Python tracker 

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



[issue22554] Idle: optionally auto-pop-up completion window for names

2014-10-04 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Need extension config dialog before add this.  Should then review completion 
extension for options that people might want.

--
dependencies: +IDLE - Add an extension configuration dialog

___
Python tracker 

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



[issue1284316] Win32: Security problem with default installation directory

2014-10-04 Thread eryksun

eryksun added the comment:

>> As mentioned before, many packages can not handle paths with 
>> spaces.
>
> This is "common knowledge", yet may not be true anymore.  

Well, see issue 21699. pip 1.5.6 is still using distlib 0.1.8, so the 
executable wrappers it creates are broken when the path to python.exe contains 
spaces.

--
nosy: +eryksun

___
Python tracker 

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



[issue21173] WeakKeyDictionary.__len__ fragile w/ _IterationGuards

2014-10-04 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Thank you for reporting this. Here is a patch with tests.

--
stage:  -> patch review
versions: +Python 3.5 -Python 3.2, Python 3.3
Added file: http://bugs.python.org/file36802/weakdictlen.patch

___
Python tracker 

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



[issue21699] Windows Python 3.4.1 pyvenv doesn't work in directories with spaces.

2014-10-04 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +Marcus.Smith, dstufft, ncoghlan, pmoore
priority: normal -> critical
stage:  -> needs patch
versions: +Python 3.5

___
Python tracker 

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



[issue19003] email.generator.BytesGenerator corrupts data by changing line endings

2014-10-04 Thread Fabian

Fabian added the comment:

I can confirm this on 3.4.1 and is really annoying. But the patch should set 
'_is_raw_payload' to False if the payload is set via 'set_payload' (the 
operations in 'set_raw_payload' need to be switched).

--
nosy: +xZise

___
Python tracker 

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



[issue8481] doc: ctypes no need to explicitly allocate writable memory with Structure

2014-10-04 Thread Francis MB

Changes by Francis MB :


--
type:  -> enhancement

___
Python tracker 

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



[issue19689] ssl.create_default_context()

2014-10-04 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
status: open -> closed

___
Python tracker 

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



[issue17444] multiprocessing.cpu_count() should use hw.availcpu on Mac OS X

2014-10-04 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
resolution:  -> out of date
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue17636] Modify IMPORT_FROM to fallback on sys.modules

2014-10-04 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
stage: test needed -> needs patch
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



[issue11582] Boilerplate code replaced in Python/ceval.c

2014-10-04 Thread Francis MB

Changes by Francis MB :


--
type:  -> enhancement

___
Python tracker 

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



[issue17636] Modify IMPORT_FROM to fallback on sys.modules

2014-10-04 Thread Antoine Pitrou

Antoine Pitrou added the comment:

This is Brett's tests patch updated against default branch.

--
nosy: +pitrou
Added file: http://bugs.python.org/file36803/import_from_tests2.diff

___
Python tracker 

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



[issue6396] '' % object() raises TypeError

2014-10-04 Thread Francis MB

Changes by Francis MB :


--
type:  -> behavior

___
Python tracker 

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



[issue11866] race condition in threading._newname()

2014-10-04 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a6b4add67168 by R David Murray in branch '2.7':
#11866: Eliminate race condition in the computation of names for new threads.
https://hg.python.org/cpython/rev/a6b4add67168

New changeset a6906b9e21d5 by R David Murray in branch '3.4':
#11866: Eliminate race condition in the computation of names for new threads.
https://hg.python.org/cpython/rev/a6906b9e21d5

New changeset e9afcce9a154 by R David Murray in branch 'default':
Merge: #11866: Eliminate race condition in the computation of names for new 
threads.
https://hg.python.org/cpython/rev/e9afcce9a154

--
nosy: +python-dev

___
Python tracker 

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



[issue11866] race condition in threading._newname()

2014-10-04 Thread R. David Murray

R. David Murray added the comment:

I committed a version of this that uses Raymond's suggestion and also makes 
sure that the first thread is named Thread-1 as it has been in the past (there 
was a test failure without that fix, but I also think it makes sense for it to 
be Thread-1 since one would normally think of the main thread as thread 0).

I did not try to turn the test script into a test case because it would take a 
long time to run if it is to have a reasonable chance of displaying the bug, 
and it would never be a consistent failure.

Thanks, Peter; sorry it took so long to get this committed.

--
nosy: +r.david.murray
resolution: accepted -> fixed
stage: commit review -> resolved
status: open -> closed
versions: +Python 3.4, Python 3.5 -Python 2.6, Python 3.1, Python 3.2, Python 
3.3

___
Python tracker 

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



[issue15855] memoryview methods and data members are missing docstrings

2014-10-04 Thread R. David Murray

R. David Murray added the comment:

It looks like there is nothing left to do here and the issue was left open by 
mistake.  If I'm wrong, someone can reopen it with a note as to what remains to 
be done (or open a new issue).

--
nosy: +r.david.murray
resolution:  -> fixed
stage: commit review -> resolved
status: open -> closed

___
Python tracker 

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



[issue17636] Modify IMPORT_FROM to fallback on sys.modules

2014-10-04 Thread Antoine Pitrou

Antoine Pitrou added the comment:

And this is a full patch.

--
stage: needs patch -> patch review
Added file: http://bugs.python.org/file36804/import_from_tests2.diff

___
Python tracker 

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



[issue17636] Modify IMPORT_FROM to fallback on sys.modules

2014-10-04 Thread Antoine Pitrou

Changes by Antoine Pitrou :


Added file: http://bugs.python.org/file36805/circrelimports.patch

___
Python tracker 

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



[issue17636] Modify IMPORT_FROM to fallback on sys.modules

2014-10-04 Thread Antoine Pitrou

Antoine Pitrou added the comment:

(full patch is actually the latest upload: circrelimports.patch. Sorry for the 
glitch)

--

___
Python tracker 

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



[issue22552] ctypes.CDLL returns singleton objects, resulting in usage conflicts

2014-10-04 Thread R. David Murray

R. David Murray added the comment:

How does this relate to issue 14201?  That is, is the answer just "use getitem 
if you don't want caching"?  (And apply the doc patch from that issue :)

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



[issue21965] Add support for Memory BIO to _ssl

2014-10-04 Thread Geert Jansen

Geert Jansen added the comment:

> One issue with the "owner" is that there is now a reference cycle between 
> SSLSocket and SSLObject (something which the original design is careful to 
> avoid by using weakrefs in the _ssl module).

Note that owner is a weakref :) Did you look at the code?

--

___
Python tracker 

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



[issue14201] Documented caching for shared library's __getattr__ and __getitem__ is incorrect

2014-10-04 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ae64614b66b7 by R David Murray in branch '2.7':
#14201: Update ctypes docs to match behavior changed from 214b28d7a999.
https://hg.python.org/cpython/rev/ae64614b66b7

New changeset 5518aa0fbc06 by R David Murray in branch '3.4':
#14201: Update ctypes docs to match behavior changed from 214b28d7a999.
https://hg.python.org/cpython/rev/5518aa0fbc06

New changeset dfdcc3fad3aa by R David Murray in branch 'default':
Merge: #14201: Update ctypes docs to match behavior changed from 214b28d7a999.
https://hg.python.org/cpython/rev/dfdcc3fad3aa

--
nosy: +python-dev

___
Python tracker 

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



[issue21965] Add support for Memory BIO to _ssl

2014-10-04 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Ahhh. I had forgotten about that. It may be worthwhile to add a comment in 
SSLObject.__init__, then. Also, can you provide a cumulated patch?

--

___
Python tracker 

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



[issue14201] Documented caching for shared library's __getattr__ and __getitem__ is incorrect

2014-10-04 Thread R. David Murray

R. David Murray added the comment:

Committed.  See also issue 22552.

--
nosy: +r.david.murray
resolution:  -> fixed
stage: commit review -> resolved
status: open -> closed

___
Python tracker 

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



[issue16866] libainstall doesn't create $(BINDIR) directory

2014-10-04 Thread R. David Murray

R. David Murray added the comment:

Looks like the status for this one should really be "needs decision".  It is 
sounds like the provided patch is not sufficient regardless, so  'commit 
review' is no longer the appropriate state.  I'm changing it back to patch 
needed as the closest available state, but we also need a decision.

--
nosy: +r.david.murray
stage: commit review -> needs patch
versions: +Python 3.5 -Python 3.2, Python 3.3

___
Python tracker 

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



[issue18131] Tkinter Variables require a proper master

2014-10-04 Thread Martin Panter

Changes by Martin Panter :


--
nosy: +vadmium

___
Python tracker 

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



[issue21965] Add support for Memory BIO to _ssl

2014-10-04 Thread Geert Jansen

Geert Jansen added the comment:

Addded the comment about owner being a weakref, and added a new consolidated 
patch (ssl-memory-bio-5).

--
Added file: http://bugs.python.org/file36806/ssl-memory-bio-5.patch

___
Python tracker 

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



[issue13473] Add tests for files byte-compiled by distutils

2014-10-04 Thread R. David Murray

R. David Murray added the comment:

Looks like someone should revise this patch taking in to account Nick's 
feedback, and updating it to apply to distutils instead of the now-defunct 
distutils2/packaging.  

Moving stage to 'needs patch'.

--
assignee: eric.araujo -> 
components:  -Distutils2
nosy: +dstufft, r.david.murray
stage: commit review -> needs patch
title: Add tests for files byte-compiled by distutils[2] -> Add tests for files 
byte-compiled by distutils
versions: +Python 3.4, Python 3.5 -3rd party, Python 3.2, Python 3.3

___
Python tracker 

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



[issue11063] uuid.py module import has heavy side effects

2014-10-04 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +serhiy.storchaka
stage: needs patch -> patch review
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



[issue6653] Potential memory leak in multiprocessing

2014-10-04 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Closing as won't fix.

--
resolution:  -> wont fix
stage: needs patch -> resolved
status: open -> closed

___
Python tracker 

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



  1   2   >