[issue22234] urllib.parse.urlparse accepts any falsy value as an url

2016-04-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: `x != ''` emits BytesWarning if x is bytes. 'encode' attribute is not needed for URL parsing. any() is slower that a `for` loop. I would suggest to look at efficient os.path implementations. -- nosy: +serhiy.storchaka

[issue26847] filter docs unclear wording

2016-04-25 Thread Georg Brandl
Georg Brandl added the comment: You didn't test your examples: >>> [] == False False False is not equal to the "empty value" of any other type than other numeric types. (This is mostly because of how booleans were originally introduced to Python.) "is false", on the other hand, is the

[issue26848] asyncio.subprocess's communicate() method mishandles empty input bytes

2016-04-25 Thread Jack O'Connor
Jack O'Connor added the comment: Related: The asyncio communicate() method differs from standard subprocess in how it treats input bytes when stdin is (probably mistakenly) not set to PIPE. Like this: proc = await create_subprocess_shell("sleep 5") await proc.communicate(b"foo") #

[issue26848] asyncio.subprocess's communicate() method mishandles empty input bytes

2016-04-25 Thread Jack O'Connor
Jack O'Connor added the comment: Thanks for the heads up, Berker, I've re-submitted the PR as https://github.com/python/asyncio/pull/335. -- ___ Python tracker

[issue26848] asyncio.subprocess's communicate() method mishandles empty input bytes

2016-04-25 Thread Berker Peksag
Berker Peksag added the comment: python/cpython is a semi-official read-only mirror of hg.python.org/cpython. We haven't switched to GitHub yet. You may want to open a pull request to https://github.com/python/asyncio See https://github.com/python/asyncio/wiki/Contributing for details.

[issue26848] asyncio.subprocess's communicate() method mishandles empty input bytes

2016-04-25 Thread Jack O'Connor
New submission from Jack O'Connor: Setting stdin=PIPE and then calling communicate(b"") should close the child's stdin immediately, similar to stdin=DEVNULL. Instead, communicate() treats b"" like None and leaves the child's stdin open, which makes the child hang forever if it tries to read

[issue22234] urllib.parse.urlparse accepts any falsy value as an url

2016-04-25 Thread Luiz Poleto
Luiz Poleto added the comment: As discussed on the Mentors list, the attached patch (issue22234_37.patch) changes the urlparse function to handle non-str and non-bytes arguments and adds a new test case for it. -- Added file: http://bugs.python.org/file42592/issue22234_37.patch

[issue22234] urllib.parse.urlparse accepts any falsy value as an url

2016-04-25 Thread Luiz Poleto
Luiz Poleto added the comment: As discussed on the Mentors list, the attached patch (issue22234_36.patch) includes the deprecation warning (and related test) on the urlparse function. -- keywords: +patch versions: +Python 3.6 -Python 3.4 Added file:

[issue26847] filter docs unclear wording

2016-04-25 Thread Luke
Luke added the comment: josh, we're saying the same thing but misunderstanding each other. :) I realize that they can be empty containers, etc., and that's why I think "equal to False" is appropriate -- because those things *are* equal to False: >>> [] == False True >>> 0 == False True etc.

[issue26847] filter docs unclear wording

2016-04-25 Thread Josh Rosenberg
Josh Rosenberg added the comment: That's why lower case "false" is used, not "False"; the former is the loose definition, the latter is the strict singleton. -- ___ Python tracker

[issue26847] filter docs unclear wording

2016-04-25 Thread Josh Rosenberg
Josh Rosenberg added the comment: "are equal to False" would be wrong though. Any "falsy" value is preserved by filterfalse, and removed by filter. They need not be equal to False (the bool singleton); empty containers (e.g. (), [], {}, "") are all considered false, and behave as such,

[issue26847] filter docs unclear wording

2016-04-25 Thread Luke
New submission from Luke: The current docs for both filter and itertools.filterfalse use the following wording (emphasis added): all elements that are false are removed returns the items that are false This could be confusing for a new Python programmer, because the actual behaviour is that

[issue26039] More flexibility in zipfile write interface

2016-04-25 Thread Martin Panter
Martin Panter added the comment: I understand Python’s zipfile module does not allow reading unless seek() is supported (this was one of Марк’s complaints). So it is irrelevant whether we are writing. I left a few comments, but it sounds like it is valid read and write at the same time.

[issue16662] load_tests not invoked in package/__init__.py

2016-04-25 Thread Anthony Sottile
Anthony Sottile added the comment: I have a hunch that this fix here may be causing this: https://github.com/spotify/dh-virtualenv/issues/148 Minimally: echo 'from setuptools import setup; setup(name="demo")' > setup.py echo 'import pytest' > tests/__init__.py $ python setup.py test running

[issue20306] Lack of pw_gecos field in Android's struct passwd causes cross-compilation for the pwd module to fail

2016-04-25 Thread Stefan Krah
Changes by Stefan Krah : -- assignee: -> skrah components: +Build -Cross-Build nosy: +skrah resolution: -> fixed stage: -> resolved status: open -> closed versions: +Python 3.6 -Python 3.4, Python 3.5 ___ Python tracker

[issue22747] Interpreter fails in initialize on systems where HAVE_LANGINFO_H is undefined

2016-04-25 Thread Stefan Krah
Stefan Krah added the comment: We don't support Android officially yet, but I think until #8610 is resolved something must be done here. -- ___ Python tracker

[issue22747] Interpreter fails in initialize on systems where HAVE_LANGINFO_H is undefined

2016-04-25 Thread Roundup Robot
Roundup Robot added the comment: New changeset ad6be34ce8c9 by Stefan Krah in branch 'default': Issue #22747: Workaround for systems without langinfo.h. https://hg.python.org/cpython/rev/ad6be34ce8c9 -- nosy: +python-dev ___ Python tracker

[issue20306] Lack of pw_gecos field in Android's struct passwd causes cross-compilation for the pwd module to fail

2016-04-25 Thread Roundup Robot
Roundup Robot added the comment: New changeset 0d74d4937ab9 by Stefan Krah in branch 'default': Issue #20306: The pw_gecos and pw_passwd fields are not required by POSIX. https://hg.python.org/cpython/rev/0d74d4937ab9 -- nosy: +python-dev ___ Python

[issue9400] multiprocessing.pool.AsyncResult.get() messes up exceptions

2016-04-25 Thread Martin Dengler
Changes by Martin Dengler : ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue26846] Workaround for non-standard stdlib.h on Android

2016-04-25 Thread Stefan Krah
Changes by Stefan Krah : -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker ___

[issue26846] Workaround for non-standard stdlib.h on Android

2016-04-25 Thread Roundup Robot
Roundup Robot added the comment: New changeset fae01d14dd4e by Stefan Krah in branch 'default': Issue #26846: Workaround for non-standard stdlib.h on Android. https://hg.python.org/cpython/rev/fae01d14dd4e -- nosy: +python-dev ___ Python tracker

[issue26846] Workaround for non-standard stdlib.h on Android

2016-04-25 Thread Stefan Krah
New submission from Stefan Krah: Android's stdlib.h pollutes the namespace by including a memory.h header. -- assignee: skrah components: Build messages: 264199 nosy: skrah, xdegaye priority: normal severity: normal status: open title: Workaround for non-standard stdlib.h on Android

[issue26833] returning ctypes._SimpleCData objects from callbacks

2016-04-25 Thread SilentGhost
Changes by SilentGhost : -- components: +ctypes nosy: +amaury.forgeotdarc, belopolsky, meador.inge ___ Python tracker ___

[issue26845] Misleading variable name in exception handling

2016-04-25 Thread ProgVal
New submission from ProgVal: In Python/errors.c, PyErr_Restore is defined this way: void PyErr_Restore(PyObject *type, PyObject *value, PyObject *traceback) In Python/ceval.c, in the END_FINALLY case, it is called like this: PyErr_Restore(status, exc, tb); I believe “exc” should be renamed

[issue17905] Add check for locale.h

2016-04-25 Thread Stefan Krah
Stefan Krah added the comment: I think all locale includes are unguarded now. -- ___ Python tracker ___ ___

[issue17905] Add check for locale.h

2016-04-25 Thread Roundup Robot
Roundup Robot added the comment: New changeset cc501d439239 by Stefan Krah in branch 'default': Issue #17905: Do not guard locale include with HAVE_LANGINFO_H. https://hg.python.org/cpython/rev/cc501d439239 -- nosy: +python-dev ___ Python tracker

[issue17905] Add check for locale.h

2016-04-25 Thread Stefan Krah
Stefan Krah added the comment: Okay, closing as a duplicate (the second patch here that checks for locale.h seems too broad to me since it's a standard header). -- nosy: +skrah resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Interpreter fails in

[issue20305] Android's incomplete locale.h implementation prevents cross-compilation

2016-04-25 Thread Stefan Krah
Stefan Krah added the comment: Thank you, closing this. -- resolution: -> out of date stage: -> resolved status: open -> closed versions: +Python 3.6 -Python 3.4 ___ Python tracker

[issue25788] fileinput.hook_encoded has no way to pass arguments to codecs

2016-04-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Added comments on Rietveld (follow the "review" link beside the patch link). -- assignee: -> serhiy.storchaka ___ Python tracker

[issue19251] bitwise ops for bytes of equal length

2016-04-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > If yes, maybe we should start with a module on PyPI. Is there a volunteer to > try this option? bitsets – ordered subsets over a predefined domain bitarray – efficient boolean array implemented as C extension bitstring – pure-Python bit string based on

[issue9998] ctypes find_library should search LD_LIBRARY_PATH on linux

2016-04-25 Thread Vinay Sajip
Vinay Sajip added the comment: > Does anyone have any valid use cases where they want to use a shared library > on LD_LIBRARY_PATH or similar I presume that would include this issue's creator and other people who have commented here about what they see as a drawback in find_library's current

[issue19251] bitwise ops for bytes of equal length

2016-04-25 Thread Gregory P. Smith
Gregory P. Smith added the comment: I have wanted bytes/bytearray bit operations (be sure to include the in place operators for bytearray) when using micropython where it is normal to be operating on binary data. that said, i'd need someone from micropython to chime in as to if they can

[issue26842] Python Tutorial 4.7.1: Need to explain default parameter lifetime

2016-04-25 Thread Edward Segall
Edward Segall added the comment: I agree with most of your points: A tutorial should be brief and should not go down rabbit holes. Expanded discussion of default parameter behavior would probably fit better with the other facets of parameter speceification and parameter passing, perhaps as a

[issue26844] Wrong error message during import

2016-04-25 Thread Brett Cannon
Changes by Brett Cannon : -- assignee: -> brett.cannon ___ Python tracker ___ ___

[issue19251] bitwise ops for bytes of equal length

2016-04-25 Thread Guido van Rossum
Guido van Rossum added the comment: Can you point to some examples of existing code that would become more readable and faster when this feature exists? Separately, how is it more secure? On Mon, Apr 25, 2016 at 9:17 AM, cowlicks wrote: > > cowlicks added the comment:

[issue19251] bitwise ops for bytes of equal length

2016-04-25 Thread STINNER Victor
STINNER Victor added the comment: > I like to add the bitwise protocol between byte objects of equal length Would it make sense to add such operators in a new module like the existing (but deprecated) audioop module? If yes, maybe we should start with a module on PyPI. Is there a volunteer to

[issue26804] Prioritize lowercase proxy variables in urllib.request

2016-04-25 Thread Senthil Kumaran
Senthil Kumaran added the comment: This is fixed in all versions of Python. Thank you for your contribution, Hans-Peter Jansen. -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker

[issue26804] Prioritize lowercase proxy variables in urllib.request

2016-04-25 Thread Roundup Robot
Roundup Robot added the comment: New changeset c502deb19cb0 by Senthil Kumaran in branch '2.7': backport fix for Issue #26804. https://hg.python.org/cpython/rev/c502deb19cb0 -- ___ Python tracker

[issue19251] bitwise ops for bytes of equal length

2016-04-25 Thread cowlicks
cowlicks added the comment: To reiterate, this issue would make more readable, secure, and speed up a lot of code. The concerns about this being a numpy-like vector operation are confusing to me. The current implementation is already vector-like, but lacks size checking. Isn't "int ^ int"

[issue26807] mock_open()().readline() fails at EOF

2016-04-25 Thread Robert Collins
Robert Collins added the comment: You're changing _mock_call but readline is actually implemented in _readline_side_effect - just changing that should be all thats needed (to deal with StopIteration). You will however need to fixup the return values since the test I added is a bit wider than

[issue26807] mock_open()().readline() fails at EOF

2016-04-25 Thread Yolanda
Yolanda added the comment: So... the failures are because i'm capturing the StopIteration exception in that case. then it's normal that it's not raised. How should you solve that problem instead? -- ___ Python tracker

[issue26807] mock_open()().readline() fails at EOF

2016-04-25 Thread Robert Collins
Robert Collins added the comment: Thanks Yolanda. I've touched up the test a little and run a full test run (make test) - sadly it fails: there is an explicit test that StopIteration gets raised if you set it as a side effect.

[issue26804] Prioritize lowercase proxy variables in urllib.request

2016-04-25 Thread Roundup Robot
Roundup Robot added the comment: New changeset 49b975122022 by Senthil Kumaran in branch '3.5': Issue #26804: urllib.request will prefer lower_case proxy environment variables https://hg.python.org/cpython/rev/49b975122022 New changeset 316593f5bf73 by Senthil Kumaran in branch 'default': merge

[issue25788] fileinput.hook_encoded has no way to pass arguments to codecs

2016-04-25 Thread Joseph Hackman
Joseph Hackman added the comment: Ping. Just wondering if anyone on the nosy list would be willing to help review my patch. :) -- ___ Python tracker

[issue26154] Add private _PyThreadState_UncheckedGet() to get the current thread state

2016-04-25 Thread Wenzel Jakob
Wenzel Jakob added the comment: I've also run into this regression. FWIW this is what I've ended up using to work around it (it's a mess, but what are we to do..) #if PY_VERSION_HEX >= 0x0305 && PY_VERSION_HEX < 0x03050200 extern "C" { /* Manually import _PyThreadState_Current symbol

[issue26807] mock_open()().readline() fails at EOF

2016-04-25 Thread Yolanda
Yolanda added the comment: diff --git a/Lib/unittest/test/testmock/testwith.py b/Lib/unittest/test/testmock/testwith.py index a7bee73..efe6391 100644 --- a/Lib/unittest/test/testmock/testwith.py +++ b/Lib/unittest/test/testmock/testwith.py @@ -297,5 +297,16 @@ class

[issue23496] Steps for Android Native Build of Python 3.4.2

2016-04-25 Thread Eric Snow
Eric Snow added the comment: FYI: https://mail.python.org/pipermail/python-dev/2016-April/144320.html -- nosy: +eric.snow ___ Python tracker ___

[issue26804] Prioritize lowercase proxy variables in urllib.request

2016-04-25 Thread Martin Panter
Martin Panter added the comment: V7 looks good to me -- stage: patch review -> commit review ___ Python tracker ___

[issue26249] Change PyMem_Malloc to use pymalloc allocator

2016-04-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: 68b2a43d8653 introduced memory leak. $ ./python -m test.regrtest -uall -R : test_format Run tests sequentially 0:00:00 [1/1] test_format beginning 9 repetitions 123456789 . test_format leaked [6, 7, 7, 7] memory blocks, sum=27 1 test failed:

[issue26739] idle: Errno 10035 a non-blocking socket operation could not be completed immediately

2016-04-25 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: I think that the select.select calls there are a red herring, since I see no evidence that the rpc socket is ever put in non-blocking mode. But the line self.rpcclt.listening_sock.settimeout(10) indicates that the socket is in timeout mode, and so, the

[issue991266] Cookie.py does not correctly quote Morsels

2016-04-25 Thread Berker Peksag
Berker Peksag added the comment: Here is a patch for Python 3. -- nosy: +berker.peksag versions: +Python 3.5, Python 3.6 -Python 3.1, Python 3.2 Added file: http://bugs.python.org/file42589/issue991266.diff ___ Python tracker

[issue7504] Same name cookies

2016-04-25 Thread Berker Peksag
Changes by Berker Peksag : -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Improper handling of duplicate cookies ___ Python tracker

[issue23662] Cookie.domain is undocumented

2016-04-25 Thread Berker Peksag
Berker Peksag added the comment: Actually, it's already documented at https://docs.python.org/3.5/library/http.cookies.html#http.cookies.Morsel. I just added a note about the default value of domain. -- nosy: +berker.peksag resolution: -> fixed stage: needs patch -> resolved status:

[issue23662] Cookie.domain is undocumented

2016-04-25 Thread Roundup Robot
Roundup Robot added the comment: New changeset 1fdaa71d47f5 by Berker Peksag in branch '3.5': Issue #23662: Document default value of RFC 2109 attributes https://hg.python.org/cpython/rev/1fdaa71d47f5 New changeset b3ad9c002bb8 by Berker Peksag in branch 'default': Issue #23662: Document

[issue9456] Apparent memory leak in PC/bdist_wininst/install.c

2016-04-25 Thread Mark Lawrence
Changes by Mark Lawrence : -- nosy: -BreamoreBoy ___ Python tracker ___ ___

[issue26039] More flexibility in zipfile write interface

2016-04-25 Thread Thomas Kluyver
Thomas Kluyver added the comment: It wasn't as bad as I thought (hopefully that doesn't mean I've missed something). zipfile-open-w6.patch allows interleaved reads and writes so long as the underlying file object is seekable. You still can't have multiple write handles open (it wouldn't know

[issue9456] Apparent memory leak in PC/bdist_wininst/install.c

2016-04-25 Thread Berker Peksag
Berker Peksag added the comment: install_c.diff looks good to me. Attaching a fresh version of it. There is a comment in PC/bdist_wininst/install.c saying IMPORTANT NOTE: IF THIS FILE IS CHANGED, PCBUILD\BDIST_WININST.VCXPROJ MUST BE REBUILT AS WELL. I don't have Windows so I can't build

[issue26826] Expose new copy_file_range() syscal in os module and use it to improve shutils.copy()

2016-04-25 Thread STINNER Victor
STINNER Victor added the comment: If we add a new private function to the os module (ex: os._copy_file_range), it can be used in shutil if available. But it would be a temporary solution until we declare the API stable. Maybe it's ok to add the API as public today. --

[issue26826] Expose new copy_file_range() syscal in os module and use it to improve shutils.copy()

2016-04-25 Thread Marcos Dione
Marcos Dione added the comment: Then I don't know. My only worry is whether having the method local to os would allow shutils.copy() to use it or not. I will start by looking at other similar functions there to see to do it. urandom() looks like a good starting point. --

[issue26804] Prioritize lowercase proxy variables in urllib.request

2016-04-25 Thread Hans-Peter Jansen
Hans-Peter Jansen added the comment: v7: - reorder test code in order to improve edibility -- Added file: http://bugs.python.org/file42586/python-urllib-prefer-lowercase-proxies-v7.diff ___ Python tracker

[issue9998] ctypes find_library should search LD_LIBRARY_PATH on linux

2016-04-25 Thread Pau Tallada
Pau Tallada added the comment: > Pau: What is wrong with the more direct CDLL("libspatialindex_c.so") proposal > that bypasses find_library()? I don't know much about library loading, but from what I understand at https://github.com/Toblerity/rtree/issues/56 , if they hardcode

[issue26842] Python Tutorial 4.7.1: Need to explain default parameter lifetime

2016-04-25 Thread Raymond Hettinger
Raymond Hettinger added the comment: > I hope this is useful. I realize it is much longer than the original. There lies the difficultly. The purpose of the tutorial is to quickly introduce the language, not to take someone deeply down a rabbit hole. The docs tend to be worded in an

[issue20305] Android's incomplete locale.h implementation prevents cross-compilation

2016-04-25 Thread Xavier de Gaye
Xavier de Gaye added the comment: This error: _curses.error: setupterm: could not find terminfo database does not occur for me after removing the '--disable-database --disable-home-terminfo' options from the configure options used to cross-compile ncurses, and after setting the TERMINFO

[issue26843] tokenize does not include Other_ID_Start or Other_ID_Continue in identifier

2016-04-25 Thread Joshua Landau
Joshua Landau added the comment: Sorry, I'd stumbled on my old comment on the closed issue and completely forgot about the *last* time I did the same thing. -- ___ Python tracker

[issue22747] Interpreter fails in initialize on systems where HAVE_LANGINFO_H is undefined

2016-04-25 Thread Xavier de Gaye
Xavier de Gaye added the comment: Android default system encoding is UTF-8 as specified at http://developer.android.com/reference/java/nio/charset/Charset.html The platform's default charset is UTF-8. (This is in contrast to some older implementations, where the default charset depended on

[issue17905] Add check for locale.h

2016-04-25 Thread Xavier de Gaye
Xavier de Gaye added the comment: Android API level 21 has a full fledged locale.h now. There is still no langinfo.h, this issue is a duplicate of issue #22747. -- nosy: +xdegaye ___ Python tracker

[issue23662] Cookie.domain is undocumented

2016-04-25 Thread Berker Peksag
Changes by Berker Peksag : -- keywords: +easy stage: -> needs patch type: -> enhancement versions: +Python 3.6 -Python 3.2, Python 3.3, Python 3.4 ___ Python tracker

[issue26844] Wrong error message during import

2016-04-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: LGTM. But while we are here, it would be nice to replace type(path) with type(path).__name__ (and the same for type(name)). -- nosy: +eric.snow, ncoghlan, serhiy.storchaka stage: patch review -> commit review versions: -Python 2.7

[issue26844] Wrong error message during import

2016-04-25 Thread SilentGhost
Changes by SilentGhost : -- nosy: +brett.cannon priority: normal -> low stage: -> patch review versions: -Python 3.2, Python 3.3, Python 3.4 ___ Python tracker

[issue26844] Wrong error message during import

2016-04-25 Thread Lev Maximov
New submission from Lev Maximov: Error message was supposedly copy-pasted without change. Makes it pretty unintuinive to debug. Fix attached. -- components: Library (Lib) files: error.diff keywords: patch messages: 264157 nosy: Lev Maximov priority: normal severity: normal status: open

[issue24194] tokenize yield an ERRORTOKEN if an identifier uses Other_ID_Start or Other_ID_Continue

2016-04-25 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- dependencies: +Request for property support in Python re lib, python lib re uses obsolete sense of \w in full violation of UTS#18 RL1.2a ___ Python tracker

[issue24194] tokenize yield an ERRORTOKEN if an identifier uses Other_ID_Start or Other_ID_Continue

2016-04-25 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- stage: -> needs patch versions: +Python 3.5, Python 3.6 -Python 3.4 ___ Python tracker ___

[issue26843] tokenize does not include Other_ID_Start or Other_ID_Continue in identifier

2016-04-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is a duplicate of issue24194. Yes, there is no progress still. -- nosy: +serhiy.storchaka resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> tokenize yield an ERRORTOKEN if an identifier uses Other_ID_Start or

[issue26837] assertSequenceEqual() raises BytesWarning when format message

2016-04-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your helpful review Martin! -- assignee: -> serhiy.storchaka resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue26837] assertSequenceEqual() raises BytesWarning when format message

2016-04-25 Thread Roundup Robot
Roundup Robot added the comment: New changeset ae5cc8ab664a by Serhiy Storchaka in branch '3.5': Issue #26837: assertSequenceEqual() now correctly outputs non-stringified https://hg.python.org/cpython/rev/ae5cc8ab664a New changeset d0d541c2afb7 by Serhiy Storchaka in branch '2.7': Issue #26837: