[issue23993] Use surrogateescape error handler by default in open() if the LC_CTYPE locale is C at startup

2015-04-25 Thread Nick Coghlan

Nick Coghlan added the comment:

If a Linux distro is using systemd (which is essentially all recent versions of 
popular distros, including RHEL/CentOS, although it won't land in Ubuntu LTS 
until 16.04), then cron jobs and service daemons will get their locale set 
properly based on the contents of /etc/locale.conf. Thus "use an init system 
that reliably sets the locale correctly for cron jobs and service daemons" is 
the correct fix for this problem.

Unfortunately, there are still an awful lot of Linux systems out there using 
other init systems that don't reliably set the locale, and for those "Python 3 
shouldn't be worse than Python 2" is a desirable behavioural goal here.

Thus, I think it makes sense for Python to special case the C locale by 
assuming it's always the wrong setting, and thus surrogateescape is going to be 
needed on all system interfaces. While it won't be a perfect fix, at least 
we'll be able to roundtrip data within the system appropriately, even if it 
still gets corrupted in the face of encoding conversions.

--

___
Python tracker 

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



[issue23911] Move path-based bootstrap code to a separate frozen file.

2015-04-25 Thread Nick Coghlan

Nick Coghlan added the comment:

Nice, this ties directly into one of the thornier problems in the PEP 432 
bootstrapping work, which needs to set up the core import system in 
Py_BeginInitialization, but delay setting up the rest of it until 
Py_EndInitialization.

Your patch achieves this by moving everything that belongs in the latter part 
of the operation to the "import _frozen_path_importer" step.

As far as naming goes, I'd suggest referring to the two import subsystems as 
"internal imports" and "external imports". The key aspect of builtin and frozen 
modules is that they're an inherent part of the interpreter itself - if you 
have an interpreter, you have all of its buitin and frozen modules natively 
available. By contrast, setting up the external import machinery requires that 
the interpreter first be configured to appropriately communicate with the host 
system.

--

___
Python tracker 

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



[issue23955] Add python.ini file for embedded/applocal installs

2015-04-25 Thread Nick Coghlan

Nick Coghlan added the comment:

I'd actually like a python.ini file defined as a Python 3.5 feature in order to 
provide a better backporting story for the PEP 476 certificate changes in 
downstream long term support releases of Python 2.7.

So +1 in principle, but I'd like to see this written up as a PEP (the SSL 
configuration setting doesn't need to be in the PEP, but the optional existence 
of the config file and reading it at startup does).

--

___
Python tracker 

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



[issue20182] Derby #13: Convert 50 sites to Argument Clinic across 5 files

2015-04-25 Thread Tal Einat

Tal Einat added the comment:

Here's a slightly modified version of the most recent patch for 
Modules/selectmodule.c. The only difference relative to the previous version is 
that I've set the epoll method function names back to what they used to be. My 
reasoning is to stay consistent with the other epoll method function names in 
the file and to keep the code familiar for the maintainers.

--
Added file: http://bugs.python.org/file39203/issue20182.selectmodule.v2.patch

___
Python tracker 

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



[issue23857] Make default HTTPS certificate verification setting configurable via global ini file

2015-04-25 Thread Nick Coghlan

Nick Coghlan added the comment:

In issue 23955, Steve Dower has suggested introducing config file support for 
easier control of path configuration when a dedicated Python interpreter 
runtime is deployed as part of a larger application.

If that proposal goes ahead (I think it needs a PEP for us to proceed with it), 
then we could use that scheme as the basis for solving the PEP 476 backporting 
problem (without necessarily having to officially standardise the latter 
upstream).

--

___
Python tracker 

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



[issue15582] Enhance inspect.getdoc to follow inheritance chains

2015-04-25 Thread Nick Coghlan

Nick Coghlan added the comment:

Yes, this was a deliberate change to "flip the default" as to which subclasses 
get bad docstring behaviour.

In the status quo, if you provide a subclass method which does basically the 
same thing as the parent class, you lose the docstring unless you duplicate it, 
meaning you have to choose between bad docstrings and a maintainability problem 
due to content duplication.

With this change, you only need a custom docstring in the subclass if you've 
changed the method behaviour enough that the parent class docstring no longer 
makes any sense.

If you just want to suppress the docstring entirely, then you'll need to 
specify an empty docstring.

This is potentially worth a note in the "Porting to Python 3.5" section of the 
What's New document, but it's an intended consequence of the change.

--

___
Python tracker 

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



[issue23967] Make inspect.signature expression evaluation more powerful

2015-04-25 Thread Nick Coghlan

Nick Coghlan added the comment:

Right, Larry and I had a fairly long discussion about this idea at the sprints, 
and I was satisfied that all the cases where he's proposing to use this are 
safe: in order to exploit them you need to be able to set __text_signature__ on 
arbitrary objects, and if an attacker can do that, you've already lost control 
of the process.

However, a natural future extension is to expose this as a public alternative 
constructor for Signature objects, and for that, the fact that it ultimately 
calls eval() under the hood presents more of a security risk. The 
"trusted=False" default on _signature_fromstr allows the function to be used 
safely on untrusted data, while allowing additional flexibility when you *do* 
trust the data you're evaluating.

--

___
Python tracker 

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



[issue24009] Get rid of rare format units in PyArg_Parse*

2015-04-25 Thread Tal Einat

Tal Einat added the comment:

+1. I was recently trying to use the C API for a 3rd party library, and all of 
these subtly different string parameter formats made things surprisingly 
confusing.

These are part of the Python C API, so removing them could break 3rd party 
code. Simply searching through the stdlib is not enough to show that these are 
not in use. So removal would require a deprecation period.

--
nosy: +taleinat

___
Python tracker 

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



[issue24037] Argument Clinic: add the boolint converter

2015-04-25 Thread Tal Einat

Tal Einat added the comment:

If this was for internal use only, intended to ease the transition to Argument 
Clinic, then extensibility isn't an issue.

An upside to this is that it would make it easy in the future to find all of 
the places in the stdlib using integers instead of bools.

A downside is that "boolint" isn't a very obvious name IMO.

--
nosy: +taleinat

___
Python tracker 

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



[issue23857] Make default HTTPS certificate verification setting configurable via global ini file

2015-04-25 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

I think this discussion is moving in the wrong direction or least one which 
won't help people not using some Linux distribution.

The use case here is very similar to the hash seed randomization which was also 
successfully handled using an environment variable setting, so why not do the 
same here ?

I don't really understand the objections mentioned against env vars. They can 
be set per process, per user, even globally and they are under control by 
whoever runs an application.

Note that this is about breaking backwards compatibility badly. Certificate 
verification is a good thing, but if it results in people no longer being able 
to easily upgrade to a new patch level release, something is wrong. If such a 
feature causes applications to fail working, admins won't go in a fix the 
application; instead they'll simply not upgrade to 2.7.9+, cutting people off 
of all the other fixes in 2.7.9+.

--

___
Python tracker 

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



[issue24037] Argument Clinic: add the boolint converter

2015-04-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I proposed boolint or intbool. Are there better variants?

An alternative is add accept={int} parameter to the bool converter. But this 
will complicate the implementation and the use without the need.

--

___
Python tracker 

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



[issue9951] introduce bytes.hex method (also for bytearray and memoryview)

2015-04-25 Thread Arnon Yaari

Arnon Yaari added the comment:

minor updates to stdtypes.rst. I also want to add a line to whatsnew/3.5 but 
don't know how to put it in words - maybe it's better if someone with better 
english will add it.

--
Added file: http://bugs.python.org/file39204/bytes.hex-1.diff

___
Python tracker 

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



[issue3286] IDLE opens window too low on Windows

2015-04-25 Thread irdb

Changes by irdb :


--
nosy: +irdb

___
Python tracker 

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



[issue4823] idle height and place

2015-04-25 Thread irdb

Changes by irdb :


--
nosy: +irdb

___
Python tracker 

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



[issue13567] HTTPError interface changes / breaks depending on what was passed to constructor

2015-04-25 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +berker.peksag
stage:  -> patch review
versions: +Python 3.4, Python 3.5 -Python 3.2, Python 3.3

___
Python tracker 

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



[issue24035] When Caps Locked, + alpha-character still displayed as uppercase

2015-04-25 Thread eryksun

eryksun added the comment:

> It looks like this is a bug in pyreadlines as suggested by 
> eryksun, but for a different reason.

As I said before, it reads keyboard input events at a lower level via 
ReadConsoleInputW, instead of calling ReadConsoleW to read the input buffer as 
a text stream. To elaborate, this means it has to be aware of the keyboard 
state, per the [KEY_EVENT_RECORD][1] dwControlKeyState. This gets passed to 
[make_KeyPress][2] as `state`, which in turn ignores the CAPSLOCK_ON flag.

[1]: https://msdn.microsoft.com/en-us/library/ms684166
[2]: 
https://github.com/pyreadline/pyreadline/blob/master/pyreadline/keysyms/keysyms.py#L116

--

___
Python tracker 

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



[issue24056] Expose closure & generator status in function repr()

2015-04-25 Thread Ethan Furman

Changes by Ethan Furman :


--
nosy: +ethan.furman

___
Python tracker 

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



[issue24058] Compiler warning for readline extension

2015-04-25 Thread Masayuki Yamamoto

New submission from Masayuki Yamamoto:

Compiler warns case of define HAVE_DECLSPEC_DLL.
In Modules/readline.c:1065, _PyOS_ReadlineTState variable declaration is 
different to Include/pythonrun.h:275.

--
components: Build, Extension Modules
hgrepos: 307
messages: 242013
nosy: masamoto
priority: normal
severity: normal
status: open
title: Compiler warning for readline extension
type: compile error
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



[issue24058] Compiler warning for readline extension

2015-04-25 Thread Masayuki Yamamoto

Masayuki Yamamoto added the comment:

Here is a patch modifying variable declaration to same as Include/pytonrun.h.

--
keywords: +patch
Added file: 
http://bugs.python.org/file39205/3.4-issue24058-readline-_PyOS_ReadlineTState.patch

___
Python tracker 

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



[issue23810] Suboptimal stacklevel of deprecation warnings for formatter and imp modules

2015-04-25 Thread Brett Cannon

Brett Cannon added the comment:

OK, I'll look at making it more general for multiple names to skip.

--

___
Python tracker 

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



[issue15329] clarify which deque methods are thread-safe

2015-04-25 Thread xiaobing jiang

Changes by xiaobing jiang :


--
nosy: +s7v7nisla...@gmail.com

___
Python tracker 

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



[issue15339] document the threading "facts of life" in Python

2015-04-25 Thread xiaobing jiang

Changes by xiaobing jiang :


--
nosy: +s7v7nisla...@gmail.com

___
Python tracker 

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



[issue15330] allow deque to act as a thread-safe circular buffer

2015-04-25 Thread xiaobing jiang

Changes by xiaobing jiang :


--
nosy: +s7v7nisla...@gmail.com

___
Python tracker 

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



[issue22544] Inconsistent cmath.log behaviour

2015-04-25 Thread Per Brodtkorb

Per Brodtkorb added the comment:

This is not only a problem for division. It also applies to multiplication as 
exemplified here:

>>> complex(0,inf)+1  # expect 1 + infj
Out[16]: (1+infj)

>>> (complex(0,inf)+1)*1  # expect 1 + infj
Out[17]: (nan+infj)

>>> complex(inf, 0) + 1j  # expect inf + 1j
Out[18]: (inf+1j)

>>> (complex(inf, 0)+1j)*1  # expect inf + 1j
Out[19]: (inf, nanj)

--
nosy: +pbrod
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



[issue15339] document the threading "facts of life" in Python

2015-04-25 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee: rhettinger -> 

___
Python tracker 

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



[issue24059] Minor speed and readability improvement to the random module

2015-04-25 Thread Raymond Hettinger

New submission from Raymond Hettinger:

Replace all the _sqrt(x) calls with x ** 0.5, improving the visual appearance 
and providing a modest speed improvement.

$ python3 -m timeit -s 'from math import sqrt' 'sqrt(3.14)'
1000 loops, best of 3: 0.032 usec per loop
$ python3 -m timeit -s 'from math import sqrt' '3.14 ** 0.5'
1 loops, best of 3: 0.0101 usec per loop

--
components: Library (Lib)
files: random_sqrt.diff
keywords: patch
messages: 242017
nosy: rhettinger
priority: low
severity: normal
stage: patch review
status: open
title: Minor speed and readability improvement to the random module
type: performance
versions: Python 3.5
Added file: http://bugs.python.org/file39206/random_sqrt.diff

___
Python tracker 

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



[issue24056] Expose closure & generator status in function repr()

2015-04-25 Thread Petr Viktorin

Changes by Petr Viktorin :


--
nosy: +encukou

___
Python tracker 

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



[issue24059] Minor speed and readability improvement to the random module

2015-04-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

sqrt(x) and x ** 0.5 can be different.

>>> 0.0171889575379941**0.5
0.13110666473522276
>>> sqrt(0.0171889575379941)
0.13110666473522273

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue24059] Minor speed and readability improvement to the random module

2015-04-25 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +mark.dickinson

___
Python tracker 

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



[issue24057] trivial typo in datetime.rst: needing a preceding dot

2015-04-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 875787fee2cc by Benjamin Peterson in branch '3.4':
fix relative link (closes #24057)
https://hg.python.org/cpython/rev/875787fee2cc

New changeset 4e48a55cffb8 by Benjamin Peterson in branch '2.7':
fix relative link (closes #24057)
https://hg.python.org/cpython/rev/4e48a55cffb8

New changeset 0351b0cb31d6 by Benjamin Peterson in branch 'default':
merge 3.4 (#24057)
https://hg.python.org/cpython/rev/0351b0cb31d6

--
nosy: +python-dev
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



[issue23955] Add python.ini file for embedded/applocal installs

2015-04-25 Thread Paul Moore

Paul Moore added the comment:

As described. this seems to be a Windows-only feature (it's replacing a 
registry lookup with a config file alongside the Python DLL).

So I'm not sure I understand Nick's comment - Nick, are you suggesting this 
should be a cross-platform feature? If so, what's the equivalent of "alongside 
the Python DLL", and what would the ini file be used for on Unix, where there's 
no registry lookup to override?

--
nosy: +paul.moore

___
Python tracker 

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



[issue24058] Compiler warning for readline extension

2015-04-25 Thread Benjamin Peterson

Benjamin Peterson added the comment:

What kind of compiler/system does this happen on?

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue11477] Incorrect operand precedence when implementing sequences in C

2015-04-25 Thread Gregory P. Smith

Changes by Gregory P. Smith :


--
nosy: +gregory.p.smith
versions: +Python 3.5 -Python 3.4

___
Python tracker 

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



[issue24058] Compiler warning for readline extension

2015-04-25 Thread Masayuki Yamamoto

Masayuki Yamamoto added the comment:

um, Compiler warned, but test passed. It seems a only warning.

build log:
$ ./configure --prefix=/opt/py34
$ make
...
building 'readline' extension
gcc -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes 
-Werror=declaration-after-statement -I./Include -I/opt/py34/include -I. 
-IInclude -I/usr/local/include -I/home/masayuki/src/CPython-3.4/Include 
-I/home/masayuki/src/CPython-3.4 -c 
/cygdrive/d/cyghome/masayuki/src/CPython-3.4/Modules/readline.c -o 
build/temp.cygwin-1.7.35-i686-3.4/cygdrive/d/cyghome/masayuki/src/CPython-3.4/Modules/readline.o
/cygdrive/d/cyghome/masayuki/src/CPython-3.4/Modules/readline.c:1065:23: 
warning: '_PyOS_ReadlineTState' redeclared without dllimport attribute: 
previous dllimport ignored [-Wattributes]
 extern PyThreadState* _PyOS_ReadlineTState;
   ^
...

test log:
$ /opt/py34/bin/python3.4m.exe -E -Wd -mtest -v test_readline
== CPython 3.4.3+ (3.4:ce2b9f160391+, Apr 25 2015, 20:45:32) [GCC 4.9.2]
==   CYGWIN_NT-6.0-1.7.35-0.287-5-3-i686-32bit-WindowsPE little-endian
==   hash algorithm: siphash24 32bit
==   /tmp/test_python_2660
Testing with flags: sys.flags(debug=0, inspect=0, interactive=0, optimize=0, 
dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=1, 
verbose=0, bytes_warning=0, quiet=0, hash_randomization=1, isolated=0)
[1/1] test_readline
testHistoryUpdates (test.test_readline.TestHistoryManipulation) ... ok
test_init (test.test_readline.TestReadline) ... ok

--
Ran 2 tests in 0.199s

OK
1 test OK.

--

___
Python tracker 

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



[issue24059] Minor speed and readability improvement to the random module

2015-04-25 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Hmm, I don't get that same result (Mac OS/X 10.10, Python 3.4.2):

>>> from math import *
>>> 0.0171889575379941**0.5
0.13110666473522273
>>> sqrt(0.0171889575379941)
0.13110666473522273

It's odd because your two result as same number, just displayed differently.  I 
thought that wasn't supposed to happen anymore.

>>> (0.13110666473522276).hex()
'0x1.0c81a6aa9a74ep-3'
>>> (0.13110666473522273).hex()
'0x1.0c81a6aa9a74dp-3'

--
nosy: +tim.peters

___
Python tracker 

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



[issue24060] Clearify necessities for logging with timestamps

2015-04-25 Thread Karl Richter

New submission from Karl Richter:

The `Formatter` section of the `logging` module at 
https://docs.python.org/2/library/logging.html#formatter-objects reads like 
it's sufficient to create an instance of `Formatter` with default arguments 
(and set it as formatter of the `Handler` of a `Logger`) to have add timestamps 
to logging output.

--
assignee: docs@python
components: Documentation
messages: 242024
nosy: docs@python, krichter
priority: normal
severity: normal
status: open
title: Clearify necessities for logging with timestamps
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



[issue24059] Minor speed and readability improvement to the random module

2015-04-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

>>> (0.0171889575379941**0.5).hex()
'0x1.0c81a6aa9a74ep-3'
>>> from math import *
>>> sqrt(0.0171889575379941).hex()
'0x1.0c81a6aa9a74dp-3'
>>> 0.0171889575379941**0.5 == sqrt(0.0171889575379941)
False

--

___
Python tracker 

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



[issue24059] Minor speed and readability improvement to the random module

2015-04-25 Thread Tim Peters

Tim Peters added the comment:

FYI, my results match Serhiy's, on Windows, under Pythons 3.4.2 and 2.7.8.

It's not surprising to me.  Since IEEE 754 standardized sqrt, most vendors 
complied, delivering a square root "as if infinitely precise" with one anally 
correct rounding.  But unless the platform pow() special-cases 0.5, that's 
going to involve a logarithm, multiplication, and exponentiation under the 
covers.  pow() implementations usually fake some "extra precision" (else the 
worst-case errors can be horrendous), but it's still not always the same as 
single-rounding.

Raymond, I didn't understand this part: "It's odd because your two result as 
same number, just displayed differently."  The output immediately following 
that showed they _are_ different numbers on your box too (the .hex() outputs 
differ by one in the last place).

--

___
Python tracker 

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



[issue24060] Clearify necessities for logging with timestamps

2015-04-25 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +vinay.sajip

___
Python tracker 

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



[issue9951] introduce bytes.hex method (also for bytearray and memoryview)

2015-04-25 Thread Gregory P. Smith

Gregory P. Smith added the comment:

bytes.hex-1.diff looks good, i'll take care of committing this and adding a 
what's new entry.  thanks!

--
assignee: ncoghlan -> gregory.p.smith
nosy: +gregory.p.smith

___
Python tracker 

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



[issue24059] Minor speed and readability improvement to the random module

2015-04-25 Thread Raymond Hettinger

Raymond Hettinger added the comment:

> The output immediately following that showed they _are_ different numbers > 
> on your box too 

So it is.  Seems like I need to increase my font size :-)

--

___
Python tracker 

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



[issue24059] Minor speed and readability improvement to the random module

2015-04-25 Thread Raymond Hettinger

Raymond Hettinger added the comment:

The next question is whether we care about that 1 ULP in the context of the 
random number calculations which already involve multi-step chains that aren't 
favorable to retaining precision: 

   s + (1.0 + s * s) ** 0.5

   ainv = (2.0 * alpha - 1.0) ** 0.5
   bbb = alpha - LOG4
   ccc = alpha + ainv

   g2rad = (-2.0 * _log(1.0 - random())) ** 0.5
   z = _cos(x2pi) * g2rad
   self.gauss_next = _sin(x2pi) * g2rad

   stddev = (sqsum/n - avg*avg) ** 0.5

--

___
Python tracker 

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



[issue9951] introduce bytes.hex method (also for bytearray and memoryview)

2015-04-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c9f1630cf2b1 by Gregory P. Smith in branch 'default':
Implements issue #9951: Adds a hex() method to bytes, bytearray, & memoryview.
https://hg.python.org/cpython/rev/c9f1630cf2b1

--
nosy: +python-dev

___
Python tracker 

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



[issue9951] introduce bytes.hex method (also for bytearray and memoryview)

2015-04-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 955a479b31a8 by Gregory P. Smith in branch 'default':
Issue9951: update _hashopenssl and md5module to use _Py_strhex().
https://hg.python.org/cpython/rev/955a479b31a8

--

___
Python tracker 

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



[issue23342] run() - unified high-level interface for subprocess

2015-04-25 Thread Thomas Kluyver

Thomas Kluyver added the comment:

I expect this can be closed now, unless there's some post-commit review 
somewhere that needs addressing?

--

___
Python tracker 

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



[issue9951] introduce bytes.hex method (also for bytearray and memoryview)

2015-04-25 Thread Gregory P. Smith

Changes by Gregory P. Smith :


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

___
Python tracker 

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



[issue9951] introduce bytes.hex method (also for bytearray and memoryview)

2015-04-25 Thread Gregory P. Smith

Gregory P. Smith added the comment:

note quite fixed, looks like some of the buildbots are having fun not compiling 
with this change:

http://buildbot.python.org/all/builders/x86%20Tiger%203.x/builds/9569/steps/compile/logs/stdio

investigating...

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



[issue9951] introduce bytes.hex method (also for bytearray and memoryview)

2015-04-25 Thread Gregory P. Smith

Gregory P. Smith added the comment:

i missed the hg adds :)

--

___
Python tracker 

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



[issue9951] introduce bytes.hex method (also for bytearray and memoryview)

2015-04-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a7737204c221 by Gregory P. Smith in branch 'default':
Add the files missing from c9f1630cf2b1 for issue9951.
https://hg.python.org/cpython/rev/a7737204c221

--

___
Python tracker 

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



[issue9951] introduce bytes.hex method (also for bytearray and memoryview)

2015-04-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7f0811452d0f by Gregory P. Smith in branch 'default':
Switch binascii over to using the common _Py_strhex implementation for its hex
https://hg.python.org/cpython/rev/7f0811452d0f

--

___
Python tracker 

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



[issue23857] Make default HTTPS certificate verification setting configurable via global ini file

2015-04-25 Thread Nick Coghlan

Nick Coghlan added the comment:

Folks being wary of upgrading to new maintenance releases is already the case - 
RHEL/CentOS selectively backport things, and other orgs like Google do 
extensive integration testing before deploying new versions. 

Folks that only use and write well behaved and well maintained software can 
readily upgrade to new point releases, large enough organisations where that 
assumption isn't necessarily valid end up having to work a bit harder :)

That said, I agree a hash randomisation style approach using environment 
variables should also work, I just expect it might be a little harder to check 
in a security auditing script.

--

___
Python tracker 

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



[issue23955] Add python.ini file for embedded/applocal installs

2015-04-25 Thread Nick Coghlan

Nick Coghlan added the comment:

If we're adding a static startup configuration file, then yes, I believe that 
should be a cross-platform feature, not something Windows specific, as it's a 
major change to our configuration philosophy. (I think it's a *necessary* 
change, but it's also a significant one)

Even if it started out as Windows only, we should have a forward looking plan 
for how it relates to the startup sequence changes proposed in PEP 432.

--

___
Python tracker 

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



[issue9951] introduce bytes.hex method (also for bytearray and memoryview)

2015-04-25 Thread Nick Coghlan

Nick Coghlan added the comment:

Thank you Arnon, and thank you Greg!

--

___
Python tracker 

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



[issue23670] Modifications to support iOS as a cross-compilation target

2015-04-25 Thread Russell Keith-Magee

Russell Keith-Magee added the comment:

Here's an updated patch that integrates some of the feedback that has been 
received so far. 

Notable changes:

* The code now works for ARMv7. Unfortunately, the price for this is a new  
libffi_ios_aarch source directory, containing generated source tree for the 
ARM64 platform. I've been working with the libffi community to address the 
compilation problems that exist in trunk, but so far, this hasn't resulted in a 
fix for the problems that have been introduced in their trunk code.

* I looked into merging the libffi_ios and libffi_osx directories, but this 
proved to be harder I thought because of legacy PowerPC support. libffi still 
ships PowerPC sources, but they're no longer included in OS/X builds, because 
Apple stopped supporting PowerPC with OS/X 10.6 (released in 2009; the last 
PowerPC Apple hardware was shipped in 2006). As a result, it's difficult to 
find compilation instructions, and even harder to find actual hardware to test 
builds. If support for PowerPC architectures (on OS/X) was deprecated, this 
would make merging the libffi_ios and libffi_osx a trivial activity.

* I've audited plat_ios/IN.py, and can now confirm that it *is* identical 
between platforms.

* I have looked into replacing Setup.* with some sort of post-configure 
procedure as suggested by @doko. Unfortunately, it's not that simple. The 
problem is that there is already 2 places where the build requirements for a 
built-in module are defined. Modules/Setup contains one set of instructions 
(although those instructions are often commented out). The second set is hard 
coded into setup.py. 

The versions in setup.py are probably more reliable (as they're the ones 
actually used for most platforms), but you need to have a working Python to 
access them. However, at the "post-configure" point, you don't have a working 
Python, so there's a bootstrapping problem.

I've refactored the Setup.ios-* definitions so that there's less duplication. 
There's now a Setup.embedded that contains the common build instructions for 
all the modules without platform-specific build instructions. Setup.ios-* just 
contains the platform-specific build instructions (in much the same way as 
setup.py has configure_ctypes_darwin).

To work around this completely, we'd need to either introduce the need for a 
bootstrap Python so that a post-configure setup could access the build 
instructions contained in setup.py, or massively refactor the process of 
building modules so that there was a set of build instructions that both 
makesetup and setup.py could use.

--
Added file: http://bugs.python.org/file39207/20150426.diff

___
Python tracker 

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



[issue9951] introduce bytes.hex method (also for bytearray and memoryview)

2015-04-25 Thread Gregory P. Smith

Gregory P. Smith added the comment:

I see some _Py_strhex related link errors on the Windows buildbots:

http://buildbot.python.org/all/builders/x86%20Windows7%203.x/builds/9642/steps/compile/logs/stdio

--

___
Python tracker 

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



[issue23955] Add python.ini file for embedded/applocal installs

2015-04-25 Thread Steve Dower

Steve Dower added the comment:

I'm leaning towards clarifying/fixing the behavior of the venv config, since 
it's most of the way there for what I care about. Adding another option for 
applocal may be needed, but possibly not, in which case defining how relative 
paths are handled would be sufficient.

Any other startup file I'd want to define as setting environment variables 
only, to avoid having multiple ways to set properties. So for most cases a 
shell script would suffice (doesn't help people linking to libpython directly, 
but they can call SetPythonHome themselves).

--

___
Python tracker 

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



[issue9951] introduce bytes.hex method (also for bytearray and memoryview)

2015-04-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b46308353ed9 by Gregory P. Smith in branch 'default':
Add missing PyAPI_FUNC macro's to the public functions as other .c files do
https://hg.python.org/cpython/rev/b46308353ed9

--

___
Python tracker 

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



[issue9951] introduce bytes.hex method (also for bytearray and memoryview)

2015-04-25 Thread Gregory P. Smith

Changes by Gregory P. Smith :


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



[issue23955] Add python.ini file for embedded/applocal installs

2015-04-25 Thread Nick Coghlan

Nick Coghlan added the comment:

Treating "local Python" as a special-case of venv sounds like a good approach, 
then (especially as it currently seems plausible we'll end up going for 
environment variable based approach to the downstream PEP 476 backport)

--

___
Python tracker 

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



[issue23342] run() - unified high-level interface for subprocess

2015-04-25 Thread Gregory P. Smith

Changes by Gregory P. Smith :


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



[issue24059] Minor speed and readability improvement to the random module

2015-04-25 Thread Tim Peters

Tim Peters added the comment:

I don't care about the ULP.  I don't care about exactly reproducing 
floating-point results across releases either, but I'd bet someone else does ;-)

--

___
Python tracker 

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



[issue15339] document the threading "facts of life" in Python

2015-04-25 Thread Gregory P. Smith

Gregory P. Smith added the comment:

This seems somewhat related to the "We need to document Python's concurrency 
and memory model" that came out at the language summit this year.

--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue23852] Wrong computation of max_fd on OpenBSD

2015-04-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7df280b311d0 by Gregory P. Smith in branch '3.4':
Fix computation of max_fd on OpenBSD.  Issue #23852.
https://hg.python.org/cpython/rev/7df280b311d0

New changeset 08d0cc23fb00 by Gregory P. Smith in branch 'default':
Fix computation of max_fd on OpenBSD.  Issue #23852.
https://hg.python.org/cpython/rev/08d0cc23fb00

--
nosy: +python-dev

___
Python tracker 

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



[issue23852] Wrong computation of max_fd on OpenBSD

2015-04-25 Thread Gregory P. Smith

Changes by Gregory P. Smith :


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