[issue32739] collections.deque rotate(n=1) default value not documented

2018-02-03 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Isn't there a missed "not"?

--
nosy: +serhiy.storchaka
status: closed -> open

___
Python tracker 

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



[issue32720] Format mini-language integer definition is incorrect

2018-02-03 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

What about arg_name and element_index?

>>> '{}'.format(123)
'123'
>>> '{0}'.format(123)
'123'
>>> '{0x0}'.format(123)
Traceback (most recent call last):
  File "", line 1, in 
KeyError: '0x0'
>>> '{0_0}'.format(123)
Traceback (most recent call last):
  File "", line 1, in 
KeyError: '0_0'
>>> '{0[0]}'.format([123])
'123'
>>> '{0[0x0]}'.format([123])
Traceback (most recent call last):
  File "", line 1, in 
TypeError: list indices must be integers or slices, not str
>>> '{0[0_0]}'.format([123])
Traceback (most recent call last):
  File "", line 1, in 
TypeError: list indices must be integers or slices, not str

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue32720] Format mini-language integer definition is incorrect

2018-02-03 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:


New changeset 3bd749b2122c17b835dc438cdaef63bfdfd61344 by Mariatta (Miss 
Islington (bot)) in branch '3.6':
bpo-32720: Fixed the definition for width and precision in format mini-language 
doc (GH-5482) (GH-5525)
https://github.com/python/cpython/commit/3bd749b2122c17b835dc438cdaef63bfdfd61344


--

___
Python tracker 

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



[issue32759] multiprocessing.Array do not release shared memory

2018-02-03 Thread Steve Dower

Change by Steve Dower :


--
nosy: +davin, pitrou

___
Python tracker 

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



[issue32720] Format mini-language integer definition is incorrect

2018-02-03 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:


New changeset 133514e9dcea9c8cc9d9dd459b1a7fb502747d7e by Mariatta (Miss 
Islington (bot)) in branch '3.7':
bpo-32720: Fixed the definition for width and precision in format mini-language 
doc (GH-5482) (GH-5524)
https://github.com/python/cpython/commit/133514e9dcea9c8cc9d9dd459b1a7fb502747d7e


--

___
Python tracker 

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



[issue32720] Format mini-language integer definition is incorrect

2018-02-03 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5354

___
Python tracker 

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



[issue32720] Format mini-language integer definition is incorrect

2018-02-03 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5353

___
Python tracker 

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



[issue32720] Format mini-language integer definition is incorrect

2018-02-03 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:


New changeset 8b5fa289fdb04b6b919cf95fa99246aa872e47a8 by Mariatta 
(nathankerr96) in branch 'master':
bpo-32720: Fixed the definition for width and precision in format mini-language 
doc (GH-5482)
https://github.com/python/cpython/commit/8b5fa289fdb04b6b919cf95fa99246aa872e47a8


--
nosy: +Mariatta

___
Python tracker 

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



[issue32337] Dict order is now guaranteed, so add tests and doc for it

2018-02-03 Thread Raymond Hettinger

Change by Raymond Hettinger :


--
assignee: rhettinger -> 

___
Python tracker 

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



[issue32337] Dict order is now guaranteed, so add tests and doc for it

2018-02-03 Thread shangdahao

shangdahao  added the comment:

Thanks zhang, I have updated it in the PR.

--

___
Python tracker 

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



[issue32216] Document PEP 557 Data Classes (dataclasses module)

2018-02-03 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:

> I've already started on drafting these docs.  Would you like to work together?

Sure, Raymond. Let me know how I can help :)

--

___
Python tracker 

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



[issue32216] Document PEP 557 Data Classes (dataclasses module)

2018-02-03 Thread Christopher Barker

Christopher Barker  added the comment:

Thanks Raymond. Can a draft be put in a gitHub repo so we can all help out?

--

___
Python tracker 

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



[issue32695] tarfile.open() raises TypeError when using compresslevel parameter with LZMA

2018-02-03 Thread bbayles

bbayles  added the comment:

In working on a patch I convinced myself that a better change might just be to 
document that you can use the *preset* keyword for LZMA compression instead of 
*compresslevel*.

--

___
Python tracker 

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



[issue32746] More misspellings, mostly in source code.

2018-02-03 Thread Terry J. Reedy

Change by Terry J. Reedy :


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

___
Python tracker 

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



[issue32746] More misspellings, mostly in source code.

2018-02-03 Thread Terry J. Reedy

Terry J. Reedy  added the comment:


New changeset c90a5dec03fbef3a26479c800d5d6d15c44d5afb by Terry Jan Reedy in 
branch '3.6':
[3.6] bpo-32746: Fix multiple typos (GH-5144) (GH-5522)
https://github.com/python/cpython/commit/c90a5dec03fbef3a26479c800d5d6d15c44d5afb


--

___
Python tracker 

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



[issue32394] socket lib beahavior change in 3.6.4

2018-02-03 Thread Ma Lin

Ma Lin  added the comment:

I create a new one (PR 5523), I'm not a C & socket expert, so if you want to 
improve/polish the patch, feel free to create a new PR based on (or not) it.

--

___
Python tracker 

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



[issue32746] More misspellings, mostly in source code.

2018-02-03 Thread Terry J. Reedy

Terry J. Reedy  added the comment:


New changeset e86db34dd3b43dc9c9beb21a82cd2c3b7c4c05df by Terry Jan Reedy (Miss 
Islington (bot)) in branch '3.7':
[3.7] bpo-32746: Fix multiple typos (GH-5144) (GH-5520)
https://github.com/python/cpython/commit/e86db34dd3b43dc9c9beb21a82cd2c3b7c4c05df


--

___
Python tracker 

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



[issue32394] socket lib beahavior change in 3.6.4

2018-02-03 Thread Ma Lin

Change by Ma Lin :


--
pull_requests: +5352

___
Python tracker 

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



[issue32746] More misspellings, mostly in source code.

2018-02-03 Thread Terry J. Reedy

Change by Terry J. Reedy :


--
pull_requests: +5351

___
Python tracker 

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



[issue27923] PEP 467 -- Minor API improvements for binary sequences

2018-02-03 Thread INADA Naoki

INADA Naoki  added the comment:

Hmm, can you read this instead?
https://github.com/python/devguide/blob/master/communication.rst

--

___
Python tracker 

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



[issue32746] More misspellings, mostly in source code.

2018-02-03 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5350

___
Python tracker 

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



[issue32746] More misspellings, mostly in source code.

2018-02-03 Thread Terry J. Reedy

Terry J. Reedy  added the comment:


New changeset c3d9508ff22ece9a96892b628dd5813e2fb0cd80 by Terry Jan Reedy (Leo 
Arias) in branch 'master':
bpo-32746: Fix multiple typos (GH-5144)
https://github.com/python/cpython/commit/c3d9508ff22ece9a96892b628dd5813e2fb0cd80


--

___
Python tracker 

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



[issue32216] Document PEP 557 Data Classes (dataclasses module)

2018-02-03 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

> I'd be interested to help write the PR for this.

I've already started on drafting these docs.  Would you like to work together?

--
nosy: +rhettinger

___
Python tracker 

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



[issue32739] collections.deque rotate(n=1) default value not documented

2018-02-03 Thread Raymond Hettinger

Change by Raymond Hettinger :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
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



[issue32761] IDLE Keymap for Cntl-A

2018-02-03 Thread Raymond Hettinger

New submission from Raymond Hettinger :

The default keymap for Cntl-A should be , the same as 
Cntl-KeyLeft.   This is consistent with how Cntl-A behaves at the bash prompt 
and in Emacs.

>>> print('Hello World')
^--- Cntl-A should take you here
^--- Cntl-A currently takes you here (which is never helpful).

--
assignee: terry.reedy
components: IDLE
messages: 311575
nosy: rhettinger, terry.reedy
priority: normal
severity: normal
status: open
title: IDLE Keymap for Cntl-A

___
Python tracker 

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



[issue32739] collections.deque rotate(n=1) default value not documented

2018-02-03 Thread Raymond Hettinger

Raymond Hettinger  added the comment:


New changeset 42e8ea9f69c133a4bbb9e496f68a05926b99c2da by Raymond Hettinger in 
branch '2.7':
bpo-32739: Show default value for rotate() (GH-5517)
https://github.com/python/cpython/commit/42e8ea9f69c133a4bbb9e496f68a05926b99c2da


--

___
Python tracker 

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



[issue32759] multiprocessing.Array do not release shared memory

2018-02-03 Thread OO O

OO O  added the comment:

mp.heap.BufferWrapper._heap = mp.heap.Heap ()
gc.collect ()

This is working!! The memory is cleared.
Just delete the globe _heap and recreate a new one, but is the the correct 
way???

--

___
Python tracker 

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



[issue32759] multiprocessing.Array do not release shared memory

2018-02-03 Thread OO O

Change by OO O :


--
versions: +Python 3.5

___
Python tracker 

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



[issue32739] collections.deque rotate(n=1) default value not documented

2018-02-03 Thread Raymond Hettinger

Change by Raymond Hettinger :


--
pull_requests: +5349

___
Python tracker 

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



[issue32760] [Python Shell command issue]

2018-02-03 Thread JamesDinh

New submission from JamesDinh :

Hi Python dev. team,

I would like to report below error:
1) Tittle: Running Linux shell command from python file always leads to reset 
config error.

2) Environment:
+ Linux distro: Both Ubuntu 16.04 64b and Fedora 25 happen this issue
+ Python:
Python 2.7.12 (default, Dec  4 2017, 14:50:18) 
[GCC 5.4.0 20160609] on linux2

3) Reproduce route:
These commands can be run normally from Linux terminal:
[I use buildroot for my embedded project]
./configure O=output project_name debug initramfs nofirewall
make O=output

But when I tried to call them from Python file, the configure command always 
lead to Restart config... - and all the new configuration values are discarded.

For your information, I tried these options:
a) 
spkConfigureCmd = ["./configure","O=output", 
"project_name","debug","initramfs","nofirewall"]
subprocess.check_call(spkConfigureCmd)
spkBuildCmd = ["make","O=output"]
subprocess.check_call(spkBuildCmd)

b) os.system("./configure O=output project_name debug initramfs nofirewall && 
make O=output")

c)
fid = open('ax2spkbuild.sh','w')
fid.write('./configure O=output project_name debug initramfs nofirewall\n')
fid.write('make O=output\n')
fid.close()
os.system('chmod +x ax2spkbuild.sh')
os.system('./ax2spkbuild.sh')

Actually I tried with another simple command like 'pwd', 'cat', 'echo' and they 
are working well. I wonder how come Python executes the Linux shell commands, 
which are slightly different to the Terminal typed commands.

--
components: Build
messages: 311572
nosy: JamesDinhBugPython
priority: normal
severity: normal
status: open
title: [Python Shell command issue]
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



[issue32759] multiprocessing.Array do not release shared memory

2018-02-03 Thread OO O

New submission from OO O :

OS: Win10 / 8.1
Python: 3.5 / 3.6

My program use mp.Array to share huge data.
But suffer from out of memory after running for a while. 

But Windows task manager didn't show which process use that huge memory. And I 
use pympler to check my python memory usage. Still shows noting. So, I use 
RamMap to check, it shows a huge shared memory is used.

I can reproduce the case by the simple test code:
   #---
   import numpy as np
   import multiprocessing as mp
   import gc

   def F ():
   a = mp.Array ( 'I', 18, lock = False )

   #
   F ()
   gc.collect ()
   #---

No matter how hard I tried. the memory is not released.
I put what I tried in the attachment picture.

--
components: Windows
files: result.jpg
messages: 311571
nosy: OO O, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: multiprocessing.Array do not release shared memory
type: resource usage
versions: Python 3.6
Added file: https://bugs.python.org/file47424/result.jpg

___
Python tracker 

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



[issue31356] Add context manager to temporarily disable GC

2018-02-03 Thread pmpp

Change by pmpp :


--
nosy: +pmpp

___
Python tracker 

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



[issue32604] Expose the subinterpreters C-API in Python for testing use.

2018-02-03 Thread Zachary Ware

Change by Zachary Ware :


--
pull_requests: +5348

___
Python tracker 

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



[issue32758] Stack overflow when parse long expression to AST

2018-02-03 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

There is also a regression in 3.7 when compile a long expression.

In 3.6:

>>> compile('+a'*100, '?', 'eval')
Traceback (most recent call last):
  File "", line 1, in 
RecursionError: maximum recursion depth exceeded during compilation

In 3.7:

>>> compile('+a'*100, '?', 'eval')
Segmentation fault (core dumped)

--

___
Python tracker 

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



[issue32739] collections.deque rotate(n=1) default value not documented

2018-02-03 Thread Raymond Hettinger

Raymond Hettinger  added the comment:


New changeset 7eb3d1e7da42112ba879a5f8602891fa17963f9e by Raymond Hettinger 
(Miss Islington (bot)) in branch '3.6':
bpo-32739: Show default value for rotate() (GH-5485) (GH-5515)
https://github.com/python/cpython/commit/7eb3d1e7da42112ba879a5f8602891fa17963f9e


--

___
Python tracker 

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



[issue32758] Stack overflow when parse long expression to AST

2018-02-03 Thread Serhiy Storchaka

New submission from Serhiy Storchaka :

Python 2 can crash when compile long expression. 

>>> x = eval('""' + '+chr(33)'*10)
Segmentation fault (core dumped)

This was fixed in Python 3. RecursionError is raised now.

>>> x = eval('""' + '+chr(33)'*10)
Traceback (most recent call last):
  File "", line 1, in 
RecursionError: maximum recursion depth exceeded during compilation
>>> x = eval('+chr(33)'*100)
Traceback (most recent call last):
  File "", line 1, in 
RecursionError: maximum recursion depth exceeded during compilation

But compiling to AST still can crash.

>>> import ast
>>> x = ast.parse('+chr(33)'*100)
Segmentation fault (core dumped)

--
components: Interpreter Core
messages: 311568
nosy: benjamin.peterson, brett.cannon, ncoghlan, serhiy.storchaka, yselivanov
priority: normal
severity: normal
status: open
title: Stack overflow when parse long expression to AST
type: crash
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



[issue20632] Define a new __key__ protocol

2018-02-03 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

I wonder if this would make sense as a parameter to dataclass now.

--
nosy: +csabella
versions: +Python 3.8 -Python 3.5

___
Python tracker 

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



[issue31356] Add context manager to temporarily disable GC

2018-02-03 Thread Gregory P. Smith

Gregory P. Smith  added the comment:

Nick and Raymond: do you remember what our original motivating use cases were 
for this idea during the sprint?

--

___
Python tracker 

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



[issue32227] singledispatch support for type annotations

2018-02-03 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

Hello,

I believe this could be closed as resolved?  Do you think it should be added to 
the What's New? page for 3.7?

--
nosy: +csabella

___
Python tracker 

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



[issue32757] Python 2.7 : Buffer Overflow vulnerability in exec() function

2018-02-03 Thread hadimene

hadimene  added the comment:

the comments lines are not needed !

--

___
Python tracker 

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



[issue32757] Python 2.7 : Buffer Overflow vulnerability in exec() function

2018-02-03 Thread hadimene

hadimene  added the comment:

Hello !

Thanks for the fast response but I tested and print() appears to be vulnerable 
too using chr() characters and yes the junk comments are useless ...

--
Added file: https://bugs.python.org/file47423/poc-print.py

___
Python tracker 

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



[issue32757] Python 2.7 : Buffer Overflow vulnerability in exec() function

2018-02-03 Thread Josh Rosenberg

Josh Rosenberg  added the comment:

A server that exposes arbitrary exec's to user-submitted data can already be 
controlled. exec can do anything that Python can do, that's the whole point. 
Sure, crashing Python is bad, but it could also keep Python alive and start 
dumping the database to arbitrary people, deleting files, etc.

Also, your Proof of Concept code is cluttered with pointless garbage AFAICT. Do 
you really need all the unused multiline strings to trigger this?

--
nosy: +josh.r

___
Python tracker 

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



[issue32757] Python 2.7 : Buffer Overflow vulnerability in exec() function

2018-02-03 Thread hadimene

New submission from hadimene :

Hello !

Recently while debugging my python code I discovered an stack-based Buffer 
overflow Vulnerability in Python 2.7 and lower versions .
This vulnerability is caused by exec() builtin function when we create 
"recursive" function using exec() ...

Example :
We want to Print "hello World !" str and we encode print "hello world" ) using 
chr() or unichr()

print "hello World " 

becomes

exec(chr(112)+chr(114)+chr(105)+chr(110)+chr(116)+chr(40)+chr(39)+chr(104)+chr(101)+chr(108)+chr(108)+chr(111)+chr(32)+chr(119)+chr(111)+chr(114)+chr(108)+chr(100)+chr(32)+chr(33)+chr(32)+chr(39)+chr(41)+chr(10)+chr(35))

and if we re-encode the result : exec() the result would be

exec(chr(101)+chr(120)+chr(101)+chr(99)+chr(40)+chr(99)+chr(104)+chr(114)+chr(40)+chr(49)+chr(49)+chr(50)+chr(41)+chr(43)+chr(99)+chr(104)+chr(114)+chr(40)+chr(49)+chr(49)+chr(52)+chr(41)+chr(43)+chr(99)+chr(104)+chr(114)+chr(40)+chr(49)+chr(48)+chr(53)+chr(41)+chr(43)+chr(99)+chr(104)+chr(114)+chr(40)+chr(49)+chr(49)+chr(48)+chr(41)+chr(43)+chr(99)+chr(104)+chr(114)+chr(40)+chr(49)+chr(49)+chr(54)+chr(41)+chr(43)+chr(99)+chr(104)+chr(114)+chr(40)+chr(52)+chr(48)+chr(41)+chr(43)+chr(99)+chr(104)+chr(114)+chr(40)+chr(51)+chr(57)+chr(41)+chr(43)+chr(99)+chr(104)+chr(114)+chr(40)+chr(49)+chr(48)+chr(52)+chr(41)+chr(43)+chr(99)+chr(104)+chr(114)+chr(40)+chr(49)+chr(48)+chr(49)+chr(41)+chr(43)+chr(99)+chr(104)+chr(114)+chr(40)+chr(49)+chr(48)+chr(56)+chr(41)+chr(43)+chr(99)+chr(104)+chr(114)+chr(40)+chr(49)+chr(48)+chr(56)+chr(41)+chr(43)+chr(99)+chr(104)+chr(114)+chr(40)+chr(49)+chr(49)+chr(49)+chr(41)+chr(43)+chr(99)+chr(104)+chr(114)+chr(40)+chr(51)+chr(50)+chr(41)+chr(43)+chr(99)+chr(
 
104)+chr(114)+chr(40)+chr(49)+chr(49)+chr(57)+chr(41)+chr(43)+chr(99)+chr(104)+chr(114)+chr(40)+chr(49)+chr(49)+chr(49)+chr(41)+chr(43)+chr(99)+chr(104)+chr(114)+chr(40)+chr(49)+chr(49)+chr(52)+chr(41)+chr(43)+chr(99)+chr(104)+chr(114)+chr(40)+chr(49)+chr(48)+chr(56)+chr(41)+chr(43)+chr(99)+chr(104)+chr(114)+chr(40)+chr(49)+chr(48)+chr(48)+chr(41)+chr(43)+chr(99)+chr(104)+chr(114)+chr(40)+chr(51)+chr(50)+chr(41)+chr(43)+chr(99)+chr(104)+chr(114)+chr(40)+chr(51)+chr(51)+chr(41)+chr(43)+chr(99)+chr(104)+chr(114)+chr(40)+chr(51)+chr(50)+chr(41)+chr(43)+chr(99)+chr(104)+chr(114)+chr(40)+chr(51)+chr(57)+chr(41)+chr(43)+chr(99)+chr(104)+chr(114)+chr(40)+chr(52)+chr(49)+chr(41)+chr(43)+chr(99)+chr(104)+chr(114)+chr(40)+chr(49)+chr(48)+chr(41)+chr(43)+chr(99)+chr(104)+chr(114)+chr(40)+chr(51)+chr(53)+chr(41)+chr(41)+chr(35))

If you do this manipulation 6-7 times and you run the encoded script then the 
Python Interpreter program will crash with a Segmentation Fault as error :
(https://lepetithacker.files.wordpress.com/2018/01/capture-dc3a9cran-2018-01-31-191359.png)

We can check the Segmentation Fault using gdb ( GNU Debugger ) 
https://lepetithacker.files.wordpress.com/2018/01/capture-dc3a9cran-2018-01-31-202241.png
 )

To get an Segmentation Fault error you can just run poc.py !

Conclusion

In my opinion , to patch this vulnerability developers need to give more 
memory/buffer to the exec() arguments , and verify if the buffer can contains 
exec() arguments in integrality without any overflow !
An attacker could control the memory of an server written in python if the 
builtin function exec() is used and python version i of the server is 2.7 or 
lower (every version of python2 could be vulnerable like Python 2.9 but I 
didn't tried yet )

--
components: Interpreter Core
files: poc.py
messages: 311561
nosy: hadimene
priority: normal
severity: normal
status: open
title: Python 2.7 : Buffer Overflow vulnerability in exec() function
type: security
versions: Python 2.7
Added file: https://bugs.python.org/file47422/poc.py

___
Python tracker 

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



[issue32739] collections.deque rotate(n=1) default value not documented

2018-02-03 Thread Raymond Hettinger

Raymond Hettinger  added the comment:


New changeset 52f745852e49498d7dd86fd309ae57f6a7af568f by Raymond Hettinger 
(Miss Islington (bot)) in branch '3.7':
bpo-32739: Show default value for rotate() (GH-5485) (GH-5514)
https://github.com/python/cpython/commit/52f745852e49498d7dd86fd309ae57f6a7af568f


--

___
Python tracker 

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



[issue32739] collections.deque rotate(n=1) default value not documented

2018-02-03 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5346

___
Python tracker 

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



[issue32739] collections.deque rotate(n=1) default value not documented

2018-02-03 Thread Raymond Hettinger

Raymond Hettinger  added the comment:


New changeset 589c718a8e3bde017350f248f7f1c009240eb52b by Raymond Hettinger in 
branch 'master':
bpo-32739: Show default value for rotate() (GH-5485)
https://github.com/python/cpython/commit/589c718a8e3bde017350f248f7f1c009240eb52b


--

___
Python tracker 

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



[issue32739] collections.deque rotate(n=1) default value not documented

2018-02-03 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5347

___
Python tracker 

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



[issue30300] asyncio.Controller

2018-02-03 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

There doesn't seem to be much appetite for this in the stdlib, so closing.  
It'll just have to live in a third party module.

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



[issue32107] Improve MAC address calculation and fix test_uuid.py

2018-02-03 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

I think this issue is resolved, right?  Closing.  Please reopen if there's 
anything left to do.

--
resolution:  -> fixed
stage: needs patch -> 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



[issue27923] PEP 467 -- Minor API improvements for binary sequences

2018-02-03 Thread amirjn

amirjn  added the comment:

We got same problem at https://www.blogs.va.gov/ 
can any one help?

--

___
Python tracker 

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



[issue30109] make reindent failed.

2018-02-03 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:

Thanks for the ping. Almost forgotten about this issue.

This can't be cherry-picked cleanly. I need to first backport the new testcase 
to 2.7, and see if it passes. If the test failed in 2.7 then I need to work on 
actually backporting the change.

I should have time to do it later tonight.

Thanks.

--

___
Python tracker 

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



[issue32680] smtplib SMTP instances missing a default sock attribute

2018-02-03 Thread amirjn

amirjn  added the comment:

apple.com

--

___
Python tracker 

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



[issue32680] smtplib SMTP instances missing a default sock attribute

2018-02-03 Thread amirjn

amirjn  added the comment:

same problem at apple.com

--
nosy: +amirjn

___
Python tracker 

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



[issue30109] make reindent failed.

2018-02-03 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

Does this just need to be cherry-picked to 2.7 to be able to close it?

--
nosy: +csabella

___
Python tracker 

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



[issue3177] Add shutil.open

2018-02-03 Thread amirjn

amirjn  added the comment:

same problem here

--

___
Python tracker 

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



[issue27923] PEP 467 -- Minor API improvements for binary sequences

2018-02-03 Thread amirjn

amirjn  added the comment:

i didnt find anything at http://devguide.python.org/communication/

--
nosy: +amirjn

___
Python tracker 

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



[issue3177] Add shutil.open

2018-02-03 Thread amirjn

amirjn  added the comment:

same problem here

--
nosy: +amirjn

___
Python tracker 

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



[issue32756] argparse: parse_known_args: raising exception on unknown arg following known one

2018-02-03 Thread Yauhen

Yauhen  added the comment:

It was a mistake in expected result, should be:

$ python arparse_test.py -ab -c
Namespace(a=True)
['-b', '-c']

--

___
Python tracker 

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



[issue32493] UUID Module - FreeBSD build failure

2018-02-03 Thread David CARLIER

David CARLIER  added the comment:

Probably. Seems workable under Apple otherwise.

--

___
Python tracker 

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



[issue32756] argparse: parse_known_args: raising exception on unknown arg following known one

2018-02-03 Thread Yauhen

New submission from Yauhen :

steps to reproduce:

import argparse
import sys

parser = argparse.ArgumentParser(prog=sys.argv[0], add_help=False)
parser.add_argument('-a', action='store_true')
parsed_args, unknown_args = parser.parse_known_args(sys.argv[1:])
print(parsed_args)
print(unknown_args)


Expected result:

$ python arparse_test.py -ab
Namespace(a=True)
['b']


Actual result:

$ python arparse_test.py -ab
usage: arparse_test.py [-a]
arparse_test.py: error: argument -a: ignored explicit argument 'b'

--
components: Library (Lib)
messages: 311546
nosy: actionless
priority: normal
pull_requests: 5345
severity: normal
status: open
title: argparse: parse_known_args: raising exception on unknown arg following 
known one
versions: Python 3.6

___
Python tracker 

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



[issue32729] socket error handling needed

2018-02-03 Thread yang

yang  added the comment:

Oh.. you are right. 
I think it's my bug. here is code
```
import urllib3
import certifi
from functools import wraps
import signal
from urllib3 import Timeout


def timeoutdec(sec):
def decorator(func):
def _timeout(signum, frame):
raise TimeoutError()

@wraps(func)
def wrapper(*args, **kwargs):
signal.signal(signal.SIGALRM, _timeout)
signal.alarm(sec)
try:
result = func(*args, **kwargs)
finally:
signal.alarm(0)
return result
return wrapper
return decorator


@timeoutdec(2)
def for_test():
timeout = Timeout(connect=10.0, read=2.0)
url = 'http://httpbin.org/delay/7'
method = 'GET'
body = None
headers = None
http = urllib3.PoolManager(timeout=timeout,
   cert_reqs='CERT_REQUIRED',
   ca_certs=certifi.where())
while True:
response = http.urlopen(method, url,
body=body,
headers=headers,
preload_content=True)

print(response.data)


for_test()

```

here is the code that i got same traceback.

maybe the TimeoutError is raised from my code, timeoutdec().

I thought it was python bug. sorry for bothering you.


and I will close my PR-32729.

--

___
Python tracker 

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



[issue32755] Several cookies with the same name get intermixed

2018-02-03 Thread Юрий Пухальский

New submission from Юрий Пухальский :

I'm using python 3.5.4.
The site gives me two headers:

I'm using aiohttp that iterates the headers and if it's set-cookie, calls 
SimpleCookie.load(). The latter maintains a dict inside by the cookie name.

So that's what happens, first we add a dict entry with LOGIN_SESSION=deleted 
and phony expiration date. Next cookie, the valid one, gets into the same dict 
entry, updates the value to the right one, but expiration date remains in the 
past. The result is that this cookie is not used.

I don't know the good way of handling it. Maybe clear the cookie fields before 
updating the dict? Or this behaviour is intended? I think the situation itself 
is wrong, the site shouldn't be sending this, but how to cope with it?

--
components: Extension Modules
messages: 311544
nosy: Юрий Пухальский
priority: normal
severity: normal
status: open
title: Several cookies with the same name get intermixed
type: behavior
versions: Python 3.5

___
Python tracker 

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



[issue32729] socket error handling needed

2018-02-03 Thread INADA Naoki

INADA Naoki  added the comment:

And your screenshot doesn't contain "full" traceback chain.
It can be very important hint about who creates invalid TimeoutError.

--

___
Python tracker 

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



[issue32729] socket error handling needed

2018-02-03 Thread INADA Naoki

INADA Naoki  added the comment:

It may be bug of raising TimeoutError, not catching.
That's why I want example code to reproduce.

--

___
Python tracker 

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



[issue32729] socket error handling needed

2018-02-03 Thread yang

yang  added the comment:

When timeout error occurred in urllib3.Poolmanager.urlopen(), the built-in 
TimeoutError raised which is not caught in existing timeout exception clause.

Thus, It is caught by 'error' except and it is not checking Nonetype so that 
raising IndexError

It patched that error and detailed in PR-5458

https://github.com/python/cpython/pull/5458

Thank you and sorry for not good at english.

--

___
Python tracker 

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