[issue22457] load_tests not invoked in root __init__.py when start=package root

2014-09-21 Thread mike bayer

Changes by mike bayer :


--
nosy: +zzzeek

___
Python tracker 

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



[issue22442] subprocess.check_call hangs on large PIPEd data.

2014-09-21 Thread Akira Li

Akira Li added the comment:

Victor, the message in my patch is copied almost verbatim from the 
current subprocess' documentation [1]

[1] 
https://hg.python.org/cpython/file/850a62354402/Doc/library/subprocess.rst#l57

People use `call(cmd, stdout=PIPE)` as a *broken* way to suppress 
output i.e., when they actually want `call(cmd, stdout=DEVNULL)`

The issue with `call(cmd, stdout=PIPE)` that it *appears* to work
if cmd doesn't produce much output i.e., it might work in tests but
may hang in production.

It is unrelated to check_output(), getstatusouptut() or getoutput().

--

___
Python tracker 

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



[issue22457] load_tests not invoked in root __init__.py when start=package root

2014-09-21 Thread Robert Collins

New submission from Robert Collins:

python -m unittest discover -t . foo

where foo is a package

will not trigger load_tests in foo/__init__.py.

To reproduce:

mkdir -p demo/tests
cd demo
cat < tests/__init__.py
import sys
import os

def load_tests(loader, tests, pattern):
print("HI WE ARE LOADING!")
this_dir = os.path.dirname(__file__)
tests.addTest(loader.discover(start_dir=this_dir, pattern=pattern))
return tests
EOF

python -m unittest discover -t . tests

--
messages: 227250
nosy: rbcollins
priority: normal
severity: normal
status: open
title: load_tests not invoked in root __init__.py when start=package root

___
Python tracker 

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



[issue19111] 2to3 should remove from future_builtins import *

2014-09-21 Thread Kevin Christopher Henry

Kevin Christopher Henry added the comment:

I'm interested in working on this, but it's not clear to me if this has been 
accepted as a bug. I converted a large project recently and was shocked to find 
that all 100+ files were broken because of the needless "from 
future_builtins..." line. Perversely, this most hurts those who made the most 
effort to make their code forward-compatible with Python 3.

One complication is that you can't simply substitute a blank line, since that 
could produce invalid code if the import is inside a try/except block. (This 
doesn't affect "from __future__..." since that can only be at the start of a 
file.) Substituting a "pass" should work fine though. That would be a bit 
unsightly, but then again so is the blank line at the start of the file 
produced by removing "from __future__...". More important is to produce code 
that actually works under Python 3.

Another issue is that it's possible to simply "import future_builtins" and then 
use, for example, "future_builtins.zip(...)". So trying to fix that usage as 
well would be (I assume) a lot more complicated. Personally it seems fine with 
me to just fix the "from __future_builtins__..." usage.

--
nosy: +marfire
versions: +Python 3.5 -Python 3.3

___
Python tracker 

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



[issue19119] duplicate test name in Lib/test/test_heapq.py

2014-09-21 Thread Ben Roberts

Ben Roberts added the comment:

Attached patch fixes the tests.

--
Added file: http://bugs.python.org/file36683/fix_heapq_tests.patch

___
Python tracker 

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



[issue1159] os.getenv() not updated after external module uses C putenv()

2014-09-21 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



[issue4887] environment inspection and manipulation API is buggy, inconsistent with "Python philosophy" for wrapping native APIs

2014-09-21 Thread Martin Panter

Martin Panter added the comment:

I suspect the $PATH example is a bad example. On my Linux setup, my initial 
PATH value is a customized path. After popping it and calling system(), I see a 
simpler default path, which is probably re-initialized somewhere else.

I suspect there is no environ.pop() bug. Everthing works according the 
documentation if you use another environment variable:

$ TEST_VARIABLE=value python
Python 3.4.0 (default, Mar 17 2014, 23:20:09) 
[GCC 4.8.2 20140206 (prerelease)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.system('echo "$TEST_VARIABLE"')
value
0
>>> os.environ.pop("TEST_VARIABLE")
'value'
>>> os.system('echo "$TEST_VARIABLE"')

0

The other point in this report, about synchronizing “os.environ” with the C 
APIs, is a duplicate of Issue 1159.

--

___
Python tracker 

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



[issue19119] duplicate test name in Lib/test/test_heapq.py

2014-09-21 Thread Ben Roberts

Ben Roberts added the comment:

> The major issue (there are other issues as well but not so difficult) is 
> whether nlargest and nsmallest should support iterator that could be endless 
> iterator or reject it (by checking __len__ attribute) straight away.

Well, failing with an exception isn't right.  I can imagine doing (and probably 
have done, at some point) nlargest on any number of generators, streams of 
data, etc.

So unless anyone can solve the halting problem (:-)) the behavior of nlargest 
is correct as possible; nlargest(2, GetOnly()) behaves just like 
list(GetOnly()) - they both hang forever.

The proper action here is just a fix in the tests: make GetOnly raise 
IndexError at some point so that it is a proper sequence.  (also rename the 
second test to get_cmp_only)

--
nosy: +roippi

___
Python tracker 

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



[issue22455] idna/punycode give wrong results on narrow builds

2014-09-21 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +lemburg, ncoghlan

___
Python tracker 

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



[issue22456] __base__ undocumented

2014-09-21 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis added the comment:

__base__ exists also in Jython and PyPy.

--

___
Python tracker 

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



[issue22454] Adding the opposite function of shlex.split()

2014-09-21 Thread Ben Roberts

Ben Roberts added the comment:

For the record I am on board with a shlex.join.  Even though the implementation 
is simple:

- It is not obvious to many users if there are any "gotchas" by doing a ' 
'.join yourself, /even if/ you know that strings with spaces in them need to 
pass through shlex.quote first.
- The symmetry of shlex.split and shlex.join is obvious - I don't need to read 
any documentation to know that they are inverse operations.
- "batteries included," "one obvious way," and all that.

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



[issue22456] __base__ undocumented

2014-09-21 Thread Guido van Rossum

Guido van Rossum added the comment:

Raymond is correct. __base__ is closely tied to the C implementation.  I think 
it might be worth a mention, but with an explicit note that it is 
CPython-specific.  It is sometimes useful, e.g. when wondering why a certain 
case of multiple inheritance is rejected.

--

___
Python tracker 

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



[issue22456] __base__ undocumented

2014-09-21 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I think that __base__ was intended to be a non-guaranteed implementation detail 
for new-style classes just like  __dictoffset__ and __flags__ .

--
nosy: +gvanrossum, rhettinger

___
Python tracker 

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



[issue22456] __base__ undocumented

2014-09-21 Thread Arfrever Frehtes Taifersar Arahesis

New submission from Arfrever Frehtes Taifersar Arahesis:

__bases__ is documented, but __base__ is not.

$ grep -r __base__ Doc
$ grep -r __bases__ Doc
Doc/c-api/object.rst:are different objects, *B*'s :attr:`~class.__bases__` 
attribute is searched in
Doc/c-api/object.rst:a depth-first fashion for *A* --- the presence of the 
:attr:`~class.__bases__`
Doc/extending/newtypes.rst:   in its :attr:`~class.__bases__`, or else it will 
not be able to call your type's
Doc/library/email.headerregistry.rst:class's ``__bases__`` list.
Doc/library/functions.rst:   tuple itemizes the base classes and becomes the 
:attr:`~class.__bases__`
Doc/library/stdtypes.rst:.. attribute:: class.__bases__
Doc/reference/datamodel.rst:  single: __bases__ (class attribute)
Doc/reference/datamodel.rst:   dictionary containing the class's namespace; 
:attr:`~class.__bases__` is a
Doc/whatsnew/2.3.rst:  removed: you can now assign to the :attr:`__name__` and 
:attr:`__bases__`
Doc/whatsnew/2.3.rst:  assigned to :attr:`__bases__` along the lines of those 
relating to assigning to

--
assignee: docs@python
components: Documentation
keywords: easy
messages: 227241
nosy: Arfrever, docs@python
priority: normal
severity: normal
status: open
title: __base__ undocumented
type: enhancement
versions: Python 2.7, 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



[issue22455] idna/punycode give wrong results on narrow builds

2014-09-21 Thread Buck Golemon

New submission from Buck Golemon:

I have "fixed" the issue in my branch here:
https://github.com/bukzor/cpython/commit/013e689731ba32319f05a62a602f01dd7d7f2e83

I don't propose it as a patch, but as a proof of concept and point of 
discussion.

If there's no chance of shipping a fix in 2.7.9, feel free to close.

--
messages: 227240
nosy: bukzor
priority: normal
severity: normal
status: open
title: idna/punycode give wrong results on narrow builds
versions: Python 2.7

___
Python tracker 

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



[issue22454] Adding the opposite function of shlex.split()

2014-09-21 Thread Sworddragon

Sworddragon added the comment:

Yes, it is possible to do this with a few other commands. But I think it would 
be still a nice enhancement to have a direct function for it.

--

___
Python tracker 

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



[issue22362] Warn about octal escapes > 0o377 in re

2014-09-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

If this is error, should the patch be applied to maintained releases?

--

___
Python tracker 

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



[issue22437] re module: number of named groups is limited to 100 max

2014-09-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch which removes static limit. It is much more complicated than 
the first patch and I prefer first apply the first patch. Aren't 1000 groups 
enough for everyone?

--
Added file: http://bugs.python.org/file36682/re_maxgroups_dynamic.patch

___
Python tracker 

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



[issue12728] Python re lib fails case insensitive matches on Unicode data

2014-09-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is preliminary patch which fixes case-insensitive regular expression 
matching of unicode strings. It is incomplete, it needs applying patches from 
issue17381, which fixes other aspects of case-insensitive matching.

One bug is left for Turkish letters. This matching is not transitive. Three 
pairs of letters should match: ı ~ I ~ i ~ İ. All other combinations should not 
match (ı !~ i, I !~ İ, ı !~ İ). This patch doesn't fixes this bug.

--
assignee:  -> serhiy.storchaka
dependencies: +IGNORECASE breaks unicode literal range matching
keywords: +patch
nosy: +serhiy.storchaka
stage: needs patch -> patch review
versions: +Python 3.5 -Python 3.3
Added file: http://bugs.python.org/file36681/re_ignore_case.patch

___
Python tracker 

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



[issue22454] Adding the opposite function of shlex.split()

2014-09-21 Thread Ben Roberts

Ben Roberts added the comment:

' '.join(shlex.quote(x) for x in split_command)

--
nosy: +roippi

___
Python tracker 

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



[issue22435] socketserver.TCPSocket leaks socket to garbage collector if server_bind() fails

2014-09-21 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Patch looks of to me.

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



[issue22445] Memoryviews require more strict contiguous checks then necessary

2014-09-21 Thread Stefan Krah

Stefan Krah added the comment:

Thanks!  I still have to review the patch in depth, but generally
I'm +1 now for relaxing the contiguity check.

Curiously enough the existing code already considered e.g. shape=[1], 
strides=[-5] as contiguous.

--

___
Python tracker 

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



[issue22415] Fix re debugging output

2014-09-21 Thread Roundup Robot

Roundup Robot added the comment:

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

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

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

--
nosy: +python-dev

___
Python tracker 

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



[issue22415] Fix re debugging output

2014-09-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Committed with Antoine's suggestion. Thank you Antoine.

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



[issue22423] Errors in printing exceptions raised in a thread

2014-09-21 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c925b436467a by Serhiy Storchaka in branch '2.7':
Issue #22423: Fixed debugging output of the GROUPREF_EXISTS opcode in the re
https://hg.python.org/cpython/rev/c925b436467a

New changeset e99a1df8db36 by Serhiy Storchaka in branch '3.4':
Issue #22423: Fixed debugging output of the GROUPREF_EXISTS opcode in the re
https://hg.python.org/cpython/rev/e99a1df8db36

New changeset fe287268e97b by Serhiy Storchaka in branch 'default':
Issue #22423: Fixed debugging output of the GROUPREF_EXISTS opcode in the re
https://hg.python.org/cpython/rev/fe287268e97b

--

___
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-09-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Senthil for your review. Committed with you suggestion.

--

___
Python tracker 

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



[issue22454] Adding the opposite function of shlex.split()

2014-09-21 Thread Sworddragon

New submission from Sworddragon:

There is currently shlex.split() that is for example useful to split a command 
string and pass it to subprocess.Popen with shell=False. But I'm missing a 
function that does the opposite: Building the command string from a list that 
could for example then be used in subprocess.Popen with shell=True.

--
components: Library (Lib)
messages: 227228
nosy: Sworddragon
priority: normal
severity: normal
status: open
title: Adding the opposite function of shlex.split()
type: enhancement
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



[issue22423] Errors in printing exceptions raised in a thread

2014-09-21 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4baa474b4f31 by Serhiy Storchaka in branch '2.7':
Issue #22423: Unhandled exception in thread no longer causes unhandled
https://hg.python.org/cpython/rev/4baa474b4f31

New changeset 176579df4edd by Serhiy Storchaka in branch '3.4':
Issue #22423: Unhandled exception in thread no longer causes unhandled
https://hg.python.org/cpython/rev/176579df4edd

New changeset 644b677c2ae5 by Serhiy Storchaka in branch 'default':
Issue #22423: Unhandled exception in thread no longer causes unhandled
https://hg.python.org/cpython/rev/644b677c2ae5

--
nosy: +python-dev

___
Python tracker 

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



[issue22443] read(1) blocks on unflushed output

2014-09-21 Thread Sworddragon

Sworddragon added the comment:

It works if "-q 0" is given without the need of a workaround. So this was just 
a feature of apt that was causing this behavior. I think here is nothing more 
to do so I'm closing this ticket.

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



[issue22442] subprocess.check_call hangs on large PIPEd data.

2014-09-21 Thread STINNER Victor

STINNER Victor added the comment:

The first place to warn uses about dangerous function calls is the 
documentation, and your patch doesn't touch the documentation.

You can for example suggest to use check_output(), getstatusouptut() or 
getoutput().

--

___
Python tracker 

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



[issue21332] subprocess bufsize=1 docs are misleading

2014-09-21 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Pushed! Thank you!

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



[issue21332] subprocess bufsize=1 docs are misleading

2014-09-21 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 38867f90f1d9 by Antoine Pitrou in branch '3.4':
Issue #21332: Ensure that ``bufsize=1`` in subprocess.Popen() selects line 
buffering, rather than block buffering.
https://hg.python.org/cpython/rev/38867f90f1d9

New changeset 763d565e5840 by Antoine Pitrou in branch 'default':
Issue #21332: Ensure that ``bufsize=1`` in subprocess.Popen() selects line 
buffering, rather than block buffering.
https://hg.python.org/cpython/rev/763d565e5840

--
nosy: +python-dev

___
Python tracker 

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



[issue22452] addTypeEqualityFunc is not used in assertListEqual

2014-09-21 Thread Ezio Melotti

Ezio Melotti added the comment:

Currently assertListEqual calls assertSequenceEqual, and assertSequenceEqual 
doesn't use any function to compare list elements -- it just does "if item1 != 
item2:" (https://hg.python.org/cpython/file/default/Lib/unittest/case.py).  
Checking the types of the two items and compare them recursively could be done, 
but it's not as simple as it sounds, since using e.g. assertSequenceEqual will 
raise an error message that will need to be caught and integrated with the 
error message that it's already being constructed, possibly resulting in a long 
and unreadable message.

Since this is a somewhat specific situation, it might be better if you just 
defined your own assert function for nested lists.  In addition to nested lists 
you might have a dictionary that contains lists, or a set of tuples or any 
other combinations of arbitrarily nested containers, and having a generic way 
to handle them all will require quite a lot of work.

One thing that could be done is to add more attributes to the exception raised 
by assertSequenceEqual (and others), so that you could do something like:
try:
self.assertEqual(nested_list1, nested_list2)
except AssertionError as exc:
index = exc.first_differing_index
self.assertEqual(nested_list1[index], nested_list2[index], msg=str(exc))

Not sure how that will look light though, and it's still not a generic 
solution, but if you know what are you dealing with, it might be helpful.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue21079] EmailMessage.is_attachment == False if filename is present

2014-09-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Following expression looks more clear to me:

c_d is not None and c_d.content_disposition == 'attachment'

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue17432] PyUnicode_ functions not accessible in Limited API on Windows

2014-09-21 Thread SilentGhost

Changes by SilentGhost :


--
title: ucs2 -> PyUnicode_ functions not accessible in Limited API on Windows

___
Python tracker 

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



[issue17432] ucs2

2014-09-21 Thread SilentGhost

Changes by SilentGhost :


--
title: PyUnicode_ functions not accessible in Limited API on Windows -> ucs2

___
Python tracker 

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



[issue22434] Use named constants internally in the re module

2014-09-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> NamedIntConstant should be private, though.

Agree. I'll add underscore to NamedIntConstant and makecode before committing 
(as in enum patch).

--

___
Python tracker 

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



[issue22452] addTypeEqualityFunc is not used in assertListEqual

2014-09-21 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



[issue22453] PyObject_REPR macro causes refcount leak

2014-09-21 Thread Chris Colbert

New submission from Chris Colbert:

This is how the macro is defined in object.h:

2.7
/* Helper for passing objects to printf and the like */
#define PyObject_REPR(obj) PyString_AS_STRING(PyObject_Repr(obj))

3.4
/* Helper for passing objects to printf and the like */
#define PyObject_REPR(obj) _PyUnicode_AsString(PyObject_Repr(obj))


PyObject_Repr returns a new reference, which is not released by the macro. 

This macro only seems to be used internally for error reporting in compile.c, 
so it's unlikely to be causing any pressing issues for the interpreter, but it 
may be biting some extension modules.

--
components: Extension Modules, Interpreter Core
messages: 227219
nosy: Chris.Colbert
priority: normal
severity: normal
status: open
title: PyObject_REPR macro causes refcount leak
type: behavior
versions: 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



[issue22434] Use named constants internally in the re module

2014-09-21 Thread Guido van Rossum

Guido van Rossum added the comment:

OK, then if you want to review Serhiy's original patch that would be great.

On Sun, Sep 21, 2014 at 5:12 AM, Antoine Pitrou 
wrote:

>
> Antoine Pitrou added the comment:
>
> I think I agree with Serhiy. Augmenting the import dependencies from the
> re module can have side effects. While the alternative (a custom Int
> subclass) isn't extremely pretty, it does the job.
>
> NamedIntConstant should be private, though.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue22442] subprocess.check_call hangs on large PIPEd data.

2014-09-21 Thread Akira Li

Akira Li added the comment:

@juj: DeprecationWarning is generated if PIPE is passed to call() as
any positional or keyword argument in particular stdin, stdout, stderr.
It also applies to check_call() that uses call() internally.

--

___
Python tracker 

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



[issue21332] subprocess bufsize=1 docs are misleading

2014-09-21 Thread Antoine Pitrou

Antoine Pitrou added the comment:

The latest patch looks good to me.

--
nosy: +pitrou

___
Python tracker 

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



[issue21332] subprocess bufsize=1 docs are misleading

2014-09-21 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
assignee: gregory.p.smith -> 
stage:  -> commit review
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



[issue22445] Memoryviews require more strict contiguous checks then necessary

2014-09-21 Thread Sebastian Berg

Changes by Sebastian Berg :


Added file: http://bugs.python.org/file36680/contiguous.py

___
Python tracker 

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



[issue21332] subprocess bufsize=1 docs are misleading

2014-09-21 Thread Akira Li

Changes by Akira Li <4kir4...@gmail.com>:


Added file: 
http://bugs.python.org/file36679/subprocess-line-buffering-issue21332-ps5.patch

___
Python tracker 

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



[issue22449] SSLContext.load_verify_locations behavior on Windows and OSX

2014-09-21 Thread Christian Heimes

Christian Heimes added the comment:

There is only a test case for ssl.get_default_verify_paths(), but not for 
SSLContext or SSLSocket.

--

___
Python tracker 

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



[issue22445] Memoryviews require more strict contiguous checks then necessary

2014-09-21 Thread Sebastian Berg

Changes by Sebastian Berg :


Added file: http://bugs.python.org/file36678/contiguous.py

___
Python tracker 

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



[issue22445] Memoryviews require more strict contiguous checks then necessary

2014-09-21 Thread Sebastian Berg

Changes by Sebastian Berg :


Added file: http://bugs.python.org/file36677/relaxed-strides-checking.patch

___
Python tracker 

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



[issue22434] Use named constants internally in the re module

2014-09-21 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I think I agree with Serhiy. Augmenting the import dependencies from the re 
module can have side effects. While the alternative (a custom Int subclass) 
isn't extremely pretty, it does the job.

NamedIntConstant should be private, though.

--

___
Python tracker 

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



[issue22451] filtertuple, filterstring and filterunicode don't have optimization for PyBool_Type

2014-09-21 Thread Antoine Pitrou

Changes by Antoine Pitrou :


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



[issue22445] Memoryviews require more strict contiguous checks then necessary

2014-09-21 Thread Sebastian Berg

Sebastian Berg added the comment:

I am very sorry. The attached patch fixes this (not sure if quite right, but if 
anything should be more general then necessary). One test fails, but it looks 
like exactly the intended change.

--
Added file: http://bugs.python.org/file36676/relaxed-strides-checking.patch

___
Python tracker 

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



[issue22452] addTypeEqualityFunc is not used in assertListEqual

2014-09-21 Thread Antoine Pitrou

Antoine Pitrou added the comment:

That sounds reasonable to me. Do you want to provide a patch?
See https://docs.python.org/devguide/ for guidelines.

--
nosy: +ezio.melotti, michael.foord, pitrou
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



[issue22449] SSLContext.load_verify_locations behavior on Windows and OSX

2014-09-21 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Do we have tests for SSL_CERT_DIR and SSL_CERT_FILE being "respected"?
Otherwise, it might make sense to add one.

--

___
Python tracker 

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



[issue22452] addTypeEqualityFunc is not used in assertListEqual

2014-09-21 Thread Simon Zack

Changes by Simon Zack :


--
type:  -> enhancement

___
Python tracker 

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



[issue22452] addTypeEqualityFunc is not used in assertListEqual

2014-09-21 Thread Simon Zack

New submission from Simon Zack:

Functions added by addTypeEqualityFunc is not used for comparing list elements 
in assertListEqual, and only used in assertEqual.

It would be nice to have assertListEqual use functions added by 
addTypeEqualityFunc for comparisons of list elements. I think this provides 
more flexibility, and we get nicely formatted error messages for nested list 
compares for free.

--
components: Library (Lib)
messages: 227210
nosy: simonzack
priority: normal
severity: normal
status: open
title: addTypeEqualityFunc is not used in assertListEqual

___
Python tracker 

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



[issue22449] SSLContext.load_verify_locations behavior on Windows and OSX

2014-09-21 Thread Christian Heimes

Christian Heimes added the comment:

'to respect' is the wrong term. 

The patch makes the code use the two env vars. Even with my patch the function 
doesn't respect SSL_CERT_DIR and SSL_CERT_FILE because Windows' cert store is 
still in use. On Linux and BSD the two env vars replace the default locations.

--

___
Python tracker 

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



[issue22366] urllib.request.urlopen should take a "context" (SSLContext) argument

2014-09-21 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever
title: urllib.request.urlopen shoudl take a "context" (SSLContext) argument -> 
urllib.request.urlopen should take a "context" (SSLContext) argument

___
Python tracker 

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



[issue22450] urllib doesn't put Accept: */* in the headers

2014-09-21 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue22444] Floor divide should return int

2014-09-21 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue22407] re.LOCALE is nonsensical for Unicode

2014-09-21 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue22425] 2to3 import fixer writes dotted_as_names into import_as_names

2014-09-21 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue22419] wsgiref request length

2014-09-21 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue22417] PEP 476: verify HTTPS certificates by default

2014-09-21 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue22442] subprocess.check_call hangs on large PIPEd data.

2014-09-21 Thread juj

juj added the comment:

Hmm, that path does it for stdout=PIPE in subprocess.call only? It could 
equally apply to stderr=PIPE in subprocess.call as well, and also to both 
stdout=PIPE and stderr=PIPE in subprocess.check_call?

--

___
Python tracker 

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



[issue22451] filtertuple, filterstring and filterunicode don't have optimization for PyBool_Type

2014-09-21 Thread Joshua Landau

Joshua Landau added the comment:

That sounds OK to me. It's a bit of a non-issue once you know about it.

--

___
Python tracker 

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



[issue11798] Test cases not garbage collected after run

2014-09-21 Thread Berker Peksag

Changes by Berker Peksag :


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



[issue22442] subprocess.check_call hangs on large PIPEd data.

2014-09-21 Thread Akira Li

Akira Li added the comment:

> What do you think?

I would prefer to deprecate PIPE argument for subprocess.call():
issue DeprecationWarning in 3.5 and raise ValueError in 3.6+

I've uploaded a patch that issues the warning.

--
keywords: +patch
type:  -> enhancement
versions: +Python 3.5 -Python 2.7
Added file: http://bugs.python.org/file36675/subprocess.call-deprecate-PIPE.diff

___
Python tracker 

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



[issue19119] duplicate test name in Lib/test/test_heapq.py

2014-09-21 Thread Berker Peksag

Changes by Berker Peksag :


--
stage:  -> patch review
versions: +Python 3.5 -Python 3.3

___
Python tracker 

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



[issue22447] logging.config.fileConfig attempts to write to file even when none configured

2014-09-21 Thread Vinay Sajip

Vinay Sajip added the comment:

I don't propose to make any changes to `fileConfig()`, for the following 
reasons:

1. It's not a bug, because there is no requirement to do what you suggest. You 
could (a) either not mention the handler in the config if you aren't going to 
use it, (b) use a delay parameter so the file opening is deferred until it's 
first needed, or (c) specify a file location which is accessible to the running 
process.

2. While it is not deprecated, the fileConfig() API has been supplanted by the 
dictConfig() API and is not receiving any functional changes. For the specific 
case you mention, dictConfig() would behave similarly to fileConfig(), and this 
wouldn't be a bug either: please use an approach such as those suggested in my 
earlier point to overcome your problem.

--
resolution:  -> not a bug
status: open -> closed
type: behavior -> enhancement

___
Python tracker 

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



[issue22451] filtertuple, filterstring and filterunicode don't have optimization for PyBool_Type

2014-09-21 Thread Raymond Hettinger

Raymond Hettinger added the comment:

It is a bit late in the game for 2.7 micro-optimizations.

FWIW, I don't think these weren't oversights. There isn't really much of a use 
case for the bool filter for strings and unicode inputs.  And the case of tuple 
inputs isn't used much ("lists are for looping/filtering and tuples are like 
records in a DB or structs in C").

Since there is no bug here and we're trying to touch 2.7 as little as possible 
these days, I recommend closing as "not a bug" or "won't fix".

If optimizing uncommon cases is important for you, then just use "filter(None, 
iterable)" instead of "filter(bool, iterable)" or work with itertools.ifilter() 
and itertools.ifilterfalse().

--

___
Python tracker 

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