[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2018-03-12 Thread Robert Smallshire
Robert Smallshire added the comment: To respond to Raymond's points: 1) Nobody is suggesting that every float method should also be available on int. Clearly some methods on float are not applicable to int. 2) Taken narrowly, you're right that is_integer() does nothing

[issue33055] bytes does not implement __bytes__()

2018-03-12 Thread FHTMitchell
New submission from FHTMitchell : Every object which has a corresponding dunder protocol also implements said protocol with one exception: >>> 'hello'.__str__() 'hello' >>> (3.14).__float__() 3.14 >>> (101).__int__() 101 >>> True.__bool__() True >>>

[issue32608] Incompatibilities with the socketserver and multiprocessing packages

2018-03-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: Hi Michael, sorry for the silence on this issue. I think the ProcessingMixIn feature is a good idea, I'll give the PR a review when I get the time. -- versions: -Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7

[issue33042] New 3.7 startup sequence crashes PyInstaller

2018-03-12 Thread Nick Coghlan
Nick Coghlan added the comment: Adding a bit of context from my prior email discussion with Hartmut: CPython actually reads sys.warnoptions at the end of Py_Initialize (its the last thing we do before the function returns). It also reads sys._xoptions during startup,

[issue22674] RFE: Add signal.strsignal(): string describing a signal

2018-03-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: This is now pushed. Thank you Antoine! -- nosy: +pitrou ___ Python tracker ___

[issue22674] RFE: Add signal.strsignal(): string describing a signal

2018-03-12 Thread Antoine Pitrou
Change by Antoine Pitrou : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.8 -Python 3.5 ___ Python tracker

[issue33042] New 3.7 startup sequence crashes PyInstaller

2018-03-12 Thread STINNER Victor
STINNER Victor added the comment: Python documentation was enhanced in Python 3.7 to explicitly list all functions safe to call *before* Py_Initialize(): https://docs.python.org/dev/c-api/init.html#before-python-initialization PySys_AddWarnOption() is not part of

Re: Flask: request vs Request

2018-03-12 Thread Andrew Z
Thank you Christopher. On Mar 12, 2018 09:10, "Christopher Mullins" wrote: > Could you please give some context when you reply, TIA >> > > Whoops, thanks for the reminder Mark. > > So what for the Request is used for then? > > > In general when you see that

Re: Enumerating all 3-tuples

2018-03-12 Thread Robin Becker
It's possible to generalize the cantor pairing function to triples, but that may not give you what you want. Effectively you can generate an arbitrary number of triples using an iterative method. My sample code looked like this import math def cantor_pair(k1,k2): return

Re: Flask: request vs Request

2018-03-12 Thread Christopher Mullins
> > Could you please give some context when you reply, TIA > Whoops, thanks for the reminder Mark. So what for the Request is used for then? In general when you see that something in Python starts with a capital letter, that indicates a class. Check out the relevant section of the PEP8 coding

[issue33054] unittest blocks when testing function using multiprocessing.Pool with state spawn

2018-03-12 Thread Kenneth Chik
New submission from Kenneth Chik : I am not sure if this is python or OS problem, I just installed Ubuntu 18.04 LTS which comes with python3 v3.6.4. When I try to unittest code which contains multiprocessing.Pool with spawn, the unittest.main() blocks after completing all

[issue26701] Documentation for int constructor mentions __int__ but not __trunc__

2018-03-12 Thread Nick Coghlan
Nick Coghlan added the comment: With both Eric's and Serhiy's updates merged, and issue 33039 broken out for the __index__ oddities, this is resolved now. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed

[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2018-03-12 Thread Mark Dickinson
Mark Dickinson added the comment: One quibble with Raymond's response: > 2) Your use case is trivially solved in a portable, trivial, and readable > > way: > >a == int(a) For Decimal, I'd recommend using `a == a.to_integral_value()` instead. Using `a == int(a)`

[issue33018] Improve issubclass() error checking and message

2018-03-12 Thread Joshua Bronson
Joshua Bronson added the comment: I'll share the use case that prompted me to submit this PR in the first place. I am the author of bidict (https://pypi.python.org/pypi/bidict), which provides a bidirectional dict class. A bidict is just like a dict, except it

[issue29712] --enable-optimizations does not work with --enable-shared

2018-03-12 Thread Eric Dujardin
Eric Dujardin added the comment: I have the same error when building 3.6.4, however not exactly with the same options. Some context first: $ lsb_release -d; lscpu |head -1 Description:Ubuntu 14.04.5 LTS Architecture: x86_64 $ gcc --version gcc

[issue33042] New 3.7 startup sequence crashes PyInstaller

2018-03-12 Thread Nick Coghlan
Change by Nick Coghlan : -- assignee: -> ncoghlan ___ Python tracker ___ ___

[issue33042] New 3.7 startup sequence crashes PyInstaller

2018-03-12 Thread Nick Coghlan
Nick Coghlan added the comment: I don't think we made any start-up changes that were specific to PySys_AddWarnOption, so my suspicion is that the crash is going to be related to a change in the constraints on either the unicode object creation or the list append

[issue22102] Zipfile generates Zipfile error in zip with 0 total number of disk in Zip64 end of central directory locator

2018-03-12 Thread Thomas Kluyver
Thomas Kluyver added the comment: I found source code for some other projects handling the same data. They all seem to agree that it should be 1: - Golang's zip reading code:

[issue33053] Running a module with `-m` will add empty directory to sys.path

2018-03-12 Thread Antti Haapala
New submission from Antti Haapala : I think this is a really stupid security bug. Running a module with `-mmodule` seems to add '' as a path in sys.path, and in front. This is doubly wrong, because '' will stand for whatever the current working directory might happen to be

[issue32719] fatal error raised when Ctrl-C print loop

2018-03-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: Yes, I don't think this can be fixed in an easy way. Let's say that users will have to live with that. -- resolution: -> wont fix stage: -> resolved status: open -> closed ___ Python tracker

[issue22102] Zipfile generates Zipfile error in zip with 0 total number of disk in Zip64 end of central directory locator

2018-03-12 Thread Thomas Kluyver
Thomas Kluyver added the comment: Do you know what tool created the zip file? I can't find anything in the spec (https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT ) to say whether 0 is a valid value for the number of disks. -- nosy: +takluyver

[issue32489] Allow 'continue' in 'finally' clause

2018-03-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: If there are no objections I'll merge this PR soon. -- versions: +Python 3.8 -Python 3.7 ___ Python tracker

Re: __import__ fails randomly due to missing file

2018-03-12 Thread Arkadiusz Bulski
I inserted importlib.invalidate_caches() instead of os.sync() and at a glance, it seems to have fixed it. Big thanks Paul! pon., 12 mar 2018 o 11:00 użytkownik Paul Moore napisał: > On 12 March 2018 at 09:12, Arkadiusz Bulski wrote: > > Hi, > > > >

Re: __import__ fails randomly due to missing file

2018-03-12 Thread Paul Moore
On 12 March 2018 at 09:12, Arkadiusz Bulski wrote: > Hi, > > For the record, I am the developer of Construct library. And the question > relates to it. > https://construct.readthedocs.io/en/latest/# > > I have an issue of Travis failing randomly at test cases. The cause is

__import__ fails randomly due to missing file

2018-03-12 Thread Arkadiusz Bulski
Hi, For the record, I am the developer of Construct library. And the question relates to it. https://construct.readthedocs.io/en/latest/# I have an issue of Travis failing randomly at test cases. The cause is always __import__ failing to import a dynamically generated code. Library generates a

[issue32174] nonASCII punctuation characters can not display in python363.chm.

2018-03-12 Thread Ma Lin
Ma Lin added the comment: The source code of .chm changed between 3.6.2 and 3.6.3, the former uses escaped html entities. I couldn't find out which commit caused this change. 3.6.2 chm: Whats New In Python 3.6 3.6.3 chm: What抯 New In Python 3.6 3.6.2 chm: Summary Release

[issue33040] Make itertools.islice supports negative values for start and stop arguments for sized iterable object

2018-03-12 Thread TitanSnow
TitanSnow added the comment: Now I have thought about it and realized that it's not suitable for islice. But there's still a common use case to drop some elements from the beginning or ending of a iterable, which is also a main reason why I wanted islice to support

Can mock.mock_open.read return different values?

2018-03-12 Thread Tim Golden
I'm contributing to a codebase which makes heavy use of mock in the test suite, a technique which I'm aware of but have used only rarely. In one situation it uses mock.mock_open(read_data="...") and then asserts again mock_open.return_value.read.call_count. A code change I've made results in

[issue27645] Supporting native backup facility of SQLite

2018-03-12 Thread Lele Gaifax
Lele Gaifax added the comment: Sorry, I could not find an easy enough way to compile against SQLite 3.8.7.1, being on Debian sid myself (3.22). I hope to find some time to try harder. -- ___ Python tracker

[issue33050] Centralized documentation of assumptions made by C code

2018-03-12 Thread Benjamin Peterson
Benjamin Peterson added the comment: In general, we try to confine ourselves to C99 aside from widely supported extensions like intXX_t (no one wants to go around writing int_least32_t). -- nosy: +benjamin.peterson ___ Python

<    1   2