[issue24915] Profile Guided Optimization improvements (better training, llvm support, etc)

2015-09-19 Thread Alecsandru Patrascu

Alecsandru Patrascu added the comment:

Thank you for upstreaming this in both branches of Python!
Do you think that a different version of regrtest.py, that will be used only 
for PGO training, should be better in this case? I mean, by implementing a 
custom version, I think we can control better the output and errors shown on 
screen.

--

___
Python tracker 

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



[issue25106] Hash computation speedup for {buffer, string, unicode}object

2015-09-19 Thread Brett Cannon

Changes by Brett Cannon :


--
status: open -> pending

___
Python tracker 

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



[issue24915] Profile Guided Optimization improvements (better training, llvm support, etc)

2015-09-19 Thread Brett Cannon

Brett Cannon added the comment:

A separate issue is fine, Alecsandru, since we can make it a dependency of this 
issue.

--

___
Python tracker 

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



[issue25176] Link to urllib.parse.parse_qsl, not parse_qs, from cgi.parse_qsl doc

2015-09-19 Thread Martin Panter

Changes by Martin Panter :


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



[issue14586] TypeError: truncate() takes no keyword arguments

2015-09-19 Thread Martin Panter

Martin Panter added the comment:

I agree with Guy’s earlier comments and would prefer this be fixed in the 
documentation. Otherwise, we would end up with third party IOBase 
implementations that use the wrong keyword name, or that don’t accept keywords 
at all. These would no longer be compatible with the new API.

Also the new patch competes with Issue 25057, also proposing keyword arguments 
for seek().

--

___
Python tracker 

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



[issue25188] regrtest.py improvement for Profile Guided Optimization builds

2015-09-19 Thread Alecsandru Patrascu

New submission from Alecsandru Patrascu:

This issue adds improved support for Profile Guided Optimization builds in the 
regression test suite. 

Mainly, we keep the visual progress status in this process and suppress errors 
or any other unnecessary output that can alarm users.

--
components: Library (Lib)
messages: 251140
nosy: alecsandru.patrascu
priority: normal
severity: normal
status: open
title: regrtest.py improvement for Profile Guided Optimization builds
type: performance
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



[issue25185] Inconsistency between venv and site

2015-09-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Example:

$ LC_ALL=ru_RU.cp1251 ./python -m venv ../vpy×
$ LC_ALL=ru_RU.cp1251 ./python -m venv ../vpyØ
Error: 'charmap' codec can't encode character '\udc98' in position 617: 
character maps to 

The first command is successful, the latter command is failed. 
'Ø'.encode('utf-8') == b'\xc3\x98', and 0x98 is invalid code in CP1251.

--

___
Python tracker 

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



[issue25108] traceback.extract_stack() compatibility break in 3.5

2015-09-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Arfrever.

--

___
Python tracker 

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



[issue25108] traceback.extract_stack() compatibility break in 3.5

2015-09-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7e718bbf5152 by Serhiy Storchaka in branch '2.7':
Issue #25108: Fixed test_traceback in the case when this test is run twice.
https://hg.python.org/cpython/rev/7e718bbf5152

--

___
Python tracker 

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



[issue25108] traceback.extract_stack() compatibility break in 3.5

2015-09-19 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis added the comment:

> New changeset f6125114b55f by Serhiy Storchaka in branch '2.7':
> Issue #25108: Backported tests for traceback functions print_stack(),
> https://hg.python.org/cpython/rev/f6125114b55f

The new tests fail on 2.7 branch when Lib/test/test_traceback.pyc is present, 
because __file__ can contain path to *.pyc files in Python 2.
It is sufficient to run test_traceback twice to reproduce problem:

$ LD_LIBRARY_PATH="$(pwd)" ./python -m test.regrtest -v test_traceback
...
$ LD_LIBRARY_PATH="$(pwd)" ./python -m test.regrtest -v test_traceback
== CPython 2.7.10+ (2.7:fe84898fbe98, Sep 20 2015, 06:52:14) [GCC 4.9.3]
==   Linux-4.1.7 little-endian
==   /tmp/cpython/build/test_python_24845
Testing with flags: sys.flags(debug=0, py3k_warning=0, division_warning=0, 
division_new=0, inspect=0, interactive=0, optimize=0, dont_write_bytecode=0, 
no_user_site=0, no_site=0, ignore_environment=0, tabcheck=0, verbose=0, 
unicode=0, bytes_warning=0, hash_randomization=0)
[1/1] test_traceback
test_bad_indentation (test.test_traceback.TracebackCases) ... ok
test_base_exception (test.test_traceback.TracebackCases) ... ok
test_bug737473 (test.test_traceback.TracebackCases) ... ok
test_caret (test.test_traceback.TracebackCases) ... ok
test_format_exception_only_bad__str__ (test.test_traceback.TracebackCases) ... 
ok
test_nocaret (test.test_traceback.TracebackCases) ... ok
test_string_exception1 (test.test_traceback.TracebackCases) ... ok
test_string_exception2 (test.test_traceback.TracebackCases) ... ok
test_unicode (test.test_traceback.TracebackCases) ... ok
test_without_exception (test.test_traceback.TracebackCases) ... ok
test_format_stack (test.test_traceback.TracebackFormatTests) ... FAIL
test_print_stack (test.test_traceback.TracebackFormatTests) ... FAIL
test_traceback_format (test.test_traceback.TracebackFormatTests) ... ok
test_extract_stack (test.test_traceback.MiscTracebackCases) ... FAIL

==
FAIL: test_format_stack (test.test_traceback.TracebackFormatTests)
--
Traceback (most recent call last):
  File "/tmp/cpython/Lib/test/test_traceback.py", line 232, in test_format_stack
'return traceback.format_stack()\n' % (__file__, lineno+1),
AssertionError: Lists differ: ['  File "/tmp/cpython/Lib/tes... != ['  File 
"/tmp/cpython/Lib/tes...

First differing element 0:
  File "/tmp/cpython/Lib/test/test_traceback.py", line 226, in test_format_stack
result = fmt()

  File "/tmp/cpython/Lib/test/test_traceback.pyc", line 226, in 
test_format_stack
result = fmt()


- ['  File "/tmp/cpython/Lib/test/test_traceback.py", line 226, in 
test_format_stack\nresult = fmt()\n',
+ ['  File "/tmp/cpython/Lib/test/test_traceback.pyc", line 226, in 
test_format_stack\nresult = fmt()\n',
?  +

-  '  File "/tmp/cpython/Lib/test/test_traceback.py", line 225, in fmt\n
return traceback.format_stack()\n']
+  '  File "/tmp/cpython/Lib/test/test_traceback.pyc", line 225, in fmt\n
return traceback.format_stack()\n']
?  +


==
FAIL: test_print_stack (test.test_traceback.TracebackFormatTests)
--
Traceback (most recent call last):
  File "/tmp/cpython/Lib/test/test_traceback.py", line 220, in test_print_stack
'traceback.print_stack()',
AssertionError: Lists differ: ['  File "/tmp/cpython/Lib/tes... != ['  File 
"/tmp/cpython/Lib/tes...

First differing element 0:
  File "/tmp/cpython/Lib/test/test_traceback.py", line 214, in test_print_stack
  File "/tmp/cpython/Lib/test/test_traceback.pyc", line 214, in test_print_stack

- ['  File "/tmp/cpython/Lib/test/test_traceback.py", line 214, in 
test_print_stack',
+ ['  File "/tmp/cpython/Lib/test/test_traceback.pyc", line 214, in 
test_print_stack',
?  +

   'prn()',
-  '  File "/tmp/cpython/Lib/test/test_traceback.py", line 212, in prn',
+  '  File "/tmp/cpython/Lib/test/test_traceback.pyc", line 212, in prn',
?  +

   'traceback.print_stack()']

==
FAIL: test_extract_stack (test.test_traceback.MiscTracebackCases)
--
Traceback (most recent call last):
  File "/tmp/cpython/Lib/test/test_traceback.py", line 248, in 
test_extract_stack
(__file__, lineno+1, 'extract', 'return traceback.extract_stack()'),
AssertionError: Lists differ: [('/tmp/cpython/Lib/test/test_... != 
[('/tmp/cpython/Lib/test/test_...

First differing element 0:
('/tmp/cpython/Lib/test/test_traceback.py', 244, 'test_extract_stack', 'result 
= 

[issue23738] Clarify documentation of positional-only default values

2015-09-19 Thread Martin Panter

Changes by Martin Panter :


--
dependencies: +TypeError: truncate() takes no keyword arguments

___
Python tracker 

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



[issue25180] Tools/parser/unparse.py needs to be updated for f-strings

2015-09-19 Thread Martin Panter

Martin Panter added the comment:

I think this patch should do it. No major surgery required, just a good dose of 
recursion :)

def test_nested_fstrings(self):  # Original code
y = 5
self.assertEqual(f'{f"{0}"*3}', '000')
self.assertEqual(f'{f"{y}"*3}', '555')
self.assertEqual(f'{f"{\'x\'}"*3}', 'xxx')

self.assertEqual(f"{r'x' f'{\"s\"}'}", 'xs')
self.assertEqual(f"{r'x'rf'{\"s\"}'}", 'xs')

def test_nested_fstrings(self):  # Unparsed output
y = 5
self.assertEqual(f"{(f'{0}' * 3)}", '000')
self.assertEqual(f"{(f'{y}' * 3)}", '555')
self.assertEqual(f'{(f"{\'x\'}" * 3)}', 'xxx')
self.assertEqual(f'{f"x{\'s\'}"}', 'xs')
self.assertEqual(f'{f"x{\'s\'}"}', 'xs')

There was no problem getting the quoting right; repr() takes care of that, and 
then you slap the “f” on the front. The most subtle thing was knowing that f"{ 
{...} }" cannot be unparsed as f"{{...}}". I unparse other expressions without 
adding spaces, but unparse that one as f"{ {...}}".

Tested by running ./python -bWall -m test -u cpu test_tools

--
keywords: +patch
nosy: +martin.panter
stage: needs patch -> patch review
Added file: http://bugs.python.org/file40524/fstring-unparse.patch

___
Python tracker 

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



[issue25170] 3.5.0 documentation archives missing

2015-09-19 Thread Georg Brandl

Georg Brandl added the comment:

This is still in PEP 101:

  ___ If this is a final release: Move the doc zips and tarballs to
  /srv/www.python.org/ftp/python/doc/X.Y.Z, creating the directory
  if necessary, and adapt the "current" symlink in .../doc to point to
  that directory.  Note though that if you're releasing a maintenance
  release for an older version, don't change the current link.

https://docs.python.org/3.5/archives/ will have the *continuously rebuilt* 
versions, so it's not the same.

--
status: closed -> open

___
Python tracker 

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



[issue21264] test_compileall fails to build in the installed location

2015-09-19 Thread R. David Murray

R. David Murray added the comment:

Yes the point is to test compilation of the path.  If I run python3 -m 
compilelall on my installed python, it works fine (zero return code).  I can't 
really investigate this further right now, but it isn't obvious to me what the 
answer is from the information in the issue so far, except that it doesn't 
*look* like it should be necessary to skip the tests unless the installation 
directories are read only *and* the .pyc files in them are non-existent or out 
of date.

--

___
Python tracker 

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



[issue25079] Tokenize generates NL instead of NEWLINE for comments

2015-09-19 Thread Optimal BPM

Optimal BPM added the comment:

OK.
But just to make me understand, would that explain why an else statement gets 
its DEDENT before the else, instead of before an dedented comment just before 
it? 
Even if the comment is visually dedented as the else?

Example where tokenize returns the DEDENT in a separate place than where it is 
visually:

if a=b:
  statement
# Comment
else:
  other statement

In the above case, the DEDENT is reportet before the else, instead of before 
the comment.

--

___
Python tracker 

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



[issue25175] Documentation-Tkinter Clarify module spelling change in Python 3 docs

2015-09-19 Thread Martin Panter

Martin Panter added the comment:

Perhaps it would be better to add the notice inside the big “See also” box at 
the top. In particular I occasionally find myself looking at the NMT “Tkinter 
reference: a GUI for Python” and Effbot sites as a substitute for the missing 
built-in documentation, and both these are written for Python 2. On the other 
hand, the TkDocs site is also useful, and seem to use Python 3.

--

___
Python tracker 

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



[issue25175] Documentation-Tkinter Clarify module spelling change in Python 3 docs

2015-09-19 Thread Carol Willing

Carol Willing added the comment:

Thank you Bar Harel for submitting a patch.

Ultimately, I believe that the wording should be what is most helpful for the 
end users.

If you wish to avoid mentioning Python 2, then a simple note cautioning the 
user to take care that the case of the module should match the user's Python 
version. 

"Note: Python 3 uses all lowercase for the 'tkinter' module. Earlier versions 
of Python used 'Tkinter'. Please take care to use the correct module name that 
corresponds to the Python version being used."

--

___
Python tracker 

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



[issue25187] bdist_rpm fails due to wrong hardcoded assumption about RPM filename format

2015-09-19 Thread David Ward

New submission from David Ward:

bdist_rpm wrongly assumes a hard-coded format for the filename of the 
non-source RPM which is generated when it calls rpmbuild, specifically:
"%{arch}/%{name}-%{version}-%{release}.%{arch}.rpm"

The format used by rpmbuild is actually specified by the RPM macro 
%{_rpmfilename}. With the /usr/lib/rpm/macros file that is shipped with 
official releases of RPM (at http://rpm.org), %{_rpmfilename} evaluates to the 
value above. However this value cannot be assumed: the directory "%{arch}/" is 
dropped under the Mock chroot environment 
(https://fedoraproject.org/wiki/Mock). Mock is used to build all official 
Fedora Project packages (by Koji) as well as unofficial packages (by Copr). 
These two build systems also target Extra Packages for Enterprise Linux (EPEL) 
in addition to Fedora releases.

As a result, bdist_rpm fails when trying to move the non-source RPM to the 
'dist' folder after it is built by rpmbuild.

The attached patch causes bdist_rpm to evaluate "%{_rpmfilename}" instead of 
relying on the hard-coded value.

--
components: Distutils
files: python-bdist_rpm-evaluate-_rpmfilename.patch
keywords: patch
messages: 251136
nosy: dpward, dstufft, eric.araujo
priority: normal
severity: normal
status: open
title: bdist_rpm fails due to wrong hardcoded assumption about RPM filename 
format
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/file40523/python-bdist_rpm-evaluate-_rpmfilename.patch

___
Python tracker 

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



[issue25179] PEP 498 f-strings need to be documented

2015-09-19 Thread Eric V. Smith

New submission from Eric V. Smith:

Issue 24965 add f-strings (see PEP 498). They need to be documented.

--
assignee: docs@python
components: Documentation
messages: 251101
nosy: docs@python, eric.smith
priority: normal
severity: normal
stage: needs patch
status: open
title: PEP 498 f-strings need to be documented
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



[issue25182] python -v crashes in nonencodable directory

2015-09-19 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

$ pwd
/home/serhiy/py/cpy�thon-3.5
$ ./python -v
import _frozen_importlib # frozen
import _imp # builtin
import sys # builtin
import '_warnings' # 
import '_thread' # 
import '_weakref' # 
import '_frozen_importlib_external' # 
import '_io' # 
import 'marshal' # 
import 'posix' # 
import _thread # previously loaded ('_thread')
import '_thread' # 
import _weakref # previously loaded ('_weakref')
import '_weakref' # 
# installing zipimport hook
import 'zipimport' # 
# installed zipimport hook
Fatal Python error: Py_Initialize: Unable to get the locale encoding
Traceback (most recent call last):
  File "", line 969, in _find_and_load
# destroy io
  File "", line 958, in _find_and_load_unlocked
# destroy io
  File "", line 673, in _load_unlocked
# destroy io
  File "", line 658, in exec_module
# destroy io
  File "", line 759, in get_code
# destroy io
  File "", line 368, in _verbose_message
# destroy io
UnicodeEncodeError: 'utf-8' codec can't encode character '\udcff' in position 
21: surrogates not allowed
# destroy encodings
Aborted (core dumped)

--
messages: 251115
nosy: brett.cannon, eric.snow, ncoghlan, serhiy.storchaka
priority: normal
severity: normal
status: open
title: python -v crashes in nonencodable directory
type: crash
versions: Python 3.4, 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



[issue25185] Inconsistency between venv and site

2015-09-19 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +vinay.sajip

___
Python tracker 

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



[issue25185] Inconsistency between venv and site

2015-09-19 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

venv writes pyvenv.cfg with utf-8 encoding, but site reads it with locale 
encoding.

--
components: Library (Lib)
messages: 251119
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: Inconsistency between venv and site
type: behavior
versions: Python 3.4, 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



[issue25175] Documentation-Tkinter Clarify module spelling change in Python 3 docs

2015-09-19 Thread Martin Panter

Martin Panter added the comment:

Normally the documentation doesn’t mention changes from Python 2. But in this 
case one often has to rely on other sources of documentation, which are often 
about Python 2, so I think the notice might be reasonable.

--
components: +Tkinter
stage: needs patch -> patch review
versions: +Python 3.4 -Python 2.7

___
Python tracker 

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



[issue24915] Profile Guided Optimization improvements (better training, llvm support, etc)

2015-09-19 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I think the --pgo flag needs only work in single process mode, since
multi-process would probably not write out the profiling data properly.

--

___
Python tracker 

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



[issue25176] Link to urllib.parse.parse_qsl, not parse_qs, from cgi.parse_qsl doc

2015-09-19 Thread Martin Panter

Martin Panter added the comment:

Thanks for the patch. This only applies to the Python 3 doc; Python 2 does not 
have the error.

--
assignee: docs@python -> martin.panter
nosy: +berker.peksag, martin.panter
stage:  -> commit review
versions: +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



[issue25176] Link to urllib.parse.parse_qsl, not parse_qs, from cgi.parse_qsl doc

2015-09-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3ed2427758cf by Martin Panter  in branch '3.4':
Issue #25176: Correct link for cgi.parse_qsl; patch from Ville Skyttä
https://hg.python.org/cpython/rev/3ed2427758cf

New changeset 138bbb7cf612 by Martin Panter  in branch '3.5':
Issue #25176: Merge cgi.parse_qsl link from 3.4 into 3.5
https://hg.python.org/cpython/rev/138bbb7cf612

New changeset f08d56387982 by Martin Panter  in branch 'default':
Issue #25176: Merge cgi.parse_qsl link from 3.5
https://hg.python.org/cpython/rev/f08d56387982

--
nosy: +python-dev

___
Python tracker 

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



[issue25180] Tools/parser/unparse.py needs to be updated for f-strings

2015-09-19 Thread Eric V. Smith

Eric V. Smith added the comment:

And it always fails with "-u cpu", which the buildbots use.

--

___
Python tracker 

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



[issue25181] Tests failed in nondecodable directory

2015-09-19 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

A number of tests are failed or skipped when run in directory with a name that 
contains non-decodable characters. Attached output of following command:

./python -m test.regrtest -uall -v test_cgitb test_cmd_line test_gdb 
test_inspect test_multiprocessin_fork test_multiprocessing_forkserver 
test_multiprocessing_spawn test_pdb test_pydoc test_pyexpat test_sax test_site 
test_subprocess test_tk test_venv test_xml_etree test_xml_etree_c

test_logging just hangs.

Locale is en_US.utf8.

--
components: Tests
files: tests.log
messages: 251113
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: Tests failed in nondecodable directory
type: behavior
versions: Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file40521/tests.log

___
Python tracker 

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



[issue25106] Hash computation speedup for {buffer, string, unicode}object

2015-09-19 Thread Jelle Zijlstra

Changes by Jelle Zijlstra :


--
nosy: +Jelle Zijlstra
status: pending -> open

___
Python tracker 

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



[issue25182] python -v crashes in nonencodable directory

2015-09-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

python without -v is not failed.

If wrap message in _bootstrap_external._verbose_message with '!%a'% and in 
_bootstrap._verbose_message with '%a'% (why _verbose_message is duplicated in 
_bootstrap and _bootstrap_external?), the output is:

...
# installing zipimport hook
@"import 'zipimport' # "
# installed zipimport hook
!'# 
/home/serhiy/py/cpy\udcffthon-3.5/Lib/encodings/__pycache__/__init__.cpython-35.pyc
 matches /home/serhiy/py/cpy\udcffthon-3.5/Lib/encodings/__init__.py'
!"# code object from 
'/home/serhiy/py/cpy\\udcffthon-3.5/Lib/encodings/__pycache__/__init__.cpython-35.pyc'"
!'# /home/serhiy/py/cpy\udcffthon-3.5/Lib/__pycache__/codecs.cpython-35.pyc 
matches /home/serhiy/py/cpy\udcffthon-3.5/Lib/codecs.py'
!"# code object from 
'/home/serhiy/py/cpy\\udcffthon-3.5/Lib/__pycache__/codecs.cpython-35.pyc'"
@"import '_codecs' # "
@"import 'codecs' # <_frozen_importlib_external.SourceFileLoader object at 
0xb70b9aac>"
!'# 
/home/serhiy/py/cpy\udcffthon-3.5/Lib/encodings/__pycache__/aliases.cpython-35.pyc
 matches /home/serhiy/py/cpy\udcffthon-3.5/Lib/encodings/aliases.py'
!"# code object from 
'/home/serhiy/py/cpy\\udcffthon-3.5/Lib/encodings/__pycache__/aliases.cpython-35.pyc'"
@"import 'encodings.aliases' # <_frozen_importlib_external.SourceFileLoader 
object at 0xb70c81ac>"
@"import 'encodings' # <_frozen_importlib_external.SourceFileLoader object at 
0xb70b96cc>"
!'# 
/home/serhiy/py/cpy\udcffthon-3.5/Lib/encodings/__pycache__/utf_8.cpython-35.pyc
 matches /home/serhiy/py/cpy\udcffthon-3.5/Lib/encodings/utf_8.py'
!"# code object from 
'/home/serhiy/py/cpy\\udcffthon-3.5/Lib/encodings/__pycache__/utf_8.cpython-35.pyc'"
@"import 'encodings.utf_8' # <_frozen_importlib_external.SourceFileLoader 
object at 0xb70ccd2c>"
@"import '_signal' # "
!'# 
/home/serhiy/py/cpy\udcffthon-3.5/Lib/encodings/__pycache__/latin_1.cpython-35.pyc
 matches /home/serhiy/py/cpy\udcffthon-3.5/Lib/encodings/latin_1.py'
!"# code object from 
'/home/serhiy/py/cpy\\udcffthon-3.5/Lib/encodings/__pycache__/latin_1.cpython-35.pyc'"
@"import 'encodings.latin_1' # <_frozen_importlib_external.SourceFileLoader 
object at 0xb70cf54c>"
!'# /home/serhiy/py/cpy\udcffthon-3.5/Lib/__pycache__/io.cpython-35.pyc matches 
/home/serhiy/py/cpy\udcffthon-3.5/Lib/io.py'
!"# code object from 
'/home/serhiy/py/cpy\\udcffthon-3.5/Lib/__pycache__/io.cpython-35.pyc'"
...

Verbose non-ascii message is written before importing codecs.

--

___
Python tracker 

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



[issue25186] Don't duplicate _verbose_message in importlib._bootstrap and _bootstrap_external

2015-09-19 Thread Brett Cannon

New submission from Brett Cannon:

For some reason _verbose_message() is defined in both _bootstrap and 
_bootstrap_external. Probably should only have it in _bootstrap, unless Eric 
has a reason he duplicated the code.

--
components: Library (Lib)
messages: 251124
nosy: brett.cannon, eric.snow
priority: normal
severity: normal
status: open
title: Don't duplicate _verbose_message in importlib._bootstrap and 
_bootstrap_external
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



[issue25175] Documentation-Tkinter Clarify module spelling change in Python 3 docs

2015-09-19 Thread Mark Lawrence

Mark Lawrence added the comment:

Does this open a can of worms?  "You did it for Tkinter, why not do it for 
everything that was changed by PEP3108"?

--
nosy: +BreamoreBoy

___
Python tracker 

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



[issue25177] OverflowError in statistics.mean when summing large floats

2015-09-19 Thread Bar Harel

Bar Harel added the comment:

Seems like this is the only viable option. It fixes the OverflowError but comes 
at the cost of precision and time.
Another option would be to try/except the overflow error and only then return 
the slower method.
Regarding the data [8.988465674311579e+307, 8.98846567431158e+307], float has 
lesser precision than other types like Decimal so the patched method would 
return 8.98846567431158e+307.
A dataset to test the fix is [8.99e+307, 8.989e+307] which gives a correct 
result.

--
keywords: +patch
Added file: http://bugs.python.org/file40519/issue25177.patch

___
Python tracker 

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



[issue23883] __all__ lists are incomplete

2015-09-19 Thread Jacek Kołodziej

Jacek Kołodziej added the comment:

Does anyone have strong preference towards one of the propositions above?

TestCase subclass looks reasonable IMHO, but I'd not add that to the scope of 
this issue (I'd be happy to implement it later, though).

Any suggestions?

--

___
Python tracker 

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



[issue24965] Implement PEP 498: Literal String Formatting

2015-09-19 Thread Eric V. Smith

Eric V. Smith added the comment:

Documentation task added as issue #25179.

Thanks to Martin for the great code reviews.

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

___
Python tracker 

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



[issue25180] Tools/parser/unparse.py needs to be updated for f-strings

2015-09-19 Thread Eric V. Smith

New submission from Eric V. Smith:

test_unparse.py occasionally fails if it picks a module that uses f-strings.

--
assignee: eric.smith
keywords: easy
messages: 251106
nosy: eric.smith
priority: normal
severity: normal
stage: needs patch
status: open
title: Tools/parser/unparse.py needs to be updated for f-strings
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



[issue25177] OverflowError in statistics.mean when summing large floats

2015-09-19 Thread Mark Dickinson

Mark Dickinson added the comment:

That patch doesn't really help, I'm afraid, since it introduces problems at the 
other end of the floating-point range: for example, `mean([5e-324, 5e-324])` 
would give `0.0` with that patch (instead of the `5e-324` it currently gives).

So currently, when computing the mean of a sequence of floats (possibly mixed 
with ints), the code:

1. Computes the sum as a Fraction.
2. Converts that Fraction to a float.
3. Divides the result by the number of elements.

Reversing steps 2 and 3 here would solve the issue, but would require some 
refactoring.  It's really up to Steven whether he thinks that that refactoring 
is worth it for these corner cases at the extremes of the floating-point range. 
 (It's difficult to imagine that such numbers would turn up frequently in 
practical applications.)

--

___
Python tracker 

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



[issue24965] Implement PEP 498: Literal String Formatting

2015-09-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a10d37f04569 by Eric V. Smith in branch 'default':
Issue #24965: Implement PEP 498 "Literal String Interpolation". Documentation 
is still needed, I'll open an issue for that.
https://hg.python.org/cpython/rev/a10d37f04569

--

___
Python tracker 

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



[issue24915] Profile Guided Optimization improvements (better training, llvm support, etc)

2015-09-19 Thread Skip Montanaro

Skip Montanaro added the comment:

Would it be possible to grep out the warning messages, but let everything
else through?
On Sep 19, 2015 1:34 PM, "Brett Cannon"  wrote:

>
> Brett Cannon added the comment:
>
> The problem with the output is that error cases are unimportant and yet it
> fooled Skip into temporarily caring until he finally noticed the warning
> message. So my worry is that someone doesn't notice the "NOTE: ignore
> errors as they don't affect anything" and then glances at the output to
> notice an error and then worries that their PGO run failed.
>
> It people really want to add output back in, though, they will need to
> patch both the Makefile to have a big NOTE in it as well as the README to
> say that any errors during the test suite run are unimportant and do not
> affect the outcome of the profile-guided optimizations.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue25180] Tools/parser/unparse.py needs to be updated for f-strings

2015-09-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 37d3b95a289b by Eric V. Smith in branch 'default':
Temporary hack for issue #25180: exclude test_fstring.py from the unparse 
round-tripping, while I figure out how to properly fix it.
https://hg.python.org/cpython/rev/37d3b95a289b

--
nosy: +python-dev

___
Python tracker 

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



[issue25182] python -v crashes in nonencodable directory

2015-09-19 Thread Brett Cannon

Brett Cannon added the comment:

And what happens if you leave -v off? Since the failure is in Py_Initialize I 
want to know if that Py_FatalError trigger is avoided without -v.

A possible fix to test is to simply modify 
importlib._bootstrap._verbose_message to catch UnicodeDecodeError and then 
print some message saying that there was some undecodable string and just 
swallow the exception. I just don't know if this is in the right place to 
prevent Py_Initialize from erroring out.

--

___
Python tracker 

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



[issue25175] Documentation-Tkinter Clarify module spelling change in Python 3 docs

2015-09-19 Thread Bar Harel

Bar Harel added the comment:

Is this good? :-)

--
keywords: +patch
nosy: +bar.harel
Added file: http://bugs.python.org/file40520/Issue25175.patch

___
Python tracker 

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



[issue25183] python -m inspect --details fails in nondecodable directory

2015-09-19 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

$ pwd
/home/serhiy/py/cpy�thon-3.5
$ ./python -m inspect --details unittest
Target: unittest
Traceback (most recent call last):
  File "/home/serhiy/py/cpy\udcffthon-3.5/Lib/runpy.py", line 170, in 
_run_module_as_main
"__main__", mod_spec)
  File "/home/serhiy/py/cpy\udcffthon-3.5/Lib/runpy.py", line 85, in _run_code
exec(code, run_globals)
  File "/home/serhiy/py/cpy\udcffthon-3.5/Lib/inspect.py", line 3050, in 

_main()
  File "/home/serhiy/py/cpy\udcffthon-3.5/Lib/inspect.py", line 3030, in _main
print('Origin: {}'.format(getsourcefile(module)))
UnicodeEncodeError: 'utf-8' codec can't encode character '\udcff' in position 
27: surrogates not allowed

--
components: Library (Lib)
messages: 251116
nosy: serhiy.storchaka, yselivanov
priority: normal
severity: normal
status: open
title: python -m inspect --details fails in nondecodable directory
type: behavior
versions: Python 3.4, 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



[issue25146] IDLE debugger could better visualize program execution

2015-09-19 Thread Mark Roseman

Mark Roseman added the comment:

Regarding the nested loops, what's happening is:
- IDLE tells interpreter to run program
- Interpreter now has control and is running program, start to end
- Because execution is being traced, before every statement we get a callback

If we didn't use the nested loop and just returned back immediately after we're 
called, the program would go onto the next statement, and the next one, etc. 
(it's in control).

Instead, we block to force the program to wait until we do something, at which 
point it continues to the next statement, after possibly modifying the 
conditions under which the execution traces fire.

If instead, we tell the execution tracing to actually stop on every statement 
(rather than running through start to end), we'll get a callback for each 
statement (to update our display), but can decide to stay stopped, or 
immediately continue on, based on whether we last did single-step, in/out, go, 
etc. That way it is more event-based: we don't need the nested event loop to 
'block' the program from running.

Totally agree on your suggestions (speed setting, and whether or not to show 
where we are outside our own code).

--

___
Python tracker 

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



[issue25181] Tests failed in nondecodable directory

2015-09-19 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
dependencies: +"python -m pydoc -w" fails in nondecodable directory, python -m 
inspect --details fails in nondecodable directory, python -v crashes in 
nonencodable directory

___
Python tracker 

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



[issue24915] Profile Guided Optimization improvements (better training, llvm support, etc)

2015-09-19 Thread Alecsandru Patrascu

Alecsandru Patrascu added the comment:

I can work on modifying the existing regrtest and adding a distinct flag, --pgo 
for example, as Antoine suggested. Indeed, it will not be trivial as regrtest 
has a dual approach (single process and multi process), but I will give it a 
try and post a patch as soon as possible.

I also suggest that I open a new issue for this case as it is somehow a 
distinct implementation than pure PGO and definitively will be some iterations 
on regrtest.py for both versions of Python until we reach a common ground. It 
is ok for everyone?

--

___
Python tracker 

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



[issue24915] Profile Guided Optimization improvements (better training, llvm support, etc)

2015-09-19 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Instead of writing a custom test runner from scratch, I would suggest adding a 
hidden --option to regrtest that would disable reporting errors.

--

___
Python tracker 

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



[issue25146] IDLE debugger could better visualize program execution

2015-09-19 Thread Mark Roseman

Mark Roseman added the comment:

Ok, I lied. The program runs through start to finish regardless, and all the 
'stopping' and breakpoints is really just very selectively deciding which 
subset of execution tracing events to pass back to the debugger. So you really 
do need to 'block' in those callbacks.

Doing this in the remote debugger is relatively easy with just a small tweak 
(turning a synchronous call into an async one, so we control when the callback 
'completes'). 

Doing so in the 'run without subprocess' scenario would be tougher, and we'd 
need to either keep the nested loops or do some funky thing with threads.

--

___
Python tracker 

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



[issue24915] Profile Guided Optimization improvements (better training, llvm support, etc)

2015-09-19 Thread Brett Cannon

Brett Cannon added the comment:

It didn't break gcc, the buildbot simply wasn't patient enough for the PGO run 
of the test suite to complete: 
http://buildbot.python.org/all/builders/AMD64%20Debian%20PGO%203.5/builds/274/steps/compile/logs/stdio
 . It takes a good amount of time to run the test suite serially with an 
instrumented interpreter and 20 minutes is not enough time. And I don't want to 
add output back simply to appease the buildbot as the output means nothing to a 
user who is doing the build themselves.

So either that buildbot needs to allow for a longer time without output, 
someone needs to come up with a way to simply emit some output that simply 
shows stuff is running (but without letting error condition stuff show up), or 
the buildbot just won't work with PGO.

--
status: open -> pending

___
Python tracker 

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



[issue24915] Profile Guided Optimization improvements (better training, llvm support, etc)

2015-09-19 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Le 19/09/2015 20:18, Brett Cannon a écrit :
> 
> And I don't
want to add output back simply to appease the buildbot as the output
means nothing to a user who is doing the build themselves.

The output is actually a good indication of progress, so I don't think
it's not as silly to add it back as you seem to think it is :-)

--
status: pending -> open

___
Python tracker 

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



[issue16701] Docs missing the behavior of += (in-place add) for lists.

2015-09-19 Thread R. David Murray

R. David Murray added the comment:

I suggested updating the library reference in my first reply on this issue.  No 
one has proposed a patch yet, though.

--

___
Python tracker 

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



[issue25170] 3.5.0 documentation archives missing

2015-09-19 Thread R. David Murray

R. David Murray added the comment:

I'm not sure there's no bug here, though there certainly doesn't seem to be any 
bug in your execution of the release process.  I think we should ask Georg's 
opinion at least.

--
nosy: +georg.brandl, r.david.murray

___
Python tracker 

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



[issue25173] IDLE - several common dialogs don't have correct parent set

2015-09-19 Thread Mark Roseman

Mark Roseman added the comment:

I think both master and parent are needed, for the likely rare case when you 
don't want a dialog attached to any window, but it needs a Tk window handle to 
build the dialog from. 

Ran across that in SearchEngine, which has a root window just for the purpose 
of creating dialogs, but the search engine doesn't know what search dialog is 
invoking it (a bad example, as in this case, the dialogs should be the ones 
display the error, not the search engine).

Anyway, have attached masterparent.patch for default branch which updates those 
message and file dialogs that make sense to use parent instead of master.

--
keywords: +patch
Added file: http://bugs.python.org/file40517/masterparent.patch

___
Python tracker 

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



[issue25173] IDLE - several common dialogs don't have correct parent set

2015-09-19 Thread Mark Roseman

Mark Roseman added the comment:

Attached masterparent27.patch, same thing for 2.7 branch

--
Added file: http://bugs.python.org/file40518/masterparent27.patch

___
Python tracker 

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



[issue16322] time.tzname on Python 3.3.0 for Windows is decoded by wrong encoding

2015-09-19 Thread Petr Prikryl

Petr Prikryl added the comment:

I have worked around a bit differently -- the snippet from the code:

result = time.tzname[0]# simplified version of the original code.

# Because of the bug in Windows libraries, Python 3.3 tried to work around
# some issues. However, the shit hit the fan, and the bug bubbled here.
# The `time.tzname` elements are (unicode) strings; however, they were
# filled with bad content. See https://bugs.python.org/issue16322 for 
details.
# Actually, wrong characters were passed instead of the good ones.
# This code should be skipped later by versions of Python that will fix
# the issue.
import platform
if platform.system() == 'Windows':
# The concrete example for Czech locale:
# - cp1250 (windows-1250) is used as native encoding
# - the time.tzname[0] should start with 'Střední Evropa'
# - the ascii('Střední Evropa') should return "'St\u0159edn\xed Evropa'"
# - because of the bug it returns "'St\xf8edn\xed Evropa'"
#
# The 'ř' character has unicode code point `\u0159` (that is hex)
# and the `\xF8` code in cp1250. The `\xF8` was wrongly used
# as a Unicode code point `\u00F8` -- this is for the Unicode
# character 'ø' that is observed in the string.
#
# To fix it, the `result` string must be reinterpreted with a different
# encoding. When working with Python 3 strings, it can probably
# done only through the string representation and `eval()`. Here
# the `eval()` is not very dangerous because the string was obtained
# from the OS library, and the values are limited to certain subset.
#
# The `ascii()` literal is prefixed by `binary` type prefix character,
# `eval`uated, and the binary result is decoded to the correct string.
local_encoding = locale.getdefaultlocale()[1]
b = eval('b' + ascii(result))
result = b.decode(local_encoding)

--

___
Python tracker 

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



[issue24915] Profile Guided Optimization improvements (better training, llvm support, etc)

2015-09-19 Thread Brett Cannon

Brett Cannon added the comment:

The problem with the output is that error cases are unimportant and yet it 
fooled Skip into temporarily caring until he finally noticed the warning 
message. So my worry is that someone doesn't notice the "NOTE: ignore errors as 
they don't affect anything" and then glances at the output to notice an error 
and then worries that their PGO run failed.

It people really want to add output back in, though, they will need to patch 
both the Makefile to have a big NOTE in it as well as the README to say that 
any errors during the test suite run are unimportant and do not affect the 
outcome of the profile-guided optimizations.

--

___
Python tracker 

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



[issue25178] IDLE: search regex errors should be in/attached to search dialog

2015-09-19 Thread Mark Roseman

New submission from Mark Roseman:

Follow-on to #25173, any regex errors are displayed by SearchEngine but they 
should be shown by the dialog where the user is typing the error. Either as a 
modal tkMessageBox attached to the dialog, or as an inline error in the dialog 
itself.

--
components: IDLE
messages: 251097
nosy: kbk, markroseman, roger.serwy, terry.reedy
priority: normal
severity: normal
status: open
title: IDLE: search regex errors should be in/attached to search dialog
type: behavior
versions: Python 2.7, Python 3.4, 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



[issue24999] Segfault in test_re.test_sre_character_class_literals() when Python is compiled by ICC

2015-09-19 Thread Mark Dickinson

Changes by Mark Dickinson :


--
nosy: +mark.dickinson

___
Python tracker 

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



[issue17319] http.server.BaseHTTPRequestHandler send_response_only doesn't check the type and value of the code.

2015-09-19 Thread Martin Panter

Martin Panter added the comment:

The proposed patch changes the code to 500 if the code is invalid (rather than 
raising an exception as I initially assumed).

I would be inclined to leave send_response() without any extra error checking 
or handling, unless this is a common problem and there is a real need for it. 
Although I reckon it might be nice to have a generic (higher-level) exception 
handler for the HTTP server that responds with “500 Internal server error” if 
possible.

--
nosy: +martin.panter

___
Python tracker 

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



[issue25138] test_socket: socket.EAI_NODATA doesn't exist on FreeBSD

2015-09-19 Thread Martin Panter

Martin Panter added the comment:

Actually, None is probably a bad default, since gaierror().errno also defaults 
to None. Maybe choose some other unlikely non-integer object instead.

--

___
Python tracker 

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



[issue25011] Smarter rl complete: hide private and special names

2015-09-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

If no one has objections, I'll commit the patch.

--
assignee:  -> serhiy.storchaka

___
Python tracker 

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



[issue24915] Profile Guided Optimization improvements (better training, llvm support, etc)

2015-09-19 Thread STINNER Victor

STINNER Victor added the comment:

Hum, the change 7fcff838d09e broke the buildbot "AMD64 Debian PGO 3.5". It 
would nice to add Clang support without loosing GCC support :-D

http://buildbot.python.org/all/builders/AMD64%20Debian%20PGO%203.5/builds/274

--
nosy: +haypo
resolution: fixed -> 
status: closed -> open

___
Python tracker 

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



[issue24999] Segfault in test_re.test_sre_character_class_literals() when Python is compiled by ICC

2015-09-19 Thread STINNER Victor

STINNER Victor added the comment:

pylong_digits.patch: new patch add two local inlined functions 
_PyLong_AsDigits() and _PyLong_FromDigits() to make the code more readable. 
Does it look good to you?

I chose two shifts since only Tim Peters has an opinion on it, and he prefers 
two shifts :-)

--
Added file: http://bugs.python.org/file40513/pylong_digits.patch

___
Python tracker 

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



[issue21259] replace "except: pass" by "except Exception: pass"

2015-09-19 Thread Raymond Hettinger

Raymond Hettinger added the comment:

> I presume you do not mind if I reclose this.

Thanks, please do reclose this.

--

___
Python tracker 

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



[issue25138] test_socket: socket.EAI_NODATA doesn't exist on FreeBSD

2015-09-19 Thread Martin Panter

Martin Panter added the comment:

Maybe it is good enough use something like this as a workaround, with an 
appropriate comment:

if e.errno == getattr(socket, "EAI_NODATA", None):  # Symbol not defined on 
FreeBSD

However I wonder if it would be reasonable to set this constant (and similar 
undefined error codes) to a dummy value like None by default in the module. The 
documentation already says “for a few symbols, default values are provided”.

--
nosy: +martin.panter

___
Python tracker 

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



[issue25138] test_socket: socket.EAI_NODATA doesn't exist on FreeBSD

2015-09-19 Thread STINNER Victor

STINNER Victor added the comment:

It would be better to catch the FreeBSD error code when the hostname is not 
known.

--

___
Python tracker 

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



[issue25101] test_zipfile failure when run by unprivileged user with installed Python

2015-09-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 80d002edc9c1 by Serhiy Storchaka in branch '3.4':
Issue #25101: Try to create a file to test write access in test_zipfile.
https://hg.python.org/cpython/rev/80d002edc9c1

New changeset fe84898fbe98 by Serhiy Storchaka in branch '2.7':
Issue #25101: Try to create a file to test write access in test_zipfile.
https://hg.python.org/cpython/rev/fe84898fbe98

New changeset 6899bf8d21c3 by Serhiy Storchaka in branch '3.5':
Issue #25101: Try to create a file to test write access in test_zipfile.
https://hg.python.org/cpython/rev/6899bf8d21c3

New changeset 399746fde4f8 by Serhiy Storchaka in branch 'default':
Issue #25101: Try to create a file to test write access in test_zipfile.
https://hg.python.org/cpython/rev/399746fde4f8

--
nosy: +python-dev

___
Python tracker 

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



[issue25139] socketserver.ThreadingMixIn exception handler: Just a little refactoring

2015-09-19 Thread Martin Panter

Martin Panter added the comment:

I suggest changing the “except” clause to “except BaseException”, which would 
make the intention clearer.

As an alternative, see also my Issue 23430, were I proposed not catching 
exceptions like KeyboardInterrupt and SystemExit, by changing this to:

try:
self.finish_request(request, client_address)
except Exception:
self.handle_error(request, client_address)
finally:
self.shutdown_request(request)

--
nosy: +martin.panter
title: Just a little refactoring -> socketserver.ThreadingMixIn exception 
handler: Just a little refactoring

___
Python tracker 

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



[issue25101] test_zipfile failure when run by unprivileged user with installed Python

2015-09-19 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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

___
Python tracker 

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



[issue25159] Regression in time to import a module

2015-09-19 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I did not find any significant different between 3.4 and 3.5 on Windows running 
the following:

import os, time
from importlib import import_module

files = os.listdir("C:/Programs/Python34/Lib")
excludes = {'antigravity.py', 'compileall.py', 'crypt.py', 'pty.py',
'this.py', 'tty.py', '__phello__.foo.py'}
start = time.monotonic()
for name in files:
if name.endswith('.py') and name not in excludes:
try:
import_module(name[:-3])
except:
print(name)
print(time.monotonic()-start)

Other than a couple of outliers, the time was consintly about .29 seconds with 
both 3.4 and 3.5:
  F:\Python\dev>py -3.x  c:/programs/python34/tem.py
The 3.5 run is a bit odd since it runs both 3.4 code and 3.5 code, but there 
were no extra exceptions once I added the needed exclusions (pyt and tty are 
also unix only) for 3.4.  The same code runs equally faster with Idle (.17 
seconds), but that must be because Idle has already imported so many more /Lib 
modules (not including idlelib/*) than python itself.

--

___
Python tracker 

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



[issue25161] Missing periods at the end of sentences

2015-09-19 Thread Martin Panter

Changes by Martin Panter :


--
stage:  -> patch review

___
Python tracker 

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



[issue25161] Missing periods at the end of sentences

2015-09-19 Thread Martin Panter

Martin Panter added the comment:

All the changes in the non-2.7 patch look reasonable to me. I left two review 
comments suggesting a few extra minor edits.

--
nosy: +martin.panter

___
Python tracker 

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



[issue25084] remove semi-busy loop in py2.7 threading.Condition.wait(timeout=x)

2015-09-19 Thread STINNER Victor

STINNER Victor added the comment:

About the new optional balanced parameter added downstream to Fedora, the patch 
is very small compared to timedlock.patch. It only changes the Python code, not 
the C code:

--- /home/haypo/prog/python/2.7/Lib/threading.py2014-11-05 
15:05:11.432003853 +0100
+++ /usr/lib64/python2.7/threading.py   2015-07-05 16:16:00.0 +0200
@@ -306,7 +306,7 @@
 else:
 return True
 
-def wait(self, timeout=None):
+def wait(self, timeout=None, balancing=True):
 """Wait until notified or until a timeout occurs.
 
 If the calling thread has not acquired the lock when this method is
@@ -355,7 +355,10 @@
 remaining = endtime - _time()
 if remaining <= 0:
 break
-delay = min(delay * 2, remaining, .05)
+if balancing:
+delay = min(delay * 2, remaining, 0.05)
+else:
+delay = remaining
 _sleep(delay)
 if not gotit:
 if __debug__:

(with some additional changes to pass balanced parameter)


Compare:

$ diffstat balanced.patch 
 threading.py |   17 ++---
 1 file changed, 10 insertions(+), 7 deletions(-)


$ diffstat timedlock.patch 
 Doc/library/thread.rst  |   31 ++---
 Doc/library/threading.rst   |   32 +-
 Include/pythread.h  |   37 
 Lib/dummy_thread.py |8 +++
 Lib/multiprocessing/pool.py |6 +-
 Lib/test/lock_tests.py  |   44 +--
 Lib/threading.py|   25 +++
 Modules/threadmodule.c  |   53 +++
 Python/thread_nt.h  |   33 +++---
 Python/thread_pthread.h |   98 +++-
 10 files changed, 296 insertions(+), 71 deletions(-)

Do you know if the balanced parameter is used in the wild? Such code only works 
with Python 2 on Fedora/CentOS/RHEL, right?


"For upstream, I think it would be desirable to backport the timeout argument 
and simply have it throw RuntimeError if used with any of the backends other 
than thread_nt and thread_pthread."

It's not how Python handles portability. There are two choices in Python:

* some functions are only available on some platforms, ex: os.fork()
* the feature is supported by all platforms and Python uses a different 
implementation depending on the platform (ex: os.kill)

Raising RuntimeError depending on the platform is not a good practice.


"That way single source Python 2/3 code gains access to the timeout option, 
while code relying on one of the no-longer-available-in-Python-3 threading 
backends doesn't incur any stability risks."

This issue is about the performance of Condition.wait(). The timeout parameter 
already exists on Python 2 in Condition.wait(). So it's already possible to 
write a single code base compatible with Python 2 and Python 3.

If you are talking about adding e *new* timeout parameter to threading.Lock, 
it's a new feature. Usually, we don't add new features in minor releases. It 
makes maintenace more complex: you cannot guarantee anymore that an application 
written for Python 2.7.x will work on Python 2.7.y. If you really want this, I 
consider that a PEP is required to define exactly the scope of such change.


"However, I don't feel strongly enough about that to argue in favour of it 
against opposition - I'm happy enough to confine my argument to changing the 
downstream Fedora/RHEL/CentOS patch."

For this specific change (optimizing Condition.wait(timeout) using OS timeout), 
it makes sense to have a downstream only patch because the change will be 
specific to Linux.

Well, I'm not strongly opposed to optimize Python 2, but since the patch is not 
portable, if you really want it, I consider that the topic should be discussed 
on python-dev to have a wide audience.

--
Added file: http://bugs.python.org/file40512/balanced.patch

___
Python tracker 

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



[issue24999] Segfault in test_re.test_sre_character_class_literals() when Python is compiled by ICC

2015-09-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This variant look overcomplicated to me.

--

___
Python tracker 

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



[issue21259] replace "except: pass" by "except Exception: pass"

2015-09-19 Thread Martin Panter

Changes by Martin Panter :


--
superseder:  -> Fix bare excepts in various places in std lib

___
Python tracker 

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



[issue25112] Windows installer assigns non-existent icons to Python file types

2015-09-19 Thread Mark Mikofski

Mark Mikofski added the comment:

+1 I just wasted at least an hour on this. :( should have checked bugs first. 
Google says nothing, so I thought I was going crazy. I saw that py.exe had only 
one icon and that Python.File had c:\windows\py.exe, 1 while 
Python.CompiledFile had C:\windows\py.exe, 2, so I thought that might be it, 
but I just wasn't sure.

Are the Py2 and Py3 icons exactly the same? if so, then IMO just use the py.ico 
and pyc.ico icons in the DLLs folder as suggested

--
nosy: +bwanamarko

___
Python tracker 

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



[issue17319] http.server.BaseHTTPRequestHandler send_response_only doesn't check the type and value of the code.

2015-09-19 Thread Martin Panter

Changes by Martin Panter :


--
Removed message: http://bugs.python.org/msg227647

___
Python tracker 

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



[issue17319] http.server.BaseHTTPRequestHandler send_response_only doesn't check the type and value of the code.

2015-09-19 Thread Martin Panter

Changes by Martin Panter :


--
Removed message: http://bugs.python.org/msg227645

___
Python tracker 

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



[issue25101] test_zipfile failure when run by unprivileged user with installed Python

2015-09-19 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka

___
Python tracker 

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



[issue25084] remove semi-busy loop in py2.7 threading.Condition.wait(timeout=x)

2015-09-19 Thread Flavio Grossi

Flavio Grossi added the comment:

> About the new optional balanced parameter added downstream to Fedora, the 
> patch is very small compared to timedlock.patch. It only changes the Python 
> code, not the C code

The balancing fix has 3 main problems imo:
- It causes long delays to receive the notification (i.e. with a timeout of 30s 
the caller may be notified after 30s in the worst case)
- It doesn't apply to other affected APIs, e.g. Queue.get() which uses a 
condition internally.
- It only fixes the problem in python programs which explicitly use it (and 
being redhat specific i guess it is not very used)

--

___
Python tracker 

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



[issue25175] Documentation-Tkinter wrong statement

2015-09-19 Thread Martin Panter

Martin Panter added the comment:

The problem here is you have quoted the Python 3 documentation (see in the 
title, or the version switcher at the top), when you are presumably using 
Python 2. The module changed name to lowercase in Python 3.

--
nosy: +martin.panter

___
Python tracker 

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



[issue25084] remove semi-busy loop in py2.7 threading.Condition.wait(timeout=x)

2015-09-19 Thread STINNER Victor

STINNER Victor added the comment:

"The balancing fix has 3 main problems imo:"

Oh by the way, I don't want to apply it to Python 2.7 upstream for a
similar reason: it's a new feature which would be added to a Python
2.7 minor version. We try to avoid that, even if Python 2.7 is
special.

--

___
Python tracker 

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



[issue24999] Segfault in test_re.test_sre_character_class_literals() when Python is compiled by ICC

2015-09-19 Thread STINNER Victor

STINNER Victor added the comment:

> This variant look overcomplicated to me.

Ok fine. I pushed  pylong_digits.patch, but I also modified a similar code a 
few lines below.

--

___
Python tracker 

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



[issue25177] OverflowError in statistics.mean when summing large floats

2015-09-19 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +steven.daprano

___
Python tracker 

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



[issue9253] argparse: optional subparsers

2015-09-19 Thread Jakub Wilk

Changes by Jakub Wilk :


--
nosy: +jwilk

___
Python tracker 

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



[issue25084] remove semi-busy loop in py2.7 threading.Condition.wait(timeout=x)

2015-09-19 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Ok, let's close it then.

--
resolution:  -> wont fix
status: open -> closed

___
Python tracker 

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



[issue25175] Documentation-Tkinter wrong statement

2015-09-19 Thread Rishit Bansal

New submission from Rishit Bansal:

The statement required to check whether Tkinter is installed on a system is 
mentioned in the documentation as python -m tkinter , whereas it is supposed to 
be python -m Tkinter (with a big 't'). Please correct this error on the 
documentation here:https://docs.python.org/3/library/tkinter.html as it is very 
misleading to beginners.

--
assignee: docs@python
components: Documentation
messages: 251070
nosy: Rishit Bansal, docs@python
priority: normal
severity: normal
status: open
title: Documentation-Tkinter wrong statement
type: compile error
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



[issue16322] time.tzname on Python 3.3.0 for Windows is decoded by wrong encoding

2015-09-19 Thread eryksun

eryksun added the comment:

To decode the tzname strings, Python calls mbstowcs, which on Windows uses 
Latin-1 in the "C" locale. However, in this locale the tzname strings are 
actually encoded using the system ANSI codepage (e.g. 1250 for Central/Eastern 
Europe). So it ends up decoding ANSI strings as Latin-1 mojibake. For example:

>>> s
'Střední Evropa (běžný čas) | Střední Evropa (letní čas)'
>>> s.encode('1250').decode('latin-1')
'Støední Evropa (bì\x9ený èas) | Støední Evropa (letní èas)'

You can work around the inconsistency by calling setlocale(LC_ALL, "") before 
anything imports the time module. This should set a locale that's not "C", in 
which case the codepage should be consistent. Of course, this won't help if you 
can't control when the time module is first imported. 

The latter wouldn't be a issue if time.tzset were implemented on Windows. You 
can at least use ctypes to call the CRT's _tzset function. This solves the 
problem with time.strftime('%Z'). You can also get the CRT's tzname by calling 
the exported __tzname function. Here's a Python 3.5 example that sets the 
current thread to use Russian and creates a new tzname tuple:

import ctypes
import locale

kernel32 = ctypes.WinDLL('kernel32')
ucrtbase = ctypes.CDLL('ucrtbase')

MUI_LANGUAGE_NAME = 8
kernel32.SetThreadPreferredUILanguages(MUI_LANGUAGE_NAME, 
   'ru-RU\0', None)
locale.setlocale(locale.LC_ALL, 'ru-RU')

# reset tzname in current locale
ucrtbase._tzset()
ucrtbase.__tzname.restype = ctypes.POINTER(ctypes.c_char_p * 2)
c_tzname = ucrtbase.__tzname()[0]
tzname = tuple(tz.decode('1251') for tz in c_tzname)

# print Cyrillic characters to the console
kernel32.SetConsoleOutputCP(1251)
stdout = open(1, 'w', buffering=1, encoding='1251', closefd=0)

>>> print(tzname, file=stdout)
('Время в формате UTC', 'Время в формате UTC')

--
nosy: +eryksun

___
Python tracker 

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



[issue25176] Link to urllib.parse.parse_qsl, not parse_qs, from cgi.parse_qsl doc

2015-09-19 Thread Ville Skyttä

New submission from Ville Skyttä:

The docs for cgi.parse_qsl should link to urllib.parse.parse_qsl instead of 
urllib.parse.parse_qs, patch attached.

--
assignee: docs@python
components: Documentation
files: cgi.parse_qsl.doc.patch
keywords: patch
messages: 251072
nosy: docs@python, scop
priority: normal
severity: normal
status: open
title: Link to urllib.parse.parse_qsl, not parse_qs, from cgi.parse_qsl doc
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file40514/cgi.parse_qsl.doc.patch

___
Python tracker 

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



[issue24965] Implement PEP 498: Literal String Formatting

2015-09-19 Thread Eric V. Smith

Eric V. Smith added the comment:

I changed the generated code to call:
format(x [, spec])

instead of:
x.__format__(spec)

The reason is that the correct way to call __format__ is actually:
type(x).__format__(x, spec)

That is, the __format__ lookup is done on the type, not the instance. From the 
earlier example, the disassembled code is now:

>>> dis.dis("f'a={a}'")
  1   0 LOAD_CONST   0 ('')
  3 LOAD_ATTR0 (join)
  6 LOAD_CONST   1 ('a=')
  9 LOAD_GLOBAL  1 (format)
 12 LOAD_NAME2 (a)
 15 CALL_FUNCTION1 (1 positional, 0 keyword pair)
 18 BUILD_LIST   2
 21 CALL_FUNCTION1 (1 positional, 0 keyword pair)
 24 RETURN_VALUE

The simplest way to make the lookup correctly is just to call format() itself, 
which does the right thing.

I still have a concept of adding opcodes to handle FormattedValue and JoinedStr 
nodes, but that's an optimization for later, if ever.

--
Added file: http://bugs.python.org/file40515/pep-498-10.diff

___
Python tracker 

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



[issue25177] OverflowError in statistics.mean when summing large floats

2015-09-19 Thread David MacIver

New submission from David MacIver:

The following code produces an OverflowError:

import statistics
statistics.mean([8.988465674311579e+307, 8.98846567431158e+307])

The error is:

  File "/home/david/.pyenv/versions/3.5.0/lib/python3.5/statistics.py", line 
293, in mean
return _sum(data)/n
  File "/home/david/.pyenv/versions/3.5.0/lib/python3.5/statistics.py", line 
184, in _sum
return T(total)
  File "/home/david/.pyenv/versions/3.5.0/lib/python3.5/numbers.py", line 291, 
in __float__
return self.numerator / self.denominator
OverflowError: integer division result too large for a float


If this is intended behaviour then it is not documented: 
https://docs.python.org/3/library/statistics.html#statistics.mean only 
specifies that it may raise StatisticsError.

--
components: Library (Lib)
messages: 251076
nosy: David MacIver
priority: normal
severity: normal
status: open
title: OverflowError in statistics.mean when summing large floats
versions: 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



[issue24999] Segfault in test_re.test_sre_character_class_literals() when Python is compiled by ICC

2015-09-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 21076e24cd8a by Victor Stinner in branch '3.5':
Issue #24999: In longobject.c, use two shifts instead of ">> 2*PyLong_SHIFT" to
https://hg.python.org/cpython/rev/21076e24cd8a

--
nosy: +python-dev

___
Python tracker 

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



[issue25175] Documentation-Tkinter Clarify module spelling change in Python 3 docs

2015-09-19 Thread Carol Willing

Carol Willing added the comment:

Although the documentation for Python 3 and Python 2 is correct as Martin 
shared, adding a note about capitalization in the Python 3 docs would be 
helpful for beginners for two reasons: 1) the name of the Tkinter project does 
start with a capital 'T' and 2) the python module name changed from Python 2 to 
3.

Adding a note that the spelling of the module changed in version 3 to 'tkinter' 
from version 2's 'Tkinter' would be helpful for new users (especially since 
Tkinter is often used in educational applications).

I have updated the issue title, issue type, stage, and keywords to reflect that 
this issue is not a documentation error but a helpful, user friendly 
documentation enhancement.

--
keywords: +easy
nosy: +willingc
stage:  -> needs patch
title: Documentation-Tkinter wrong statement -> Documentation-Tkinter Clarify 
module spelling change in Python 3 docs
type: compile error -> enhancement
versions: +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



[issue25177] OverflowError in statistics.mean when summing large floats

2015-09-19 Thread Bar Harel

Bar Harel added the comment:

I believe it's an intended behavior as python's float has a limit after all. 
It's hard to reach it but definitely possible.
A workaround is to internally use Decimal (also take the advantage that it's 
implementation is now way faster) but it will cause a precision loss, and 
somewhat unexpected behavior.
Last thing we can do is catch that OverflowError and raise StatisticsError from 
exc.
I believe catching and re-raising as Statistics or just writing that it may 
also cause an Overflow error are the most viable ways.
Either way, I'd like another opinion before implementing either method as a 
patch.

--
nosy: +bar.harel

___
Python tracker 

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



[issue25177] OverflowError in statistics.mean when summing large floats

2015-09-19 Thread David MacIver

David MacIver added the comment:

I'm not sure what you mean by float having a limit here. It's certainly finite 
precision, but there is still a representable value with that finite precision 
closest to the mean.

As an example where there is an obvious correct answer that will trigger this 
error: statistics.mean([sys.float_info.max, sys.float_info.max]), this should 
return sys.float_info.max (which is definitely representable!), but instead 
raises this overflow error.

--

___
Python tracker 

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



[issue12885] distutils.filelist.findall() fails on broken symlink in Py2.x

2015-09-19 Thread Jason R. Coombs

Jason R. Coombs added the comment:

Although the code was ported from setuptools, it wasn't ported from the long 
stable implementation, but was ported following the recent refactor, which had 
a 
[regression](https://bitbucket.org/pypa/setuptools/issues/425/odd-failure-on-183-missing-files-but-they)
 revealing that the [docstring no longer matched the 
implementation](https://bitbucket.org/pypa/setuptools/commits/72ec36bea07c7dd1cf48e20894864e8a4e1b480f).
 The latest implementation provides [a more elegant 
approach](https://bitbucket.org/pypa/setuptools/src/738b139f3016a05084c9f34c6364d7d20b3aac9d/setuptools/__init__.py?fileviewer=file-view-default#__init__.py-154),
 but continues to maintain the expectation of the setuptools implementation.

I still need to address Eric's question about what filelists are affected, but 
also now update the patch to ensure that the disparity between findall('.') and 
findall(anything_else) is captured.

--

___
Python tracker 

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



[issue22559] [backport] ssl.MemoryBIO

2015-09-19 Thread Donald Stufft

Donald Stufft added the comment:

Now that 3.5 is out, does that mean we can sync 2.7 with the 3.5 ssl again and 
land this patch?

--

___
Python tracker 

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



[issue25177] OverflowError in statistics.mean when summing large floats

2015-09-19 Thread Bar Harel

Bar Harel added the comment:

Whoop! I see the reason for it now. By limit I don't mean the precision limit, 
I mean the top limit in which float converts to "inf".
Seems like this bug is due to the change of python 3's division operator.
Under numbers it states:
"It's important that this conversion use the integer's "true"
division rather than casting one side to float before dividing
so that ratios of huge integers convert without overflowing."

It is meant to not to overflow but the "/" operator is now "//".
Lemme patch it up and see if it fixes the problem. If it states the integer's 
"true" division, I believe this small fix will be sufficient as it has been 
tested before.

--

___
Python tracker 

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



[issue25177] OverflowError in statistics.mean when summing large floats

2015-09-19 Thread Bar Harel

Bar Harel added the comment:

Yup, it indeed fixes the problem. Sorry for thinking it's intended.
Seems like it's a small problem but it does affects all the uses of Integral  
or Rational.
I'll test it with the suite hoping it has a sufficient coverage.

--

___
Python tracker 

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



[issue25173] IDLE - several common dialogs don't have correct parent set

2015-09-19 Thread Mark Roseman

Mark Roseman added the comment:

No comment on state of Tkinter documentation. ;-)

I'll have a go through the uses of 'master' in IDLE and see which others should 
be changed, and put together a patch. Plus double-check with all the other 
dialogs in lib/tkinter to see if there are any other gotchas to be aware of.

The 'detail' option appears to be 8.5 only, added in 2004 
(http://www.tcl.tk/cgi-bin/tct/tip/152.html).

--

___
Python tracker 

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



  1   2   >