Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico Newsgroups: comp.lang.python Subject: Re: Spurious issue in CPython 2.7.5 Date: Wed, 25 May 2016 03:23:03 +1000 Lines: 38 Message-ID: References: <779717266.18172.1464085350716.JavaMail.open-xchange@ox.netsite.dk> <57448b9a$0$1584$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de U5Xk8e2z81+xoBRAZ4kugAXGNAqGmRCUpIKnyrPG3otg== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'cc:addr:python-list': 0.09; 'integers': 0.09; 'longs': 0.09; 'python': 0.10; 'wed,': 0.15; 'value.': 0.15; '(around': 0.16; '(note:': 0.16; '2016': 0.16; 'echo': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'integers,': 0.16; 'mean,': 0.16; 'py3': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'ssize_t': 0.16; 'subject:issue': 0.16; 'wrote:': 0.16; 'later': 0.16; 'memory': 0.17; 'copied': 0.18; '>>>': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'converted': 0.22; 'am,': 0.23; 'seems': 0.23; 'header:In-Reply-To:1': 0.24; "doesn't": 0.26; 'rest': 0.26; 'error': 0.27; 'message-id:@mail.gmail.com': 0.27; 'actual': 0.28; 'convert': 0.29; 'too.': 0.30; 'certain': 0.31; '"the': 0.32; 'point': 0.33; 'message.': 0.33; "d'aprano": 0.33; 'int': 0.33; 'steven': 0.33; 'traceback': 0.33; 'list': 0.34; 'received:google.com': 0.35; 'something': 0.35; 'received:74.125.82': 0.35; 'but': 0.36; 'too': 0.36; 'created': 0.36; 'subject:: ': 0.37; 'being': 0.37; 'missing': 0.37; 'rather': 0.39; 'skip:x 10': 0.40; 'different': 0.63; 'places': 0.64; 'limit': 0.65; 'chrisa': 0.84; 'to:none': 0.91; 'relate': 0.91; 'have.': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc; bh=q1ZVpXgd8JwH2aFQbgjrZtGvty36qq7oPurYlbir398=; b=hYXwaoin1VMq/SsdonrwarjI2XgDfz9br6+snTfikpbBzybllRauiucZUIr1wQ3y3Y nsPlai1qb9Geli4BR8jcG1mI4bUDtbxQojhPpeFVv7qIN4FHtkGCuw+un35h4GIa+ioR w+9IC6hRUEaLAqA/3ehU+cMlIAM/Bg8stkRD0QIUGnEOh2fuT+r84ApIQCY+wIS3j+SJ XgjkuvbLzS6YC33yFirQJJ4E364PYV4AGBUTi5EOtyNIyosPrl83zRTDKD6YYJgrxrKk 3TU36FnIAmKHA/glXFS/SZb/t90zlaHKgems3HVCNv37CTT8t2lwSBCreJfd4Mg+MC/j 6WHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:cc; bh=q1ZVpXgd8JwH2aFQbgjrZtGvty36qq7oPurYlbir398=; b=mMOOvFw/2U5y559VFPE+8m1VL4W0qiE28rW+W/ORNk+5VAPH7eOjmVSIabIahBtURP NARLZY/pHTLFCA1ipuWIvQC7nNHu7yUpv3OTR7femYAnVIG7Z3FMesTB+MOlBg1ADvYK oseBQqvbeaaYeen/5FtsmKp5KAJ/yq24DhvtjdB52pE9z56NCYhbHRodPYiAWne9DCJe TfHWBhNS2xQ6iv1IsdVcCBvq+A/6AdYn/EaKuL4Aryig6nZWuGSHzB45tmQPbZgfyVul 6NQI01pkHdgOruY48NLqGgnKX8M8eW5Pchbzby63ovc/JyuvGDc+l483aqsKQ2+CwRs+ NQBg== X-Gm-Message-State: AOPr4FWmyYdIhIDgYR1NOdREH7WaH5dZWObprA1m8qoWJxKjSjC/rN7xv/R7bb/zqzeGIjQ9zkJ/YheTf3oKdQ== X-Received: by 10.28.44.87 with SMTP id s84mr23270653wms.61.1464110583858; Tue, 24 May 2016 10:23:03 -0700 (PDT) In-Reply-To: <57448b9a$0$1584$c3e8da3$5496439d@news.astraweb.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: <779717266.18172.1464085350716.JavaMail.open-xchange@ox.netsite.dk> <57448b9a$0$1584$c3e8da3$5496439d@news.astraweb.com> Xref: csiph.com comp.lang.python:109072 On Wed, May 25, 2016 at 3:12 AM, Steven D'Aprano wrote: >> 2: In my process later on I get: "OverflowError: long too big to >> convert". > > Can you copy and paste the actual traceback rather than retyping it from > memory? I think you're missing something, namely what the long is being > converted to. The rest of the traceback will help too. > > >> This happens in different places and seems to always relate to >> obtaining a length of something (dict or list created by list >> comprehension). Fx >> >> "for i in xrange(0, len_of_stuff, max_section_size):" >> >> en_of_stuff is always less than the max long (around 600). > > What do you mean, "the max long"? Longs do not have a max value. The only > limit is the amount of memory you have. A Python long doesn't, but an ssize_t does. In certain places, Python integers get converted into C integers, at which point an over-large value triggers OverflowError. >>> xrange(1<<100) Traceback (most recent call last): File "", line 1, in OverflowError: Python int too large to convert to C long >>> xrange(1,500,1<<100) Traceback (most recent call last): File "", line 1, in OverflowError: Python int too large to convert to C long (Note: Doesn't happen with a Py3 range object.) But I echo the request for a copied and pasted error message. ChrisA