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

--
nosy: +nikratio, orsenthil, serhiy.storchaka
stage:  - patch review

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



[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 rep...@bugs.python.org
http://bugs.python.org/issue22891
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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

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



[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
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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
___
___
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-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 Py_LIMITED_API is defined. So it is unlikely that third-party code 
uses it. We can just remove this macro in 3.5.

There are other bugs in formatting fatal error messages where PyObject_REPR() 
is used. PyBytes_AS_STRING() is called for unicode objects. Definitely this 
branch of the code is rarely executed.

Here is a patch which expands PyObject_REPR() in Python/compile.c and replaces 
PyBytes_AS_STRING() with PyUnicode_AsUTF8(). In 3.5 we also should remove the 
PyObject_REPR macro definition.

--
assignee:  - serhiy.storchaka
keywords: +patch
nosy: +serhiy.storchaka
stage:  - patch review
type: behavior - resource usage
versions:  -Python 3.1, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file37220/PyObject_REPR.patch

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



[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
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 the build tree worked too, so I'm lost why this now 
fails.  Confirmed that reverting the fix resolves running the testcase in the 
same environment.

--
components: Library (Lib)
messages: 231312
nosy: doko, pitrou
priority: high
severity: normal
status: open
title: regression introduced by the fix for issue #22462
versions: Python 3.4, Python 3.5

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22895
___
___
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-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

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22453
___
___
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-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
http://bugs.python.org/issue22453
___
___
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-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 safer to handle errors.

You may use PySys_FormatStderr() in the two functions to write context, and 
then call Py_FatalError with a simple message. The exact formatting doesn't 
matter much, these cases must never occur :-) An assertion may be enough :-p

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22453
___
___
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-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
_PyUnicode_AsString(PyObject_Repr(o)).

--

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



[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
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 PyObject_REPR().

--
nosy: +pitrou

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



[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 /usr/lib/python3.4/test/test_pyexpat.py, line 422, in 
StartElementHandler
raise RuntimeError(name)
RuntimeError: a

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File /usr/lib/python3.4/test/test_pyexpat.py, line 447, in test_exception
self.assertIn('call_with_frame(StartElement', entries[1][3])
  File /usr/lib/python3.4/unittest/case.py, line 1053, in assertIn
if member not in container:
TypeError: argument of type 'NoneType' is not iterable


test_exception (test.test_pyexpat.HandlerExceptionTest) ... ERROR

==
ERROR: test_exception (test.test_pyexpat.HandlerExceptionTest)
--
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 /usr/lib/python3.4/test/test_pyexpat.py, line 422, in 
StartElementHandler
raise RuntimeError(name)
RuntimeError: a

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File /usr/lib/python3.4/test/test_pyexpat.py, line 447, in test_exception
self.assertIn('call_with_frame(StartElement', entries[1][3])
  File /usr/lib/python3.4/unittest/case.py, line 1053, in assertIn
if member not in container:
TypeError: argument of type 'NoneType' is not iterable

--
Ran 36 tests in 0.016s

--

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



[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:  - serhiy.storchaka
nosy: +kristjan.jonsson, pitrou, serhiy.storchaka, terry.reedy
stage: needs patch - patch review

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



[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. I don't know if we should try to be 
smarter or not.

At first we could make the test more lenient.

--
components: +Tests
priority: high - normal
title: regression introduced by the fix for issue #22462 - test failure 
introduced by the fix for issue #22462
type:  - behavior

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



[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 the stdlib at all.

--
assignee: serhiy.storchaka
components: Extension Modules, Interpreter Core
messages: 231323
nosy: serhiy.storchaka
priority: normal
severity: normal
stage: needs patch
status: open
title: Don't use PyObject_As*Buffer() functions
type: resource usage
versions: Python 3.4, Python 3.5

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



[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 rep...@bugs.python.org
http://bugs.python.org/issue22608
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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
http://bugs.python.org/issue18637
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 error in _PyNode_SizeOf declaration.
https://hg.python.org/cpython/rev/ab3e8aab7119

New changeset 0f663e0ce1d3 by Serhiy Storchaka in branch 'default':
Issue #18637: Fixed an error in _PyNode_SizeOf declaration.
https://hg.python.org/cpython/rev/0f663e0ce1d3

--
nosy: +python-dev

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



[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
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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
___
___
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-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 changes. So I prefer to keep fprintf.

 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.

-/* Helper for passing objects to printf and the like */
-#define PyObject_REPR(obj) _PyUnicode_AsString(PyObject_Repr(obj))
+#ifndef Py_LIMITED_API
+/* Helper for passing objects to printf and the like.
+   Leaks refcounts.  Don't use it!
+*/
+#define PyObject_REPR(obj) PyUnicode_AsUTF8(PyObject_Repr(obj))
+#endif

--

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



[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
___
___
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-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 it, and add a porting note in whatsnew for 3.5.

--

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



[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
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 rep...@bugs.python.org
http://bugs.python.org/issue21032
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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
http://bugs.python.org/issue20082
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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
http://bugs.python.org/issue20066
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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

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



[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
___
___
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-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 -r 0f663e0ce1d3 Doc/whatsnew/3.5.rst
--- a/Doc/whatsnew/3.5.rst  Tue Nov 18 17:30:50 2014 +0200
+++ b/Doc/whatsnew/3.5.rst  Tue Nov 18 19:14:09 2014 +0200
@@ -441,3 +441,7 @@ Changes in the C API
 
 * The :c:type:`PyMemAllocator` structure was renamed to
   :c:type:`PyMemAllocatorEx` and a new ``calloc`` field was added.
+
+* Removed non-documented macro :c:macro:`PyObject_REPR` which leaked 
references.
+  Use format character ``%R`` in :c:func:`PyUnicode_FromFormat`-like functions
+  to format the :func:`repr` of the object.
diff -r 0f663e0ce1d3 Include/object.h
--- a/Include/object.h  Tue Nov 18 17:30:50 2014 +0200
+++ b/Include/object.h  Tue Nov 18 19:14:09 2014 +0200
@@ -575,9 +575,6 @@ PyAPI_FUNC(PyObject *) PyObject_Dir(PyOb
 PyAPI_FUNC(int) Py_ReprEnter(PyObject *);
 PyAPI_FUNC(void) Py_ReprLeave(PyObject *);
 
-/* Helper for passing objects to printf and the like */
-#define PyObject_REPR(obj) _PyUnicode_AsString(PyObject_Repr(obj))
-
 /* Flag bits for printing: */
 #define Py_PRINT_RAW1   /* No string quotes etc. */
 
diff -r 0f663e0ce1d3 Python/compile.c
--- a/Python/compile.c  Tue Nov 18 17:30:50 2014 +0200
+++ b/Python/compile.c  Tue Nov 18 19:14:09 2014 +0200
@@ -1414,12 +1414,12 @@ get_ref_type(struct compiler *c, PyObjec
 PyOS_snprintf(buf, sizeof(buf),
   unknown scope for %.100s in %.100s(%s)\n
   symbols: %s\nlocals: %s\nglobals: %s,
-  PyBytes_AS_STRING(name),
-  PyBytes_AS_STRING(c-u-u_name),
-  PyObject_REPR(c-u-u_ste-ste_id),
-  PyObject_REPR(c-u-u_ste-ste_symbols),
-  PyObject_REPR(c-u-u_varnames),
-  PyObject_REPR(c-u-u_names)
+  PyUnicode_AsUTF8(name),
+  PyUnicode_AsUTF8(c-u-u_name),
+  PyUnicode_AsUTF8(PyObject_Repr(c-u-u_ste-ste_id)),
+  
PyUnicode_AsUTF8(PyObject_Repr(c-u-u_ste-ste_symbols)),
+  PyUnicode_AsUTF8(PyObject_Repr(c-u-u_varnames)),
+  PyUnicode_AsUTF8(PyObject_Repr(c-u-u_names))
 );
 Py_FatalError(buf);
 }
@@ -1476,11 +1476,11 @@ compiler_make_closure(struct compiler *c
 fprintf(stderr,
 lookup %s in %s %d %d\n
 freevars of %s: %s\n,
-PyObject_REPR(name),
-PyBytes_AS_STRING(c-u-u_name),
+PyUnicode_AsUTF8(PyObject_Repr(name)),
+PyUnicode_AsUTF8(c-u-u_name),
 reftype, arg,
-_PyUnicode_AsString(co-co_name),
-PyObject_REPR(co-co_freevars));
+PyUnicode_AsUTF8(co-co_name),
+PyUnicode_AsUTF8(PyObject_Repr(co-co_freevars)));
 Py_FatalError(compiler_make_closure());
 }
 ADDOP_I(c, LOAD_CLOSURE, arg);
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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
- Open IDLE
- Open the debugger
- Open the file
- Delete the A, type shiftaltA
- type commands to save. This triggers the problem.

Application hangs (not responding) and needs to force quit. Sometimes the 
graphics memory of other applications gets corrupted.

--
components: IDLE
messages: 231338
nosy: steipe
priority: normal
severity: normal
status: open
title: IDLE - MacOS: freeze on non-ASCII save with open debugger
type: behavior
versions: Python 2.7

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



[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

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



[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
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 rep...@bugs.python.org
http://bugs.python.org/issue20948
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 precision. I refactored PyUnicode_FromFormatV() 
to optimize it. During the optimization, makefmt() was simplified, and in fact 
it is now possible to inline it and remove it. I just removed it in Python 3.5.

Should we change something in Python 2.7 and 3.4? Ignore the warning? Or can I 
just close the issue?

Thanks for the report Jeffrey.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20948
___
___
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-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
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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* crash. The Python interpreters are all built like:

./configure --prefix=/mnt/jenkins/languages/python/rX.Y.Z --enable-shared  
make  make install

This is Amazon Linux AMI release 2014.09.

The unittest suite's final output is:

--
Ran 15 tests in 265.947s

OK
Segmentation fault (core dumped)

Backtrace from a Python 3.4.2 coredump attached.

--
components: Interpreter Core
files: dump.txt
messages: 231345
nosy: emptysquare
priority: normal
severity: normal
status: open
title: segfault during shutdown attempting to log ResourceWarning
type: crash
versions: Python 3.4
Added file: http://bugs.python.org/file37224/dump.txt

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22898
___
___
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-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 rep...@bugs.python.org
http://bugs.python.org/issue22453
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 (category=optimized out, 
stack_level=stack_level@entry=1, format=format@entry=0x7f5f1ca8b377 unclosed 
file %R) at Python/_warnings.c:813

But -Wignore has no effect.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22898
___
___
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-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: Fexed reference leaks when format error messages in ceval.c.
https://hg.python.org/cpython/rev/6e26b5291c41

--

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



[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 mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 is not supported

I'm running python 3.4.2 and the line is present in the 3.4.2 source I 
downloaded from the python.org today.

That is all.

--
messages: 231350
nosy: recharti
priority: normal
severity: normal
status: open
title: http.server.BaseHTTPRequestHandler.parse_request (TypeError: decoding 
str is not supported)
type: crash
versions: Python 3.4

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



[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 
call/subclass the classes from http.server and introduce a bytes/str confusion? 
 They might not be correctly/completely ported to Python 3 in that case.

In any case, a full traceback will be helpful to help debug this.

--
nosy: +georg.brandl

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



[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 detection in pathlib is now more robust.
https://hg.python.org/cpython/rev/712f246da49b

--
nosy: +python-dev
resolution:  - fixed
stage: needs patch - resolved
status: open - closed

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



[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 the OS X Cocoa Tk 8.5 (or likely 8.6) as used 
with the python.org 64-bin/32-bit 10.6+ installers, for example, just opening a 
new edit window, inserting a non-ASCII character, and then trying to Save.  
EncodingMessage subclasses the Tkinter SimpleDialog module and creates a new 
Toplevel root; I seem to recall other problems like this in the past.  The 
problem is not seen with the older Carbon Tk 8.4 or with an X11 Tk on OS X.

--
nosy: +ned.deily
stage:  - needs patch
title: IDLE - MacOS: freeze on non-ASCII save with open debugger - IDLE hangs 
on OS X with Cocoa Tk if encoding dialog is required during save

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



[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
import atexit

@atexit.register
def main():
  atexit.register(goodbye)

@atexit.register
def goodbye():
  print(Goodbye)
$ python2 testatexit.py
Goodbye
Goodbye
$ python3 testatexit.py
Goodbye

--

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



[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: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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
nosy: +serhiy.storchaka
stage:  - patch review
Added file: http://bugs.python.org/file37225/pydoc_port_2.patch

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



[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
http://bugs.python.org/issue18731
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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

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