[issue17102] tarfile extract can write files outside the destination path

2018-08-27 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
resolution:  -> duplicate
stage: needs patch -> resolved
status: open -> closed
superseder:  -> tarfile: Traversal attack vulnerability

___
Python tracker 

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



[issue34516] httplib sets unbefitting "Host" in request header when requests an ipv6 format url.

2018-08-27 Thread chen wu


chen wu  added the comment:

Thanks so much for your reply. 

when httplib.HTTPConnection is inited with host [fc00::0a08::2] and port 35357, 
we can make a request normally. only the 'Host' set in header is wrong. I think 
the most simple way to fix this is adding judgement condition, maybe like this:
974# Wrap the IPv6 Host Header with [] (RFC 2732)
975if host_enc.find(':') >= 0 and host_enc.find(']') < 0:
976host_enc = "[" + host_enc + "]"

or rules should be given, because when port is not default, only 
(host=[aaa:bbb]:123, port=None) and (host=aaa:bbb, port=123) are valid for 
httplib now.

so sorry for my poor English. hope you can understand what im saying. :)

--

___
Python tracker 

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



[issue34525] smtplib's authobject return value wrongly documented

2018-08-27 Thread Sebastian Rittau


Change by Sebastian Rittau :


--
keywords: +patch
pull_requests: +8438
stage:  -> patch review

___
Python tracker 

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



[issue34525] smtplib's authobject return value wrongly documented

2018-08-27 Thread Sebastian Rittau


New submission from Sebastian Rittau :

smtplib's authobject() callback is supposed to return bytes, according to both 
the documentation at https://docs.python.org/3/library/smtplib.html as well as 
the docstring of SMTP.auth(). This does neither match the implementation of 
auth(), which immediately calls encode() on the return value, nor that of the 
auth_cram_md5() et al, which return str.

--
assignee: docs@python
components: Documentation
messages: 324209
nosy: docs@python, srittau
priority: normal
severity: normal
status: open
title: smtplib's authobject return value wrongly documented
versions: Python 3.7

___
Python tracker 

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



[issue34524] Format conversion documentation example don't match comment

2018-08-27 Thread Richard Evans


Change by Richard Evans :


--
resolution:  -> not a bug
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue34524] Format conversion documentation example don't match comment

2018-08-27 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
pull_requests: +8437
stage:  -> patch review

___
Python tracker 

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



[issue34524] Format conversion documentation example don't match comment

2018-08-27 Thread Eric V. Smith


Eric V. Smith  added the comment:

Can you be more specific?

--
nosy: +eric.smith

___
Python tracker 

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



[issue34524] Format conversion documentation example don't match comment

2018-08-27 Thread Richard Evans


New submission from Richard Evans :

When reading the documentation for string formats I found that the conversion 
examples had comments that didn't match the example.

--
assignee: docs@python
components: Documentation
messages: 324207
nosy: Richard Evans, docs@python
priority: normal
severity: normal
status: open
title: Format conversion documentation example don't match comment
versions: Python 3.8

___
Python tracker 

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



[issue34523] Choose the filesystem encoding before Python initialization (add _PyCoreConfig.filesystem_encoding)

2018-08-27 Thread STINNER Victor


Change by STINNER Victor :


--
title: Choose the filesystem encoding earlier in Python initialization (add 
_PyCoreConfig.filesystem_encoding) -> Choose the filesystem encoding before 
Python initialization (add _PyCoreConfig.filesystem_encoding)

___
Python tracker 

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



[issue34523] Choose the filesystem encoding earlier in Python initialization (add _PyCoreConfig.filesystem_encoding)

2018-08-27 Thread STINNER Victor


Change by STINNER Victor :


--
keywords: +patch
pull_requests: +8436
stage:  -> patch review

___
Python tracker 

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



[issue34523] Choose the filesystem encoding earlier in Python initialization (add _PyCoreConfig.filesystem_encoding)

2018-08-27 Thread STINNER Victor


New submission from STINNER Victor :

Currently, the Python filesystem encoding is get in the middle of the Python 
initialization. initfsencoding() is only called when the import machinery is 
ready. Technically, only getting the Python codec name requires a working 
import machinery.

We can get the locale encoding even before Py_Initialize(), but update the 
encoding to the Python codec name (ex: replace "ANSI_X3.4-1968" with "ascii") 
once the import machinery is ready.

With my change, for an application embedding Python, the filesystem encoding 
can now be forced using _PyCoreConfig.filesystem_encoding. If it's set, Python 
will use it (and ignore the locale encoding).

Attached PR implements this idea and adds _PyCoreConfig.filesystem_encoding.


The change move all code to select encoding and error handler inside 
config_init_fs_encoding(), rather than relying on Py_FileSystemDefaultEncoding 
constant (its default value is set using #ifdef) and initfsencoding() (to get 
the locale encoding at runtime).


With this change, it becomes more obvious than the interpreter core 
configuration is mutable. initfsencoding() modify the encoding/errors during 
Python initialization, and sys._enablelegacywindowsfsencoding() even modify it 
at runtime. Previously, I wanted to expose the full core_config at the Python 
level, as something like sys.flags. But since it's mutable, I'm not longer sure 
that it's a good idea. To *get* the filesystem encoding/errors, they are 
already sys.getfilesystemencoding() and sys.getfilesystemencodeerrors(). 
Modifying the filesystem encoding at runtime is a very bad idea tried in the 
past and it caused many issues.


For the long term, I would like to remove Py_HasFileSystemDefaultEncoding, 
since it's really an implementation detail and there is no need to expose it. 
More generally, I don't see the purpose of exposing directly the encoding and 
error handler at the C level: Py_FileSystemDefaultEncoding and 
Py_FileSystemDefaultEncodeErrors. These symbols are constant constant, they 
cannot be modified when Python is embedded. But well, it's just a remark, 
technically, these 3 symbols don't cause any kind of trouble.


Commit message:
---
bpo-34485: Add _PyCoreConfig.filesystem_encoding

_PyCoreConfig_Read() is now responsible to choose the filesystem
encoding and error handler. Using Py_Main(), the encoding is now
selected even before calling Py_Initialize().

_PyCoreConfig.filesystem_encoding is now the reference instead of
Py_FileSystemDefaultEncoding for the Python filesystem encoding.

Changes:

* Add filesystem_encoding and filesystem_errors to _PyCoreConfig
* _PyCoreConfig_Read() now reads the locale encoding for the file
  system encoding. Coerce temporarly the locale or set temporarly the
  LC_CTYPE locale to the user preferred locale.
* PyUnicode_EncodeFSDefault() and PyUnicode_DecodeFSDefaultAndSize()
  now use the interpreter configuration rather than
  Py_FileSystemDefaultEncoding and Py_FileSystemDefaultEncodeErrors
  global configuration variables.
* Add _Py_SetFileSystemEncoding() and _Py_ClearFileSystemEncoding()
  private functions to only modify Py_FileSystemDefaultEncoding and
  Py_FileSystemDefaultEncodeErrors in coreconfig.c.
---

--
components: Interpreter Core
messages: 324206
nosy: eric.snow, inada.naoki, ncoghlan, vstinner
priority: normal
severity: normal
status: open
title: Choose the filesystem encoding earlier in Python initialization (add 
_PyCoreConfig.filesystem_encoding)
versions: Python 3.8

___
Python tracker 

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



[issue34007] test_gdb fails in s390x SLES buildbots

2018-08-27 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Walking the stack up one by one only triggers the "PC not saved" when the stack 
goes into libc:

(gdb) break builtin_id
Breakpoint 1 at 0x139403c: file Python/bltinmodule.c, line 1182.
(gdb) r
Starting program: /home/linux1/cpython/python tester.py
Missing separate debuginfos, use: zypper install 
glibc-debuginfo-2.22-62.13.2.s390x
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 0x3fffd2ff910 (LWP 9951)]
[New Thread 0x3fffcaff910 (LWP 9952)]
[New Thread 0x3fff7fff910 (LWP 9953)]
[New Thread 0x3fff77ff910 (LWP 9954)]

Thread 1 "python" hit Breakpoint 1, builtin_id (self=0x3fffdf5c0c8, v=0x14f7690 
) at Python/bltinmodule.c:1182
1182return PyLong_FromVoidPtr(v);
(gdb) thread 2
[Switching to thread 2 (Thread 0x3fffd2ff910 (LWP 9951))]
#0  0x03fffde8da0a in pthread_cond_timedwait@@GLIBC_2.3.2 () from 
/lib64/libpthread.so.0
(gdb) up
#1  0x01186a2e in PyCOND_TIMEDWAIT (cond=0x15139b0 <_PyRuntime+1192>, 
mut=0x15139e0 <_PyRuntime+1240>, us=5000) at Python/condvar.h:90
90  r = pthread_cond_timedwait((cond), (mut), );
(gdb)
#2  0x01186f3a in take_gil (tstate=0x1538620) at Python/ceval_gil.h:208
208 COND_TIMED_WAIT(_PyRuntime.ceval.gil.cond, 
_PyRuntime.ceval.gil.mutex,
(gdb)
#3  0x011884a6 in _PyEval_EvalFrameDefault (f=0x3fffd844d00, 
throwflag=0) at Python/ceval.c:980
980 take_gil(tstate);
(gdb)
#4  0x01187db8 in PyEval_EvalFrameEx (f=0x3fffd844d00, throwflag=0) at 
Python/ceval.c:536
536 return interp->eval_frame(f, throwflag);
(gdb)
#5  0x01047596 in function_code_fastcall (co=0x3fffdd76640, 
args=0x3fff8000a98, nargs=1, globals=0x3fffddcff30) at Objects/call.c:283
283 result = PyEval_EvalFrameEx(f,0);
(gdb)
#6  0x01048144 in _PyFunction_FastCallKeywords (func=0x3fffd7d8680, 
stack=0x3fff8000a90, nargs=1, kwnames=0x0) at Objects/call.c:408
408 return function_code_fastcall(co, stack, nargs, globals);
(gdb)
#7  0x011a48b6 in call_function (pp_stack=0x3fffd2fb5f8, oparg=1, 
kwnames=0x0) at Python/ceval.c:4623
4623x = _PyFunction_FastCallKeywords(func, stack, nargs, 
kwnames);
(gdb)
#8  0x0119c088 in _PyEval_EvalFrameDefault (f=0x3fff80008f0, 
throwflag=0) at Python/ceval.c:3186
3186res = call_function(, oparg + 1, NULL);
(gdb)
#9  0x01187db8 in PyEval_EvalFrameEx (f=0x3fff80008f0, throwflag=0) at 
Python/ceval.c:536
536 return interp->eval_frame(f, throwflag);
(gdb)
#10 0x01047596 in function_code_fastcall (co=0x3fffda6e580, 
args=0x3fffd87e980, nargs=1, globals=0x3fffdd717c0) at Objects/call.c:283
283 result = PyEval_EvalFrameEx(f,0);
(gdb)
#11 0x01048144 in _PyFunction_FastCallKeywords (func=0x3fffd7d61b0, 
stack=0x3fffd87e978, nargs=1, kwnames=0x0) at Objects/call.c:408
408 return function_code_fastcall(co, stack, nargs, globals);
(gdb)
#12 0x011a48b6 in call_function (pp_stack=0x3fffd2fd1b8, oparg=1, 
kwnames=0x0) at Python/ceval.c:4623
4623x = _PyFunction_FastCallKeywords(func, stack, nargs, 
kwnames);
(gdb)
#13 0x0119c088 in _PyEval_EvalFrameDefault (f=0x3fffd87e7f0, 
throwflag=0) at Python/ceval.c:3186
3186res = call_function(, oparg + 1, NULL);
(gdb)
#14 0x01187db8 in PyEval_EvalFrameEx (f=0x3fffd87e7f0, throwflag=0) at 
Python/ceval.c:536
536 return interp->eval_frame(f, throwflag);
(gdb)
#15 0x01047596 in function_code_fastcall (co=0x3fffda6e340, 
args=0x3fffd2fed28, nargs=1, globals=0x3fffdd717c0) at Objects/call.c:283
283 result = PyEval_EvalFrameEx(f,0);
(gdb)
#16 0x01047a2e in _PyFunction_FastCallDict (func=0x3fffd7d3f70, 
args=0x3fffd2fed20, nargs=1, kwargs=0x0) at Objects/call.c:322
322 return function_code_fastcall(co, args, nargs, globals);
(gdb)
#17 0x010467d6 in _PyObject_FastCallDict (callable=0x3fffd7d3f70, 
args=0x3fffd2fed20, nargs=1, kwargs=0x0) at Objects/call.c:98
98  return _PyFunction_FastCallDict(callable, args, nargs, kwargs);
(gdb)
#18 0x01049c5c in _PyObject_Call_Prepend (callable=0x3fffd7d3f70, 
obj=0x3fffdc70650, args=0x3fffdfb9050, kwargs=0x0)
at Objects/call.c:904
904 result = _PyObject_FastCallDict(callable,
(gdb)
#19 0x01324f02 in method_call (method=0x3fffdeee258, 
args=0x3fffdfb9050, kwargs=0x0) at Objects/classobject.c:306
306 return _PyObject_Call_Prepend(func, self, args, kwargs);
(gdb)
#20 0x01047396 in PyObject_Call (callable=0x3fffdeee258, 
args=0x3fffdfb9050, kwargs=0x0) at Objects/call.c:245
245 result = (*call)(callable, args, kwargs);
(gdb)
#21 0x012b91be in t_bootstrap (boot_raw=0x3fffd9fb118) at 
./Modules/_threadmodule.c:992
992 res = PyObject_Call(boot->func, boot->args, boot->keyw);
(gdb)
#22 0x03fffde88b22 

[issue34007] test_gdb fails in s390x SLES buildbots

2018-08-27 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I need to do some more experimenting because those symbols are not available on 
other systems with the test passing. Something is corrupting/not saving the 
program counter but I do not know what.

--

___
Python tracker 

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



[issue33635] OSError when using pathlib.Path.rglob() to list device files

2018-08-27 Thread miss-islington


miss-islington  added the comment:


New changeset 2cf33161f7cb4ca726c74fcfa2d6db27073953d8 by Miss Islington (bot) 
in branch '3.7':
bpo-33635: Handling Bad file descriptor in Path.is_file and related. (GH-8542)
https://github.com/python/cpython/commit/2cf33161f7cb4ca726c74fcfa2d6db27073953d8


--
nosy: +miss-islington

___
Python tracker 

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



[issue34487] enum _sunder_ names mix metaclass and enum class attributes

2018-08-27 Thread Ethan Furman


Ethan Furman  added the comment:

All those attributes live in the Enum class.  If you use a non-existent 
attribute, such as _name, then the metaclass will be called to check if that 
name is actually an Enum member.

--
assignee: docs@python -> ethan.furman
nosy: +ethan.furman

___
Python tracker 

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



[issue34482] datetime: Tests for potential crashes due to non-UTF-8-encodable strings

2018-08-27 Thread Paul Ganssle


Paul Ganssle  added the comment:

Somewhat related: #6697.

Turns out there are already some tests here for this, specifically for the C 
version only: 
https://github.com/python/cpython/blob/master/Lib/test/datetimetester.py#L3328

--

___
Python tracker 

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



[issue34007] test_gdb fails in s390x SLES buildbots

2018-08-27 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I think I understand what is happening. The SLES buildbots do not have 
debugging symbols for glibc:

(gdb) set verbose on
(gdb) break builtin_id
Reading in symbols for Python/bltinmodule.c...done.
Breakpoint 1 at 0x139403c: file Python/bltinmodule.c, line 1182.
(gdb) r
Starting program: /home/linux1/cpython/python tester.py
Reading symbols from /lib/ld64.so.1...(no debugging symbols found)...done.
Reading symbols from system-supplied DSO at 0x3fffdffe000...(no debugging 
symbols found)...done.
Missing separate debuginfos, use: zypper install 
glibc-debuginfo-2.22-62.13.2.s390x
Reading symbols from /lib64/libpthread.so.0...(no debugging symbols 
found)...done.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Reading symbols from /lib64/libdl.so.2...(no debugging symbols found)...done.
Reading symbols from /lib64/libutil.so.1...(no debugging symbols found)...done.
Reading symbols from /lib64/libm.so.6...(no debugging symbols found)...done.
Reading symbols from /lib64/libc.so.6...(no debugging symbols found)...done.

And when requesting the stacktrace of a thread it cannot go into libc because 
the program counter is not available:

(gdb) thread apply 2 where

#19 0x01324f02 in method_call (method=, 
args=(), kwargs=0x0) at Objects/classobject.c:306
#20 0x01047396 in PyObject_Call (callable=, args=(), kwargs=0x0) at Objects/call.c:245
#21 0x012b91be in t_bootstrap (boot_raw=0x3fffd9fb118) at 
./Modules/_threadmodule.c:992
#22 0x03fffde88b22 in start_thread () from /lib64/libpthread.so.0
#23 0x03fffdb7164a in thread_start () from /lib64/libc.so.6
PC not saved

This get triggered when printing the python stack trace with py-bt and the 
exception is getting printed on stderr and this fails the test.

--

___
Python tracker 

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



[issue33635] OSError when using pathlib.Path.rglob() to list device files

2018-08-27 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8435

___
Python tracker 

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



[issue33635] OSError when using pathlib.Path.rglob() to list device files

2018-08-27 Thread Steve Dower

Steve Dower  added the comment:


New changeset 216b745eafa7cd4a683a8405dcfbd7f5567f504c by Steve Dower 
(Przemysław Spodymek) in branch 'master':
bpo-33635: Handling Bad file descriptor in Path.is_file and related. (GH-8542)
https://github.com/python/cpython/commit/216b745eafa7cd4a683a8405dcfbd7f5567f504c


--
nosy: +steve.dower

___
Python tracker 

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



[issue34454] datetime: NULL dereference in fromisoformat() on PyUnicode_AsUTF8AndSize() failure

2018-08-27 Thread Paul Ganssle


Change by Paul Ganssle :


--
pull_requests: +8434

___
Python tracker 

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



[issue21109] tarfile: Traversal attack vulnerability

2018-08-27 Thread Philippe Godbout


Philippe Godbout  added the comment:

Lars, I think the suggested approach is great. Documentation for the tarfile 
class should be changed in order to direct user to the "safe" version with an 
relevant warning. A bit like what is done for PRNG safety.
As stated by Eduardo an optional "safe" parameter to opt into safe mode could 
also be an interesting approach.

--
nosy: +Philippe Godbout

___
Python tracker 

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



[issue34200] importlib: python -m test test_pkg -m test_7 fails randomly

2018-08-27 Thread Vladimir Matveev


Vladimir Matveev  added the comment:

I've tried to repro this on Mac, Windows box and Windows VM - works fine for 
all cases.

--
nosy: +v2m

___
Python tracker 

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



[issue34403] test_utf8_mode.test_cmd_line() fails on HP-UX due to false assumptions

2018-08-27 Thread Michael Felt

Michael Felt  added the comment:

On 27/08/2018 15:22, Michael Osipov wrote:
> Michael Osipov <1983-01...@gmx.net> added the comment:
>
> So I changed the test code to:
>
> diff --git a/Lib/test/test_utf8_mode.py b/Lib/test/test_utf8_mode.py
> index 26e2e13ec5..d9f8a3ed8b 100644
> --- a/Lib/test/test_utf8_mode.py
> +++ b/Lib/test/test_utf8_mode.py
> @@ -208,7 +208,7 @@ class UTF8ModeTests(unittest.TestCase):
>  def test_cmd_line(self):
>  arg = 'h\xe9\u20ac'.encode('utf-8')
>  arg_utf8 = arg.decode('utf-8')
> -arg_ascii = arg.decode('ascii', 'surrogateescape')
> +arg_ascii = arg.decode('roman8', 'surrogateescape')
>  code = 'import locale, sys; print("%s:%s" % 
> (locale.getpreferredencoding(), ascii(sys.argv[1:])))'
>
>  def check(utf8_opt, expected, **kw):
>
> and the output is:
> ==
> FAIL: test_cmd_line (test.test_utf8_mode.UTF8ModeTests)
> --
> Traceback (most recent call last):
>   File "/var/osipovmi/cpython/Lib/test/test_utf8_mode.py", line 224, in 
> test_cmd_line
> check('utf8=0', [c_arg], LC_ALL='C')
>   File "/var/osipovmi/cpython/Lib/test/test_utf8_mode.py", line 217, in check
> self.assertEqual(args, ascii(expected), out)
> AssertionError: "['h\\xc3\\xa9\\xe2\\x82\\xac']" != 
> "['h\\xfb\\u02cb\\xe3\\x82\\u02dc']"
> - ['h\xc3\xa9\xe2\x82\xac']
> + ['h\xfb\u02cb\xe3\x82\u02dc']
>  : roman8:['h\xc3\xa9\xe2\x82\xac']
>
> I still don't understand that.
Something I found helpful was to change:

    check('utf8=0', [c_arg], LC_ALL='C')

to
    check('utf8=0', [c_arg], LC_ALL='C', failure=True )

This also fails, but it shows what is being executed.

Further, my 'understanding' is that ascii(whatever) is much smarter than
whatever.decode('ascii', ...) does. Also, ascii() tends to use the \x
shorthand, while decode('ascii', 'surrogateescape') uses the \udc prefix.

And, while you might still consider it a 'bug', did you try using c_arg
= arg.decode('iso-88859-1') ?

Michael (F)

>
> I believe that surrogate escape only works for ASCII and nothing else. If so, 
> this test must be skipped on HP-UX and AIX.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue34522] PyTypeObject's tp_base initialization bug

2018-08-27 Thread Eddie Elizondo


Change by Eddie Elizondo :


--
keywords: +patch
pull_requests: +8432
stage:  -> patch review

___
Python tracker 

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



[issue34522] PyTypeObject's tp_base initialization bug

2018-08-27 Thread Eddie Elizondo


New submission from Eddie Elizondo :

>From the documentation, it says that PyType_Ready should be called on `ALL` 
>type objects to finish their initialization 
>(https://docs.python.org/3/c-api/type.html#c.PyType_Ready). This means that a 
>PyTypeObject's ob_type should always be set by PyType_Ready.

It turns out that this is not actually followed by all the core types in 
CPython. This leads to the usage of types that were not initialized through 
PyType_Ready.

This fix modifies PyVarObject_HEAD_INIT to default the type to NULL so that all 
objects have to be fully initialized through PyType_Ready.

Plus:
* It initializes all the objects that were not being initialized through 
PyType_Ready.
* Modifies PyType_Ready to special case the ob_type initialization of 
PyType_Type and PyBaseObject_Type.
* It modifies the edge case of _Py_FalseStruct and _Py_TrueStruct.

Read more: https://mail.python.org/pipermail/python-dev/2018-August/154946.html

--
components: Interpreter Core
messages: 324195
nosy: eelizondo
priority: normal
severity: normal
status: open
title: PyTypeObject's tp_base initialization bug
type: behavior
versions: Python 3.8

___
Python tracker 

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



[issue34007] test_gdb fails in s390x SLES buildbots

2018-08-27 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I requested a SLES VM in https://linuxone20.cloud.marist.edu as indicated by 
@David Edelsohn (the builtbot maintainer) and I can reproduce the issue on 
master, 3.7, 3.6 and 3.5. So it seems that a change in gdb itself caused this. 
Interestingly, in Python 3.5 the error is different:

==
FAIL: test_threads (test.test_gdb.PyBtTests)
Verify that "py-bt" indicates threads that are waiting for the GIL
--
Traceback (most recent call last):
  File "/home/linux1/cpython/Lib/test/test_gdb.py", line 771, in test_threads
self.assertIn('Waiting for the GIL', gdb_output)
AssertionError: 'Waiting for the GIL' not found in 'Breakpoint 1 at 0x11751d8: 
file Python/bltinmodule.c, line 1093.\n[Thread debugging using libthread_db 
enabled]\nUsing host libthread_db library "/lib64/libthread_db.so.1".\n[New 
Thread 0x3fffd2ff910 (LWP 33928)]\n[New Thread 0x3fffcaff910 (LWP 33929)]\n'

--
Ran 45 tests in 19.522s

--

___
Python tracker 

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



[issue34498] Python 3.7 breaks on singledispatch_function.register(pseudo_type), which Python 3.6 accepted

2018-08-27 Thread Brett Cannon


Change by Brett Cannon :


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue21109] tarfile: Traversal attack vulnerability

2018-08-27 Thread Tal Einat


Tal Einat  added the comment:

Lars, a huge +1 from me for your suggested approach and patch.  I'd like to 
work this into a review-ready PR.

The patch is a great step forward but still a ways from being ready for a PR: 
It is missing tests entirely and there are still several important methods of 
SafeTarFile which don't use the safety logic, e.g. next() and getmemebers().

Lars, would you be interested in continuing to work on this?

--
nosy: +taleinat
versions: +Python 3.8

___
Python tracker 

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



[issue1044] tarfile insecure pathname extraction

2018-08-27 Thread Tal Einat


Change by Tal Einat :


--
Removed message: https://bugs.python.org/msg324192

___
Python tracker 

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



[issue1044] tarfile insecure pathname extraction

2018-08-27 Thread Tal Einat


Tal Einat  added the comment:

I suggest marking this as a duplicate of #21109, which is more general and 
includes most of the relevant discussion and patches.

--
nosy: +taleinat

___
Python tracker 

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



[issue17102] tarfile extract can write files outside the destination path

2018-08-27 Thread Tal Einat


Tal Einat  added the comment:

I suggest marking this as a duplicate of #21109, which is more general and 
includes most of the relevant discussion and patches.

--
nosy: +taleinat

___
Python tracker 

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



[issue34516] httplib sets unbefitting "Host" in request header when requests an ipv6 format url.

2018-08-27 Thread Prudvi RajKumar Maddala


Prudvi RajKumar Maddala  added the comment:

I don't think urllib module is part of core python library. It's a 3rd party 
library which we usually install using pip

--
nosy: +prudvinit

___
Python tracker 

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



[issue34514] assertEqual doesn't use maxDiff when comparing dictionaries

2018-08-27 Thread Prudvi RajKumar Maddala


Prudvi RajKumar Maddala  added the comment:

I see that maxDiff is applied correctly when comparing dictionaries. I don't 
think that's an issue.

--

___
Python tracker 

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



[issue34521] test_socket.RecvmsgIntoSCMRightsStreamTest fails on AMD64 FreeBSD CURRENT Debug 3.x

2018-08-27 Thread Pablo Galindo Salgado


New submission from Pablo Galindo Salgado :

test_socket.RecvmsgIntoSCMRightsStreamTest fails on AMD64 FreeBSD CURRENT Debug 
3.x:

https://buildbot.python.org/all/#/builders/60/builds/248


==
FAIL: testFDPassSeparateMinSpace 
(test.test_socket.RecvmsgIntoSCMRightsStreamTest)
--
Traceback (most recent call last):
  File "/usr/home/pablo/cpython/Lib/test/test_socket.py", line 2881, in 
testFDPassSeparateMinSpace
maxcmsgs=2, ignoreflags=socket.MSG_CTRUNC)
  File "/usr/home/pablo/cpython/Lib/test/test_socket.py", line 2798, in 
checkRecvmsgFDs
self.assertEqual(len(fds), numfds)
AssertionError: 1 != 2

--
Ran 18 tests in 0.084s

FAILED (failures=1)
test test_socket failed
test_socket failed

== Tests result: FAILURE ==

1 test failed:
test_socket


I was able to reproduce the bug in the buildbot but this same test fails in 3.6 
and 3.5 in the buildbot so it can be some configuration in the buildbot or some 
regression in FreeBSD.

--
components: FreeBSD, Tests
messages: 324188
nosy: koobs, pablogsal
priority: normal
severity: normal
status: open
title: test_socket.RecvmsgIntoSCMRightsStreamTest fails on AMD64 FreeBSD 
CURRENT Debug 3.x
type: behavior

___
Python tracker 

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



[issue34520] test_asyncio leaked [2, 2, 2] references, sum=6 in AMD64 Windows8.1 Refleaks 3.7

2018-08-27 Thread Pablo Galindo Salgado


New submission from Pablo Galindo Salgado :

test_asyncio is potentially leaking resources in AMD64 Windows8.1 Refleaks 3.7:

https://buildbot.python.org/all/#/builders/132/builds/241

--
Ran 1782 tests in 115.342s
OK (skipped=78)
.
test_asyncio leaked [2, 2, 2] references, sum=6
test_asyncio leaked [2, 3, 2] memory blocks, sum=7
3 tests failed again:
test_asyncio test_smtplib test_trace
== Tests result: FAILURE then FAILURE ==
383 tests OK.

--
components: Tests, Windows, asyncio
messages: 324187
nosy: asvetlov, pablogsal, paul.moore, steve.dower, tim.golden, yselivanov, 
zach.ware
priority: normal
severity: normal
status: open
title: test_asyncio leaked [2, 2, 2] references, sum=6 in AMD64 Windows8.1 
Refleaks 3.7
type: behavior
versions: Python 3.7

___
Python tracker 

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



[issue34489] subprocess: execution of batch-files (.cmd/.bat) is vulnerable in python for windows / insufficient escape

2018-08-27 Thread Steve Dower


Steve Dower  added the comment:

Would you consider adding your test suite into the regression tests as well?

Right now, this is a well known issue on all platforms, but there is no clear 
universal solution. If your approach works well for all platforms and does not 
adversely impact any of them, it could be considered. But otherwise, we would 
prefer to keep our advice to not use subprocess with untrusted data while still 
allowing it in circumstances where the developer chooses otherwise.

--

___
Python tracker 

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



[issue34470] windows msi in headless mode fails to install Script directory on reinstall if the python folder was deleted but not uninstalled

2018-08-27 Thread Steve Dower


Steve Dower  added the comment:

Also, if you could provide some instructions on how to validate the issue you 
are reporting. Right now, I'm not even sure what you are seeing that is the 
problem.

--

___
Python tracker 

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



[issue34470] windows msi in headless mode fails to install Script directory on reinstall if the python folder was deleted but not uninstalled

2018-08-27 Thread Steve Dower


Steve Dower  added the comment:

Can you please provide the full set of logs for the Python 3.7 install? 
(They'll be in %TEMP%, and there will be quite a number of them.)

--
versions: +Python 3.7

___
Python tracker 

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



[issue34502] Docs of sys.exit() mention utf8_mode for an unclear reason

2018-08-27 Thread STINNER Victor


STINNER Victor  added the comment:

Ah ok, in this case, everything is fine :-)

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue34502] Docs of sys.exit() mention utf8_mode for an unclear reason

2018-08-27 Thread Alexey Izbyshev


Alexey Izbyshev  added the comment:

Victor, but sys.flags docs *do* contain the note[1]:

Changed in version 3.7: Added dev_mode attribute for the new -X dev flag and 
utf8_mode attribute for the new -X utf8 flag.

I've tried to express that in msg324086, but obviously failed.

[1] https://docs.python.org/3/library/sys.html#sys.flags

--

___
Python tracker 

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



[issue34347] AIX: test_utf8_mode.test_cmd_line fails

2018-08-27 Thread Michael Osipov


Michael Osipov <1983-01...@gmx.net> added the comment:

Interesting is that the very same approach does not work for HP-UX even if I 
swap out the params for HP-UX:

$ ./python -m test test_utf8_mode
Run tests sequentially
0:00:00 [1/1] test_utf8_mode
test test_utf8_mode failed -- Traceback (most recent call last):
  File "/var/osipovmi/cpython/Lib/test/test_utf8_mode.py", line 226, in 
test_cmd_line
check('utf8=0', [c_arg], LC_ALL='C')
  File "/var/osipovmi/cpython/Lib/test/test_utf8_mode.py", line 217, in check
self.assertEqual(args, ascii(expected), out)
AssertionError: "['h\\xc3\\xa9\\xe2\\x82\\xac']" != 
"['h\\xfb\\u02cb\\xe3\\x82\\u02dc']"
- ['h\xc3\xa9\xe2\x82\xac']
+ ['h\xfb\u02cb\xe3\x82\u02dc']
 : roman8:['h\xc3\xa9\xe2\x82\xac']

--

___
Python tracker 

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



[issue14568] HP-UX local libraries not included

2018-08-27 Thread Michael Osipov


Michael Osipov <1983-01...@gmx.net> added the comment:

Can someone review the PR for this?

--
nosy: +michael-o
versions: +Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue34519] Add additional aliases for HP Roman 8

2018-08-27 Thread Michael Osipov


Change by Michael Osipov <1983-01...@gmx.net>:


--
keywords: +patch
pull_requests: +8431
stage:  -> patch review

___
Python tracker 

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



[issue34347] AIX: test_utf8_mode.test_cmd_line fails

2018-08-27 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 7ef1697be54a74314d5214d9ba0580d4e620694c by Victor Stinner 
(Michael Felt) in branch 'master':
bpo-34347: Fix test_utf8_mode.test_cmd_line for AIX (GH-8923)
https://github.com/python/cpython/commit/7ef1697be54a74314d5214d9ba0580d4e620694c


--

___
Python tracker 

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



[issue34519] Add additional aliases for HP Roman 8

2018-08-27 Thread Michael Osipov


New submission from Michael Osipov <1983-01...@gmx.net>:

HP Roman 8 is also known as 'hp-roman8', 'cp1051' and 'ibm1051'. They are 
missing from the aliases.py.

--
components: Library (Lib)
messages: 324178
nosy: michael-o
priority: normal
severity: normal
status: open
title: Add additional aliases for HP Roman 8
type: enhancement
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue13312] test_time fails: strftime('%Y', y) for negative year

2018-08-27 Thread STINNER Victor


STINNER Victor  added the comment:

Note for myself: Python 2.7 is not affected by this bug because it doesn't 
accept year < 1900.

--

___
Python tracker 

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



[issue34403] test_utf8_mode.test_cmd_line() fails on HP-UX due to false assumptions

2018-08-27 Thread Michael Osipov


Michael Osipov <1983-01...@gmx.net> added the comment:

Maybe Victor Stinner has some insights here.

--
nosy: +vstinner

___
Python tracker 

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



[issue34403] test_utf8_mode.test_cmd_line() fails on HP-UX due to false assumptions

2018-08-27 Thread Michael Osipov


Michael Osipov <1983-01...@gmx.net> added the comment:

Maybe skipping the test is the best thing:
diff --git a/Lib/test/test_utf8_mode.py b/Lib/test/test_utf8_mode.py
index 26e2e13ec5..d6c4b321be 100644
--- a/Lib/test/test_utf8_mode.py
+++ b/Lib/test/test_utf8_mode.py
@@ -12,7 +12,7 @@ from test.support.script_helper import assert_python_ok, 
assert_python_failure


 MS_WINDOWS = (sys.platform == 'win32')
-
+HPUX = (sys.platform.startswith('hp-ux'))

 class UTF8ModeTests(unittest.TestCase):
 DEFAULT_ENV = {
@@ -205,6 +205,7 @@ class UTF8ModeTests(unittest.TestCase):
 self.assertEqual(out, 'UTF-8 UTF-8')

 @unittest.skipIf(MS_WINDOWS, 'test specific to Unix')
+@unittest.skipIf(HPUX, 'test specific to Unix with ASCII default locale')
 def test_cmd_line(self):
 arg = 'h\xe9\u20ac'.encode('utf-8')
 arg_utf8 = arg.decode('utf-8')

--

___
Python tracker 

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



[issue34502] Docs of sys.exit() mention utf8_mode for an unclear reason

2018-08-27 Thread STINNER Victor


Change by STINNER Victor :


--
resolution: fixed -> 
status: closed -> open

___
Python tracker 

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



[issue34502] Docs of sys.exit() mention utf8_mode for an unclear reason

2018-08-27 Thread STINNER Victor


STINNER Victor  added the comment:

Yes, it's a note for sys.flags. Can you please add it back to sys.flags?

Sorry, I added the note at the wrong place.

--

___
Python tracker 

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



[issue34403] test_utf8_mode.test_cmd_line() fails on HP-UX due to false assumptions

2018-08-27 Thread Michael Osipov


Michael Osipov <1983-01...@gmx.net> added the comment:

So I changed the test code to:

diff --git a/Lib/test/test_utf8_mode.py b/Lib/test/test_utf8_mode.py
index 26e2e13ec5..d9f8a3ed8b 100644
--- a/Lib/test/test_utf8_mode.py
+++ b/Lib/test/test_utf8_mode.py
@@ -208,7 +208,7 @@ class UTF8ModeTests(unittest.TestCase):
 def test_cmd_line(self):
 arg = 'h\xe9\u20ac'.encode('utf-8')
 arg_utf8 = arg.decode('utf-8')
-arg_ascii = arg.decode('ascii', 'surrogateescape')
+arg_ascii = arg.decode('roman8', 'surrogateescape')
 code = 'import locale, sys; print("%s:%s" % 
(locale.getpreferredencoding(), ascii(sys.argv[1:])))'

 def check(utf8_opt, expected, **kw):

and the output is:
==
FAIL: test_cmd_line (test.test_utf8_mode.UTF8ModeTests)
--
Traceback (most recent call last):
  File "/var/osipovmi/cpython/Lib/test/test_utf8_mode.py", line 224, in 
test_cmd_line
check('utf8=0', [c_arg], LC_ALL='C')
  File "/var/osipovmi/cpython/Lib/test/test_utf8_mode.py", line 217, in check
self.assertEqual(args, ascii(expected), out)
AssertionError: "['h\\xc3\\xa9\\xe2\\x82\\xac']" != 
"['h\\xfb\\u02cb\\xe3\\x82\\u02dc']"
- ['h\xc3\xa9\xe2\x82\xac']
+ ['h\xfb\u02cb\xe3\x82\u02dc']
 : roman8:['h\xc3\xa9\xe2\x82\xac']

I still don't understand that.

I believe that surrogate escape only works for ASCII and nothing else. If so, 
this test must be skipped on HP-UX and AIX.

--

___
Python tracker 

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



[issue34518] Documentation for coroutine objects

2018-08-27 Thread Hrvoje Nikšić

Hrvoje Nikšić  added the comment:

That's exactly it, thanks! I have no idea how I missed it, despite looking (I 
thought) carefully.

But yes, they should be linked from 
https://docs.python.org/3/library/stdtypes.html . Just as currently there is 
https://docs.python.org/3/library/stdtypes.html#generator-types that links to 
https://docs.python.org/3/reference/expressions.html#yieldexpr , there could be 
a #coroutine-types that links to 
https://docs.python.org/3/reference/datamodel.html#coroutine-objects

Another place to link is https://docs.python.org/3/glossary.html#term-coroutine 
- it currently does link to the reference, but only to the "async def" syntax.

Since https://docs.python.org/3/reference/compound_stmts.html#async-def is 
linked from many places, it might make sense to mention that *calling* a 
coroutine immediately returns a coroutine object, with a link to 
https://docs.python.org/3/reference/datamodel.html#coroutine-objects

--

___
Python tracker 

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



[issue34516] httplib sets unbefitting "Host" in request header when requests an ipv6 format url.

2018-08-27 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue34518] Documentation for coroutine objects

2018-08-27 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Is this what you are referring to that has docs for send, close and throw in 
coroutine objects ? 
Coroutine object docs : 
https://docs.python.org/3/reference/datamodel.html#coroutine-objects

If the above is the one then I think we can improve on the visibility by 
linking it from other pages since it doesn't show up with Google for 'coroutine 
close'. I had to use Docs folder in source code and sphinx search in 
docs.python.org with 'coroutine close' to get there.

Thanks

--

___
Python tracker 

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



[issue34518] Documentation for coroutine objects

2018-08-27 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue34486] "RuntimeError: release unlocked lock" when starting a thread

2018-08-27 Thread STINNER Victor


STINNER Victor  added the comment:

cond_race.py: simplified example using threading.Lock and threading.Condition: 
the issue seems to be related to threading.Event which doesn't handle properly 
signals.

--
nosy: +pitrou, serhiy.storchaka
Added file: https://bugs.python.org/file47765/cond_race.py

___
Python tracker 

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



[issue11192] test_socket error on AIX

2018-08-27 Thread Michael Felt


Change by Michael Felt :


--
keywords: +patch
pull_requests: +8430
stage:  -> patch review

___
Python tracker 

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



[issue34355] SIGSEGV (Address boundary error)

2018-08-27 Thread INADA Naoki


INADA Naoki  added the comment:

I think so.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> int(s), float(s) and others may cause segmentation fault

___
Python tracker 

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



[issue30858] Keyword can't be an expression?

2018-08-27 Thread Vedran Čačić

Vedran Čačić  added the comment:

Nick, thanks for validating my pain. :-|

In the meantime, I found out Python already knows more finely what kind of 
expression something is, and uses that knowledge in the error messages. Look:

>>> a + b = 4
SyntaxError: can't assign to operator
>>> a(b) = 4
SyntaxError: can't assign to function call
>>> 'a' = 4
SyntaxError: can't assign to literal

So, how about "keyword argument name cannot be an operator / function call / 
literal"? (Of course, if you ask me, "operator" is also unfortunate, but at 
least there is a precedent.)

--

___
Python tracker 

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



[issue34434] Removal of kwargs for built-in types not covered with "changed in Python" note in documentation

2018-08-27 Thread Xiang Zhang


Change by Xiang Zhang :


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

___
Python tracker 

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



[issue34434] Removal of kwargs for built-in types not covered with "changed in Python" note in documentation

2018-08-27 Thread miss-islington


miss-islington  added the comment:


New changeset fa3fd4cb181120007aefc408366c0cef6fb62f9d by Miss Islington (bot) 
in branch '3.7':
bpo-34434: Update doc for bool(), float() and int() arguments (GH-8834)
https://github.com/python/cpython/commit/fa3fd4cb181120007aefc408366c0cef6fb62f9d


--
nosy: +miss-islington

___
Python tracker 

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



[issue34434] Removal of kwargs for built-in types not covered with "changed in Python" note in documentation

2018-08-27 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8429

___
Python tracker 

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



[issue3692] improper scope in list comprehension, when used in class declaration

2018-08-27 Thread Mark Dickinson


Change by Mark Dickinson :


--
nosy: +mark.dickinson

___
Python tracker 

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



[issue34434] Removal of kwargs for built-in types not covered with "changed in Python" note in documentation

2018-08-27 Thread Xiang Zhang


Xiang Zhang  added the comment:


New changeset 3fe89dac42809a7741d50ebf595be98833b79b97 by Xiang Zhang (Louis 
Sautier) in branch 'master':
bpo-34434: Update doc for bool(), float() and int() arguments (GH-8834)
https://github.com/python/cpython/commit/3fe89dac42809a7741d50ebf595be98833b79b97


--
nosy: +xiang.zhang

___
Python tracker 

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



[issue34487] enum _sunder_ names mix metaclass and enum class attributes

2018-08-27 Thread INADA Naoki


INADA Naoki  added the comment:

Is it really need to be documented?
How is it important when using enum?

If there are no problem, I prefer keeping it implementation detail and don't 
make document fatter.

--
nosy: +inada.naoki

___
Python tracker 

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



[issue26544] platform.libc_ver() returns incorrect version number

2018-08-27 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8428

___
Python tracker 

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



[issue26544] platform.libc_ver() returns incorrect version number

2018-08-27 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 7d81e8f5995df6980a1a02923e224a481375f130 by Serhiy Storchaka in 
branch 'master':
bpo-26544: Get rid of dependence from distutils in platform. (GH-8356)
https://github.com/python/cpython/commit/7d81e8f5995df6980a1a02923e224a481375f130


--

___
Python tracker 

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



[issue34171] Lib/trace.cover not removed by the clean target

2018-08-27 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8427

___
Python tracker 

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



[issue34171] Lib/trace.cover not removed by the clean target

2018-08-27 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset b44a1d4f71daf4edb948b9878f82a60891e4a2e1 by Serhiy Storchaka in 
branch 'master':
bpo-34171: Fix test_trace. (GH-8940)
https://github.com/python/cpython/commit/b44a1d4f71daf4edb948b9878f82a60891e4a2e1


--

___
Python tracker 

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



[issue34517] Error referencing local variables in dict comprehensions inside class definitions

2018-08-27 Thread Mark Dickinson


Change by Mark Dickinson :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue34517] Error referencing local variables in dict comprehensions inside class definitions

2018-08-27 Thread Mark Dickinson


Change by Mark Dickinson :


--
resolution: not a bug -> duplicate
stage:  -> resolved

___
Python tracker 

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



[issue34517] Error referencing local variables in dict comprehensions inside class definitions

2018-08-27 Thread Mark Dickinson


Change by Mark Dickinson :


--
superseder:  -> improper scope in list comprehension, when used in class 
declaration

___
Python tracker 

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



[issue34517] Error referencing local variables in dict comprehensions inside class definitions

2018-08-27 Thread Mark Dickinson

Mark Dickinson  added the comment:

[I wrote this before Serhiy posted his reply; sending it anyway, in case the 
doc links are useful.]

This is documented, by-design behaviour. Essentially name resolution skips 
class scopes.

See 
https://docs.python.org/3/reference/executionmodel.html#resolution-of-names, 
and particularly the example at the end of that section, which is very similar 
to your example.

See also: 
https://docs.python.org/3/reference/expressions.html#displays-for-lists-sets-and-dictionaries,
 and in particular this part:

> However, aside from the iterable expression in the leftmost for clause,
> the comprehension is executed in a separate implicitly nested scope.
> This ensures that names assigned to in the target list don’t “leak” into
> the enclosing scope.

That "leftmost for clause" bit explains why, in the following example, the 
first comprehension is evaluated successfully, but the second raises a 
`NameError`.

>>> class A:
... a = 3
... b = [x+y for x in range(a) for y in range(3)]  # okay
... c = [x+y for x in range(3) for y in range(a)]  # raises

--
nosy: +mark.dickinson -serhiy.storchaka
resolution: duplicate -> not a bug
stage: resolved -> 
superseder: improper scope in list comprehension, when used in class 
declaration -> 

___
Python tracker 

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



[issue26694] Disasembler fall with Key Error while disassemble obfuscated code.

2018-08-27 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

The dis module is not supposed to support invalid bytecode. This is a new 
feature, and 2.7 can give only bug fixes.

--
nosy: +serhiy.storchaka
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue32836] Symbol table for comprehensions (list, dict, set) still includes temporary _[1] variable

2018-08-27 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.7, Python 3.8

___
Python tracker 

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



[issue34427] calling MutableSequence.extend on self produces infinite loop

2018-08-27 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Agreed. Appending >2**31 items one by one to the collection with external 
storage is not very efficient, so such collection likely has specialized 
extend().

--

___
Python tracker 

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



[issue34517] Error referencing local variables in dict comprehensions inside class definitions

2018-08-27 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

This is a duplicate of issue3692.

--
nosy: +serhiy.storchaka
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> improper scope in list comprehension, when used in class 
declaration

___
Python tracker 

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



[issue34517] Error referencing local variables in dict comprehensions inside class definitions

2018-08-27 Thread Alex Mashianov


Change by Alex Mashianov :


--
versions: +Python 3.6 -Python 3.7

___
Python tracker 

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



[issue34517] Error referencing local variables in dict comprehensions inside class definitions

2018-08-27 Thread Alex Mashianov


Alex Mashianov  added the comment:

Update: any class definition comprehension referencing local variables inside 
filtering block produces this error.

--

___
Python tracker 

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



[issue34518] Documentation for coroutine objects

2018-08-27 Thread Hrvoje Nikšić

New submission from Hrvoje Nikšić :

Coroutine objects have public methods such as send, close, and throw, which do 
not appear to be documented. For example, at 
https://stackoverflow.com/q/51975658/1600898 a StackOverflow user asks how to 
abort an already created (but not submitted) coroutine without a 
RuntimeWarning, with the answer being to use the close() method. The user asked 
where does one find the close method.

Currently methods only appear to be documented in PEP 492, referring to 
generator documentation for details. The glossary entry for coroutine (object) 
links to PEP 492 and to the async def statement. Various places in the 
documentation, e.g. the index, link to 
https://docs.python.org/3/library/asyncio-task.html#coroutine but that page is 
mostly concerned with the usage of coroutines within asyncio, where the methods 
on individual coroutine objects should not be used.

I would expect to find documentation on coroutine objects under built-in types, 
https://docs.python.org/3/library/stdtypes.html .

In comparison, generator-iterator methods are documented in the language 
reference:

https://docs.python.org/3/reference/expressions.html#generator-iterator-methods

--
assignee: docs@python
components: Documentation
messages: 324157
nosy: docs@python, hniksic
priority: normal
severity: normal
status: open
title: Documentation for coroutine objects
versions: Python 3.7

___
Python tracker 

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



[issue34517] Error referencing local variables in dict comprehensions inside class definitions

2018-08-27 Thread Alex Mashianov


New submission from Alex Mashianov :

This code:
class A:
a = 1
b = {str(x): x for x in range(5) if x != a}

Produces following error:
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 3, in A
  File "", line 3, in 
NameError: name 'a' is not defined


Which i think it shouldn't produce. Issue occurs only in dict comprehensions 
inside class definitions referencing class attributes(which are in local scope 
during definition).

--
components: Interpreter Core
messages: 324156
nosy: Alex Mashianov
priority: normal
severity: normal
status: open
title: Error referencing local variables in dict comprehensions inside class 
definitions
type: behavior
versions: Python 3.7

___
Python tracker 

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



[issue34511] I suggest to add documentation about "method" parameter of urllib.request.Request class

2018-08-27 Thread harobed

harobed  added the comment:

 Mariatta Wijaya

Thanks.

Sorry for my bad issue.

--

___
Python tracker 

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



[issue34515] lib2to3: support non-ASCII identifiers

2018-08-27 Thread monson


Change by monson :


--
versions: +Python 3.8 -Python 3.7

___
Python tracker 

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



[issue34219] distutils: build_ext -D wrongly assume defining a symbol with no value

2018-08-27 Thread monson


Change by monson :


--
versions: +Python 3.8 -Python 3.7

___
Python tracker 

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



[issue34487] enum _sunder_ names mix metaclass and enum class attributes

2018-08-27 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue34334] QueueHandler logs exc_info twice

2018-08-27 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue19217] Calling assertEquals for moderately long list takes too long

2018-08-27 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue34514] assertEqual doesn't use maxDiff when comparing dictionaries

2018-08-27 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

@victor I am little confused over the issue since you have said 
"`assertDictEqual()` "will be used by default to compare dictionaries in calls 
to assertEqual()" and "`maxDiff` doesn't apply to `assertEqual()` when 
comparing dictionaries" . Since assertDictEqual is used for assertEqual calls 
when they compare dictionaries I can see that maxDiff value is applied to the 
diffs. A script will be helpful here on the expected and actual output. The 
attached script I have used to check that the maxDiff value is applied.


$ ./python.exe ../backups/bpo34514.py


==
FAIL: test_assert_dict_equal_large_diff (__main__.Test_TestCase)
--
Traceback (most recent call last):
  File "../backups/bpo34514.py", line 59, in test_assert_dict_equal_large_diff
self.assertDictEqual(original, expected)
AssertionError: {1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, [726 chars]: 99} != 
{101: 101, 102: 102, 103: 103, 104: 104, 10[942 chars] 199}
Diff is 3347 characters long. Set self.maxDiff to None to see it.

==
FAIL: test_assert_dict_equal_small_diff (__main__.Test_TestCase)
--
Traceback (most recent call last):
  File "../backups/bpo34514.py", line 31, in test_assert_dict_equal_small_diff
self.assertDictEqual(original, expected)
AssertionError: {1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9} != {101: 
101, 102: 102, 103: 103, 104: 104, 10[42 chars] 109}
- {1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9}
+ {101: 101,
+  102: 102,
+  103: 103,
+  104: 104,
+  105: 105,
+  106: 106,
+  107: 107,
+  108: 108,
+  109: 109}

==
FAIL: test_assert_equal_large_diff (__main__.Test_TestCase)
--
Traceback (most recent call last):
  File "../backups/bpo34514.py", line 45, in test_assert_equal_large_diff
self.assertEqual(original, expected)
AssertionError: {1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, [726 chars]: 99} != 
{101: 101, 102: 102, 103: 103, 104: 104, 10[942 chars] 199}
Diff is 3347 characters long. Set self.maxDiff to None to see it.

==
FAIL: test_assert_equal_small_diff (__main__.Test_TestCase)
--
Traceback (most recent call last):
  File "../backups/bpo34514.py", line 17, in test_assert_equal_small_diff
self.assertEqual(original, expected)
AssertionError: {1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9} != {101: 
101, 102: 102, 103: 103, 104: 104, 10[42 chars] 109}
- {1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9}
+ {101: 101,
+  102: 102,
+  103: 103,
+  104: 104,
+  105: 105,
+  106: 106,
+  107: 107,
+  108: 108,
+  109: 109}

--
Ran 4 tests in 3.496s

FAILED (failures=4)


Thanks

--
Added file: https://bugs.python.org/file47764/bpo34514.py

___
Python tracker 

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



[issue34514] assertEqual doesn't use maxDiff when comparing dictionaries

2018-08-27 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

@prudvinit 

Reference : 
https://docs.python.org/3.8/library/unittest.html#unittest.TestCase.maxDiff

> This attribute controls the maximum length of diffs output by assert methods 
> that report diffs on failure. It defaults to 80*8 characters. Assert methods 
> affected by this attribute are assertSequenceEqual() (including all the 
> sequence comparison methods that delegate to it), assertDictEqual() and 
> assertMultiLineEqual().

Thanks

--
nosy: +xtreak

___
Python tracker 

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



[issue32968] Fraction modulo infinity should behave consistently with other numbers

2018-08-27 Thread Mark Dickinson


Mark Dickinson  added the comment:

Fixed for Python 3.8. Thank you!

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

___
Python tracker 

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



[issue32968] Fraction modulo infinity should behave consistently with other numbers

2018-08-27 Thread Mark Dickinson


Mark Dickinson  added the comment:


New changeset 393f1ff62e032f20adaed2613a9e2d2d6bcb1eb3 by Mark Dickinson (Elias 
Zamaria) in branch 'master':
bpo-32968: Make modulo and floor division involving Fraction and float 
consistent with other operations (#5956)
https://github.com/python/cpython/commit/393f1ff62e032f20adaed2613a9e2d2d6bcb1eb3


--

___
Python tracker 

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



[issue34515] lib2to3: support non-ASCII identifiers

2018-08-27 Thread monson


Change by monson :


--
keywords: +patch
pull_requests: +8426
stage:  -> patch review

___
Python tracker 

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



[issue34025] SMTP EmailPolicy not using the correct line length for RCF 2045 encoded data (is 78, should be 76)

2018-08-27 Thread AldarisPale


AldarisPale  added the comment:

Hi!

I hit this bug on python 3.4.

For the reference here are two email sources. The first one works while the 
second one does not. Both were produced using smtplib the only difference being 
the workaround proposed by Douglas Thor.
I hit this bug when using K-9 mail for reading e-mails.
Relevant github link: 
https://github.com/k9mail/k-9/issues/1659#issuecomment-416074768

This one works:
---

Return-Path: 
X-Original-To: recei...@receiverdomain.com
Delivered-To: recei...@receiverdomain.com
Received: from [127.0.0.1] (smtp [127.0.0.1])
by smtp.receiverdomain.com (Postfix) with ESMTP id 2697F23C0063
for ; Mon, 27 Aug 2018 09:20:15 +0300 
(EEST)
Subject: Malformed base64
From: sen...@senderdomain.com
To: recei...@receiverdomain.com
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
Message-Id: <20180827062015.2697f23c0...@smtp.receiverdomain.com>
Date: Mon, 27 Aug 2018 09:20:15 +0300 (EEST)

Q09OVEVOVF9MRU5HVEg6IDEyMzQ1Njc4OTBhYmNkZWYNCkNPTlRFTlRfVFlQRTogMTIzNDU2Nzg5
MGFiY2RlZg0KQ09OVEVYVF9ET0NVTUVOVF9ST09UOiAxMjM0NTY3ODkwYWJjZGVmDQpDT05URVhU
X1BSRUZJWDogMTIzNDU2Nzg5MGFiY2RlZg0KRE9DVU1FTlRfUk9PVDogMTIzNDU2Nzg5MGFiY2Rl
Zg0KR0FURVdBWV9JTlRFUkZBQ0U6IDEyMzQ1Njc4OTBhYmNkZWYNCkhUVFBTOiAxMjM0NTY3ODkw
YWJjZGVmDQpIVFRQX0FDQ0VQVDogMTIzNDU2Nzg5MGFiY2RlZg0KSFRUUF9BQ0NFUFRfRU5DT0RJ
Tkc6IDEyMzQ1Njc4OTBhYmNkZWYNCkhUVFBfQUNDRVBUX0xBTkdVQUdFOiAxMjM0NTY3ODkwYWJj
ZGVmDQpIVFRQX0NBQ0hFX0NPTlRST0w6IDEyMzQ1Njc4OTBhYmNkZWYNCkhUVFBfQ09OTkVDVElP
TjogMTIzNDU2Nzg5MGFiY2RlZg0KSFRUUF9ETlQ6IDEyMzQ1Njc4OTBhYmNkZWYNCkhUVFBfSE9T
VDogMTIzNDU2Nzg5MGFiY2RlZg0KSFRUUF9PUklHSU46IDEyMzQ1Njc4OTBhYmNkZWYNCkhUVFBf
UkVGRVJFUjogMTIzNDU2Nzg5MGFiY2RlZg0KSFRUUF9VUEdSQURFX0lOU0VDVVJFX1JFUVVFU1RT
OiAxMjM0NTY3ODkwYWJjZGVmDQpIVFRQX1VTRVJfQUdFTlQ6IDEyMzQ1Njc4OTBhYmNkZWYNClBB
VEg6IDEyMzQ1Njc4OTBhYmNkZWYNClFVRVJZX1NUUklORzogMTIzNDU2Nzg5MGFiY2RlZg0KUkVE
SVJFQ1RfSFRUUFM6IDEyMzQ1Njc4OTBhYmNkZWYNClJFRElSRUNUX1NTTF9UTFNfU05JOiAxMjM0
NTY3ODkwYWJjZGVmDQpSRURJUkVDVF9TVEFUVVM6IDEyMzQ1Njc4OTBhYmNkZWYNClJFRElSRUNU
X1VOSVFVRV9JRDogMTIzNDU2Nzg5MGFiY2RlZg0KUkVESVJFQ1RfVVJMOiAxMjM0NTY3ODkwYWJj
ZGVmDQpSRU1PVEVfQUREUjogMTIzNDU2Nzg5MGFiY2RlZg0KUkVNT1RFX1BPUlQ6IDEyMzQ1Njc4
OTBhYmNkZWYNClJFUVVFU1RfTUVUSE9EOiAxMjM0NTY3ODkwYWJjZGVmDQpSRVFVRVNUX1NDSEVN
RTogMTIzNDU2Nzg5MGFiY2RlZg0KUkVRVUVTVF9VUkk6IDEyMzQ1Njc4OTBhYmNkZWYNClNDUklQ
VF9GSUxFTkFNRTogMTIzNDU2Nzg5MGFiY2RlZg0KU0NSSVBUX05BTUU6IDEyMzQ1Njc4OTBhYmNk
ZWYNClNFUlZFUl9BRERSOiAxMjM0NTY3ODkwYWJjZGVmDQpTRVJWRVJfQURNSU46IDEyMzQ1Njc4
OTBhYmNkZWYNClNFUlZFUl9OQU1FOiAxMjM0NTY3ODkwYWJjZGVmDQpTRVJWRVJfUE9SVDogMTIz
NDU2Nzg5MGFiY2RlZg0KU0VSVkVSX1BST1RPQ09MOiAxMjM0NTY3ODkwYWJjZGVmDQpTRVJWRVJf
U0lHTkFUVVJFOiAxMjM0NTY3ODkwYWJjZGVmDQpTRVJWRVJfU09GVFdBUkU6IDEyMzQ1Njc4OTBh
YmNkZWYNClNTTF9UTFNfU05JOiAxMjM0NTY3ODkwYWJjZGVmDQpVTklRVUVfSUQ6IDEyMzQ1Njc4
OTBhYmNkZWYNCg==


This one does not:
--

Return-Path: 
X-Original-To: recei...@receiverdomain.com
Delivered-To: recei...@receiverdomain.com
Received: from [127.0.0.1] (smtp [127.0.0.1])
by smtp.receiverdomain.com (Postfix) with ESMTP id 0D25523C0063
for ; Mon, 27 Aug 2018 09:21:13 +0300 
(EEST)
Subject: Malformed base64
From: sen...@senderdomain.com
To: recei...@receiverdomain.com
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
Message-Id: <20180827062113.0d25523c0...@smtp.receiverdomain.com>
Date: Mon, 27 Aug 2018 09:21:13 +0300 (EEST)

Q09OVEVOVF9MRU5HVEg6IDEyMzQ1Njc4OTBhYmNkZWYKQ09OVEVOVF9UWVBFOiAxMjM0NTY3ODkwYQ==
YmNkZWYKQ09OVEVYVF9ET0NVTUVOVF9ST09UOiAxMjM0NTY3ODkwYWJjZGVmCkNPTlRFWFRfUFJFRg==
SVg6IDEyMzQ1Njc4OTBhYmNkZWYKRE9DVU1FTlRfUk9PVDogMTIzNDU2Nzg5MGFiY2RlZgpHQVRFVw==
QVlfSU5URVJGQUNFOiAxMjM0NTY3ODkwYWJjZGVmCkhUVFBTOiAxMjM0NTY3ODkwYWJjZGVmCkhUVA==
UF9BQ0NFUFQ6IDEyMzQ1Njc4OTBhYmNkZWYKSFRUUF9BQ0NFUFRfRU5DT0RJTkc6IDEyMzQ1Njc4OQ==
MGFiY2RlZgpIVFRQX0FDQ0VQVF9MQU5HVUFHRTogMTIzNDU2Nzg5MGFiY2RlZgpIVFRQX0NBQ0hFXw==
Q09OVFJPTDogMTIzNDU2Nzg5MGFiY2RlZgpIVFRQX0NPTk5FQ1RJT046IDEyMzQ1Njc4OTBhYmNkZQ==
ZgpIVFRQX0ROVDogMTIzNDU2Nzg5MGFiY2RlZgpIVFRQX0hPU1Q6IDEyMzQ1Njc4OTBhYmNkZWYKSA==
VFRQX09SSUdJTjogMTIzNDU2Nzg5MGFiY2RlZgpIVFRQX1JFRkVSRVI6IDEyMzQ1Njc4OTBhYmNkZQ==
ZgpIVFRQX1VQR1JBREVfSU5TRUNVUkVfUkVRVUVTVFM6IDEyMzQ1Njc4OTBhYmNkZWYKSFRUUF9VUw==
RVJfQUdFTlQ6IDEyMzQ1Njc4OTBhYmNkZWYKUEFUSDogMTIzNDU2Nzg5MGFiY2RlZgpRVUVSWV9TVA==
UklORzogMTIzNDU2Nzg5MGFiY2RlZgpSRURJUkVDVF9IVFRQUzogMTIzNDU2Nzg5MGFiY2RlZgpSRQ==
RElSRUNUX1NTTF9UTFNfU05JOiAxMjM0NTY3ODkwYWJjZGVmClJFRElSRUNUX1NUQVRVUzogMTIzNA==
NTY3ODkwYWJjZGVmClJFRElSRUNUX1VOSVFVRV9JRDogMTIzNDU2Nzg5MGFiY2RlZgpSRURJUkVDVA==
X1VSTDogMTIzNDU2Nzg5MGFiY2RlZgpSRU1PVEVfQUREUjogMTIzNDU2Nzg5MGFiY2RlZgpSRU1PVA==
RV9QT1JUOiAxMjM0NTY3ODkwYWJjZGVmClJFUVVFU1RfTUVUSE9EOiAxMjM0NTY3ODkwYWJjZGVmCg==
UkVRVUVTVF9TQ0hFTUU6IDEyMzQ1Njc4OTBhYmNkZWYKUkVRVUVTVF9VUkk6IDEyMzQ1Njc4OTBhYg==
Y2RlZgpTQ1JJUFRfRklMRU5BTUU6IDEyMzQ1Njc4OTBhYmNkZWYKU0NSSVBUX05BTUU6IDEyMzQ1Ng==

[issue34516] httplib sets unbefitting "Host" in request header when requests an ipv6 format url.

2018-08-27 Thread chen wu

New submission from chen wu :

when I tried to request a url like "https://[fc00:0a08::2]:35357", I got 400. 
The code is like:
import requests
requests.get("https://[fc00:0a08::2]:35357;, verify=False)
And the apache logs:
vhost.c(889): [client fc00:ac1c::9a5:58692] AH00550: Client sent malformed 
Host header: [[fc00::0a08::2]]:35357
If user no set "Host" in header, httpslib will pase it from url and set it.
The paser function is urllib3.util.url.pase_url. When url is 
"https://[fc00:0a08::2]:35357;, we got host [fc00:0a08::2].
And then httplib sets host in putrequest, "[" and "]" will be added to 
[fc00:0a08::2], which is not a valid format for host.
The part of codes are:
974# Wrap the IPv6 Host Header with [] (RFC 2732)
975if host_enc.find(':') >= 0:
976host_enc = "[" + host_enc + "]"

maybe the judgement condition for wrap ipv6 host header with [] is not very 
well?

--
components: Library (Lib)
messages: 324149
nosy: visionwun
priority: normal
severity: normal
status: open
title: httplib sets unbefitting "Host" in request header when requests an ipv6 
format url.
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue34515] lib2to3: support non-ASCII identifiers

2018-08-27 Thread monson

New submission from monson :

Python 3.0 introduces additional characters from outside the ASCII range (see 
PEP 3131). see 
https://docs.python.org/3/reference/lexical_analysis.html#identifiers

But lib2to3 can't tokenize them corretly.
```
$ echo '中 = 1' | python3.7 -m lib2to3.pgen2.tokenize
1,0-1,1:ERRORTOKEN  '中'
1,2-1,3:OP  '='
1,4-1,5:NUMBER  '1'
1,5-1,6:NEWLINE '\n'
2,0-2,0:ENDMARKER   ''
```
'中' should be tokenized as NAME instead of ERRORTOKEN.

--
components: Library (Lib)
messages: 324148
nosy: monson
priority: normal
severity: normal
status: open
title: lib2to3: support non-ASCII identifiers
versions: Python 3.7

___
Python tracker 

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



[issue34427] calling MutableSequence.extend on self produces infinite loop

2018-08-27 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> But a MutableSequence can represents a sequence that doesn't
> fit in memory. It can provide an interface to a linear 
> on-disk store. In this case creating an on-memory copy 
> is not possible.

This case is likely not worth worrying about.  If a user created such a 
sequence AND wrote "s += s", it is unclear whether any particular unpleasant 
outcome (including the current behavior) could be avoided.

--

___
Python tracker 

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



[issue34410] itertools.tee not thread-safe; can segfault interpreter when wrapped iterator releases GIL

2018-08-27 Thread Xiang Zhang


Xiang Zhang  added the comment:

I could. But currently I don't have a good idea how to fix it elegantly. If 
anyone else makes a PR, I'm willing to review it.

--
stage:  -> needs patch
versions: +Python 3.8

___
Python tracker 

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