[issue31898] Add `recommended-packages.txt` to `venv` documentation

2017-10-29 Thread Nick Coghlan
Nick Coghlan added the comment: https://bugs.python.org/issue31899 is a follow-up issue to discuss whether or not it would make sense to expand these recommendations to cover explicit compatibility testing against these libraries for CPython updates --

[issue31899] Ensure backwards compatibility with recommended packages

2017-10-29 Thread Nick Coghlan
New submission from Nick Coghlan : This is a potential follow-up to issue 31898, whereby the recommended packages list could be taken into account as part of CPython's own testing regime. The gist of the idea would be to: 1. Update the recommended-packages list to nominate

[issue31898] Add `recommended-packages.txt` to `venv` documentation

2017-10-29 Thread Nick Coghlan
Change by Nick Coghlan : -- stage: -> needs patch type: -> enhancement ___ Python tracker ___

[issue31898] Add `recommended-packages.txt` to `venv` documentation

2017-10-29 Thread Nick Coghlan
New submission from Nick Coghlan : As per the python-ideas thread starting at https://mail.python.org/pipermail/python-ideas/2017-October/047508.html, this is proposal to add a `pip -r` compatible `recommended-packages.txt` file to the `venv` documentation that summarises

Re: ValueError: Error 3 while encrypting in ECB mode

2017-10-29 Thread Steve D'Aprano
On Mon, 30 Oct 2017 01:20 pm, Ho Yeung Lee wrote: from Crypto.Cipher import AES key = 'mysecretpassword' plaintext = 'Secret Message A' encobj = AES.new(key, AES.MODE_ECB) ciphertext = encobj.encrypt("hello") > Traceback (most recent call last): > File "", line 1,

Re: Invoking return through a function?

2017-10-29 Thread Rustom Mody
On Sunday, October 29, 2017 at 9:52:01 PM UTC+5:30, Rick Johnson wrote: > On Sunday, October 29, 2017 at 9:19:03 AM UTC-5, Alberto Riva wrote: > > In a language like Lisp > > Python is nothing like Lisp, and for good reason! Sure, we > have a few lispers and functional fanboys who hang around >

[issue31897] RecursionError in plistlib.loads

2017-10-29 Thread Ned Williamson
Ned Williamson added the comment: ``` import plistlib dat = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00AAAnAAA' plistlib.loads(dat, fmt=plistlib.FMT_BINARY) ``` raises ``` Traceback (most recent call last):

[issue31897] RecursionError in plistlib.loads

2017-10-29 Thread Ned Williamson
Ned Williamson added the comment: ``` import plistlib dat = b'AAAwAAA\xc9A\x9cAA\x00\x00\x00\x00\x00\x00\x00\x0b\x00\x00A\x04\xb2\xaaAA' plistlib.loads(dat, fmt=plistlib.FMT_BINARY) ``` raises ``` Traceback (most recent call

[issue31897] RecursionError in plistlib.loads

2017-10-29 Thread Ned Williamson
Ned Williamson added the comment: I'm filing related bugs under this same issue. ``` import plistlib dat = b'Q\xe4\xfeAIwAAA\xc9A\xc1AAA\xc1AAA\x9cAAnAAA\x00\x00\x00\x00\x00\x00\x00\x0b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00AA'

[issue31897] RecursionError in plistlib.loads

2017-10-29 Thread Ned Williamson
Ned Williamson added the comment: The crashing version numbers are from testing on the release Python 3.5, but I think we can just fix this in 3.7+. -- ___ Python tracker

[issue31897] RecursionError in plistlib.loads

2017-10-29 Thread Ned Williamson
New submission from Ned Williamson : Hi, The following program crashes for me using the current Python3.7 master: ``` import plistlib plistlib.loads(b'\xdd\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' b'\xda\x0cw\xb7\x00\x00\x00\x00\x00\x00\x00\xc7\x00'

[issue31896] In function define class inherit ctypes.structure, and using ctypes.pointer leak memory

2017-10-29 Thread Yang Big
New submission from Yang Big : Here my code: 2 import sys 3 import ctypes 4 5 6 def hi(): 7 class timespec(ctypes.Structure): 8 ┆ """Time specification, as described in clock_gettime(3).""" 9 ┆ _fields_ = (('tv_sec',

Re: why it append one more letter after decode?

2017-10-29 Thread Ho Yeung Lee
i fixed by replace("","\\") On Monday, October 30, 2017 at 11:16:02 AM UTC+8, Igor Korot wrote: > Hi, > > On Sun, Oct 29, 2017 at 10:03 PM, Ho Yeung Lee wrote: > > i discover when > > it > > decode("\\",1,2) > > in interactive console > > is [ > > > > but decode in

Re: why it append one more letter after decode?

2017-10-29 Thread Igor Korot
Hi, On Sun, Oct 29, 2017 at 10:03 PM, Ho Yeung Lee wrote: > i discover when > it > decode("\\",1,2) > in interactive console > is [ > > but decode in big project > it see as > decode(r"\\",1,2) > [[ > > it double Those 2 lines are different. Thank you. > > On Monday,

Re: why it append one more letter after decode?

2017-10-29 Thread Ho Yeung Lee
it seems that it read csv file from "\\" to "" On Monday, October 30, 2017 at 11:03:57 AM UTC+8, Ho Yeung Lee wrote: > i discover when > it > decode("\\",1,2) > in interactive console > is [ > > but decode in big project > it see as > decode(r"\\",1,2) > [[ > > it double > > On Monday,

Re: why it append one more letter after decode?

2017-10-29 Thread Igor Korot
Hi, On Sun, Oct 29, 2017 at 8:50 PM, Ho Yeung Lee wrote: > > if run these function to decode in python interactive console, > it can decode correct, You probably changed the code somewhere... You just need to debug it and see what is happening... Thank you. > > but when

Re: why it append one more letter after decode?

2017-10-29 Thread Ho Yeung Lee
i discover when it decode("\\",1,2) in interactive console is [ but decode in big project it see as decode(r"\\",1,2) [[ it double On Monday, October 30, 2017 at 9:51:01 AM UTC+8, Ho Yeung Lee wrote: > if run these function to decode in python interactive console, > it can decode correct, >

Re: Coding style in CPython implementation

2017-10-29 Thread Στέφανος Σωφρονίου
On Monday, October 30, 2017 at 2:35:13 AM UTC+2, ROGER GRAYDON CHRISTMAN wrote: > NOTE: The case in question was never comparing to True; it was comparing to > NULL. > > There is no "No: if x == None" below, because None is not Boolean. > Similarly comparing a pointer to NULL is not the same

ValueError: Error 3 while encrypting in ECB mode

2017-10-29 Thread Ho Yeung Lee
>>> from Crypto.Cipher import AES >>> >>> key = 'mysecretpassword' >>> plaintext = 'Secret Message A' >>> encobj = AES.new(key, AES.MODE_ECB) >>> ciphertext = encobj.encrypt("hello") Traceback (most recent call last): File "", line 1, in File

Re: why it append one more letter after decode?

2017-10-29 Thread Ho Yeung Lee
if run these function to decode in python interactive console, it can decode correct, but when run with a big project, it append a letter Y On Monday, October 30, 2017 at 9:48:36 AM UTC+8, Ho Yeung Lee wrote: > def leftrotate(l, n): > return l[n:] + l[:n] > > def rightrotate(l, n): >

[issue31894] test_timestamp_naive failed on NetBSD

2017-10-29 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > The documentation only says “datetime.timestamp” calls “mktime” Indeed. See . This is a documentation bug. Since 3.6 the timestamp does not

[issue31895] Native hijri calendar support

2017-10-29 Thread Steven D'Aprano
Steven D'Aprano added the comment: Python 2.7 is in feature freeze, so 3.7 is the absolute earliest this could be introduced. Given how close we are to 3.7 feature freeze, 3.8 is more likely. I don't think we would have any objections to supporting hijri calendar,

why it append one more letter after decode?

2017-10-29 Thread Ho Yeung Lee
def leftrotate(l, n): return l[n:] + l[:n] def rightrotate(l, n): return l[-n:] + l[:-n] def encode(s, k, kk): l = [ord(i) for i in s] return leftrotate(''.join([chr(i + k) for i in l]), kk) def decode(s, k, kk): l = [ord(i) for i in rightrotate(s, kk)] return

[issue31894] test_timestamp_naive failed on NetBSD

2017-10-29 Thread Martin Panter
Martin Panter added the comment: Are you sure it is a “system” bug? As far as I understand, at least Posix does not require support for local time before 1970. See . But why is

[issue31895] Native hijri calendar support

2017-10-29 Thread Haneef
Haneef added the comment: This feature can be added to the (datetime.py)[https://docs.python.org/3/library/datetime.html], Java has done a similar move and it makes the whole process a lot easier. The Hijri calendar is used across the globe by various websites and

Re: Invoking return through a function?

2017-10-29 Thread Steve D'Aprano
On Mon, 30 Oct 2017 06:09 am, Alberto Riva wrote: > But that's exactly why I would like to be able to use macros. I think > that being able to write "return if this happens" is much more explicit > than having to write the full if statement, every time. There have been proposals in the past for

[issue31895] Native hijri calendar support

2017-10-29 Thread Haneef
New submission from Haneef : There should be native support for converting between Hijri (Umm al-Qura), Gregorian, Julian and UnixTime calendars. Many big players have included native support for Hijri calendar in their SDKs and software. Below are some: (Java Hijri

Re: Invoking return through a function?

2017-10-29 Thread Steve D'Aprano
On Mon, 30 Oct 2017 02:35 am, Stefan Ram wrote: > So, I guess, we then must accept that sometimes - under > extraordinary circumstances - it should be tolerated to > write a function that is as long as six lines. An entire six lines... you cowboy! *wink* -- Steve “Cheer up,” they

Re: Invoking return through a function?

2017-10-29 Thread Steve D'Aprano
On Mon, 30 Oct 2017 03:35 am, Alberto Riva wrote: > On 10/29/2017 10:35 AM, Steve D'Aprano wrote: [...] >> You mean *less* explicit. "checkKey" gives absolutely no hint that it >> causes the current function to return. > > That's just because I used a name that was too generic in my example. I

Re: Coding style in CPython implementation

2017-10-29 Thread ROGER GRAYDON CHRISTMAN
NOTE: The case in question was never comparing to True; it was comparing to NULL. There is no "No: if x == None" below, because None is not Boolean. Similarly comparing a pointer to NULL is not the same as comparing it to a Boolean. So I would favor the "Explicit is better than Implicit" in

[issue31894] test_timestamp_naive failed on NetBSD

2017-10-29 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I am not sure. This is a system bug and we often provide work-arounds or even reimplementations of buggy time functions in the time and datetime modules. Whether or not this is something that is worth fixing is a question

[issue31894] test_timestamp_naive failed on NetBSD

2017-10-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I'm not a datetime expert. What is the better way to skip the test? Is it worth to change the date to say (1970, 3, 9) for which the correct result is obtained on this system? -- ___

[issue31894] test_timestamp_naive failed on NetBSD

2017-10-29 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I posted a wrong command, but fortunately I am in New York, so it did not matter $ TZ=EST+05EDT,M3.2.0,M11.1.0 python -c 'import time;print(time.localtime(14400)[:])' (1969, 12, 31, 23, 0, 0, 2, 365, 0) --

Re: Sandsifter software finds hidden instructions inside processors.

2017-10-29 Thread skybuck2000
I do remember a very rare and extreme Windows 7 system hang not so long ago. It was probably caused by having to many FireFox tabs open... and somehow a website/FireFox managed to "hang windows 7". Windows 7 might have been busy trying to write data to the harddisk and somehow during that

[issue31894] test_timestamp_naive failed on NetBSD

2017-10-29 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I hate this long form display! Next time please use time.localtime(14400)[:]. Do you agree that this is a system bug? On my Mac, I get $ python -c 'import time; print(time.localtime(14400)[:])' (1969, 12, 31, 23, 0, 0,

[issue31894] test_timestamp_naive failed on NetBSD

2017-10-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: $ TZ=EST+05EDT,M3.2.0,M11.1.0 ./python -c 'import time; print(time.localtime(14400))' time.struct_time(tm_year=1970, tm_mon=1, tm_mday=1, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=3, tm_yday=1, tm_isdst=1) --

[issue31894] test_timestamp_naive failed on NetBSD

2017-10-29 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I don't have access to NetBSD and this looks like a bug in the system implementation of localtime. The timestamp method is implemented by probing system localtime in the vicinity of UTC timestamp. What does

Re: Invoking return through a function?

2017-10-29 Thread Alberto Riva
As suggested by Ned I'm going to stop replying after pointing out just a couple of things. The most important one is the following: > But since your assertion of: "Python, like Lisp, has X,Y and > Z features in common" and furthermore that: "I cannot find > another language that has exactly

Re: Sandsifter software finds hidden instructions inside processors.

2017-10-29 Thread skybuck2000
I am going to issue a warning about all of this software: SandSifter, Linux Mint 18.2 and install-apt and for windows: git For now I suspect running two instances of SandSifter at same time on Linux Mint 18.2 caused file system corruption as can be seen on these three screenshots also

[issue31894] test_timestamp_naive failed on NetBSD

2017-10-29 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : $ ./python -m test -vuall test_datetime ... == FAIL: test_timestamp_naive (test.datetimetester.TestDateTime_Pure)

Re: Repairing Python installation?

2017-10-29 Thread Martin Schöön
Den 2017-10-29 skrev Chris Warrick : > On 29 October 2017 at 18:11, Martin Schöön wrote: >> I have installed Python 3 virtualenv and Nikola according to those >> instructions. I now have a working Nikola but I sure don't know what >> I am doing :-) How

Re: Listing link urls

2017-10-29 Thread Kishore Kumar Alajangi
+ tutor On Sun, Oct 29, 2017 at 6:57 AM, Kishore Kumar Alajangi < akishorec...@gmail.com> wrote: > Hi, > > I am facing an issue with listing specific urls inside web page, > > https://economictimes.indiatimes.com/archive.cms > > Page contains link urls by year and month vise, > Ex:

Listing link urls

2017-10-29 Thread Kishore Kumar Alajangi
Hi, I am facing an issue with listing specific urls inside web page, https://economictimes.indiatimes.com/archive.cms Page contains link urls by year and month vise, Ex: /archive/year-2001,month-1.cms I am able to list all required urls using the below code, from bs4 import BeautifulSoup

Re: Python-list Digest, Vol 169, Issue 44

2017-10-29 Thread Deught Chilapondwa
Sir, You have been sending me alot of messages but hardly can I understand. Offcourse I registered with you, but I can't understand the messages reharding what I should do. Can you come back to me with clarification? Impatienly waiting to hear from you. Deught Chilapondwa. On 25 Oct 2017 6:01 pm,

[issue31630] math.tan has poor accuracy near pi/2 on OpenBSD and NetBSD

2017-10-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I have got both (!) results in the same binary on NetBSD (gcc 4.8.5). tan(1.57079632679489611) = 1978937966095219.00 tan(0x1.921fb54442d16p+0) = 0x1.c1f559a01adccp+50 tan(1.57079632679489611) = 1978945885716843.00

Re: Invoking return through a function?

2017-10-29 Thread Rick Johnson
Alberto Riva wrote: > Rick Johnson wrote: > > Alberto Riva wrote: > >> Rick Johnson wrote: > >>> Alberto Riva wrote: > > [...] > > > > > > > > > > In a language like Lisp > > > > > > > > Python is nothing like Lisp, and for good reason! > > > > > > I would disagree with this. Actually, it's

[issue31630] math.tan has poor accuracy near pi/2 on OpenBSD and NetBSD

2017-10-29 Thread Stefan Krah
Stefan Krah added the comment: Also, does this occur in a VM on on the bare metal or both? What leaves me puzzled is that I cannot reproduce the Linux x86 report with almost the exact same compiler. But I'm on x64 and use -m32. --

[issue31630] math.tan has poor accuracy near pi/2 on OpenBSD and NetBSD

2017-10-29 Thread Tim Peters
Tim Peters added the comment: BTW, has anyone tried running a tiny C program on these platforms to see what tan(1.5707963267948961) delivers? The kind of code fdlibm uses is sensitive not only to compiler (mis)optimization, but also to stuff like how the FPU's "precision

[issue31630] math.tan has poor accuracy near pi/2 on OpenBSD and NetBSD

2017-10-29 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- components: +Tests -Extension Modules title: math.tan has poor accuracy near pi/2 on OpenBSD -> math.tan has poor accuracy near pi/2 on OpenBSD and NetBSD versions: +Python 2.7, Python 3.6, Python 3.7

[issue31630] math.tan has poor accuracy near pi/2 on OpenBSD

2017-10-29 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +4138 stage: -> patch review ___ Python tracker ___

Re: Invoking return through a function?

2017-10-29 Thread bartc
On 29/10/2017 17:02, Alberto Riva wrote: On 10/29/2017 12:21 PM, Rick Johnson wrote: In this specific case, I wanted to invoke a return if the key doesn't exist (as I wrote in my post). But this is not strictly relevant, my question was more general. To phrase it in yet another way: is there

Re: Invoking return through a function?

2017-10-29 Thread Ned Batchelder
On 10/29/17 3:09 PM, Alberto Riva wrote: On 10/29/2017 02:13 PM, Rick Johnson wrote: Alberto Riva wrote: Rick Johnson wrote: Alberto Riva wrote: [...] In a language like Lisp Python is nothing like Lisp, and for good reason! I would disagree with this. Actually, it's the most Lisp-

[issue31630] math.tan has poor accuracy near pi/2 on OpenBSD

2017-10-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There is the same result on NetBSD 7.1. -- ___ Python tracker ___

Re: Invoking return through a function?

2017-10-29 Thread Alberto Riva
On 10/29/2017 02:13 PM, Rick Johnson wrote: Alberto Riva wrote: Rick Johnson wrote: Alberto Riva wrote: [...] In a language like Lisp Python is nothing like Lisp, and for good reason! I would disagree with this. Actually, it's the most Lisp- like language I've encountered in my 25

[issue31304] Update doc for starmap_async error_back kwarg

2017-10-29 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- keywords: +patch pull_requests: +4137 stage: needs patch -> patch review ___ Python tracker

Re: Coding style in CPython implementation

2017-10-29 Thread Chris Angelico
On Mon, Oct 30, 2017 at 12:47 AM, Stefan Ram wrote: > =?UTF-8?B?zqPPhM6tz4bOsc69zr/PgiDOo8+Jz4bPgc6/zr3Or86/z4U=?= > writes: >>I guess the following parts from "Zen of Python" apply to this case: > > If we would agree to apply Python

Re: Invoking return through a function?

2017-10-29 Thread Rick Johnson
Alberto Riva wrote: > Rick Johnson wrote: > > Alberto Riva wrote: [...] > >> In a language like Lisp > > > > Python is nothing like Lisp, and for good reason! > > I would disagree with this. Actually, it's the most Lisp- > like language I've encountered in my 25 years of writing >

django celery delay function dont exetute

2017-10-29 Thread Xristos Xristoou
hello I want to use celery tasks in my Django project and I try to follow this very good tutorial from Mr.Vitor Freitas. but in my case and if try to run it that tutorial project i don't get results back the functions don't execute and in my case and in tutorial(i take message to wait and

[issue26228] pty.spawn hangs on FreeBSD 9.3, 10.x

2017-10-29 Thread Cornelius Diekmann
Change by Cornelius Diekmann : -- pull_requests: +4136 ___ Python tracker ___ ___

Re: Repairing Python installation?

2017-10-29 Thread Chris Warrick
On 29 October 2017 at 18:11, Martin Schöön wrote: > I have installed Python 3 virtualenv and Nikola according to those > instructions. I now have a working Nikola but I sure don't know what > I am doing :-) How do I get back into that nikola python environment > next

Re: Repairing Python installation?

2017-10-29 Thread Martin Schöön
Den 2017-10-29 skrev Chris Warrick : > On 28 October 2017 at 22:41, Martin Schöön wrote: >> >> Could mixing pip installs with Debian distro installs of Python >> packages lead to conflicts or other problems? > > Yes, it does, you should avoid that at

Aw: Re: Invoking return through a function?

2017-10-29 Thread Karsten Hilbert
> In this specific case, I wanted to invoke a return if the key doesn't > exist (as I wrote in my post). But this is not strictly relevant, my > question was more general. To phrase it in yet another way: is there > *any other way* to invoke return on a function, except by explicitly > writing

Re: Invoking return through a function?

2017-10-29 Thread Alberto Riva
On 10/29/2017 12:21 PM, Rick Johnson wrote: On Sunday, October 29, 2017 at 9:19:03 AM UTC-5, Alberto Riva wrote: Hello, I'm wondering if there is a way of writing a function that causes a return from the function that called it. To explain with an example, let's say that I want to exit my

Re: Invoking return through a function?

2017-10-29 Thread Alberto Riva
On 10/29/2017 11:13 AM, bartc wrote: (What the OP wants was also proposed a few weeks back in comp.lang.c. But that was only within nested functions, so if H is inside G, and G is inside F, then a 'returnall' from H would return directly directly from F. Apparently Lisp allows this...)

Re: Invoking return through a function?

2017-10-29 Thread Alberto Riva
On 10/29/2017 10:35 AM, Steve D'Aprano wrote: On Mon, 30 Oct 2017 01:18 am, Alberto Riva wrote: Hello, I'm wondering if there is a way of writing a function that causes a return from the function that called it. To explain with an example, let's say that I want to exit my function if a dict

Re: Invoking return through a function?

2017-10-29 Thread Rick Johnson
On Sunday, October 29, 2017 at 9:19:03 AM UTC-5, Alberto Riva wrote: > Hello, > > I'm wondering if there is a way of writing a function that > causes a return from the function that called it. To > explain with an example, let's say that I want to exit my > function if a dict does not contain a

Re: Compression of random binary data

2017-10-29 Thread Ben Bacarisse
Gregory Ewing writes: > Ben Bacarisse wrote: >> But that has to be about the process that gives rise to the data, not >> the data themselves. > >> If I say: "here is some random data..." you can't tell if it is or is >> not from a random source. I can, as a parlour

Re: Invoking return through a function?

2017-10-29 Thread bartc
On 29/10/2017 14:35, Steve D'Aprano wrote: On Mon, 30 Oct 2017 01:18 am, Alberto Riva wrote: I'm wondering if there is a way of writing a function that causes a return from the function that called it. You really should re-think your strategy. Your suggestion, if possible, would lead to

Re: Coding style in CPython implementation

2017-10-29 Thread Rick Johnson
On Sunday, October 29, 2017 at 4:00:59 AM UTC-5, Στέφανος Σωφρονίου wrote: [...] > I guess the following parts from "Zen of Python" apply to this case: > > - Beautiful is better than ugly. > - Explicit is better than implicit. > - Simple is better than complex. > - Readability counts. Now go

Re: Invoking return through a function?

2017-10-29 Thread Steve D'Aprano
On Mon, 30 Oct 2017 01:18 am, Alberto Riva wrote: > Hello, > > I'm wondering if there is a way of writing a function that causes a > return from the function that called it. To explain with an example, > let's say that I want to exit my function if a dict does not contain a > given key. I could

Re: Invoking return through a function?

2017-10-29 Thread Ned Batchelder
On 10/29/17 10:18 AM, Alberto Riva wrote: Hello, I'm wondering if there is a way of writing a function that causes a return from the function that called it. To explain with an example, let's say that I want to exit my function if a dict does not contain a given key. I could write: def

Invoking return through a function?

2017-10-29 Thread Alberto Riva
Hello, I'm wondering if there is a way of writing a function that causes a return from the function that called it. To explain with an example, let's say that I want to exit my function if a dict does not contain a given key. I could write: def testFun(): ... if key not in dict:

Re: Compression of random binary data

2017-10-29 Thread Steve D'Aprano
On Sun, 29 Oct 2017 01:56 pm, Stefan Ram wrote: > If the entropy of an individual message is not defined, > than it is still available to be defined. I define it > to be log2(1/p), where p is the probability of this > message. I also choose a unit for it, which I call "bit". That is

[issue31893] Issues with kqueue

2017-10-29 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +4135 stage: -> patch review ___ Python tracker ___

[issue31893] Issues with kqueue

2017-10-29 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : In Modules/selectmodule.c it is assumed that the kevent structure is defined on FreeBSD and NetBSD as: struct kevent { uintptr_t ident; short filter; u_short flags;

Re: sys.path[] question

2017-10-29 Thread ElChino
Thomas Jollans wrote: You can find out where a module is loaded from by checking its __file__ attribute. Run python (in interactive mode) and execute import pyreadline pyreadline.__file__ Thanks for that tip. Does that mean that only this .egg is where python imports all pyreadline files

[issue31749] Request: Human readable byte amounts in the standard library

2017-10-29 Thread Martin Panter
Martin Panter added the comment: Ken Kundert started a related discussion a while back on Python-ideas: . This was about SI-prefixed units in general; not restricted to bytes.

[issue31886] Multiprocessing.Pool hangs after re-spawning several worker process.

2017-10-29 Thread Antoine Pitrou
Change by Antoine Pitrou : -- nosy: +Olivier.Grisel, tomMoral ___ Python tracker ___ ___

[issue31886] Multiprocessing.Pool hangs after re-spawning several worker process.

2017-10-29 Thread Antoine Pitrou
Antoine Pitrou added the comment: Generally speaking, queues can remain in an inconsistent state after a process crash (because the process might have crashed just after acquiring a shared semaphore or sending part of a large message). It's not obvious to me how we could

Re: Repairing Python installation?

2017-10-29 Thread Chris Warrick
On 28 October 2017 at 22:41, Martin Schöön wrote: > It seems something is amiss with my Python 2.7 installation. Revisiting > Nikola (static web site generator written in Python) for the first time > in several years the other day I experience some unexpected problems. I

Re: sys.path[] question

2017-10-29 Thread Thomas Jollans
On 28/10/17 19:24, ElChino wrote: > From the Python2.7 snippet in [1], Python2.7 reports that my > sys.path[] contains: > f:\ProgramFiler\Python27\lib\site-packages\pyreadline-2.0-py2.7-win32.egg > > (a .zip-file) > > But I have also a 'f:\ProgramFiler\Python27\lib\site-packages\pyreadline' >

Re: Repairing Python installation?

2017-10-29 Thread Martin Schöön
Den 2017-10-28 skrev Percival John Hackworth : > On 28-Oct-2017, Martin Schöön wrote > (in article ): > >> It seems something is amiss with my Python 2.7 installation. Revisiting >> Nikola (static web site generator written in Python) for the

[issue20047] bytearray partition bug

2017-10-29 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue20047] bytearray partition bug

2017-10-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 107f3cc791d223dc06b7c80f0de672e88ae6a8d1 by Serhiy Storchaka in branch '2.7': [2.7] bpo-20047: Make bytearray methods partition() and rpartition() rejecting (GH-4158) (#4163)

[issue20047] bytearray partition bug

2017-10-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 9ea5a3a45b35d01b602e7e4da4f72b2db407e5c6 by Serhiy Storchaka in branch '3.6': [3.6] bpo-20047: Make bytearray methods partition() and rpartition() rejecting (GH-4158) (#4162)

Re: Repairing Python installation?

2017-10-29 Thread Martin Schöön
Den 2017-10-28 skrev Karsten Hilbert : > On Sat, Oct 28, 2017 at 08:41:34PM +, Martin Schöön wrote: > >> It seems something is amiss with my Python 2.7 installation. Revisiting >> Nikola (static web site generator written in Python) for the first time >> in several

Re: Compression of random binary data

2017-10-29 Thread Steve D'Aprano
On Sun, 29 Oct 2017 06:03 pm, Chris Angelico wrote: > On Sun, Oct 29, 2017 at 6:00 PM, Ian Kelly wrote: >> On Oct 28, 2017 5:53 PM, "Chris Angelico" wrote: >>> One bit. It might send the message, or it might NOT send the message. >> >> Not sending the

Re: Compression of random binary data

2017-10-29 Thread Steve D'Aprano
On Sun, 29 Oct 2017 02:31 pm, Gregory Ewing wrote: > Steve D'Aprano wrote: >> I don't think that's right. The entropy of a single message is a >> well-defined quantity, formally called the self-information. >> >> https://en.wikipedia.org/wiki/Self-information > > True, but it still depends on

[issue31892] ssl.get_server_certificate should allow specifying certificate / key type

2017-10-29 Thread Hanno Boeck
New submission from Hanno Boeck : The function ssl.get_server_certificate() from the ssl module is supposed to allow fetching the certificate of a TLS server. However in its current form it provides no way to specify a key type. Many popular hosts (e.g. facebook, google)

[issue25720] Fix curses module compilation with ncurses6

2017-10-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I'll try to test this on NetBSD after fixing curses on NetBSD. It uses a different implementation of curses which don't support is_pad. -- dependencies: +Make curses compiling on NetBSD 7.1 and tests passing versions:

[issue31891] Make curses compiling on NetBSD 7.1 and tests passing

2017-10-29 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +twouters ___ Python tracker ___ ___

[issue31891] Make curses compiling on NetBSD 7.1 and tests passing

2017-10-29 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +4134 stage: -> patch review ___ Python tracker ___

[issue31891] Make curses compiling on NetBSD 7.1 and tests passing

2017-10-29 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : NetBSD perhaps is the last open OS that don't use ncurses. For now the _curses module is not compiled on NetBSD. Its curses implementation doesn't contain several ncurses functions. included for non-ncurses implementations

[issue8070] Infinite loop in PyRun_InteractiveLoopFlags() if PyRun_InteractiveOneFlags() raises an error

2017-10-29 Thread Xavier de Gaye
Xavier de Gaye added the comment: The infinite loop may occur if one of the functions called by PyRun_InteractiveOneObject() returns persistently -1. This may be the case when there is no more memory and is handled by issue 30696. It is not possible anymore to reproduce

[issue25720] Fix curses module compilation with ncurses6

2017-10-29 Thread Masayuki Yamamoto
Masayuki Yamamoto added the comment: I opened PR 4164 to improve the is_pad configure check and previous PR was closed. -- ___ Python tracker

Re: Coding style in CPython implementation

2017-10-29 Thread Στέφανος Σωφρονίου
On Sunday, October 29, 2017 at 4:18:38 AM UTC+2, Dan Sommers wrote: > On Sat, 28 Oct 2017 16:20:54 -0700, Στέφανος Σωφρονίου wrote: > > > I do believe though that if (!d) is a lot clearer than if (d == NULL) > > as it is safer than falsely assigning NULL in d, by pure mistake. > > Having made my

[issue25720] Fix curses module compilation with ncurses6

2017-10-29 Thread Masayuki Yamamoto
Change by Masayuki Yamamoto : -- pull_requests: +4133 ___ Python tracker ___ ___

[issue20047] bytearray partition bug

2017-10-29 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +4132 ___ Python tracker ___ ___

[issue20047] bytearray partition bug

2017-10-29 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +4131 ___ Python tracker ___ ___

Re: Compression of random binary data

2017-10-29 Thread Gregory Ewing
Chris Angelico wrote: One bit. It might send the message, or it might NOT send the message. The entropy formula assumes that you are definitely going to send one of the possible messages. If not sending a message is a possibility, then you need to include an empty message in the set of

  1   2   >