[issue25889] Find_BOM accepts a char*, but is passed an unsigned char*; and related usage

2015-12-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2481ae1ce35c by Serhiy Storchaka in branch 'default':
Issue #25889: Got rid of warning about mixing signed/unsigned char pointers.
https://hg.python.org/cpython/rev/2481ae1ce35c

--
nosy: +python-dev

___
Python tracker 

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



[issue25893] Second variable DWORD reqdSize in getpythonregpath is initialized but not used

2015-12-18 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> fixed
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



[issue25899] Unnecessary non-ASCII characters in standard library

2015-12-18 Thread Chris Angelico

Chris Angelico added the comment:

Whoops! Meant to include that as a second attachment. Now attached.

It's a quickly-thrown-together thing and not fully PEP 8 compliant.

--
Added file: http://bugs.python.org/file41346/nonascii.py

___
Python tracker 

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



[issue24103] Use after free in xmlparser_setevents (1)

2015-12-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Proposed patch fixes both this issue and issue24104. With the special macro 
proposed in issue20440 it can be better.

--
assignee:  -> serhiy.storchaka
keywords: +patch
stage: needs patch -> patch review
versions: +Python 3.6 -Python 3.4
Added file: 
http://bugs.python.org/file41347/xmlparser_setevents_refcnt_bugs.patch

___
Python tracker 

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



[issue25899] Unnecessary non-ASCII characters in standard library

2015-12-18 Thread Chris Angelico

Chris Angelico added the comment:

There are non-ASCII dashes and apostrophes in .rst files; are they worth 
cleaning up?

--

___
Python tracker 

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



[issue25899] Unnecessary non-ASCII characters in standard library

2015-12-18 Thread Chris Angelico

Chris Angelico added the comment:

Oops, didn't see Victor's comment. (How do I get notified when someone posts a 
patch review?) New patch uploaded which does this.

Note that Steven D'Aprano has expressed the opposite desire - that non-ASCII 
text be kept, as it should be acceptable and its presence makes for good 
toolchain testing. Noseying him in for his input.

--
nosy: +steven.daprano
Added file: http://bugs.python.org/file41351/asciify.diff

___
Python tracker 

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



[issue25899] Unnecessary non-ASCII characters in standard library

2015-12-18 Thread Chris Angelico

Chris Angelico added the comment:

Misc/NEWS has a UTF-8 BOM. Otherwise, it and Misc/HISTORY look fine (all names 
and other legit cases). Lib/idlelib/CREDITS.txt and Lib/idlelib/README.txt both 
have non-UTF8 text in them. I don't understand what's with the first line of 
.bzrignore, so I'm (pun fully intended) ignoring it. 
Modules/_ctypes/libffi/ChangeLog has several non-ASCII markers, but it looks to 
be a historical record, so I'm not sure it should be tampered with. Expanded 
patch attached.

That egrep needs --color to do its highlighting, if it's not the default.

--
Added file: http://bugs.python.org/file41349/asciify.diff

___
Python tracker 

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



[issue25899] Unnecessary non-ASCII characters in standard library

2015-12-18 Thread Chris Angelico

Chris Angelico added the comment:

Another version of detection script attached.

--
Added file: http://bugs.python.org/file41350/nonascii.py

___
Python tracker 

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



[issue25899] Unnecessary non-ASCII characters in standard library

2015-12-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

All in Modules/_ctypes/libffi/ is third-party code.

The ACUTE ACCENT character at the start of .bzrignore was added in b635462a5798 
by Benjamin. I think this is just a typo.

The patch LGTM (if address Victor's comment).

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue25889] Find_BOM accepts a char*, but is passed an unsigned char*; and related usage

2015-12-18 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> fixed
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



[issue25900] unittest ignores the first ctrl-c when it shouldn't

2015-12-18 Thread Marius Gedminas

New submission from Marius Gedminas:

unittest.signals._InterruptHandler is very nice: on first ^C it tells any 
registered unittest Result instances to gracefully stop the test run, and on 
any subsequent ^C it defers to the default interrupt handler, which immediately 
terminates the test run (possibly without giving it a chance to output summary 
information).

This doesn't work very well when a test runner forgets to register the Result 
instance: the first ^C is then quietly ignored.  (See 
https://github.com/django-nose/django-nose/issues/252 for an example.)

Suggestion: if there are no registered results in the unittest.signals._results 
dict, don't silently ignore the first ^C.  Instead, immediately defer to the 
saved interrupt handler.

Since code is often clearer than words, I'm attaching a patch.

--
components: Library (Lib)
files: dont-ignore-first-ctrl-c.patch
keywords: patch
messages: 256656
nosy: mgedmin
priority: normal
severity: normal
status: open
title: unittest ignores the first ctrl-c when it shouldn't
type: behavior
Added file: http://bugs.python.org/file41345/dont-ignore-first-ctrl-c.patch

___
Python tracker 

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



[issue25899] Unnecessary non-ASCII characters in standard library

2015-12-18 Thread Chris Angelico

Chris Angelico added the comment:

As an alternative to checking only *.py, the second version uses the 'file' 
command to recognize text files. Run from the cpython top-level directory 
(rather than Lib/), it finds a large number of additional results, many of 
which appear to have a UTF-8 BOM. Are they also worth removing?

--
Added file: http://bugs.python.org/file41348/nonascii.py

___
Python tracker 

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



[issue25899] Unnecessary non-ASCII characters in standard library

2015-12-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

In .rst files they are good.

Add | (LC_ALL=C egrep "$(printf '[\x80-\xff]+')";) in the pipe after your 
script to highligh non-ASCII characters.

--

___
Python tracker 

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



[issue25899] Unnecessary non-ASCII characters in standard library

2015-12-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Non-ASCII apostrophes and dashes in docstrings can be considered as a bug, 
since they can lead pydoc or help() to fail.

The patch LGTM.

Could you please provide your script used to search non-ASCII sources Chris?

Are there doubtful non-ASCII inclusions in tests, in C files, or in the 
documentation (including Misc/NEWS, Misc/HISTORY, etc)?

--
nosy: +serhiy.storchaka
type:  -> behavior
versions: +Python 2.7, Python 3.5

___
Python tracker 

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




[issue25901] make test crash

2015-12-18 Thread fluyy

New submission from fluyy:

I Compile the Python interpreter statically.

$ uname -a
Linux ubuntu 4.2.0-16-generic #19-Ubuntu SMP Thu Oct 8 15:35:06 UTC 2015 x86_64 
x86_64 x86_64 GNU/Linux

fluyy@ubuntu:~/tmp/Python-3.5.1$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.2.1-22ubuntu2' 
--with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs 
--enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr 
--program-suffix=-5 --enable-shared --enable-linker-build-id 
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix 
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu 
--enable-libstdcxx-debug --enable-libstdcxx-time=yes 
--with-default-libstdcxx-abi=new --enable-gnu-unique-object 
--disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib 
--disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo 
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home 
--with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 
--with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 
--with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar 
--enable-objc-gc --enable-multiarch --disable-werror --with-arch
 -32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib 
--with-tune=generic --enable-checking=release --build=x86_64-linux-gnu 
--host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 5.2.1 20151010 (Ubuntu 5.2.1-22ubuntu2)


 ./configure LDFLAGS="-Wl,-no-export-dynamic -Wl,--no-as-needed -static-libgcc 
-static" CPPFLAGS="-static -fPIC" -disable-shared 
-prefix="/home/fluyy/python3.5"

and I change -O3 to -O2 in Makefile

I had change some complie options. because make is error

the options I changed is :

1.gcc -pthread -Wl,-no-export-dynamic -Wl,--no-as-needed -static-libgcc -static 
 -o Programs/_freeze_importlib Programs/_freeze_importlib.o 
Modules/getbuildinfo.o Parser/acceler.o Parser/grammar1.o Parser/listnode.o 
Parser/node.o Parser/parser.o Parser/bitset.o Parser/metagrammar.o 
Parser/firstsets.o Parser/grammar.o Parser/pgen.o Parser/myreadline.o 
Parser/parsetok.o Parser/tokenizer.o Objects/abstract.o Objects/accu.o 
Objects/boolobject.o Objects/bytes_methods.o Objects/bytearrayobject.o 
Objects/bytesobject.o Objects/cellobject.o Objects/classobject.o 
Objects/codeobject.o Objects/complexobject.o Objects/descrobject.o 
Objects/enumobject.o Objects/exceptions.o Objects/genobject.o 
Objects/fileobject.o Objects/floatobject.o Objects/frameobject.o 
Objects/funcobject.o Objects/iterobject.o Objects/listobject.o 
Objects/longobject.o Objects/dictobject.o Objects/odictobject.o 
Objects/memoryobject.o Objects/methodobject.o Objects/moduleobject.o 
Objects/namespaceobject.o Objects/object.o Objec
 ts/obmalloc.o Objects/capsule.o Objects/rangeobject.o Objects/setobject.o 
Objects/sliceobject.o Objects/structseq.o Objects/tupleobject.o 
Objects/typeobject.o Objects/unicodeobject.o Objects/unicodectype.o 
Objects/weakrefobject.o Python/_warnings.o Python/Python-ast.o Python/asdl.o 
Python/ast.o Python/bltinmodule.o Python/ceval.o Python/compile.o 
Python/codecs.o Python/dynamic_annotations.o Python/errors.o 
Python/frozenmain.o Python/future.o Python/getargs.o Python/getcompiler.o 
Python/getcopyright.o Python/getplatform.o Python/getversion.o 
Python/graminit.o Python/import.o Python/importdl.o Python/marshal.o 
Python/modsupport.o Python/mystrtoul.o Python/mysnprintf.o Python/peephole.o 
Python/pyarena.o Python/pyctype.o Python/pyfpe.o Python/pyhash.o 
Python/pylifecycle.o Python/pymath.o Python/pystate.o Python/pythonrun.o 
Python/pytime.o Python/random.o Python/structmember.o Python/symtable.o 
Python/sysmodule.o Python/traceback.o Python/getopt.o Python/pystrcmp.o 
Python/pystrtod.o Pyth
 on/pystrhex.o Python/dtoa.o Python/formatter_unicode.o Python/fileutils.o 
Python/dynload_shlib.o   Python/thread.o Modules/config.o Modules/getpath.o 
Modules/main.o Modules/gcmodule.o  Modules/_threadmodule.o  
Modules/signalmodule.o  Modules/posixmodule.o  Modules/errnomodule.o  
Modules/pwdmodule.o  Modules/_sre.o  Modules/_codecsmodule.o  
Modules/_weakref.o  Modules/_functoolsmodule.o  Modules/_operator.o  
Modules/_collectionsmodule.o  Modules/itertoolsmodule.o  Modules/atexitmodule.o 
 Modules/_stat.o  Modules/timemodule.o  Modules/_localemodule.o  
Modules/_iomodule.o Modules/iobase.o Modules/fileio.o Modules/bytesio.o 
Modules/bufferedio.o Modules/textio.o Modules/stringio.o  Modules/zipimport.o  
Modules/faulthandler.o  Modules/_tracemalloc.o Modules/hashtable.o  
Modules/symtablemodule.o  Modules/readline.o  Modules/arraymodule.o  
Modules/mathmodule.o Modules/_math.o  Modules/_struct.o  
Modules/_randommodule.o  Modules/_elementtree.o  Modules/_pickle.o  
Modules/_datetimemodule.o  M
 odules/_bisectmodule.o  

[issue25899] Unnecessary non-ASCII characters in standard library

2015-12-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I think yes if this is not Windows-specific file. See also 4796dec0a7d0, 
7255af1a1c50, a8568ea83599, 652baf23c368.

--

___
Python tracker 

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



[issue25899] Unnecessary non-ASCII characters in standard library

2015-12-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c87b2f61650f by Serhiy Storchaka in branch '3.5':
Issue #25899: Converted non-ASCII characters in docstrings and manpage
https://hg.python.org/cpython/rev/c87b2f61650f

New changeset 1eeb25f08cfd by Serhiy Storchaka in branch 'default':
Issue #25899: Converted non-ASCII characters in docstrings and manpage
https://hg.python.org/cpython/rev/1eeb25f08cfd

New changeset 7b176dafb56b by Serhiy Storchaka in branch '3.5':
Issue #25899: Fixed typo in .bzrignore.
https://hg.python.org/cpython/rev/7b176dafb56b

New changeset 8873f34e2186 by Serhiy Storchaka in branch '2.7':
Issue #25899: Fixed typo in .bzrignore.
https://hg.python.org/cpython/rev/8873f34e2186

New changeset e1d5f645b476 by Serhiy Storchaka in branch 'default':
Issue #25899: Fixed typo in .bzrignore.
https://hg.python.org/cpython/rev/e1d5f645b476

--
nosy: +python-dev

___
Python tracker 

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



[issue25890] PyObject *po in _listdir_windows_no_opendir is initialized but not used

2015-12-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3f32bacd353d by Serhiy Storchaka in branch 'default':
Issue #25890: Removed yet one unused variable.
https://hg.python.org/cpython/rev/3f32bacd353d

--

___
Python tracker 

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



[issue25890] PyObject *po in _listdir_windows_no_opendir is initialized but not used

2015-12-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Alexander for your reports.

--
resolution:  -> fixed
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



[issue25892] PyObject *exc in encode_code_page_strict is initialized but not used

2015-12-18 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> fixed
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



[issue25891] Stray variable meth_idx in enable_symlink

2015-12-18 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> fixed
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



[issue25892] PyObject *exc in encode_code_page_strict is initialized but not used

2015-12-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 77bd84a6964a by Serhiy Storchaka in branch 'default':
Issues #25890, #25891, #25892: Removed unused variables in Windows code.
https://hg.python.org/cpython/rev/77bd84a6964a

--
nosy: +python-dev

___
Python tracker 

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



[issue25890] PyObject *po in _listdir_windows_no_opendir is initialized but not used

2015-12-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 77bd84a6964a by Serhiy Storchaka in branch 'default':
Issues #25890, #25891, #25892: Removed unused variables in Windows code.
https://hg.python.org/cpython/rev/77bd84a6964a

--
nosy: +python-dev

___
Python tracker 

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



[issue25891] Stray variable meth_idx in enable_symlink

2015-12-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 77bd84a6964a by Serhiy Storchaka in branch 'default':
Issues #25890, #25891, #25892: Removed unused variables in Windows code.
https://hg.python.org/cpython/rev/77bd84a6964a

--
nosy: +python-dev

___
Python tracker 

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



[issue25902] Fixed various refcount issues in ElementTree iteration

2015-12-18 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

ElementTree iteration code holds borrowed references when call user code 
(comparison with the tag, concatenating text and tail lazy lists, testing text 
and tail for empty). User code can make borrowed references invalid and this 
can lead to a crash. One example is provided by Martin in msg256495. Other 
possible cases can be more hard to reproduce.

Proposed patch makes iterating code to own references that it operates.

--
components: Extension Modules, XML
files: etree_iter_refcount.patch
keywords: patch
messages: 256673
nosy: martin.panter, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Fixed various refcount issues in ElementTree iteration
type: crash
versions: Python 2.7, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file41352/etree_iter_refcount.patch

___
Python tracker 

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



[issue25873] Faster ElementTree iterating

2015-12-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for your review Martin. I have opened a separate issue25902 for 
refcount bugs in iteration. Its patch is purposed for all versions, while this 
issue is for developer version only.

--

___
Python tracker 

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



[issue25899] Unnecessary non-ASCII characters in standard library

2015-12-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> Are there any locale encodings where \x92 isn't an apostrophe?

Latin1 and all ISO-8859-*. CP437 and perhaps all DOS codepages. KOI8 family. 
And of course UTF-8.

--

___
Python tracker 

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



[issue25899] Unnecessary non-ASCII characters in standard library

2015-12-18 Thread Chris Angelico

Chris Angelico added the comment:

So Lib/idlelib/README.txt would decode wrongly in anything other than a Windows 
codepage? Seems a good reason to asciify line 3.

--

___
Python tracker 

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



[issue25903] SUGGESTION: Optimize code in PYO

2015-12-18 Thread Devyn Johnson

New submission from Devyn Johnson:

I have a suggestion. When Python code is byte-compiled to *.pyo files, what if 
byte-compiler were to be made to enhance some of the code. For instance, "if 
type(OBJECT) == int:" would be changed to "if isinstance(OBJECT, int):". Python 
is used in numerous software, so why not add a feature like this that could 
increase performance?

--
messages: 256676
nosy: Devyn Johnson
priority: normal
severity: normal
status: open
title: SUGGESTION: Optimize code in PYO
type: enhancement
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



[issue25904] SUGGESTION: New Datatypes

2015-12-18 Thread Devyn Johnson

New submission from Devyn Johnson:

As we all know, Python is sometimes used to computer large numbers and precise 
numbers (i.e. doubles) with the help of third-party modules. In my opinion, it 
seems that Python may benefit from gaining new data-types such as "longint" (a 
"long long" in C) and "quad" (a "long double" in C). Thus, Python could 
natively be used for processing larger numbers than Python3.6.

--
components: Interpreter Core
messages: 256678
nosy: Devyn Johnson
priority: normal
severity: normal
status: open
title: SUGGESTION: New Datatypes
type: behavior
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



[issue25899] Unnecessary non-ASCII characters in standard library

2015-12-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Lib/idlelib/CREDITS.txt and Lib/idlelib/README.txt are read by IDLE. The first 
with the iso-8859-1 encoding, the second with locale encoding. Both are wrong 
if files are in UTF-8.

--

___
Python tracker 

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



[issue25899] Unnecessary non-ASCII characters in standard library

2015-12-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 505593490f4c by Serhiy Storchaka in branch 'default':
Issue #25899: Converted Objects/listsort.txt to UTF-8.
https://hg.python.org/cpython/rev/505593490f4c

--

___
Python tracker 

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



[issue25899] Unnecessary non-ASCII characters in standard library

2015-12-18 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +terry.reedy

___
Python tracker 

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



[issue25899] Unnecessary non-ASCII characters in standard library

2015-12-18 Thread Chris Angelico

Chris Angelico added the comment:

Ah, got it. That definitely settles Idle's CREDITS.txt. Are there any locale 
encodings where \x92 isn't an apostrophe?

--

___
Python tracker 

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



[issue25898] Check for subsequence inside a sequence

2015-12-18 Thread Sebastian Linke

Sebastian Linke added the comment:

@Josh
What is the point of using iterators here? If the user wants an iterator to be 
checked then he can throw that iterator right away because it was exhausted by 
the function. I think that in most cases the user wants to do some 
postprocessing on a hairstack after being checked. This is why I restricted the 
arguments to be sequences.

Keeping that restriction in mind a pure Python implementation could look like 
this:

def has_subsequence(seq, subseq):
if not subseq:
return True
if len(subseq) > len(seq):
return False
start = 0
while True:
try:
start = seq.index(subseq[0], start)
except ValueError:
# seq.index() did not match
return False
stop = start + len(subseq)
if seq[stop - 1] == subseq[-1] and seq[start:stop] == subseq:
return True
start += 1

Unfortunately, this version potentially creates lots of subseqences for 
checking equality with the `subseq` argument. I tried to minimise the 
occurrence of those cases by pre-checking the first and the last element of a 
candidate. Anyway, this seems to be faster for small needles compared to your 
`deque`-based suggestion.

--

___
Python tracker 

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



[issue25905] IDLE fails to display the README file

2015-12-18 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

When open the About IDLE dialog and press the README button on bottom line, I 
get the UnicodeDecodeError:

Exception in Tkinter callback
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/tkinter/__init__.py", line 1548, in __call__
return self.func(*args)
  File "/home/serhiy/py/cpython/Lib/idlelib/aboutDialog.py", line 127, in 
ShowIDLEAbout
self.display_file_text('About - Readme', 'README.txt')
  File "/home/serhiy/py/cpython/Lib/idlelib/aboutDialog.py", line 139, in 
display_file_text
textView.view_file(self, title, fn, encoding)
  File "/home/serhiy/py/cpython/Lib/idlelib/textView.py", line 74, in view_file
contents = file.read()
  File "/home/serhiy/py/cpython/Lib/codecs.py", line 321, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x92 in position 72: 
invalid start byte

That is because IDLE opens the Lib/idlelib/README.txt file with default 
(locale) encoding, while it contains the RIGHT SINGLE QUOTATION MARK character 
encoded with the CP1252 encoding and non-decodable with UTF-8.

I think IDLE should open all distributed files with UTF-8 encoding. 
Lib/idlelib/CREDITS.txt and Lib/idlelib/README.txt should be recoded to UTF-8.

--
components: IDLE
messages: 256679
nosy: Rosuav, kbk, roger.serwy, serhiy.storchaka, terry.reedy
priority: normal
severity: normal
status: open
title: IDLE fails to display the README file
type: behavior
versions: Python 2.7, Python 3.5, Python 3.6

___
Python tracker 

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



[issue25899] Unnecessary non-ASCII characters in standard library

2015-12-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Opened issue25905 for IDLE-related files.

--
resolution:  -> fixed
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



[issue25782] CPython hangs on error __context__ set to the error itself

2015-12-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

And added more comments to your patch.

--

___
Python tracker 

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



[issue22908] ZipExtFile in zipfile can be seekable

2015-12-18 Thread Daniel Kessel

Daniel Kessel added the comment:

It would be great to have the ZipFileExt class seekable.
This would help in implementing features in other projects.

For example, pydicom would gain the ability to read from ZIP files, as 
mentioned in https://github.com/darcymason/pydicom/issues/219

--
nosy: +dkessel

___
Python tracker 

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



[issue25903] SUGGESTION: Optimize code in PYO

2015-12-18 Thread Emanuel Barry

Emanuel Barry added the comment:

*.pyo files have been removed from the language as of 3.5; instead, the 
optimization is done directly to the *.pyc files. Are you suggesting 
re-introducing *.pyo files or changing this behaviour in the current model?

Also, 'if type(obj) is int' is *not* the same as 'if isinstance(obj, int)' -- 
the first one checks explicitely that 'obj' is an int. The second allows for 
any arbitrary subclass of int; most people using the first idiom want ints 
specifically, disallowing subclasses.

What other optimizations do you have in mind?

--
nosy: +ebarry

___
Python tracker 

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



[issue25906] Worker stall in multiprocessing.Pool

2015-12-18 Thread Christian Schou Oxvig

New submission from Christian Schou Oxvig:

I am experiencing some seemingly random stalls in my scientific simulations 
that make use of a multiprocessing.Pool for parallelization. It has been 
incredibly difficult for me to come up with an example that consistently 
reproduces the problem. It seems more or less random if and when the problem 
occurs. The below snippet is my best shot at something that has a good chance 
at hitting the problem. I know it is unfortunate to have PyTables in the mix 
but it is the only example I have been able to come up with that almost always 
hit the problem. I have been able to reproduce the problem (once!) by simply 
removing the with-statement (and thus PyTables) in the work function. However, 
by doing so (at least in my runs), the chance of hitting the problem almost 
vanishes. Also, judging from the output of the script, it seems that the cause 
of the problem is to be found in Python and not in PyTables.


import os
import multiprocessing as mp
import tables

_hdf_db_name = 'join_crash_test.hdf'
_lock = mp.Lock()


class File():

def __init__(self, *args, **kwargs):
self._args = args
self._kwargs = kwargs

if len(args) > 0:
self._filename = args[0]
else:
self._filename = kwargs['filename']

def __enter__(self):
_lock.acquire()
self._file = tables.open_file(*self._args, **self._kwargs)
return self._file

def __exit__(self, type, value, traceback):
self._file.close()
_lock.release()


def work(task):
worker_num, iteration = task

with File(_hdf_db_name, mode='a') as h5_file:
h5_file.create_array('/', 'a{}_{}'.format(worker_num, iteration),
 obj=task)
print('Worker {} finished writing to HDF table at iteration {}'.format(
worker_num, iteration))

return (worker_num, iteration)

iterations = 10
num_workers = 24
maxtasks = 1

if os.path.exists(_hdf_db_name):
os.remove(_hdf_db_name)

for iteration in range(iterations):
print('Now processing iteration: {}'.format(iteration))
tasks = zip(range(num_workers), num_workers * [iteration])
try:
print('Spawning worker pool')
workers = mp.Pool(num_workers, maxtasksperchild=maxtasks)
print('Mapping tasks')
results = workers.map(work, tasks, chunksize=1)
finally:
print('Cleaning up')
workers.close()
print('Workers closed - joining')
workers.join()
print('Process terminated')


In most of my test runs, this example stalls at "Workers closed - joining" in 
one of the iterations. Hitting C-c and inspecting the stack shows that the main 
process is waiting for a single worker that never stops executing. I have 
tested the example on various combinations of the below listed operating 
systems and Python version.

Ubuntu 14.04.1 LTS
Ubuntu 14.04.3 LTS
ArchLinux (updated as of December 14, 2015)

Python 2.7.10 :: Anaconda 2.2.0 (64-bit)
Python 2.7.11 :: Anaconda 2.4.0 (64-bit)
Python 2.7.11 (Arch Linux 64-bit build)
Python 3.3.5 :: Anaconda 2.1.0 (64-bit)
Python 3.4.3 :: Anaconda 2.3.0 (64-bit)
Python 3.5.0 :: Anaconda 2.4.0 (64-bit)
Python 3.5.1 (Arch Linux 64-bit build)
Python 3.5.1 :: Anaconda 2.4.0 (64-bit)

It seems that some combinations are more likely to reproduce the problem than 
others. In particular, all the Python 3 builds reproduce the problem on almost 
every run, whereas I have not been able to reproduce the problem with the above 
example on any version of Python 2. I have, however, seen what appears to be 
the same problem in one of my simulations using Python 2.7.11. After 5 hours it 
stalled very close to the point of closing a Pool. Inspecting the HDF database 
holding the results showed that all but a single of the 4000 tasks submitted to 
the Pool finished. To me, this suggests that a single worker never finished 
executing.

The problem I am describing here might very well be related to issue9205 as 
well as issue22393. However, I am not sure how to verify if this is indeed the 
case or not.

--
messages: 256684
nosy: chroxvi
priority: normal
severity: normal
status: open
title: Worker stall in multiprocessing.Pool
type: behavior
versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5

___
Python tracker 

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



[issue25782] CPython hangs on error __context__ set to the error itself

2015-12-18 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Added file: http://bugs.python.org/file41354/set_context_reordering.patch

___
Python tracker 

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



[issue25782] CPython hangs on error __context__ set to the error itself

2015-12-18 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Removed file: http://bugs.python.org/file41353/set_context_reordering.patch

___
Python tracker 

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



[issue25782] CPython hangs on error __context__ set to the error itself

2015-12-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch that illustrates my idea (the documentation could be better).

--
Added file: http://bugs.python.org/file41353/set_context_reordering.patch

___
Python tracker 

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



[issue25782] CPython hangs on error __context__ set to the error itself

2015-12-18 Thread Yury Selivanov

Yury Selivanov added the comment:

> Serhiy Storchaka added the comment:
> 
> The patch LGTM (but I prefer reordering solution).

Serhiy, could you please describe your solution in more detail? An elaborate 
example would help. Perhaps I just misunderstand your idea. And thanks for the 
review!

--
nosy: +Yury.Selivanov

___
Python tracker 

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



[issue25904] SUGGESTION: New Datatypes

2015-12-18 Thread Mark Dickinson

Mark Dickinson added the comment:

Are you aware that Python's int type is already effectively arbitrary precision?

>>> 23**100
14886191506363039393791556586559754231987119653801368686576988209222433278539331352152390143277346804233476592179447310859520222529876001
>>> type(23**100)


For the suggestion of "quad": this has come up a couple of times in the past, 
but there are many things that would need to be discussed:

- Is it actually useful or necessary?
- Is it useful enough to warrant being included in the standard library, rather 
than provided by 3rd party libraries (gmpy, mpmath, ...).
- Would it be better to provide an arbitrary-precision binary floating-point 
type? What would this provide that the existing arbitrary-precision decimal 
floating-point type (in the decimal module) doesn't already provide.
- What would the impact be on the rest of the core code and the standard 
library: how many modules would need to be adapted to work with the new 
floating-point type, and how much work would that be?
- What would the format be? You suggest matching "long double" in C, but that 
may not be the best plan: long double isn't consistent across even mainstream 
platforms. On Windows it's just the same as "double"; on OS X and most (all?) 
flavours of Linux it's the ancient x87 80-bit format. On some PPC machines it's 
a double-double format. IMO, the only sane format for something called "quad" 
would be the IEEE 754 standard binary128 format, but there's almost no hardware 
support for that format (excluding IBM zSeries). So we'd have to maintain (or 
borrow) a software implementation, which would be a *lot* of work. (I don't 
know of good free non-GPL implementations already in existence.)

I'm personally a strong -1 on adding a quad type to the Python core language: I 
don't think the extra complication is worth it. But if you want to take this 
further, I'd suggest taking it to the python-ideas mailing list: 
https://mail.python.org/mailman/listinfo/python-ideas. 
I'm going to close the issue here: adding quad is too big a proposed change for 
a tracker issue; I'm sure lots of people would weigh in on a python-ideas 
discussion.

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue25773] Deprecate deleting with PyObject_SetAttr, PyObject_SetAttrString and PySequence_SetItem

2015-12-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The conclusion of the discussion is to not deprecate this behavior in the code, 
but just warn in the documentation. That has done in issue25701.

--
resolution:  -> rejected
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



[issue25844] Pylauncher, launcher.c: Assigning NULL to a pointer instead of testing against NULL

2015-12-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

To the fix for this bug we have to provoke the unsufficient memory error just 
at this point. This is unlikely worth.

Thank you Alexander for your reports.

--
nosy: +serhiy.storchaka
resolution:  -> fixed
stage: test needed -> 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



[issue25864] collections.abc.Mapping should include a __reversed__ that raises TypeError

2015-12-18 Thread R. David Murray

R. David Murray added the comment:

You can write a patch if you like, but we haven't come to a consensus on 
actually doing anything.  I'm leaning toward Andrew's position, but not 
strongly, so we need some more core dev opinions.

--

___
Python tracker 

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



[issue25900] unittest ignores the first ctrl-c when it shouldn't

2015-12-18 Thread R. David Murray

Changes by R. David Murray :


--
nosy: +michael.foord, rbcollins

___
Python tracker 

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



[issue25903] SUGGESTION: Optimize code in PYO

2015-12-18 Thread R. David Murray

R. David Murray added the comment:

pyo files weren't removed, they were just renamed, and -O differentiated from 
-OO.  The provides the opportunity to introduce additional "optimized byte 
code" versions that do other optimizations, which several people are working 
on.  There are also other aspects of python optimization, and again a number of 
people are working on related projects.  So, find one that interests you and 
chip in :)

--
nosy: +r.david.murray
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



[issue25856] The __module__ attribute of non-heap classes is not interned

2015-12-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Actually this is not specific to itertools. Every non-heap class not from the 
builtins module is affected.

Proposed patch just interns the __module__ value. The patch also cleans up the 
code.

--
keywords: +patch
stage:  -> patch review
title: The __module__ attribute of itertools members is not interned -> The 
__module__ attribute of non-heap classes is not interned
Added file: http://bugs.python.org/file41356/intern___module__.patch

___
Python tracker 

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



[issue19771] runpy should check ImportError.name before wrapping it

2015-12-18 Thread SilentGhost

SilentGhost added the comment:

Martin, could you please escape * in Misc/NEWS, it causes a warning when 
building documentation.

--
nosy: +SilentGhost

___
Python tracker 

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



[issue25907] Documentation i18n: Added trans tags in sphinx templates

2015-12-18 Thread Emanuel Barry

Changes by Emanuel Barry :


--
nosy: +ebarry

___
Python tracker 

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



[issue25718] itertools.accumulate __reduce__/__setstate__ bug

2015-12-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

What would you say about the patch Kristján?

--

___
Python tracker 

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



[issue25898] Check for subsequence inside a sequence

2015-12-18 Thread R. David Murray

R. David Murray added the comment:

If I were trying to channel Raymond I'd suggest posting the python as a recipe 
and see if there is uptake.  However, I could be wrong and he might be 
interested.  (I can't say that I've ever needed this check myself.)

I'd be inclined to agree that it should only work on sequences and be in 
collections.  If you can come up with a real use case where you wouldn't need 
the realized haystack afterwards I'd be interested to hear it :)  Regardless, I 
don't see how it could be composed with other itertools, so it doesn't seem to 
belong there.

As long as one is finding the needle, one might as well return the index, 
though.  So subsequence_index instead of has_subsequence.  And then you'd want 
an optional start index, and maybe an rsubsequence_index :)  So, it could be a 
method of Sequence, but is it useful enough to be worth adding?  Do any other 
languages have such a function as part of their built in toolkit?

(Aside: you can avoid creating a subsequence by using a loop.  You'd have to 
test with a bunch of variant sizes to see which is more efficient, but I'm 
guessing it would be the loop.)

--
nosy: +r.david.murray

___
Python tracker 

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



[issue25907] Documentation i18n: Added trans tags in sphinx templates

2015-12-18 Thread Julien

New submission from Julien:

o/

# Context

I'm trying to resuscitate the translation of Python doc in french, 
[python_doc_fr](https://github.com/AFPy/python_doc_fr).

I finished the translation of `tutorial.po` (that was partially translated by 
the AFPY team around 2012) and now working on `glossary.po` (~60%). :-)

# Problem

The homepage (`src/Doc/tools/templates/indexcontent.html`) is not translatable 
as is, as it misses the translation markers.

# Solution

I attached a patch to this issue adding them, it works well so I translated the 
generated `sphinx.po` and rebuilt the doc you can enjoy the result here:
 
http://www.afpy.org/doc/python/3.4/

--
assignee: docs@python
components: Documentation
files: i18n.patch
keywords: patch
messages: 256691
nosy: docs@python, sizeof
priority: normal
severity: normal
status: open
title: Documentation i18n: Added trans tags in sphinx templates
versions: Python 3.4
Added file: http://bugs.python.org/file41355/i18n.patch

___
Python tracker 

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



[issue25906] Worker stall in multiprocessing.Pool

2015-12-18 Thread R. David Murray

Changes by R. David Murray :


--
nosy: +davin, sbt

___
Python tracker 

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



[issue25846] Use of Py_ARRAY_LENGTH on pointer in posixmodule.c, win32_wchdir

2015-12-18 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> fixed
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



[issue25862] TextIOWrapper assertion failure after read() and SEEK_CUR

2015-12-18 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +serhiy.storchaka
stage:  -> needs patch

___
Python tracker 

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



[issue25908] ProcessPoolExecutor deadlock on KeyboardInterrupt

2015-12-18 Thread Thomas Jackson

New submission from Thomas Jackson:

If a KeyboardInterrupt is received while a worker process is grabbing an item 
off of the queue that worker process dies with an uncaught exception. This 
means that the ProcessPool now has lost a process, and currently has no 
mechanism to recover from dead processes. This is especially noticeable if the 
CallItem is relatively large (as the call_queue.get() includes all the pickle 
time).

A simple fix is to have the worker process not do anything with the keyboard 
interrupt-- since it would have no idea what to do. This cannot be implemented 
with a regular try/except-- as the item will be partially pulled off of the 
queue and lost. My proposed fix is to disable the SIGINT handler in the worker 
process while getting items off of the queue.

An alternate approach is to actually change multiprocessing.Queue.get() to 
leave the item on the queue if it is interrupted with a keyboard interrupt

to this is to catch the KeyboardInterrupt and simply continue on-- then we can 
rely on the caller to do the cleanup.This cannot be done by simply 


Proposed patch attached

--
files: worker_ignore_interrupt.patch
keywords: patch
messages: 256703
nosy: jacksontj
priority: normal
severity: normal
status: open
title: ProcessPoolExecutor deadlock on KeyboardInterrupt
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file41358/worker_ignore_interrupt.patch

___
Python tracker 

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



[issue25863] ISO-2022 seeking forgets state

2015-12-18 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +serhiy.storchaka
stage:  -> needs patch

___
Python tracker 

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



[issue25880] u'..'.encode('idna') → UnicodeError: label empty or too long

2015-12-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The bare UnicodeError is raised also by following codecs: utf_16, utf_32, 
punycode, undefined, and East-Asian multibyte codecs, and by undocumented an 
unused function urllib.urlparse.to_bytes().

I think it would be nice to be more specific if possible.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue25880] u'..'.encode('idna') → UnicodeError: label empty or too long

2015-12-18 Thread R. David Murray

R. David Murray added the comment:

I wonder if we originally only had UnicodeError and it got split later but 
these codecs were never updated.  The codecs date back to the start of unicode 
support in python2, I think.

Adding MAL, he's likely to have an opinion on this ;)

Oh, right.  The more likely possibility is that there was (in python2) no way 
to know if the operation was (from the user's POV) encoding or decoding when 
the codec was called.  In python3 we do know, when the codec is called via 
encode/decode, but the codecs are still generic in principle.  So yeah, we need 
MAL's opinion.  (Or, I could be completely confused, since I always found 
encode/decode confusing in python2 :)

--
nosy: +lemburg

___
Python tracker 

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



[issue25908] ProcessPoolExecutor deadlock on KeyboardInterrupt

2015-12-18 Thread Thomas Jackson

Thomas Jackson added the comment:

Seems that I accidentally hit submit, so let me finish the last bit of my 
message here:


An alternate approach is to actually change multiprocessing.Queue.get() to 
leave the item on the queue if it is interrupted with a keyboard interrupt. 
Then the worker process could handle the exception in a more meaningful way

It is also interesting to note, that in the event that the caller gets a 
KeyboardInterrupt there is no `terminate` method which would let you kill jobs 
before they run. I'm not certain if that should be included in this issue, or 
if I should file a separate ticket since they are related but different.

--

___
Python tracker 

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



[issue25898] Check for subsequence inside a sequence

2015-12-18 Thread Ethan Furman

Ethan Furman added the comment:

+1 for sequences
+1 for subsequence_index instead of has_subsequence
+1 for returning None when not found  ;)

--
nosy: +ethan.furman

___
Python tracker 

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



[issue25860] os.fwalk() silently skips remaining directories when error occurs

2015-12-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM. Here is a patch with tests.

--
assignee:  -> serhiy.storchaka
nosy: +serhiy.storchaka
stage:  -> patch review
versions: +Python 3.6 -Python 3.4
Added file: 
http://bugs.python.org/file41357/fwalk-silently-skips-dirs-when-error-occurs-with-tests.patch

___
Python tracker 

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



[issue1322] Deprecate platform.dist() and platform.linux_distribution() functions

2015-12-18 Thread Andy Maier

Andy Maier added the comment:

Nir, 
I appreciate very much what you are doing. I was about to do the same ;-)

I'll review your code shortly. I like the idea to use /etc/os-release, as it 
has the most complete information. Stay tuned.
Andy

Am 6. Dezember 2015 18:12:52 MEZ, schrieb Nir Cohen :
>
>Nir Cohen added the comment:
>
>I have a premliminary implementation of it: https://github.com/nir0s/ld
>
>Would love some help. It tries to use adhere to the standards
>(os-release first, lsb-release later, then, distro-specific release
>files).
>
>It also returns more types of values then there were before.
>
>--
>nosy: +nir0s
>
>___
>Python tracker 
>
>___

--

___
Python tracker 

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



[issue25880] u'..'.encode('idna') → UnicodeError: label empty or too long

2015-12-18 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

On 18.12.2015 20:25, R. David Murray wrote:
> I wonder if we originally only had UnicodeError and it got split later but 
> these codecs were never updated.  The codecs date back to the start of 
> unicode support in python2, I think.

UnicodeDecodeError and UnicodeEncodeError were added in Python 2.3
as part of the more flexible error handlers.

> Adding MAL, he's likely to have an opinion on this ;)
> 
> Oh, right.  The more likely possibility is that there was (in python2) no way 
> to know if the operation was (from the user's POV) encoding or decoding when 
> the codec was called.  In python3 we do know, when the codec is called via 
> encode/decode, but the codecs are still generic in principle.  So yeah, we 
> need MAL's opinion.  (Or, I could be completely confused, since I always 
> found encode/decode confusing in python2 :)

There's a clear direction with codecs:
- encode: transform to the encoded data
- decode: transform back from the encoded data

Take e.g. the hex codec. It encodes data into hex format and
decodes from hex format back into the original data.

The IDNA codecs transforms Unicode domains into the IDNA format
(.encode()) and back to Unicode again (.decode()).

It was added in Python 2.3 as well, so I guess it was just
an overlap/oversight that it was not adapted to the new error
classes.

--

___
Python tracker 

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



[issue14911] generator.throw() documentation inaccurate

2015-12-18 Thread Martin Panter

Martin Panter added the comment:

This one is based on the public 3.5 branch, so should work. I corrected a small 
typo made in the previous patch.

--
versions:  -Python 3.4
Added file: http://bugs.python.org/file41360/throw-3x.v3.patch

___
Python tracker 

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



[issue25904] SUGGESTION: New Datatypes

2015-12-18 Thread Mark Dickinson

Changes by Mark Dickinson :


--
resolution:  -> rejected
status: open -> closed

___
Python tracker 

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



[issue25903] SUGGESTION: Optimize code in PYO

2015-12-18 Thread Chris Angelico

Chris Angelico added the comment:

The trouble with that example is that the semantics aren't the same. The 
isinstance check will also be true for subclasses of int (for instance, 
isinstance(True,int) is True), but the equality check will catch only exact 
matches. And that's even before considering that anything can be overridden - 
the name 'type' or 'int' might have been rebound, or the type object might have 
an __eq__ method, etc, etc.

If you want to look into CPython optimization, hang out on the python-dev 
mailing list (and read its recent archives); there's a current project called 
"FAT Python" which does a lot of changes of this nature, and it has to cope 
with certain questions (like "what if this has been rebound?"). This isn't a 
simple problem, but it's one people are looking into.

--
nosy: +Rosuav

___
Python tracker 

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



[issue12346] Python source code build fails with old mercurial

2015-12-18 Thread R. David Murray

R. David Murray added the comment:

Luke: since this issue is closed, please open a new 2.7 only issue with a 
reference to this one.

--

___
Python tracker 

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



[issue557704] netrc module can't handle all passwords

2015-12-18 Thread R. David Murray

R. David Murray added the comment:

To clarify: other FTP programs handling passwords with spaces *in the .netrc 
file*.

--

___
Python tracker 

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



[issue557704] netrc module can't handle all passwords

2015-12-18 Thread R. David Murray

R. David Murray added the comment:

This issue was closed because other FTP programs also did not handle passwords 
with spaces.  If this has subsequently changed (passwords with spaces are now 
widely accepted by other FTP programs) then the issue could be reopened.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue19771] runpy should check ImportError.name before wrapping it

2015-12-18 Thread Martin Panter

Martin Panter added the comment:

I think Serhiy just fixed this in revision ed2420379b8d, so it should be okay 
now.

--

___
Python tracker 

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



[issue25864] collections.abc.Mapping should include a __reversed__ that raises TypeError

2015-12-18 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Unless this somehow breaks the philosophy of ABCs, I would be inclined to add 
the negative methods.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue25827] Support ICC in configure

2015-12-18 Thread Zachary Ware

Zachary Ware added the comment:

After testing, I think I like '-fp-model strict' better in CFLAGS_NODIST.  On 
Ubuntu, `CC=gcc ./python -m test.test_distutils` passes when the flag is in 
CFLAGS_NODIST, but fails when it's in BASECFLAGS.  On OSX, it fails both ways, 
due to deployment target issues; I suspect that's probably solvable by setting 
some other environment variable correctly (I don't know enough about OSX to say 
for sure, though).  I don't think this patch needs to go as far as the LTO 
patch does to add the argument to CFLAGS; most third party extensions probably 
won't necessitate '-fp-model strict', those that do can add it themselves.

On the other hand, 2.7 doesn't have CFLAGS_NODIST (and I don't want to add it), 
so BASECFLAGS is about the only option there.

Barring objections, I'll commit this new patch in a few days.

--
nosy: +doko
Added file: http://bugs.python.org/file41359/configure_icc.v2.diff

___
Python tracker 

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



[issue25905] IDLE fails to display the README file

2015-12-18 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Strange and accidental.  This is the one line I kept from the old version, 
before deleting the old and adding the new.  I believe I edited either with 
IDLE or Notepad++, and I would be surprised if the latter, an editor for 
programmers, would turn ' into ’.  It does not for .py and .rst files.  
README.txt should be Ascii-only.

Larry, I applied the README.txt reverse replacement to 3.4 in case you feel 
like cherry picking it into 3.4.4, but it is not a blocker.  No NEWS entries 
would be needed for 3.4 as this would fix an unreleased reversion.

--
assignee:  -> terry.reedy
nosy: +larry
stage:  -> needs patch

___
Python tracker 

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



[issue25905] IDLE fails to display the README file

2015-12-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 11c789c034fe by Terry Jan Reedy in branch '2.7':
Issue #25905: Revert unwanted conversion of ' to ’ RIGHT SINGLE QUOTATION MARK.
https://hg.python.org/cpython/rev/11c789c034fe

New changeset 42963dd81600 by Terry Jan Reedy in branch '3.4':
Issue #25905: Revert unwanted conversion of ' to ’ RIGHT SINGLE QUOTATION MARK.
https://hg.python.org/cpython/rev/42963dd81600

--
nosy: +python-dev

___
Python tracker 

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



[issue25905] IDLE fails to display the README file

2015-12-18 Thread Terry J. Reedy

Terry J. Reedy added the comment:

For CREDITS.txt, the only issue is 'Löwis' (ö has latin-1 code 246), which was 
changed from Loewis in 2003.  If not changed back to the ascii form, what 
matters is that the encoding used for decoding from bytes to unicode matches 
the actual encoding.  AFAIK, it currently does

def ShowIDLECredits(self):  # aboutDialog.py, line 130
self.display_file_text('About - Credits', 'CREDITS.txt', 'iso-8859-1')

No encoding is given for README.txt, line 133, because none should be needed.  
I am going to leave this alone for now.

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



[issue25908] ProcessPoolExecutor deadlock on KeyboardInterrupt

2015-12-18 Thread Thomas Jackson

Thomas Jackson added the comment:

Some more investigation, it seems that the alternate `Queue` fix is a 
non-starter. From my investigation it seems that the ProcessPoolExecutor is 
assuming that multiprocess.Queue is gauranteed delivery, and it isn't (because 
of the pickling). So the issue is that the worker process drops the message if 
its interrupted while unpickling and the Pool class has no idea-- and assumes 
that the job is still running. With that being said it seems like my attached 
patch is probably the most reasonable fix without a major rework of how the 
ProcessPoolExecutor works.

--

___
Python tracker 

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



[issue25589] test_ascii_formatd fails on Mac when built with Intel compiler

2015-12-18 Thread Zachary Ware

Zachary Ware added the comment:

This one is officially weird.

I can reliably reproduce the segfault in test_ascii_formatd on OSX with ICC 15 
or 16, using the included libffi in Modules/_ctypes/libffi_osx.  There are also 
segfaults in test_ctypes, test_multiprocessing, and test_threading (all 
stemming from an issue in ctypes).

Using libffi from Homebrew and --with-system-ffi, all the segfaults go away, 
and in fact all tests pass (with --with-icc from #25827, which adds '-fp-model 
strict' to CFLAGS).  The bundled 'nearly vanilla' libffi doesn't work with OSX; 
it doesn't make it through configure.

Somehow, argcount in _ctypes_callproc is being corrupted, but applying this 
patch somehow makes test_ascii_formatd pass:

diff -r 937774aa1853 Modules/_ctypes/callproc.c
--- a/Modules/_ctypes/callproc.cMon Dec 14 03:41:59 2015 +
+++ b/Modules/_ctypes/callproc.cFri Dec 18 02:10:04 2015 -0600
@@ -1168,6 +1168,7 @@
 PyErr_NoMemory();
 goto cleanup;
 }
+printf("line 1171, argcount %zd", argcount);
 for (i = 0; i < argcount; ++i) {
 atypes[i] = args[i].ffi_type;
 if (atypes[i]->type == FFI_TYPE_STRUCT)


I have absolutely no idea why that should work.  Adding that line before the 
previous statement still results in segfault, and adding it anywhere after line 
1178 also still results in segfault.  Even with the magic patch, test_ctypes 
still segfaults elsewhere.  I'm out of my depth as to what could be causing 
this or how to further diagnose it.

As a workaround, would it be kosher to mandate --with-system-ffi on Darwin when 
CC=icc?  As I recall, the custom libffi is necessary for regular OSX builds to 
accommodate fat binaries; how concerned are we about supporting fat binaries 
with ICC?

--
components: +ctypes

___
Python tracker 

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



[issue22227] Simplify tarfile iterator

2015-12-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a8f24e26abc7 by Serhiy Storchaka in branch 'default':
Issue #7: The TarFile iterator is reimplemented using generator.
https://hg.python.org/cpython/rev/a8f24e26abc7

--
nosy: +python-dev

___
Python tracker 

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



[issue22227] Simplify tarfile iterator

2015-12-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thanks Martin and Raymond for reviews.

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