Deutsch English Français Italiano |
<mailman.5.1714841343.3326.python-list@python.org> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!fu-berlin.de!uni-berlin.de!not-for-mail From: dieter.maurer@online.de Newsgroups: comp.lang.python Subject: Re: how to discover what values produced an exception? Date: Sat, 4 May 2024 18:24:29 +0200 Lines: 30 Message-ID: <mailman.5.1714841343.3326.python-list@python.org> References: <8734qz9ey0.fsf@tudado.org> <26166.24893.646556.142871@ixdm.fritz.box> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: news.uni-berlin.de EGZO7LDZs3o11vicDGQa+wbWIxlSJFVFUv1oIPkmysfA== Cancel-Lock: sha1:rBfXIo5uSGhY90M+uLZUH8v7AKg= sha256:alm7V/WbAXp+8X0jUwhLfV3ldywGGuCahN0+cOGHrxs= Return-Path: <dieter.maurer@online.de> X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org Authentication-Results: mail.python.org; dkim=pass reason="2048-bit key; unprotected key" header.d=online.de header.i=dieter.maurer@online.de header.b=QwZumJeb; dkim-adsp=pass; dkim-atps=neutral X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'traceback': 0.04; '(most': 0.05; 'last):': 0.05; 'received:212.227': 0.07; 'cc:addr:python- list': 0.09; 'received:212.227.126': 0.09; 'subject:how': 0.09; 'values.': 0.09; 'cc:no real name:2**0': 0.14; '>>>>': 0.16; 'subject:values': 0.16; 'subject:what': 0.16; 'python': 0.16; 'values': 0.17; 'bug': 0.19; 'cc:addr:python.org': 0.20; 'exception': 0.22; 'problem,': 0.22; 'code': 0.23; 'received:de': 0.23; 'cc:2**0': 0.25; 'thorough': 0.26; '"",': 0.32; 'received:kundenserver.de': 0.32; 'received:mout.kundenserver.de': 0.32; 'header:In-Reply-To:1': 0.34; 'fix': 0.36; 'cases': 0.36; 'source': 0.36; 'special': 0.37; 'received:192.168': 0.37; 'file': 0.38; 'could': 0.38; 'much.': 0.39; 'wrote': 0.39; 'something': 0.40; 'received:212': 0.62; 'involved': 0.63; 'required': 0.65; 'analysis': 0.69; 'discover': 0.80; 'typically,': 0.84; 'caused': 0.86 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=online.de; s=s42582890; t=1714841340; x=1715446140; i=dieter.maurer@online.de; bh=+6GJbPnrRdFvM9D4gXl/CJsChqP5HMYjnNve1RtjRTg=; h=X-UI-Sender-Class:MIME-Version:Content-Type: Content-Transfer-Encoding:Message-ID:Date:From:To:Cc:Subject: In-Reply-To:References:cc:content-transfer-encoding:content-type: date:from:message-id:mime-version:reply-to:subject:to; b=QwZumJeb12dAsTjiYAAUDYzcxcxdLOvYwfQikpdp+dDEb7iWQV7R5RXUFrXU/4wo Vsy2c/bM0JTNc6L4e2nYfRyaZ2lpzBKB3I6ZuF5cD+2OIpJJ0oAGopJHWlR9tMZeK LZKic27D1CZBO39p+nbEqhVNgoGaqSFvhLqkmZSDbNC3fs2M7vOpVOXxE6lFI0JOz uLzirPqtVKirI5AlGMboJMellTcM70rjXx3mHLwPIjFV//Ghrs7jnm0rp7kvWjFjU Z3Xx15qULPF8GkMY8pyDxKxe8pRTKSDhQKbsmZnJLZZ5o5elvxSzy8vEtuPre3e58 D8/j/m1Wn22aazv1sg== X-UI-Sender-Class: 6003b46c-3fee-4677-9b8b-2b628d989298 In-Reply-To: <8734qz9ey0.fsf@tudado.org> X-Mailer: VM 8.0.12-devo-585 under 21.4 (patch 24) "Standard C" XEmacs Lucid (x86_64-linux-gnu) X-Provags-ID: V03:K1:aYz5fBM8+DvVCvGI4A3zZD2efh081cKjNe+VJT4y2otb4qvf/Ob G/AbDLpI8VWfo5YkVPhO5GmU1yve7OfTBZKVe8hMCuKv8Vphj0WsoIm7JJRzeqsWDfj155e D3ACUsUpT1lIpU9Uwriwvsx2t6MKDC5aTMxFj+QtALZvyyyadrncpyXXWCiA5ASmS6LlZGd FCa2Xd0FG1kW/puW9/PyQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:3RtUg17sFbY=;DFLjbGfVliFrgXtId3A/EFoX63b 3oypxdYUCqpaqcVU0I7inPFql9FsoRA9rZ9vryNtG6NIpsLJUoJTQDxccnAx9URAZbZuvndw2 47LE3Lih3+DmJgZsN5p4XSHkZNC/xoUE75LGANDPBnqkuAO6pVsa15qj5SFxPzyb8zD0I2sLf 8Wy50uyXOh7kylSmhF2S1YjMrXkBAKSXVaIpe6MP7V9WhhbdiUZY4FgDAgu3kWUdEAadrN65I Ucf4WTv0WhJ3yhE51SbizHl0OGUqKQK1pmIsbkbloR6HU9OVE5PK3XaQn5JR4CP0Z3MUyI0SF h4PX4+KHBzoOXfIBWCfnELugY/sf0vFEWQAekyIDI1qFlHvD5vGogSqlTkbSAqxC7Rij/sfJB 3doMsUTNRo09ITKXYvO77MKCFIWykuPVg8eg3qzFxMtSRwme1YNtFicupeyNgyJRFuAHXKK+V fPzPrkeU4pUxHr3qSwpS/TuiCNu6i6qPMVTr2foTlw6gH+AlLZfXI4h9Z4e8bvCWSfPHqNhzH X3jZXuzbEEcL3hyIbsXQGu9NHLtPZ0zzDfl42+xi+z8maFz+5jpS+GZFLaxUpJn405UEaXroj n2y5I+AC9RrK5eCEUJhDocaLwMO3+MxLzx65H1FqMlyJr+B2jvW0DBjcuQzkUVleEp6N87AfI zxjq4Gik4drOJd0vRR1nvj1ykvZdlZrEK3d6bY0FtUvPweuik/STk+PmGq87bAcGgtSWxKtOV ynantlvytWDouY/WA0uEVOtv5fLIf87gLXv0JInGH+y1XRUNjYSDLQ= X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.39 Precedence: list List-Id: General discussion list for the Python programming language <python-list.python.org> List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> List-Archive: <https://mail.python.org/pipermail/python-list/> List-Post: <mailto:python-list@python.org> List-Help: <mailto:python-list-request@python.org?subject=help> List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> X-Mailman-Original-Message-ID: <26166.24893.646556.142871@ixdm.fritz.box> X-Mailman-Original-References: <8734qz9ey0.fsf@tudado.org> Bytes: 6136 Johanne Fairchild wrote at 2024-5-3 10:56 -0300: >How to discover what values produced an exception? Or perhaps---why >doesn't the Python traceback show the values involved in the TypeError? >For instance: > >--8<-------------------------------------------------------->8--- >>>> (0,0) < 4 >Traceback (most recent call last): > File "<stdin>", line 1, in <module> >TypeError: '<' not supported between instances of 'tuple' and 'int' >--8<-------------------------------------------------------->8--- > >It could have said something like: > >--8<-------------------------------------------------------->8--- >TypeError: '<' not supported between instances of 'tuple' and 'int' > in (0,0) < 4. >--8<-------------------------------------------------------->8--- > >We would know which were the values that caused the problem, which would >be very helpful. Typically, the traceback informs you about the source code line where the exception has been raised. When the source line contains literals, you see the values. If not, then only in special (speak: rather simple) cases the knowledge of the values will help much. Usually, a more thorough analysis is required to find out the bug location and how to fix the bug.