[issue22095] Use of set_tunnel with default port results in incorrect post value in host header

2014-11-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: If call _get_hostport() in set_tunnel() then it should be removed in _tunnel(). As for tests, it would be better do not rely on implementation details. Instead you can monkey-patch the send() method of of HTTPConnection instance and check passed argument.

[issue22891] code removal from urllib.parse.urlsplit()

2014-11-18 Thread Alexander Todorov
Alexander Todorov added the comment: Does test cases pass after removal of those lines? (I will be surprised) Yes they do. Also see my detailed explanation above, there's no reason for test cases to fail. -- ___ Python tracker

[issue22314] pydoc.py: TypeError with a $LINES defined to anything

2014-11-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch. -- keywords: +patch nosy: +serhiy.storchaka stage: - patch review type: - behavior versions: +Python 3.4, Python 3.5 Added file: http://bugs.python.org/file37219/pydoc_ttypager_lines.patch ___

[issue22367] Please add F_OFD_SETLK, etc support to fcntl.lockf

2014-11-18 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- stage: - needs patch versions: -Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22367 ___

[issue22370] pathlib OS detection

2014-11-18 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- assignee: - pitrou nosy: +pitrou, serhiy.storchaka type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22370 ___

[issue22453] PyObject_REPR macro causes refcount leak

2014-11-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your report Chris. PyObject_REPR() is used only in Python/compile.c just before calling Py_FatalError(). So refcount leaks doesn't matter in these cases. PyObject_REPR() is expanded to deprecated _PyUnicode_AsString which is not defined if

[issue22652] Add suggestion about keyword arguments to this error message: builtins.TypeError: my_func() takes 1 positional argument but 2 were given

2014-11-18 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- stage: - needs patch type: - enhancement ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22652 ___

[issue22895] regression introduced by the fix for issue #22462

2014-11-18 Thread Matthias Klose
New submission from Matthias Klose: the fix for issue #22462 introduces a regression in the test_pyexpat test cases. I'm not yet sure why. This is only seen when running the testsuite from the installed location, which shouldn't matter. Tried to run the tests with a stripped executable in

[issue22453] PyObject_REPR macro causes refcount leak

2014-11-18 Thread STINNER Victor
STINNER Victor added the comment: PyObject_REPR() is expanded to deprecated _PyUnicode_AsString which is not defined if Py_LIMITED_API is defined. PyObject_REPR() is still defined if Py_LIMITED_API is defined, I just checked. -- nosy: +haypo ___

[issue22453] PyObject_REPR macro causes refcount leak

2014-11-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PyObject_REPR() is still defined if Py_LIMITED_API is defined, I just checked. But it is expanded to undefined name. So it is not usable in any case. -- ___ Python tracker rep...@bugs.python.org

[issue22453] PyObject_REPR macro causes refcount leak

2014-11-18 Thread STINNER Victor
STINNER Victor added the comment: PyObject_REPR.patch: the first part looks good to me. For the second part, you can use PySys_FormatStderr() which is more complex but more correct: it formats the string as Unicode and then encode it to stderr encoding. PyUnicode_FromFormatV() is probably

[issue22453] PyObject_REPR macro causes refcount leak

2014-11-18 Thread STINNER Victor
STINNER Victor added the comment: Serhiy Storchaka wrote: But it is expanded to undefined name. So it is not usable in any case. Ah correct, I didn't notice _PyUnicode_AsString in the expanded result (I checked with gcc -E). When Py_LIMITED_API is set, PyObject_REPR(o) is expanded to

[issue22895] regression introduced by the fix for issue #22462

2014-11-18 Thread Jeremy Kloth
Changes by Jeremy Kloth jeremy.kloth+python-trac...@gmail.com: -- nosy: +jkloth ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22895 ___ ___

[issue22462] Modules/pyexpat.c violates PEP 384

2014-11-18 Thread Jeremy Kloth
Changes by Jeremy Kloth jeremy.kloth+python-trac...@gmail.com: -- nosy: +jkloth ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22462 ___ ___

[issue22895] regression introduced by the fix for issue #22462

2014-11-18 Thread Antoine Pitrou
Antoine Pitrou added the comment: Please post the traceback. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22895 ___ ___ Python-bugs-list

[issue22370] pathlib OS detection

2014-11-18 Thread Antoine Pitrou
Antoine Pitrou added the comment: This sounds reasonable, indeed. -- stage: - needs patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22370 ___

[issue22367] Please add F_OFD_SETLK, etc support to fcntl.lockf

2014-11-18 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +neologix ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22367 ___ ___ Python-bugs-list mailing

[issue22453] PyObject_REPR macro causes refcount leak

2014-11-18 Thread Antoine Pitrou
Antoine Pitrou added the comment: PyObject_REPR() is expanded to deprecated _PyUnicode_AsString which is not defined if Py_LIMITED_API is defined. So it is unlikely that third-party code uses it Py_LIMITED_API is the stable ABI. Most third-party code doesn't use it, so it may still use

[issue22895] regression introduced by the fix for issue #22462

2014-11-18 Thread Matthias Klose
Matthias Klose added the comment: [258/383] test_pyexpat test test_pyexpat failed -- Traceback (most recent call last): File /usr/lib/python3.4/test/test_pyexpat.py, line 432, in test_exception parser.Parse(babc//b/a, 1) File ../Modules/pyexpat.c, line 405, in StartElement File

[issue22113] memoryview and struct.pack_into

2014-11-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This issue is similar to issue10212. Here is a patch which makes struct.pack_into() support new buffer protocol. Something similar should be applied to 3.x because PyObject_AsWriteBuffer() is deprecated and not safe. -- assignee: -

[issue22895] test failure introduced by the fix for issue #22462

2014-11-18 Thread Antoine Pitrou
Antoine Pitrou added the comment: Thanks. So, this is not a regression: the failing test was introduced in #22462 and probably would have not worked before, either. The problem is that ../Modules/pyexpat.c makes sense from the checkout directory but not necessarily from the install location.

[issue22896] Don't use PyObject_As*Buffer() functions

2014-11-18 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: PyObject_AsCharBuffer(), PyObject_AsReadBuffer() and PyObject_AsWriteBuffer() release the buffer right after acquiring and return a pointer to released buffer. This is not safe and could cause issues sooner or later. These functions shouldn't be used in

[issue22608] test_socket fails with sem_init: Too many open files

2014-11-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I suggest to merge issue22608 and issue22610 and also clean up other long living event objects in tests. -- nosy: +serhiy.storchaka stage: - needs patch versions: +Python 3.4, Python 3.5 ___ Python tracker

[issue10599] sgmllib.parse_endtag() is not respecting quoted text

2014-11-18 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- components: +Library (Lib) -None nosy: +ezio.melotti versions: +Python 2.7 -Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10599

[issue18637] mingw: export _PyNode_SizeOf as PyAPI for parser module

2014-11-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: LGTM. -- assignee: - serhiy.storchaka nosy: +serhiy.storchaka stage: - commit review type: enhancement - behavior versions: +Python 2.7, Python 3.5 ___ Python tracker rep...@bugs.python.org

[issue18637] mingw: export _PyNode_SizeOf as PyAPI for parser module

2014-11-18 Thread Roundup Robot
Roundup Robot added the comment: New changeset eb25629d2a46 by Serhiy Storchaka in branch '2.7': Issue #18637: Fixed an error in _PyNode_SizeOf declaration. https://hg.python.org/cpython/rev/eb25629d2a46 New changeset ab3e8aab7119 by Serhiy Storchaka in branch '3.4': Issue #18637: Fixed an

[issue18637] mingw: export _PyNode_SizeOf as PyAPI for parser module

2014-11-18 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- resolution: - fixed stage: commit review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18637 ___

[issue18637] mingw: export _PyNode_SizeOf as PyAPI for parser module

2014-11-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Definitely this was a bug. Thank you Roumen for your patch. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18637 ___

[issue22453] PyObject_REPR macro causes refcount leak

2014-11-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: For the second part, you can use PySys_FormatStderr() which is more complex but more correct PySys_FormatStderr() is more heavy function, it depends on working sys.stderr and codecs. Taking into account the lack of tests we should be careful with such

[issue19670] SimpleCookie Generates Non-RFC6265-Compliant Cookies

2014-11-18 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19670 ___ ___

[issue22453] PyObject_REPR macro causes refcount leak

2014-11-18 Thread Antoine Pitrou
Antoine Pitrou added the comment: Le 18/11/2014 17:39, Serhiy Storchaka a écrit : Py_LIMITED_API is the stable ABI. Most third-party code doesn't use it, so it may still use PyObject_REPR(). So we should just add a warning? This macro is not documented anywhere. Well we can still remove

[issue17750] allow the testsuite to run in the installed location

2014-11-18 Thread Matthias Klose
Changes by Matthias Klose d...@debian.org: -- dependencies: +test failure introduced by the fix for issue #22462 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17750 ___

[issue21266] test_zipfile fails to run in the installed location

2014-11-18 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- assignee: - serhiy.storchaka nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21266 ___

[issue21032] Socket leak if HTTPConnection.getresponse() fails

2014-11-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Could you please submit a contributor form (https://www.python.org/psf/contrib/) Martin? -- assignee: - serhiy.storchaka nosy: +serhiy.storchaka stage: - patch review versions: +Python 3.5 ___ Python tracker

[issue20948] -Wformat=2 -Wformat-security findings

2014-11-18 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +haypo, pitrou, serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20948 ___

[issue20082] Misbehavior of BufferedRandom.write with raw file in append mode

2014-11-18 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +benjamin.peterson, hynek, pitrou, serhiy.storchaka, stutzbach stage: - patch review versions: +Python 2.7, Python 3.4, Python 3.5 ___ Python tracker rep...@bugs.python.org

[issue20066] PyStructSequence_NewType() not setting proper heap allocation flag?

2014-11-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See also issue15729. -- components: +Interpreter Core nosy: +serhiy.storchaka stage: - needs patch versions: +Python 3.4, Python 3.5 -Python 3.3 ___ Python tracker rep...@bugs.python.org

[issue15729] PyStructSequence_NewType enhancement

2014-11-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See also issue20066. -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15729 ___ ___

[issue21266] test_zipfile fails to run in the installed location

2014-11-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is a duplicate of issue17753 (test_write_filtered_python_package was added later). -- resolution: - duplicate stage: - resolved status: open - closed superseder: - test_zipfile: requires write access to test and email.test

[issue22825] Modernize TextFile

2014-11-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: So you suggest just close this issue? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22825 ___ ___

[issue22453] PyObject_REPR macro causes refcount leak

2014-11-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is updated patch. -- Added file: http://bugs.python.org/file37221/PyObject_REPR_2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22453 ___diff

[issue22113] memoryview and struct.pack_into

2014-11-18 Thread Antoine Pitrou
Antoine Pitrou added the comment: I think you forgot to upload your patch. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22113 ___ ___

[issue22113] memoryview and struct.pack_into

2014-11-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Oh, sorry. Here is it. -- keywords: +patch Added file: http://bugs.python.org/file37222/struct_pack_into_memoryview.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22113

[issue22897] IDLE - MacOS: freeze on non-ASCII save with open debugger

2014-11-18 Thread Boris
New submission from Boris: When attempting to save a file containing an Aring; character with the debugger open, IDLE freezes with/or without partially opening the warning window. (Mac OS X 10.9.5, IDLE running python 2.7.5). Reproducible steps: - Create and save file with one line: 1+1 # A

[issue21280] shutil.make_archive() with default root_dir parameter raises FileNotFoundError: [Errno 2] No such file or directory: ''

2014-11-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch. -- assignee: - serhiy.storchaka keywords: +patch nosy: +hynek, serhiy.storchaka, tarek stage: - patch review type: - behavior versions: +Python 3.5 Added file: http://bugs.python.org/file37223/shutil_make_archive_in_curdir.patch

[issue20156] bz2.BZ2File.read() does not treat growing input file properly

2014-11-18 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- assignee: - serhiy.storchaka nosy: +serhiy.storchaka priority: normal - low versions: +Python 3.5 -Python 2.7, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20156

[issue21775] shutil.copytree() crashes copying to VFAT on Linux: AttributeError: 'PermissionError' object has no attribute 'winerror'

2014-11-18 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21775 ___ ___ Python-bugs-list

[issue21775] shutil.copytree() crashes copying to VFAT on Linux: AttributeError: 'PermissionError' object has no attribute 'winerror'

2014-11-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: LGTM. Go ahead Greg. -- assignee: - gward nosy: +serhiy.storchaka stage: - commit review versions: +Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21775

[issue20948] -Wformat=2 -Wformat-security findings

2014-11-18 Thread Roundup Robot
Roundup Robot added the comment: New changeset d6d2549340cb by Victor Stinner in branch 'default': Issue #20948: Inline makefmt() in unicode_fromformat_arg() https://hg.python.org/cpython/rev/d6d2549340cb -- nosy: +python-dev ___ Python tracker

[issue21775] shutil.copytree() crashes copying to VFAT on Linux: AttributeError: 'PermissionError' object has no attribute 'winerror'

2014-11-18 Thread STINNER Victor
STINNER Victor added the comment: Would it be possible to write a unit test, maybe using unittest.mock to mock most parts? -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21775

[issue20948] -Wformat=2 -Wformat-security findings

2014-11-18 Thread STINNER Victor
STINNER Victor added the comment: The format parameter passed to sprintf() is created by makefmt() function. In Python 3.5, makefmt() has a few parameters. The code is simple and looks safe. The makefmt() function was much more complex in Python 3.3, it had more parameters: zeropad, width and

[issue22453] PyObject_REPR macro causes refcount leak

2014-11-18 Thread STINNER Victor
STINNER Victor added the comment: PyObject_REPR_2.patch looks good to me, but it should only be applied to Python 3.5. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22453 ___

[issue22898] segfault during shutdown attempting to log ResourceWarning

2014-11-18 Thread A. Jesse Jiryu Davis
New submission from A. Jesse Jiryu Davis: Running a unittest suite for Motor, my MongoDB driver which uses PyMongo, greenlet, and Tornado. The suite commonly segfaults during interpreter shutdown. I've reproduced this crash with Python 3.3.5, 3.4.1, and 3.4.2. Python 2.6 and 2.7 do *not*

[issue22453] PyObject_REPR macro causes refcount leak

2014-11-18 Thread Roundup Robot
Roundup Robot added the comment: New changeset e339d75a21d5 by Serhiy Storchaka in branch 'default': Issue #22453: Removed non-documented macro PyObject_REPR(). https://hg.python.org/cpython/rev/e339d75a21d5 -- nosy: +python-dev ___ Python tracker

[issue22898] segfault during shutdown attempting to log ResourceWarning

2014-11-18 Thread A. Jesse Jiryu Davis
A. Jesse Jiryu Davis added the comment: The crash can ignore whether or not I specify -Wignore on the python command line. I was hoping to avoid the crash by short-circuiting the ResourceWarning code path, since the following line appears in the backtrace: #5 PyErr_WarnFormat

[issue22453] PyObject_REPR macro causes refcount leak

2014-11-18 Thread Roundup Robot
Roundup Robot added the comment: New changeset 342a619cdafb by Serhiy Storchaka in branch '3.4': Issue #22453: Warn against the use of leaking macro PyObject_REPR(). https://hg.python.org/cpython/rev/342a619cdafb New changeset 6e26b5291c41 by Serhiy Storchaka in branch '2.7': Issue #22453:

[issue22894] unittest.TestCase.subTest causes all subsequent tests to be skipped in failfast mode

2014-11-18 Thread Ethan Furman
Changes by Ethan Furman et...@stoneleaf.us: -- nosy: +ethan.furman ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22894 ___ ___ Python-bugs-list

[issue22453] PyObject_REPR macro causes refcount leak

2014-11-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your reviews Victor and Antoine. -- resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22453

[issue22899] http.server.BaseHTTPRequestHandler.parse_request (TypeError: decoding str is not supported)

2014-11-18 Thread Ryan Chartier
New submission from Ryan Chartier: While the parse_request is handling the requestline, it tries to force the string into iso-8859-1 using an unsupported syntax. Line #274 in server.py requestline = str(self.raw_requestline, 'iso-8859-1') Obviously, python complains. TypeError: decoding str

[issue22899] http.server.BaseHTTPRequestHandler.parse_request (TypeError: decoding str is not supported)

2014-11-18 Thread Georg Brandl
Georg Brandl added the comment: With the vanilla BaseHTTPRequestHandler, this shouldn't happen. self.raw_requestline is read from a socket file, which returns bytes, so they can be decoded using str(bytes, encoding). Can you please check if there are any third-party packages involved that

[issue22370] pathlib OS detection

2014-11-18 Thread Roundup Robot
Roundup Robot added the comment: New changeset cb1d7eac601d by Antoine Pitrou in branch '3.4': Close #22370: Windows detection in pathlib is now more robust. https://hg.python.org/cpython/rev/cb1d7eac601d New changeset 712f246da49b by Antoine Pitrou in branch 'default': Close #22370: Windows

[issue22897] IDLE hangs on OS X with Cocoa Tk if encoding dialog is required during save

2014-11-18 Thread Ned Deily
Ned Deily added the comment: Thanks for the report. It appears that all that is needed to trigger the hang is any operation that invokes the IDLE EncodingMessage dialog (Non-ASCII found, yet no encoding declared. Add a line like [...]) in IOBinding.py during a Save when IDLE is linked with

[issue22867] document behavior of calling atexit.register() while atexit._run_exitfuncs is running

2014-11-18 Thread Ethan Furman
Ethan Furman added the comment: From a post by Ian Kelly (https://mail.python.org/pipermail/python-list/2014-November/681073.html) -- In fact it seems the behavior does differ between Python 2.7 and Python 3.4: $ cat testatexit.py

[issue22825] Modernize TextFile

2014-11-18 Thread Éric Araujo
Éric Araujo added the comment: Yes. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22825 ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue18905] pydoc -p 0 says the server is available at localhost:0

2014-11-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: With the patch resolved address 127.0.0.1 is printed instead of localhost. self.address[0] can be used to match current behavior of 2.7 and 3.x. And why not just initialize the url attribute in server_activate()? -- assignee: - serhiy.storchaka

[issue18731] Increased test coverage for uu and telnet

2014-11-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: test_encode_defaults is failed now. Don't use hardcoded filename length. And I don't understand the purpose of changes in uu.py. -- versions: +Python 2.7, Python 3.5 ___ Python tracker rep...@bugs.python.org

[issue22825] Modernize TextFile

2014-11-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your response. This was a part of large patch about migration to use of with (issue22826 and issue22831 are other parts). -- resolution: - rejected stage: patch review - resolved status: open - closed