[issue27882] Python docs on 9.2 Math module lists math.log2 as function but it does not exist

2016-08-28 Thread Raymond Hettinger
Raymond Hettinger added the comment: Also, check your Python version to make sure that you're running Python 3.3 or later. -- nosy: +rhettinger status: pending -> open ___ Python tracker

[issue27413] Add an option to json.tool to bypass non-ASCII characters.

2016-08-28 Thread Raymond Hettinger
Raymond Hettinger added the comment: The patch looks good. If no one else objects soon, I will apply it. -- assignee: -> rhettinger nosy: +rhettinger ___ Python tracker

[issue27413] Add an option to json.tool to bypass non-ASCII characters.

2016-08-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Test fails on non-utf8 locale. $ LC_ALL=en_US ./python -m test.regrtest -v -m test_no_ensure_ascii_flag test_json ... == FAIL: test_no_ensure_ascii_flag (test.test_json.test_tool.TestTool)

[issue27877] Add recipe for "valueless" Enums to docs

2016-08-28 Thread Raymond Hettinger
Raymond Hettinger added the comment: -0 I concur with OP's observation that "object() returns a new unique value while conveying that that value should not be expected to be used in any meaningful way" and that this recipe could help reinforce that notion. That said, the idiomatic way to

[issue27078] Make f'' strings faster than .format: BUILD_STRING opcode?

2016-08-28 Thread Raymond Hettinger
Raymond Hettinger added the comment: I put this in the "new feature" category in the sense that after beta we're trying to stabilize the code base. Introducing a new opcode is a higher risk change that needs to go in the release cycle as early as possible. --

[issue27413] Add an option to json.tool to bypass non-ASCII characters.

2016-08-28 Thread Wei-Cheng Pan
Wei-Cheng Pan added the comment: 1. Replaced non-ASCII literals to \u 2. Removed failed assertion Test passed with LC_ALL=en_US and LC_ALL=en_US.UTF-8 . I've tried to use locale.getdefaultlocale(), but seems the output string will vary in different locales. -- Added file:

[issue27877] Add recipe for "valueless" Enums to docs

2016-08-28 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- Removed message: https://bugs.python.org/msg273815 ___ Python tracker ___

[issue27413] Add an option to json.tool to bypass non-ASCII characters.

2016-08-28 Thread Wei-Cheng Pan
Changes by Wei-Cheng Pan : Removed file: https://bugs.python.org/file44243/json-add-an-option-to-bypass-non-ascii-characters-v3.patch ___ Python tracker

[issue27877] Add recipe for "valueless" Enums to docs

2016-08-28 Thread Raymond Hettinger
Raymond Hettinger added the comment: After a little more thought, I think this would be a worthwhile recipe and would help communicate the notion that the value has no particular meaning. -- ___ Python tracker

[issue27413] Add an option to json.tool to bypass non-ASCII characters.

2016-08-28 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: rhettinger -> ___ Python tracker ___

[issue27867] various issues due to misuse of PySlice_GetIndicesEx

2016-08-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I'm saying that PySlice_GetIndicesEx2 can't just use Py_SIZE. -- ___ Python tracker ___

[issue27861] sqlite3 type confusion and multiple frees

2016-08-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: LGTM except one style nit. -- ___ Python tracker ___ ___

[issue27861] sqlite3 type confusion and multiple frees

2016-08-28 Thread Xiang Zhang
Xiang Zhang added the comment: It's a trivial personal style choice I think. Do what you want if you'd like to merge it. -- ___ Python tracker ___

[issue27413] Add an option to json.tool to bypass non-ASCII characters.

2016-08-28 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- Removed message: https://bugs.python.org/msg273813 ___ Python tracker ___

[issue27882] Python docs on 9.2 Math module lists math.log2 as function but it does not exist

2016-08-28 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- status: open -> pending ___ Python tracker ___

[issue27413] Add an option to json.tool to bypass non-ASCII characters.

2016-08-28 Thread Berker Peksag
Berker Peksag added the comment: > If I'm not misreading your comment, this will change the original behavior, > right? Assuming you also change ensure_ascii = not options.no_ensure_ascii to ensure_ascii = options.no_ensure_ascii no, it won't change the original behavior. That way

[issue27881] Fix possible bugs when setting sqlite3.Connection.isolation_level

2016-08-28 Thread Xiang Zhang
Xiang Zhang added the comment: issue27881.patch tires to solve this. Hope to get feedback. -- keywords: +patch Added file: https://bugs.python.org/file44247/issue27881.patch ___ Python tracker

[issue27881] Fix possible bugs when setting sqlite3.Connection.isolation_level

2016-08-28 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> serhiy.storchaka stage: -> patch review ___ Python tracker ___

[issue27883] sqlite-3.14.1 for Python_3.6.0b1 ?

2016-08-28 Thread Big Stone
New submission from Big Stone: Sqlite-3.14.1 includes a lot of fixes since sqlite-38.11, including some for windows ;-) . it would be nice to upgrade -- components: Windows messages: 273821 nosy: Big Stone, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity:

[issue27761] Private _nth_root function loses accuracy

2016-08-28 Thread STINNER Victor
STINNER Victor added the comment: Hum, "g = D(x**(1.0/n))" computes a float and then convert it to a decimal, right? Can we please add comments to explain why you start with float, compute decimal and finish with float? And maybe also document the algorithm? --

[issue27761] Private _nth_root function loses accuracy

2016-08-28 Thread Tim Peters
Tim Peters added the comment: That's clever, Serhiy! Where did it come from? It's not Newton's method, but it also appears to enjoy quadratic convergence. As to speed, why are you asking? You should be able to time it, yes? On my box, it's about 6 times slower than the last code I posted.

[issue27883] sqlite-3.14.1 for Python_3.6.0b1 ?

2016-08-28 Thread Big Stone
Big Stone added the comment: remark: since sqlite 3.11.0, sqlite.org default sqlite3.dll includes FTS3, FTS5, RTREE, DBSTAT, JSON1, and RBU extensions, causing sqlite3.dll to jump to 1646Ko size instead of 756Ko current (windows 64). This works well over Python3.5.2 64 bit, but you may

[issue27886] Docs: the difference between rename and replace is not obvious

2016-08-28 Thread Andrew Svetlov
Andrew Svetlov added the comment: Just keeping the reference to `os.rename()`: https://docs.python.org/3/library/os.html#os.rename Aha, `os.rename` says: "On Unix, if dst exists and is a file, it will be replaced silently if the user has permission." and "On Windows, if dst already exists,

[issue27051] Create PIP gui

2016-08-28 Thread Nick Coghlan
Nick Coghlan added the comment: As David hinted at, the pip GUI should *not* support privilege escalation on Linux - needing to do so indicates someone is attempting to install into the system Python, and the GUI should never do that. If there's no active virtual environment, it should do a

[issue27885] Add a Crypto++ Wrapper for when Someone needs to use Crypto++ things outside of C++, e.g. in Python Code

2016-08-28 Thread R. David Murray
R. David Murray added the comment: This kind of thing should be a pypi package. The process for getting something included in the standard library includes it being available on pypi, as well as a widespread need for the functionality, and even then it is not easy to get something included.

[issue27877] Add recipe for "valueless" Enums to docs

2016-08-28 Thread John Hagen
John Hagen added the comment: Raymond, thanks for your consideration and input. I'll work on a small patch unless I hear from Ethan that he'd rather do it. I'm happy to defer to his expertise. I did try out None as a value just to be sure that that didn't work as it would not be a bad

[issue27884] during 'make install', pre-existing site-packages residents are recompiled. Twice.

2016-08-28 Thread Matt Morrison
New submission from Matt Morrison: I've been building Python 3 from source on Linux for a long time (at least since 3.2 days), and I honestly can't remember if this has happened before 3.6 or not, which is why I'm only tagging this 3.6. Basically, when running 'make install' (after building

[issue27884] during 'make install', pre-existing site-packages residents are recompiled. Twice.

2016-08-28 Thread R. David Murray
R. David Murray added the comment: As far as I can tell, this is working as designed, and in fact you ought to see site-packages getting compiled *three* times (normal, -O, and -OO). I wonder if this is a holdover from when we didn't have per-interpreter pyc files, and its just that no one

[issue27885] Add a Crypto++ Wrapper for when Someone needs to use Crypto++ things outside of C++, e.g. in Python Code

2016-08-28 Thread Decorater
New submission from Decorater: So, I have Python Code that would be nice if the interpreter had a built in Crypto++ support. I am Suggesting for 3.6 to Add in this as it would be helpful for any Python Developer to do something like: import cryptopp And then doing the functiosn that Crpyto++

[issue27885] Add a Crypto++ Wrapper for when Someone needs to use Crypto++ things outside of C++, e.g. in Python Code

2016-08-28 Thread R. David Murray
R. David Murray added the comment: And, not surprisingly, the pypi package already exists: https://pypi.python.org/pypi/pycryptopp/0.7.1.869544967005693312591928092448767568728501330214 The rest of my comment stands. -- ___ Python tracker

[issue27761] Private _nth_root function loses accuracy

2016-08-28 Thread Tim Peters
Tim Peters added the comment: Victor, happy to add comments, but only if there's sufficient interest in actually using this. In the context of this issue report, it's really only important that Mark understands it, and he already does ;-) For example, it starts with float `**` because that's

[issue27761] Private _nth_root function loses accuracy

2016-08-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Wouldn't following implementation be faster? import decimal c = decimal.DefaultContext.copy() c.prec = 25 def rootn(x, n, D=decimal.Decimal, sub=c.subtract, mul=c.multiply, log=c.ln):

[issue27886] Docs: the difference between rename and replace is not obvious

2016-08-28 Thread Andrew Svetlov
New submission from Andrew Svetlov: Hi. On reading the doc for pathlib I've stuck with `.rename()` and `.replace()` (https://docs.python.org/3/library/pathlib.html#pathlib.Path.rename). What's the difference? Going to pathlib's source code I've figured out that methods are use different

[issue26470] Make OpenSSL module compatible with OpenSSL 1.1.0

2016-08-28 Thread Christian Heimes
Christian Heimes added the comment: Thanks Alex, I ported the Python and C code to 2.7 but forgot to address doc updates. You can find an updated patch on github: https://github.com/python/cpython/compare/2.7...tiran:feature/openssl110_27 I'll submit a new patch after your review. Chi Hsuan

[issue27886] Docs: the difference between rename and replace is not obvious

2016-08-28 Thread R. David Murray
R. David Murray added the comment: No, we don't like to overuse warnings. -- ___ Python tracker ___ ___

[issue27761] Private _nth_root function loses accuracy

2016-08-28 Thread Tim Peters
Tim Peters added the comment: Steven, you certainly _can_ ;-) check first whether `r**n == x`, but can you prove `r` is the best possible result when it's true? Offhand, I can't. I question it because it rarely seems to _be_ true (in well less than 1% of the random-ish test cases I tried).

[issue27744] Add AF_ALG (Linux Kernel crypto) to socket module

2016-08-28 Thread Christian Heimes
Christian Heimes added the comment: New patch with setsockopt(socket.SOL_ALG, socket.ALG_SET_AEAD_AUTHSIZE, None, taglen) instead of (None, taglen). -- Added file: https://bugs.python.org/file44248/AF_ALG-kernel-crypto-support-for-socket-module-2.patch

[issue27886] Docs: the difference between rename and replace is not obvious

2016-08-28 Thread R. David Murray
Changes by R. David Murray : -- versions: -Python 3.4 ___ Python tracker ___ ___

[issue27886] Docs: the difference between rename and replace is not obvious

2016-08-28 Thread R. David Murray
R. David Murray added the comment: The existing docs are pretty clear on the difference: rename is only guaranteed to replace an existing file on unix (which I think means posix in this context), whereas replace always replaces the file, regardless of platform. I'm actually surprised that

[issue24045] Behavior of large returncodes (sys.exit(nn))

2016-08-28 Thread Martin Panter
Martin Panter added the comment: Is this a duplicate of Issue 24052? -- nosy: +martin.panter ___ Python tracker ___

[issue27761] Private _nth_root function loses accuracy

2016-08-28 Thread STINNER Victor
STINNER Victor added the comment: Tim Peters: "Victor, happy to add comments, but only if there's sufficient interest in actually using this." It looks like tests fail on some platforms. I guess that it depends on the different factors: quality of the C math library, quality of the IEEE 754

[issue27877] Add recipe for "valueless" Enums to docs

2016-08-28 Thread Emanuel Barry
Emanuel Barry added the comment: The patch doesn't apply. I manually copy-pasted the lines in the source and generated a new one. I would probably rephrase "these values hold no meaning and should not be used" into "the values are not important" or something along those lines. --

[issue27761] Private _nth_root function loses accuracy

2016-08-28 Thread Steven D'Aprano
Steven D'Aprano added the comment: This has been really eye-opening, and I just wanted to drop you a note that I am watching this thread carefully. My first priority is to get the tests all passing before beta 1 on 2016-09-12, even if (as seems likely) that means weakening the tests, and then

[issue27886] Docs: the difference between rename and replace is not obvious

2016-08-28 Thread Eryk Sun
Eryk Sun added the comment: Having rename() in pathlib is fine as long as it links to the os docs. This probably needs a new issue, but I do see room for improvement in the latter. For Unix, the os.rename and os.replace docs should clarify that an empty destination directory can be replaced

[issue25969] Update lib2to3 grammar to include missing unpacking generalizations.

2016-08-28 Thread Gregory P. Smith
Changes by Gregory P. Smith : -- nosy: +gregory.p.smith priority: normal -> high versions: +Python 2.7 ___ Python tracker ___

[issue24052] sys.exit(code) returns "success" to the OS for some nonzero values of code

2016-08-28 Thread Martin Panter
Martin Panter added the comment: Here is a relevant Posix bug thread: http://austingroupbugs.net/view.php?id=947 As well as Windows, apparently Solaris, OS X, and a recent version of Free BSD have more than eight bits of exit status. I don’t know if Python’s sys.exit() supports this though.

[issue27877] Add recipe for "valueless" Enums to docs

2016-08-28 Thread John Hagen
John Hagen added the comment: Patch attached. -- keywords: +patch Added file: https://bugs.python.org/file44249/issue27877.johnthagen.01.patch ___ Python tracker

[issue27761] Private _nth_root function loses accuracy

2016-08-28 Thread Tim Peters
Tim Peters added the comment: As I said, the last code I posted is "fast enough" - I can't imagine a real application can't live with being able to do "only" tens of thousands of roots per second. A geometric mean is typically an output summary statistic, not a transformation applied

[issue27761] Private _nth_root function loses accuracy

2016-08-28 Thread Tim Peters
Tim Peters added the comment: Let's spell one of these out, to better understand why sticking to native precision is inadequate. Here's one way to write the Newton step in "guess + relatively_small_correction" form: def plain(x, n): g = x**(1.0/n) return g - (g -