[issue19108] Benchmark runner tries to execute external Python command and fails on error reporting

2016-09-02 Thread Stefan Behnel
Stefan Behnel added the comment: Let's close this as outdated. New bugs for the new project should be reported in github anyway. -- resolution: -> out of date status: open -> closed ___ Python tracker

[issue19489] move quick search box above TOC

2016-09-02 Thread Zachary Ware
Zachary Ware added the comment: Berker, would you mind giving this another look? If you give it the OK, I can get it committed if you don't beat me to it. -- assignee: docs@python -> berker.peksag ___ Python tracker

[issue27883] Update sqlite version for Windows build

2016-09-02 Thread Zachary Ware
Zachary Ware added the comment: I agree, we should update our sqlite version. I'll try to get to this next week, but it shouldn't be a big deal if it misses beta 1 since it's not a new feature. -- stage: -> needs patch title: sqlite-3.14.1 for Python_3.6.0b1 ? -> Update sqlite

[issue27947] Trailing backslash in raw string format causes EOL

2016-09-02 Thread cfgbd
cfgbd added the comment: Thanks for comment. Here I got my answer from string docs. Even in a raw literal, quotes can be escaped with a backslash, but the backslash remains in the result; for example, r"\"" is a valid string literal consisting of two characters: a backslash and a double

[issue27947] Trailing backslash in raw string format causes EOL

2016-09-02 Thread Tim Peters
Changes by Tim Peters : -- resolution: -> not a bug stage: -> resolved status: open -> closed versions: +Python 3.2 -Python 3.4 ___ Python tracker

[issue27947] Trailing backslash in raw string format causes EOL

2016-09-02 Thread Ammar Askar
Ammar Askar added the comment: This isn't a bug, in fact this very behavior is documented within the string docs, please read the last paragraph here: https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals -- nosy: +ammar2 title: Bug of python interpreter

[issue27947] Bug of python interpreter

2016-09-02 Thread cfgbd
New submission from cfgbd: In python shell, I typed words and got result as follows. It seems that the use of 'r' before a literal string may cause an error that the an odd '\' at the end of literal string blocked the quote. >>> rb'abc\\\' SyntaxError: EOL while scanning string literal >>>

[issue27939] Tkinter mainloop raises when setting the value of ttk.LabeledScale

2016-09-02 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- nosy: +serhiy.storchaka stage: -> needs patch type: crash -> behavior versions: +Python 3.6 ___ Python tracker

[issue27928] Add hashlib.scrypt

2016-09-02 Thread Alex Gaynor
Alex Gaynor added the comment: Bug in the error message "n must be a multiple of 2." it should say "n must be a power of 2." -- nosy: +alex ___ Python tracker

[issue23591] enum: Add Flags and IntFlags

2016-09-02 Thread Roundup Robot
Roundup Robot added the comment: New changeset f33fc2117bb2 by Ethan Furman in branch 'default': issue23591: bool(empty_flags) == False; more docs & tests https://hg.python.org/cpython/rev/f33fc2117bb2 -- ___ Python tracker

[issue23591] enum: Add Flags and IntFlags

2016-09-02 Thread Roundup Robot
Roundup Robot added the comment: New changeset 31586a2f01b6 by Ethan Furman in branch 'default': issue23591: optimize _high_bit() https://hg.python.org/cpython/rev/31586a2f01b6 -- ___ Python tracker

[issue21122] CPython fails to build modules with LLVM LTO on Mac OS X

2016-09-02 Thread Brett Cannon
Brett Cannon added the comment: Here is a patch to turn on `-Wl,-export_dynamic` when building with LTO. Unfortunately I have a bunch of tests that fail when running with LTO+PGO of the form of: [ 95/398] test_bytes Traceback (most recent call last): File

[issue21122] CPython fails to build modules with LLVM LTO on Mac OS X

2016-09-02 Thread Brett Cannon
Changes by Brett Cannon : -- components: +Macintosh ___ Python tracker ___ ___

[issue26359] CPython build options for out-of-the box performance

2016-09-02 Thread Brett Cannon
Brett Cannon added the comment: So if I enable this manually, I get various test failures from modules on OS X El Capitan with the same type of failure: [ 95/398] test_bytes Traceback (most recent call last): File "/Users/brettcannon/Repositories/python/cpython/3.5/Lib/runpy.py", line 193,

[issue27945] Various segfaults with dict

2016-09-02 Thread Christian Heimes
Changes by Christian Heimes : -- nosy: +christian.heimes ___ Python tracker ___ ___

[issue26359] CPython build options for out-of-the box performance

2016-09-02 Thread Brett Cannon
Changes by Brett Cannon : -- assignee: brett.cannon -> dependencies: +CPython fails to build modules with LLVM LTO on Mac OS X ___ Python tracker

[issue27946] issues in elementtree and elsewhere due to PyDict_GetItem

2016-09-02 Thread tehybel
New submission from tehybel: I would like to describe an issue in the _elementtree module, and then propose a fix which would prevent this type of bug everywhere in the codebase. The issue exists in _elementtree_Element_get_impl in /Modules/_elementtree.c. Here is the code: static PyObject

[issue27945] Various segfaults with dict

2016-09-02 Thread Emanuel Barry
Changes by Emanuel Barry : -- nosy: +ebarry, larry, ned.deily, rhettinger, serhiy.storchaka priority: normal -> critical stage: -> needs patch title: five dictobject issues -> Various segfaults with dict type: -> crash ___

[issue27945] five dictobject issues

2016-09-02 Thread tehybel
Changes by tehybel : -- versions: +Python 3.5, Python 3.6 ___ Python tracker ___ ___

[issue27945] five dictobject issues

2016-09-02 Thread tehybel
New submission from tehybel: Here I'll describe five distinct issues I found. Common to them all is that they reside in the built-in dictionary object. Four of them are use-after-frees and one is an array-out-of-bounds indexing bug. All of the described functions reside in

[issue27944] two hotshot module issues

2016-09-02 Thread tehybel
New submission from tehybel: Here I'll describe two issues in the "hotshot" module which can be found in /Modules/_hotshot.c. Note that this module is for Python 2.7 only. The issues are (1) an uninitialized variable use and (2) a double free. Issue 1: uninitialized variable usage in

[issue27943] pstats.Stats: missing the source OS setting argument in strip_dirs() method

2016-09-02 Thread Jaroslav
New submission from Jaroslav: Forked from Issue 27902. The method cannot process the paths from different OS correctly. The optional argument will help, default = host OS settings as it is now. -- components: Windows messages: 274273 nosy: Jaroslav, paul.moore, steve.dower,

[issue27902] pstats.Stats: strip_dirs() method cannot handle file paths from different OS

2016-09-02 Thread Jaroslav
Jaroslav added the comment: The paragraph is ok. I'll open. Thanks a lot. -- ___ Python tracker ___ ___

[issue27928] Add hashlib.scrypt

2016-09-02 Thread Christian Heimes
Christian Heimes added the comment: It's not a limitation of the argument clinic. PyArg_Parse*() does not support required, keyword-only arguments without a default value. I'm using None as default value, require PyLong_Type and added some extra checks. -- Added file:

[issue27905] Add documentation for typing.Type

2016-09-02 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Michael, thank you for helping with this! Please take a look at my comments on the patch. -- nosy: +levkivskyi ___ Python tracker

[issue27919] Deprecate and remove extra_path distribution kwarg

2016-09-02 Thread Jason R. Coombs
Jason R. Coombs added the comment: Doing a quick search on Github, it seems there are [537 projects](https://github.com/search?utf8=%E2%9C%93=extra_path+filename%3Asetup.py=Code=searchresults) indicating `extra_path` in their setup.py. Many (most?) of those are using the feature to group

[issue22458] Add fractions benchmark

2016-09-02 Thread Stefan Krah
Stefan Krah added the comment: Which Stefan? :) Anyway, the first half of this issue was centered around the proposition that fractions are a "better decimal", and the latest pull request still has the "decimal backend" in it. :) Fast fractions have been around for a long time (Lisp/sbcl),

[issue27934] json float encoding incorrect for dbus.Double

2016-09-02 Thread Mark Dickinson
Mark Dickinson added the comment: Note that this will also change the results for JSON output of NumPy float64 values, so at the very least I'd expect this change to break (admittedly poorly written) unit tests / doctests. Python 2.7.12 (default, Jul 10 2016, 18:28:23) [GCC 4.2.1 Compatible

[issue26208] decimal C module's exceptions don't match the Python version

2016-09-02 Thread Mark Dickinson
Changes by Mark Dickinson : -- nosy: +mark.dickinson ___ Python tracker ___ ___

[issue27869] test failures under Bash on Windows

2016-09-02 Thread Brett Cannon
Brett Cannon added the comment: And with the latest patches applied, same hanging tests, but one less failure: test_asyncio test_asyncore test_epoll test_faulthandler test_fcntl test_ftplib test_httpservers test_import test_mmap test_multiprocessing_fork

[issue27936] Inconsistent round behavior between float and int

2016-09-02 Thread Mark Dickinson
Mark Dickinson added the comment: For the record, the float behaviour was changed (for Python 3.5) in http://bugs.python.org/issue19933. There didn't seem to be any particularly strong motivation for that change, but it's done now. -- ___ Python

[issue22458] Add fractions benchmark

2016-09-02 Thread STINNER Victor
STINNER Victor added the comment: Stefan Krah added the comment: > Fractions will shine in most benchmarks where decimal is exact anyway. According to Stefan's latest message, the purpose of the benchmark is not the compare decimal to fractions, but measure the performance of fractions for one

[issue27942] Default value identity regression

2016-09-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This likely is an interference of issue27095 with issue26148. I consider this as a regression. This causes not only a waste of memory, but can affect a performance, since comparing non-identical strings is slower than comparing identical strings.

[issue27942] Default value identity regression

2016-09-02 Thread Steven D'Aprano
Steven D'Aprano added the comment: Can confirm the expected behaviour (printing True) in Python 2.4 through 2.7, 3.3, Jython 2.5, and even venerable old Python 1.5 (where it prints 1). But *not* IronPython 2.6, where it prints False. In 3.6, the difference seems to be here: py> f =

[issue27934] json float encoding incorrect for dbus.Double

2016-09-02 Thread Mark Dickinson
Mark Dickinson added the comment: Yes. I'm fairly convinced about the bug part; it's the gratuitous breakage part that worries me. It wouldn't surprise me at all to find that there's someone out there who wants all their numbers to be written out to JSON with exactly 6 places after the point,

[issue27931] Email parse IndexError <""@wiarcom.com>

2016-09-02 Thread Xiang Zhang
Xiang Zhang added the comment: It should be. If there is anything wrong I'd like to hear and fix. -- ___ Python tracker ___

[issue27928] Add hashlib.scrypt

2016-09-02 Thread Xiang Zhang
Xiang Zhang added the comment: It looks good. But Christian, may I ask how do you generate the argument clinic? It looks from me that the declaration cannot give you such a format "y*|$y*O!O!O!ll:scrypt". I rerun clinic.py and the .c.h file is altered. Maybe it's better to abandon AC for

[issue27941] Bad error message from Decimal('garbage') across the py3 range

2016-09-02 Thread Stefan Krah
Stefan Krah added the comment: Hardly a bad error message, but see #26208. -- nosy: +skrah resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> decimal C module's exceptions don't match the Python version type: behavior -> enhancement

[issue27942] Default value identity regression

2016-09-02 Thread Kay Hayen
New submission from Kay Hayen: Consider this: def defaultKeepsIdentity(arg = "str_value"): print(arg is "str_value") defaultKeepsIdentity() This has been outputing "True" on every Python release I have seen so far, but not so on 3.6.0a4. Normally string values come from a "co_const" and

[issue22458] Add fractions benchmark

2016-09-02 Thread Stefan Krah
Stefan Krah added the comment: The reason is that the benchmark is a softball for fractions. Using the fastest fraction implementation (gmpy.mpq) and the best printing method for both types, gmpy.mpq seems to be about 2.5 to 3 times slower than decimal. It is however easy to generate

[issue27869] test failures under Bash on Windows

2016-09-02 Thread Brett Cannon
Brett Cannon added the comment: I re-ran the test suite in a directory not under /mnt/c to see if having a different file owner would change things and it did. test_logging and test_socket still hang, but the failures go down to 23: test_asyncio test_asyncore test_eintr test_epoll

[issue27941] Bad error message from Decimal('garbage') across the py3 range

2016-09-02 Thread Samuele Santi
New submission from Samuele Santi: Looks like, on some occasions, running ``Decimal('garbage')`` on Python 3.x decimal raises this error: decimal.InvalidOperation: [] instead of the usual: decimal.InvalidOperation: Invalid literal for Decimal: 'garbage' This seems to be caused by

[issue27928] Add hashlib.scrypt

2016-09-02 Thread Christian Heimes
Christian Heimes added the comment: You are right. Let's try this again. How do you like: >>> hashlib.scrypt(b'', n=2, r=2, p=3) Traceback (most recent call last): File "", line 1, in TypeError: salt is required >>> hashlib.scrypt(b'', salt=b'') Traceback (most recent call last): File "",

[issue27934] json float encoding incorrect for dbus.Double

2016-09-02 Thread Eddie James
Changes by Eddie James : Added file: http://bugs.python.org/file44349/json-float-repr-2.7.patch ___ Python tracker ___

[issue27934] json float encoding incorrect for dbus.Double

2016-09-02 Thread Eddie James
Eddie James added the comment: Python 2.7 also already behaves correctly for other dbus types: Python 2.7.6 (default, Jun 22 2015, 17:58:13) [GCC 4.8.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import dbus >>> import json >>> x = dbus.Int32(3) >>> x

[issue27456] asyncio: set TCP_NODELAY flag by default

2016-09-02 Thread Марк Коренберг
Марк Коренберг added the comment: vote +10 for that -- nosy: +mmarkk ___ Python tracker ___ ___

[issue27940] xml.etree: Avoid XML declaration for the "ascii" encoding

2016-09-02 Thread Stefan Behnel
Stefan Behnel added the comment: > By the way, I'm surprised that the special encoding "unicode" relies on the > *current* locale encoding when the XML declaration is requested. That seems a weird choice. Since it serialises to a Unicode string, it shouldn't have any XML declaration at all,

[issue27934] json float encoding incorrect for dbus.Double

2016-09-02 Thread Mark Dickinson
Mark Dickinson added the comment: > That's still using PyObject_Repr() which will call tp_repr for dbus.Double... > Any suggestions? Right, you'll want to replace that with a call to `PyFloat_Type.tp_repr(obj)`, as in the Python 3 code. We're in a bit of a grey area here: making this change

[issue27934] json float encoding incorrect for dbus.Double

2016-09-02 Thread R. David Murray
Changes by R. David Murray : -- resolution: third party -> stage: resolved -> needs patch status: closed -> open ___ Python tracker

[issue27934] json float encoding incorrect for dbus.Double

2016-09-02 Thread Eddie James
Eddie James added the comment: Wait what about the json C code for 2.7? That's still using PyObject_Repr() which will call tp_repr for dbus.Double... Any suggestions? -- ___ Python tracker

[issue27937] logging.getLevelName microoptimization

2016-09-02 Thread R. David Murray
R. David Murray added the comment: Parens do not cause lazy evaluation unless what is parenthesized is a generator comprehension. An expanded if solution is the correct one. If Vinay prefers a one liner, I think you could also write: _levelToName.get(level) or _nameToLevel.get(level) or

[issue27934] json float encoding incorrect for dbus.Double

2016-09-02 Thread Eddie James
Eddie James added the comment: Thanks Mark, yes you installed the right package. OK I didn't dig deep enough in the sub class. And yea, there shouldn't be any difference between float.__repr__ and float.__str__. Obviously repr calls the object's tp_repr method, while float.__repr__ calls the

[issue27931] Email parse IndexError <""@wiarcom.com>

2016-09-02 Thread R. David Murray
R. David Murray added the comment: You are correct, it is technically a valid angleaddr. I'll review this next week, the patch looks good (thanks) but I need to double check a couple things before I commit. -- assignee: -> r.david.murray stage: needs patch -> commit review

[issue22458] Add fractions benchmark

2016-09-02 Thread Stefan Behnel
Stefan Behnel added the comment: > So this benchmark cannot be used to show the superiority of exact fractions. I don't see how a benchmark would be a way to show that. It's certainly not the goal of this benchmark to show that one is computationally better than the other. But if a benchmark

[issue27934] json float encoding incorrect for dbus.Double

2016-09-02 Thread Mark Dickinson
Mark Dickinson added the comment: > Nothing that can/should be done on the stdlib side, then. I think there's nothing to do for 3.x: as far as I can tell, everything should be working exactly as desired there. For 2.7, we may want to consider processing float instances using `float.__repr__`

[issue27934] json float encoding incorrect for dbus.Double

2016-09-02 Thread Mark Dickinson
Mark Dickinson added the comment: > Dbus.Double is not a subclass of float unfortunately. Okay, now I'm *really* confused. :-) If it's not a subclass of `float`, then how do you end up in the `floatstr` code? Every path to that code that I can see in the source is via an `isinstance(,

[issue23591] enum: Add Flags and IntFlags

2016-09-02 Thread Ethan Furman
Ethan Furman added the comment: > Yes, you're correct here, but what about output? Do all relevant bits have > to be named separately? No. > And will the output always talk about separate > bits? No. > We have talked about this. Indeed. Here's my previous reply. ;) >> The algorithm is

[issue27934] json float encoding incorrect for dbus.Double

2016-09-02 Thread R. David Murray
R. David Murray added the comment: Nothing that can/should be done on the stdlib side, then. -- nosy: +r.david.murray resolution: -> third party stage: -> resolved status: open -> closed ___ Python tracker

[issue16334] Faster unicode-escape and raw-unicode-escape codecs

2016-09-02 Thread STINNER Victor
STINNER Victor added the comment: > Did you benchmark this change? I afraid that this inflates execution code > size and can have negative impact on the performance. I consider that readability (maintainability) matters more than such micro optimization. --

[issue16334] Faster unicode-escape and raw-unicode-escape codecs

2016-09-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > Unicode escape encodecs were modified by the issue #25353 to use the > _PyBytesWriter API. Sadly, I didn't benchmark my change before pushing it > :-/ You can benchmark it now by checking out revisions with your patch and just before. But AFAIK the

[issue27934] json float encoding incorrect for dbus.Double

2016-09-02 Thread Eddie James
Eddie James added the comment: Understood on 2.7, I wasn't aware it would cause any issues. Dbus.Double is not a subclass of float unfortunately. Problem is that all Dbus types seem to have a custom tp_repr method that returns that strange formatting I mentioned. So repr won't be the same as

[issue27898] regexp performance degradation between 2.7.6 and 2.7.12

2016-09-02 Thread Steve Newcomb
Steve Newcomb added the comment: On 08/30/2016 12:46 PM, Raymond Hettinger wrote: > Raymond Hettinger added the comment: > > It would be helpful if you ... make a small set of regular expressions that > demonstrate the performance regression. > Done. Attachments: test.py : Code that exercises

[issue27934] json float encoding incorrect for dbus.Double

2016-09-02 Thread Eric V. Smith
Changes by Eric V. Smith : -- nosy: +eric.smith ___ Python tracker ___ ___

[issue16334] Faster unicode-escape and raw-unicode-escape codecs

2016-09-02 Thread STINNER Victor
STINNER Victor added the comment: I rebased faster_unicode_escape_4.patch and made tiny changes: * Rename WRITECHAR macro to WRITE_ASCII_CHAR() * Add WRITE_CHAR() macro to avoid "goto writechar;" * Drop the "store" label: use WRITE_CHAR() macro instead, expect that getcode() only returns valid

[issue27921] f-strings: do not allow backslashes

2016-09-02 Thread Eric V. Smith
Eric V. Smith added the comment: > This looks a little ugly. True. My goal is to get the simplest possible thing working now, and then before beta 2 fix it so that backslashes again work in the text portions of an f-string. After that, I'll fix this particular piece of code (and the others,

[issue22458] Add fractions benchmark

2016-09-02 Thread Stefan Krah
Stefan Krah added the comment: I've left comments on GitHub. [scoder] > As I said, where ever exact calculations are needed.. Even if the formatting comment is addressed, the main problem with this benchmark is that *both* fraction and decimal calculations are in fact exact here. You can

[issue16334] Faster unicode-escape and raw-unicode-escape codecs

2016-09-02 Thread STINNER Victor
STINNER Victor added the comment: Unicode escape encodecs were modified by the issue #25353 to use the _PyBytesWriter API. Sadly, I didn't benchmark my change before pushing it :-/ Your patch basically reverts my change. > Py3.2Py3.3Py3.6Py3.6+patch > 195 (+136%) 109

[issue27938] PyUnicode_AsEncodedString, PyUnicode_Decode: add fast-path for "us-ascii" encoding

2016-09-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See also get_standard_encoding() in Python/codecs.c. I suppose it is faster. UTF-32 is rarely used as external encoding, but it is still used as internal encoding in some programming languages and libraries (e.g. wchar_t* in C and std::wstring in C++ on

[issue27940] xml.etree: Avoid XML declaration for the "ascii" encoding

2016-09-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > By the way, I'm surprised that the special encoding "unicode" relies on the > *current* locale encoding when the XML declaration is requested. Why not > alway susing UTF-8 for *unicode* instead of the locale encoding? Because it is usually outputs to

[issue23591] enum: Add Flags and IntFlags

2016-09-02 Thread Vedran Čačić
Vedran Čačić added the comment: > Nope. You are welcome to give more meaningful names to different > combinations of powers of two. Yes, you're correct here, but what about output? Do all relevant bits have to be named separately? And will the output always talk about separate bits? We have

[issue27456] asyncio: set TCP_NODELAY flag by default

2016-09-02 Thread STINNER Victor
Changes by STINNER Victor : -- title: TCP_NODELAY -> asyncio: set TCP_NODELAY flag by default ___ Python tracker ___

[issue24648] Allocation of values array in split dicts should use small object allocator.

2016-09-02 Thread STINNER Victor
Changes by STINNER Victor : -- resolution: -> fixed status: open -> closed ___ Python tracker ___

[issue27915] Use 'ascii' instead of 'us-ascii' to bypass lookup machinery

2016-09-02 Thread STINNER Victor
STINNER Victor added the comment: It looks like the email module has a special usage of the "us-ascii" encoding name. It's not just an alias to "ascii". So I proposed a patch implementing the fast-path differently in the Python builtin codecs: see my issue #27938. The xml.etree module has

[issue27940] xml.etree: Avoid XML declaration for the "ascii" encoding

2016-09-02 Thread STINNER Victor
STINNER Victor added the comment: Note: I found the "us-ascii" special case when reviewing the issue #27915 which proposed to replace "us-ascii" with "ascii" in the xml.etree module to use the Python fast-path for performance. -- ___ Python tracker

[issue27940] xml.etree: Avoid XML declaration for the "ascii" encoding

2016-09-02 Thread STINNER Victor
New submission from STINNER Victor: The ElementTree module (xml.etree) avoids the XML declaration for "utf-8" and "us-ascii" codecs, but not for the "ascii" encoding. Attached patch avoids the XML declaration for the "ascii" codec since it's a subset of UTF-8 and UTF-8 is the default encoding

[issue27934] json float encoding incorrect for dbus.Double

2016-09-02 Thread Mark Dickinson
Mark Dickinson added the comment: > I propose a change to use str() for float objects as well. This could be > ported back to 2.7 as well That would be a behaviour change for 2.7, and an undesirable one. `str` loses precision in Python 2, so e.g., `json.loads(json.dumps(pi)) == pi` would no

[issue27928] Add hashlib.scrypt

2016-09-02 Thread Xiang Zhang
Xiang Zhang added the comment: It looks that new patch when used like this hashlib.scrypt(b'password') will generate a "an integer is required" exception message which is misleading. I don't test it since I don't get openssl 1.1. And the phrase "interpreted as buffers of bytes" in the doc may

[issue26470] Make OpenSSL module compatible with OpenSSL 1.1.0

2016-09-02 Thread Bernard Spil
Bernard Spil added the comment: Sorry for the noise Christian, I thought the former EGD handling was still in place. That was fixed with https://github.com/python/cpython/commit/968ec1d29b44ca7a600df5984adff00a78392368 on 07 Jul 2016 -- ___ Python

[issue27939] Tkinter mainloop raises when setting the value of ttk.LabeledScale

2016-09-02 Thread Goyo
New submission from Goyo: Calling mainloop after setting the value of a ttk.LabeledScale raises an error. The same happens if the value is set after entering the mainloop. Does not affect python 3.4.3. Does not affect ttk.Scale. No error is raised if you do not call mainloop. import tkinter

[issue27938] PyUnicode_AsEncodedString, PyUnicode_Decode: add fast-path for "us-ascii" encoding

2016-09-02 Thread STINNER Victor
New submission from STINNER Victor: The "us-ascii" encoding is an alias to the Python ASCII encoding. PyUnicode_AsEncodedString() and PyUnicode_Decode() functions have a fast-path for the "ascii" string, but not for "us-ascii". Attached patch uses also the fast-path for "us-ascii". It's a

[issue27779] Sync-up docstrings in C version of the the decimal module

2016-09-02 Thread Stefan Krah
Stefan Krah added the comment: "hand written signatures" refers to the signatures that Argument Clinic would generate if it were used (but I don't want that). So this is an example of a hand written signature: "is_infinite($self, /)\n--\n\n\" I still wonder if people wouldn't be served

[issue26470] Make OpenSSL module compatible with OpenSSL 1.1.0

2016-09-02 Thread Christian Heimes
Christian Heimes added the comment: Yes, I plan to change this for Python 3.7 along with #27876. -- ___ Python tracker ___

[issue26470] Make OpenSSL module compatible with OpenSSL 1.1.0

2016-09-02 Thread Christian Heimes
Christian Heimes added the comment: Bernard, where do you see HAVE_RAND_EGD in my patch or in any recent version of _ssl.c? There is no reference to HAVE_RAND_EGD. The patches use OPENSSL_NO_EGD. -- ___ Python tracker

[issue27937] logging.getLevelName microoptimization

2016-09-02 Thread Ondřej Medek
Ondřej Medek added the comment: That's probably my lack of Python knowledge. I have though that parentheses in ("Level %s" % level) cause lazy evaluation. If not, then this code has to be optimized by if-then, too. -- ___ Python tracker

[issue27928] Add hashlib.scrypt

2016-09-02 Thread Christian Heimes
Christian Heimes added the comment: Here is a new patch with argument clinic, more tests and required keyword arguments. -- Added file: http://bugs.python.org/file44344/Add-hashlib.scrypt-2.patch ___ Python tracker

[issue27937] logging.getLevelName microoptimization

2016-09-02 Thread Xiang Zhang
Xiang Zhang added the comment: No, I mean this method you propose: return _levelToName.get(level, (_nameToLevel.get(level, ("Level %s" % level I cannot see any difference with the original code, except parentheses. -- ___ Python tracker

[issue27937] logging.getLevelName microoptimization

2016-09-02 Thread Ondřej Medek
Ondřej Medek added the comment: Which 'first' method do you mean? logging.getLevelName() converts level (int) to level name (str). But due to the backward compatibility is also converts level name (str) to level (int). -- ___ Python tracker

[issue27936] Inconsistent round behavior between float and int

2016-09-02 Thread Mark Dickinson
Mark Dickinson added the comment: The test could be strengthened to add a check that the types of `round(x)` and `round(x, None)` match. -- ___ Python tracker

[issue27936] Inconsistent round behavior between float and int

2016-09-02 Thread Mark Dickinson
Mark Dickinson added the comment: Ah, sorry; now that I've looked at the patch, I see I misunderstood. You're not replacing None with zero; you're replacing it with NULL. Patch LGTM. -- ___ Python tracker

[issue27936] Inconsistent round behavior between float and int

2016-09-02 Thread Mark Dickinson
Mark Dickinson added the comment: > I think the round() function should explicitly check for None and replace it > with zero That would be a change in behaviour: `round(x)` is not the same as `round(x, 0)`. For most types, `round(x)` returns an `int`, while `round(x, 0)` returns something of

[issue27937] logging.getLevelName microoptimization

2016-09-02 Thread Xiang Zhang
Xiang Zhang added the comment: What's the meaning of the first method? -- nosy: +xiang.zhang ___ Python tracker ___

[issue27937] logging.getLevelName microoptimization

2016-09-02 Thread Ondřej Medek
New submission from Ondřej Medek: The logging.getLevelName contains code: return _levelToName.get(level, _nameToLevel.get(level, ("Level %s" % level))) I am still a Python beginner, but I think the most of the times the _nameToLevel.get is called unnecessarily. IMHO the code should be return

[issue27935] logging level FATAL missing in _nameToLevel

2016-09-02 Thread Xiang Zhang
Xiang Zhang added the comment: Though FATAL is not mentioned in the doc, but I think it should be added to getLevelName, just like how WARN is handled now: >>> logging.getLevelName("WARN") 30 -- keywords: +patch nosy: +xiang.zhang Added file:

[issue27936] Inconsistent round behavior between float and int

2016-09-02 Thread Raymond Hettinger
Changes by Raymond Hettinger : Added file: http://bugs.python.org/file44342/fix_round_default_none_with_test.diff ___ Python tracker

[issue27936] Inconsistent round behavior between float and int

2016-09-02 Thread Raymond Hettinger
Changes by Raymond Hettinger : Removed file: http://bugs.python.org/file44341/fix_round_default_none.diff ___ Python tracker ___

[issue27936] Inconsistent round behavior between float and int

2016-09-02 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- keywords: +patch Added file: http://bugs.python.org/file44341/fix_round_default_none.diff ___ Python tracker

[issue27936] Inconsistent round behavior between float and int

2016-09-02 Thread Raymond Hettinger
Raymond Hettinger added the comment: The different data types make different choices: >>> from decimal import Decimal >>> from fractions import Fraction >>> (1).__round__(None) Traceback (most recent call last): File "", line 1, in (1).__round__(None) TypeError: 'NoneType'

[issue27931] Email parse IndexError <""@wiarcom.com>

2016-09-02 Thread Xiang Zhang
Xiang Zhang added the comment: Looking at the spec this is a valid angle addr. Not only et_angle_addr('<""@wiarcom.com> SIZE=28113')[0].addr_spec but also et_angle_addr('<""@wiarcom.com> SIZE=28113')[0].local_part fails for the same reason. The problem exists in get_bare_quoted_string. When

[issue27935] logging level FATAL missing in _nameToLevel

2016-09-02 Thread SilentGhost
Changes by SilentGhost : -- nosy: +vinay.sajip ___ Python tracker ___ ___

[issue27936] Inconsistent round behavior between float and int

2016-09-02 Thread Jonatan Skogsfors
New submission from Jonatan Skogsfors: Theo error handling for round is different for float and int. Python 3.5.1 (default, Apr 18 2016, 11:46:32) [GCC 4.2.1 Compatible Apple LLVM 7.3.0 (clang-703.0.29)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>>

  1   2   >