Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

If I had only known, I would have been a locksmith. -- Albert Einstein


devel / comp.lang.python / Too Broad of an exception

SubjectAuthor
* Too Broad of an exceptionrsutton
+* Re: Too Broad of an exceptionRene Kita
|`* Re: Too Broad of an exceptionRene Kita
| `* Re: Too Broad of an exceptionMats Wichmann
|  `- Re: Too Broad of an exceptionStefan Ram
`* Re: Too Broad of an exceptionStefan Ram
 `* Re: Too Broad of an exceptionStefan Ram
  `* Re: Too Broad of an exceptionrsutton
   +- Re: Too Broad of an exceptionKushal Kumaran
   +- Re: Too Broad of an exceptionThomas Passin
   `- Re: Too Broad of an exceptiondn

1
Too Broad of an exception

<uhb85v$pu1o$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24219&group=comp.lang.python#24219

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: rsutto...@comcast.net (rsutton)
Newsgroups: comp.lang.python
Subject: Too Broad of an exception
Date: Wed, 25 Oct 2023 10:19:43 -0400
Organization: A noiseless patient Spider
Lines: 32
Message-ID: <uhb85v$pu1o$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 25 Oct 2023 14:19:43 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="47eb6cb5a8ab8c5219c734f8ea80e325";
logging-data="849976"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+T2uMl39xdV6+5MWegNQnv"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:dv49nWAi74u0ALH8ymNwtbQV04Q=
Content-Language: en-US
 by: rsutton - Wed, 25 Oct 2023 14:19 UTC

Hi all,
I am fairly new to python (ie < 2 years). I have a question about
pylint. I am running on windows 10/11, python 3.10.11.

Here's what I'm trying to do:
I am using robocopy to to copy a set of files to/from a LAN location and
my desktop(s). Here is the partial code:

p = subprocess.run(["robocopy.exe",
STORE_LOCATION, NEWS_LOCATION,
"/NFL", "/NDL", "/NJH", "/NJS", "/NP", "/XF",
"msgFilterRules.dat",
"xmsgFilterRules.dat"], check=False)

# this is necessary because Windows Robocopy returns
# various return codes for success.
if p.returncode >= 8:
raise Exception(f'Invalid result: {p.returncode}')

It actually runs fine. But pylint is not having it. I get:

win_get_put_tb_filters.py:61:12: W0719: Raising too general exception:
Exception (broad-exception-raised)

But the code I have written does exactly what I want. If the returncode
is 7 or less, then I have success. If the returncode is 8 or above
there is a failure and I want to see what the returncode is.

Trying to read the python Exception docs is mind bending. Any help
would be appreciated.

Richard

Re: Too Broad of an exception

<uhb8h4$ppm7$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24220&group=comp.lang.python#24220

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: mai...@rkta.de (Rene Kita)
Newsgroups: comp.lang.python
Subject: Re: Too Broad of an exception
Date: Wed, 25 Oct 2023 14:25:42 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 18
Message-ID: <uhb8h4$ppm7$1@dont-email.me>
References: <uhb85v$pu1o$1@dont-email.me>
Injection-Date: Wed, 25 Oct 2023 14:25:42 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="381c759df4ff1a3d587a01e1a45d0c87";
logging-data="845511"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19g4WJOhSHYzbgdlYfVbx8p"
User-Agent: tin/2.6.2-20221225 ("Pittyvaich") (Linux/5.10.0-26-amd64 (x86_64))
Cancel-Lock: sha1:VeMeH3b8sCPR4v5vvh5u7+t7OU4=
 by: Rene Kita - Wed, 25 Oct 2023 14:25 UTC

rsutton <rsutton43@comcast.net> wrote:
> Hi all,
> I am fairly new to python (ie < 2 years). I have a question about
> pylint. I am running on windows 10/11, python 3.10.11.
[...]
> if p.returncode >= 8:
> raise Exception(f'Invalid result: {p.returncode}')
>
> It actually runs fine. But pylint is not having it. I get:
>
> win_get_put_tb_filters.py:61:12: W0719: Raising too general exception:
> Exception (broad-exception-raised)

pylint is just a linter, ignore it if the code works and you like it the
way it is.

pylint complains because you use Exception. Use e.g. RuntimeException to
silence it.

Re: Too Broad of an exception

<Exceptions-20231025154940@ram.dialup.fu-berlin.de>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24221&group=comp.lang.python#24221

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!rocksolid2!news.neodome.net!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram...@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.python
Subject: Re: Too Broad of an exception
Date: 25 Oct 2023 14:51:16 GMT
Organization: Stefan Ram
Lines: 23
Expires: 1 Sep 2024 11:59:58 GMT
Message-ID: <Exceptions-20231025154940@ram.dialup.fu-berlin.de>
References: <uhb85v$pu1o$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de z4gl6nAdmvNyU3N3/e1FjAj2OX2konN/HlZFQitLw0/5HO
Cancel-Lock: sha1:8jUWolK2i0uFYY3HunkvUCGYKz0= sha256:HvgGo7KfzRR67pWrwoaTMVsnScD/KdVqzLy3CKcZaV8=
X-Copyright: (C) Copyright 2023 Stefan Ram. All rights reserved.
Distribution through any means other than regular usenet
channels is forbidden. It is forbidden to publish this
article in the Web, to change URIs of this article into links,
and to transfer the body without this notice, but quotations
of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
services to mirror the article in the web. But the article may
be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en-US
Accept-Language: de-DE-1901, en-US, it, fr-FR
 by: Stefan Ram - Wed, 25 Oct 2023 14:51 UTC

rsutton <rsutton43@comcast.net> writes:
>Trying to read the python Exception docs is mind bending. Any help
>would be appreciated.

After "import builtins", "_ =[ print( x )for x in dir( builtins )
if 'rror' in x or 'xception' in x ]" (one long line without the
outer quotation marks) prints some prominent exception types. After
manually removing those that do not seem to apply, I am left with:

"AssertionError",
"ChildProcessError",
"EnvironmentError",
"IOError",
"LookupError",
"OSError",
"OverflowError",
"RuntimeError",
"SyntaxError",
"SystemError",
"ValueError", and
"WindowsError".

Re: Too Broad of an exception

<exceptions-20231025160611@ram.dialup.fu-berlin.de>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24222&group=comp.lang.python#24222

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram...@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.python
Subject: Re: Too Broad of an exception
Date: 25 Oct 2023 15:06:52 GMT
Organization: Stefan Ram
Lines: 13
Expires: 1 Sep 2024 11:59:58 GMT
Message-ID: <exceptions-20231025160611@ram.dialup.fu-berlin.de>
References: <uhb85v$pu1o$1@dont-email.me> <Exceptions-20231025154940@ram.dialup.fu-berlin.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de OZwVDPrf0lLFSYeYcAHzeQqI4fA3mMTkWuAziF13hCnytu
Cancel-Lock: sha1:2Y3aVBtjHGDMaPmTT71rbU80FFE= sha256:xGheZK2GCWYFkcdN0+gpONssZ0gikSUqk41qinqKeg4=
X-Copyright: (C) Copyright 2023 Stefan Ram. All rights reserved.
Distribution through any means other than regular usenet
channels is forbidden. It is forbidden to publish this
article in the Web, to change URIs of this article into links,
and to transfer the body without this notice, but quotations
of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
services to mirror the article in the web. But the article may
be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en-US
Accept-Language: de-DE-1901, en-US, it, fr-FR
 by: Stefan Ram - Wed, 25 Oct 2023 15:06 UTC

ram@zedat.fu-berlin.de (Stefan Ram) writes:
>outer quotation marks) prints some prominent exception types. After
>manually removing those that do not seem to apply, I am left with:
>"AssertionError",
>"ChildProcessError",
....

"Manually removing" above was meant to be a fast first pass,
where I only excluded exception types that were obviously
inappropriate. It is now to be followed by a search for the
appropriate exception types among those exception types left.

Re: Too Broad of an exception

<uhbddo$pu1n$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24225&group=comp.lang.python#24225

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: rsutto...@comcast.net (rsutton)
Newsgroups: comp.lang.python
Subject: Re: Too Broad of an exception
Date: Wed, 25 Oct 2023 11:49:12 -0400
Organization: A noiseless patient Spider
Lines: 27
Message-ID: <uhbddo$pu1n$1@dont-email.me>
References: <uhb85v$pu1o$1@dont-email.me>
<Exceptions-20231025154940@ram.dialup.fu-berlin.de>
<exceptions-20231025160611@ram.dialup.fu-berlin.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 25 Oct 2023 15:49:12 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="47eb6cb5a8ab8c5219c734f8ea80e325";
logging-data="849975"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18yS61itwVFgveVxcTi6qzj"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:LT2G+DQWJ2ChamifcBYl8DuGPKk=
Content-Language: en-US
In-Reply-To: <exceptions-20231025160611@ram.dialup.fu-berlin.de>
 by: rsutton - Wed, 25 Oct 2023 15:49 UTC

On 10/25/2023 11:06 AM, Stefan Ram wrote:
> ram@zedat.fu-berlin.de (Stefan Ram) writes:
>> outer quotation marks) prints some prominent exception types. After
>> manually removing those that do not seem to apply, I am left with:
>> "AssertionError",
>> "ChildProcessError",
> ...
>
> "Manually removing" above was meant to be a fast first pass,
> where I only excluded exception types that were obviously
> inappropriate. It is now to be followed by a search for the
> appropriate exception types among those exception types left.
>
>
@Rene & @Stefan,
I really appreciate the guidance provided. By replacing Exception with
RuntimeError, pylint seems happy! More specificity, I guess. I know
that I could have ignored the pylint exceptions, but I want to use this
as a learning experience. I looks like I have a lot of reading to do on
exception handling. IMO all of the try/except code looks quite clumsy to
me. It may be excellent for some tasks but to me, it looks quite
inelegant. Like I said, I have a lot to learn.

Thank you both for your guidance.

Richard

Re: Too Broad of an exception

<mailman.77.1698256124.3828.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24230&group=comp.lang.python#24230

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!paganini.bofh.team!2.eu.feeder.erje.net!3.eu.feeder.erje.net!feeder.erje.net!news.szaf.org!fu-berlin.de!uni-berlin.de!not-for-mail
From: kus...@locationd.net (Kushal Kumaran)
Newsgroups: comp.lang.python
Subject: Re: Too Broad of an exception
Date: Wed, 25 Oct 2023 10:41:09 -0700
Lines: 31
Message-ID: <mailman.77.1698256124.3828.python-list@python.org>
References: <uhb85v$pu1o$1@dont-email.me>
<Exceptions-20231025154940@ram.dialup.fu-berlin.de>
<exceptions-20231025160611@ram.dialup.fu-berlin.de>
<uhbddo$pu1n$1@dont-email.me> <87y1fqwqfe.fsf@copper>
Mime-Version: 1.0
Content-Type: text/plain
X-Trace: news.uni-berlin.de tkdGZmaGU1lapIy0+SJxdgvndeDcJ3qw/Pgwp15PQqyg==
Cancel-Lock: sha1:P7jSsdwSr7gnmgenpspSYtm/RPk= sha256:GbRhAiFzlihv2r+pm+ojyHMVa5HUkTpXz/sMIYdi9qc=
Return-Path: <kushal@locationd.net>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.010
X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'looks': 0.02; '2023':
0.07; 'ram': 0.07; 'meant': 0.09; 'obviously': 0.09; 'prints':
0.09; 'skip:` 10': 0.09; 'types.': 0.09; 'utility': 0.09;
'writes:': 0.09; 'excluded': 0.16; 'ignored': 0.16; 'kushal':
0.16; 'learn.': 0.16; 'outer': 0.16; 'pylint': 0.16; 'wrote:':
0.16; 'code.': 0.17; 'guidance': 0.19; 'to:addr:python-list':
0.20; 'exception': 0.22; 'problem,': 0.22; 'code': 0.23; 'seems':
0.26; 'stefan': 0.26; '>>>': 0.28; 'header:User-Agent:1': 0.30;
'seem': 0.31; 'am,': 0.31; 'program': 0.31; 'said,': 0.32; 'but':
0.32; 'skip:" 20': 0.34; 'header:In-Reply-To:1': 0.34; 'those':
0.36; 'really': 0.37; 'could': 0.38; 'quite': 0.39; 'use': 0.39;
'wed,': 0.39; 'program.': 0.40; 'want': 0.40; 'search': 0.61;
'above': 0.62; 'me.': 0.62; 'with:': 0.64; 'your': 0.64; 'among':
0.65; 'let': 0.66; 'types': 0.67; 'manually': 0.69; 'pass,': 0.69;
'experience.': 0.70; 'left': 0.83; 'prominent': 0.84; 'quotation':
0.84; 'received:88': 0.84; 'replacing': 0.91
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on
arsenic.locationd.net
X-Spam-Level:
X-Spam-Status: No, score=-2.5 required=5.0 tests=ALL_TRUSTED,BAYES_00
autolearn=ham autolearn_force=no version=3.4.6
X-Clacks-Overhead: GNU Terry Pratchett
In-Reply-To: <uhbddo$pu1n$1@dont-email.me> (rsutton's message of "Wed, 25 Oct
2023 11:49:12 -0400")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
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: <87y1fqwqfe.fsf@copper>
X-Mailman-Original-References: <uhb85v$pu1o$1@dont-email.me>
<Exceptions-20231025154940@ram.dialup.fu-berlin.de>
<exceptions-20231025160611@ram.dialup.fu-berlin.de>
<uhbddo$pu1n$1@dont-email.me>
 by: Kushal Kumaran - Wed, 25 Oct 2023 17:41 UTC

On Wed, Oct 25 2023 at 11:49:12 AM, rsutton <rsutton43@comcast.net> wrote:
> On 10/25/2023 11:06 AM, Stefan Ram wrote:
>> ram@zedat.fu-berlin.de (Stefan Ram) writes:
>>> outer quotation marks) prints some prominent exception types. After
>>> manually removing those that do not seem to apply, I am left with:
>>> "AssertionError",
>>> "ChildProcessError",
>> ...
>> "Manually removing" above was meant to be a fast first pass,
>> where I only excluded exception types that were obviously
>> inappropriate. It is now to be followed by a search for the
>> appropriate exception types among those exception types left.
>>
> @Rene & @Stefan,
> I really appreciate the guidance provided. By replacing Exception
> with RuntimeError, pylint seems happy! More specificity, I guess. I
> know that I could have ignored the pylint exceptions, but I want to
> use this as a learning experience. I looks like I have a lot of
> reading to do on exception handling. IMO all of the try/except code
> looks quite clumsy to me. It may be excellent for some tasks but to
> me, it looks quite inelegant. Like I said, I have a lot to learn.
>

>From what you've described of your problem, it seems like a small-ish
utility program you're writing for your own use. You don't need any
`try`...`except` blocks in such code. You just let the exception stop
your program.

--
regards,
kushal

Re: Too Broad of an exception

<mailman.79.1698264190.3828.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24233&group=comp.lang.python#24233

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: lis...@tompassin.net (Thomas Passin)
Newsgroups: comp.lang.python
Subject: Re: Too Broad of an exception
Date: Wed, 25 Oct 2023 13:50:39 -0400
Lines: 38
Message-ID: <mailman.79.1698264190.3828.python-list@python.org>
References: <uhb85v$pu1o$1@dont-email.me>
<Exceptions-20231025154940@ram.dialup.fu-berlin.de>
<exceptions-20231025160611@ram.dialup.fu-berlin.de>
<uhbddo$pu1n$1@dont-email.me>
<62012c67-6af3-41e3-9b5b-5ede6ff90f72@tompassin.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de oH5wM3KQ7bvD+4VTYP7OywdA/z/R1Tv0HBGQhORDueuA==
Cancel-Lock: sha1:OaglkgLu5uWkDrhUR05tectZiic= sha256:TRN+VXodZ6EWdSJbJcjbVIFYPefL6erIx4ULohMUKVw=
Return-Path: <list1@tompassin.net>
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=tompassin.net header.i=@tompassin.net header.b=Huyx2VxF;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.012
X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'looks': 0.02; 'ram': 0.07;
'meant': 0.09; 'obviously': 0.09; 'prints': 0.09; 'types.': 0.09;
'writes:': 0.09; 'excluded': 0.16; 'ignored': 0.16; 'learn.':
0.16; 'me.\xc2\xa0': 0.16; 'outer': 0.16; 'pylint': 0.16;
'received:10.0.0': 0.16; 'received:64.90': 0.16;
'received:64.90.62': 0.16; 'received:64.90.62.162': 0.16;
'received:dreamhost.com': 0.16; 'wrote:': 0.16; 'code.': 0.17;
'probably': 0.17; 'guidance': 0.19; 'to:addr:python-list': 0.20;
'exception': 0.22; 'code': 0.23; 'depends': 0.25; 'seems': 0.26;
'stefan': 0.26; '>>>': 0.28; 'sense': 0.28; 'header:User-Agent:1':
0.30; 'seem': 0.31; 'am,': 0.31; "doesn't": 0.32; 'python-list':
0.32; 'received:10.0': 0.32; 'received:mailchannels.net': 0.32;
'received:relay.mailchannels.net': 0.32; 'said,': 0.32; 'but':
0.32; 'particular': 0.33; 'skip:" 20': 0.34; 'header:In-Reply-
To:1': 0.34; 'those': 0.36; 'really': 0.37; 'could': 0.38;
'quite': 0.39; 'handle': 0.39; 'use': 0.39; 'rest': 0.39; 'both':
0.40; 'want': 0.40; 'search': 0.61; 'above': 0.62; 'richard':
0.64; 'with:': 0.64; 'your': 0.64; 'among': 0.65; 'types': 0.67;
'header:Received:6': 0.67; 'received:64': 0.67; 'right': 0.68;
'manually': 0.69; 'pass,': 0.69; 'left': 0.83; 'prominent': 0.84;
'quotation': 0.84; 'reversed': 0.84; 'replacing': 0.91
X-Sender-Id: dreamhost|x-authsender|tpassin@tompassin.net
ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1698256240; a=rsa-sha256;
cv=none;
b=AK0chNrUgmKMKG4rSmb2HXa3lvrG0wScFvHu7BSkkRUcba5/fq8PHJ1vQl4HW2hKPmNLoi
imdqqYjNepkIRp/bzxA1wQOFQ8Kk94kqCS9B155lwho+YVFCQQiu379zAJN0YSL0M4GOb9
rpBtg1X0j2gzF34sd9Arbcb5MlAWHFoCEZRZzka1rPTJhnQYLXpx3kVjZTkMRFLO3c75l6
yuv1HOKR6MQ1DkXMfqck6H9HmJyp0qsduWaMOoHnZMxVIdosjjPbxRBXJ72tOT+ZXJKwbV
DQ84/OZxZxFDi2KFl+8n83u3cUjxRFk7fCjT5L23rhARAuk4+dahkl8l3o6E5Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed;
d=mailchannels.net; s=arc-2022; t=1698256240;
h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
to:to:cc:mime-version:mime-version:content-type:content-type:
content-transfer-encoding:content-transfer-encoding:
in-reply-to:in-reply-to:references:references:dkim-signature;
bh=+WpweUJY4qBsj8GZSnMjBEEITcVCPZaCQyERgpdSmrY=;
b=CuuYcTs49JJZT14hzy/us5m425Bx0oOyqdKnBj7MhWgv2W4AaqQDHd2WifLGc0ZRkXhU2T
oTkXrJ4fG10isDLMulOV8BqIJDNzCKPmOc8Wtn0c8xSF8l8Oy9zOOCCTVkcTdBODgP56iA
IzVtlzq5REfz1PhhKAw0dKqFAsZLq3VMTziHSa2hwnl/Ye3V0mOyE5+vVuC9MDVSiuDKAX
tZJN9kbATtJnQrJ5IVA01NW+NLlOBB2cu3PlkzxeO/N+xQ/WmwujRSMpGkzvUTGK4TVbFj
bBmgzlftuDf5h7t2zo20ZEkjJuoeZXbOcv2WRzf6LwQZcB+1V9P+7/hyIIMQcQ==
ARC-Authentication-Results: i=1; rspamd-86646d89b6-x2bdw;
auth=pass smtp.auth=dreamhost smtp.mailfrom=list1@tompassin.net
X-Sender-Id: dreamhost|x-authsender|tpassin@tompassin.net
X-MC-Relay: Neutral
X-MailChannels-SenderId: dreamhost|x-authsender|tpassin@tompassin.net
X-MailChannels-Auth-Id: dreamhost
X-Macabre-Minister: 26b43ad76d34bdf9_1698256240587_1634176855
X-MC-Loop-Signature: 1698256240587:459651557
X-MC-Ingress-Time: 1698256240587
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tompassin.net;
s=dreamhost; t=1698256240;
bh=+WpweUJY4qBsj8GZSnMjBEEITcVCPZaCQyERgpdSmrY=;
h=Date:Subject:To:From:Content-Type:Content-Transfer-Encoding;
b=Huyx2VxFbs0tMMmLwuXTLdZr4VvWdqsETxXYNvPJ5jT2MVPbemJEFezq6oX5nxdE1
FH651V9ECDXVezYBmQ+vUbPiZ3Mmp5C2VmLMQERPMM77nAi8ZziBwxe97UwcWZZyGj
kn4pRsNPGHZwDcBBJNuBW5NuCHot3Zv3XhmPTJCQb7uVyXm/+ZlZ/TU/x4FPl001es
mHO0BFMvybNkdu2VP5V8Fk4LF8Jjr8bb1mvqWvT7a7kHIeLvTae5nsxtn+SoYiIt79
fBgmQv+juGx/Wggk1RxHdVE7dHexu8jNi9uR67Qf/0pDTBP7pQXAsp1UMoKe2NCFlY
M3uQx4YrbjgWA==
User-Agent: Mozilla Thunderbird
Content-Language: en-US
In-Reply-To: <uhbddo$pu1n$1@dont-email.me>
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: <62012c67-6af3-41e3-9b5b-5ede6ff90f72@tompassin.net>
X-Mailman-Original-References: <uhb85v$pu1o$1@dont-email.me>
<Exceptions-20231025154940@ram.dialup.fu-berlin.de>
<exceptions-20231025160611@ram.dialup.fu-berlin.de>
<uhbddo$pu1n$1@dont-email.me>
 by: Thomas Passin - Wed, 25 Oct 2023 17:50 UTC

On 10/25/2023 11:49 AM, rsutton via Python-list wrote:
> On 10/25/2023 11:06 AM, Stefan Ram wrote:
>> ram@zedat.fu-berlin.de (Stefan Ram) writes:
>>> outer quotation marks) prints some prominent exception types. After
>>> manually removing those that do not seem to apply, I am left with:
>>> "AssertionError",
>>> "ChildProcessError",
>> ...
>>
>>    "Manually removing" above was meant to be a fast first pass,
>>    where I only excluded exception types that were obviously
>>    inappropriate. It is now to be followed by a search for the
>>    appropriate exception types among those exception types left.
>>
>>
> @Rene & @Stefan,
> I really appreciate the guidance provided.  By replacing Exception with
> RuntimeError, pylint seems happy!  More specificity, I guess.  I know
> that I could have ignored the pylint exceptions, but I want to use this
> as a learning experience.  I looks like I have a lot of reading to do on
> exception handling. IMO all of the try/except code looks quite clumsy to
> me.  It may be excellent for some tasks but to me, it looks quite
> inelegant.  Like I said, I have a lot to learn.

In this particular case you could probably just handle the return result
from robocopy right there. Of course, it depends on the rest of the
code. It probably doesn't really need an exception, and if you want to
handle it in the calling function, you could just return the result as a
boolean:

return p.returncode < 8 # Reversed the test since a return of "True"
# would make more sense as a return code

> Thank you both for your guidance.
>
> Richard
>

Re: Too Broad of an exception

<mailman.82.1698283952.3828.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24236&group=comp.lang.python#24236

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: PythonL...@DancesWithMice.info (dn)
Newsgroups: comp.lang.python
Subject: Re: Too Broad of an exception
Date: Thu, 26 Oct 2023 14:32:18 +1300
Organization: DWM
Lines: 26
Message-ID: <mailman.82.1698283952.3828.python-list@python.org>
References: <uhb85v$pu1o$1@dont-email.me>
<Exceptions-20231025154940@ram.dialup.fu-berlin.de>
<exceptions-20231025160611@ram.dialup.fu-berlin.de>
<uhbddo$pu1n$1@dont-email.me>
<74cda9f7-2fcf-48f1-b227-bac8c558dcef@DancesWithMice.info>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de ZdnfGeJ7U+VauRiWKj0ehwd2pa2aJr7Q8msu3uBG9Dbg==
Cancel-Lock: sha1:TzzKXCCcuTL4XhMZZPdI/V2K13s= sha256:KnI5qUfcPyfmAPjkILzKGwMsFEzO1IataYk+Uvv1nnE=
Return-Path: <PythonList@DancesWithMice.info>
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=danceswithmice.info header.i=@danceswithmice.info
header.b=A2X9/y82; dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.008
X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'ram': 0.07; '=dn': 0.09;
'from:addr:danceswithmice.info': 0.09; 'from:addr:pythonlist':
0.09; 'meant': 0.09; 'obviously': 0.09; 'prints': 0.09;
'received:192.168.1.64': 0.09; 'types.': 0.09; 'writes:': 0.09;
'excluded': 0.16; 'message-id:@DancesWithMice.info': 0.16;
'outer': 0.16; 'received:cloud': 0.16; 'received:rangi.cloud':
0.16; 'wrote:': 0.16; 'guidance': 0.19; 'to:addr:python-list':
0.20; 'unable': 0.21; 'exception': 0.22; 'stefan': 0.26; '>>>':
0.28; 'header:User-Agent:1': 0.30; 'am,': 0.31;
'header:Organization:1': 0.31; 'python-list': 0.32;
'received:192.168.1': 0.32; 'header:In-Reply-To:1': 0.34;
'people': 0.36; 'those': 0.36; 'really': 0.37; 'received:192.168':
0.37; 'least': 0.39; 'neither': 0.39; 'learn': 0.40; 'search':
0.61; 'above': 0.62; 'email': 0.63; 'among': 0.65; 'benefit':
0.65; 'types': 0.67; 'pass,': 0.69; '....': 0.76; 'prominent':
0.84; 'quotation': 0.84; 'replacing': 0.91
DKIM-Filter: OpenDKIM Filter v2.11.0 vps.rangi.cloud 20DFC3C67
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=danceswithmice.info;
s=staff; t=1698283942;
bh=prkWs2TYwlm9sg5+YCf7HOkznXuzY8ePkjBq6KCa+N0=;
h=Date:Subject:To:References:From:In-Reply-To:From;
b=A2X9/y82TBxg/LtJ6l7AM/SiAix8LjIiwEu40wELU/FhW4eOAM4v9M2I3/GpsYXLm
XsdqqfT6zglMbGtU630L9XZO0dX56/YC+V/vvDlStrfSOGHFcrgkBc5+dfMpln4NvP
2rjTwIebd9wisz50JbvaDDLE5NdL0TZreghaLzxL7zUM/gK1ptAi2yM7z9e5Mi+iix
WrphC34jLOayJkcyUjRlirkle+gtSF7BcrVyuK2basZEKlatDJzi3SWCvlyeKQLsVG
/oleoJ4vdF2s8iIUCVoQjxzSnBYg7tAA7CEMJTh3cNT2/0q6x11Wje0cMdZBwICe66
oKGM5AWqkcJbw==
User-Agent: Mozilla Thunderbird
Content-Language: en-GB
In-Reply-To: <uhbddo$pu1n$1@dont-email.me>
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: <74cda9f7-2fcf-48f1-b227-bac8c558dcef@DancesWithMice.info>
X-Mailman-Original-References: <uhb85v$pu1o$1@dont-email.me>
<Exceptions-20231025154940@ram.dialup.fu-berlin.de>
<exceptions-20231025160611@ram.dialup.fu-berlin.de>
<uhbddo$pu1n$1@dont-email.me>
 by: dn - Thu, 26 Oct 2023 01:32 UTC

On 26/10/2023 04.49, rsutton via Python-list wrote:
> On 10/25/2023 11:06 AM, Stefan Ram wrote:
>> ram@zedat.fu-berlin.de (Stefan Ram) writes:
>>> outer quotation marks) prints some prominent exception types. After
....

>>    "Manually removing" above was meant to be a fast first pass,
>>    where I only excluded exception types that were obviously
>>    inappropriate. It is now to be followed by a search for the
>>    appropriate exception types among those exception types left.
>>
>>
> @Rene & @Stefan,
> I really appreciate the guidance provided.  By replacing Exception with
....

It would appear that (at least one message) did not make it to email -
neither to the list-archive.

People wishing to learn are unable to benefit a response, if it is not
sent to the list!

--
Regards,
=dn

Re: Too Broad of an exception

<uhda2p$1fp8c$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24237&group=comp.lang.python#24237

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: mai...@rkta.de (Rene Kita)
Newsgroups: comp.lang.python
Subject: Re: Too Broad of an exception
Date: Thu, 26 Oct 2023 09:04:27 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 22
Message-ID: <uhda2p$1fp8c$1@dont-email.me>
References: <uhb85v$pu1o$1@dont-email.me> <uhb8h4$ppm7$1@dont-email.me>
Injection-Date: Thu, 26 Oct 2023 09:04:27 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="4ae6c0fd11fc7796660e255cccd00d1a";
logging-data="1565964"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/c9QkPegkFCDZRs+h1HiOj"
User-Agent: tin/2.6.2-20221225 ("Pittyvaich") (Linux/5.10.0-26-amd64 (x86_64))
Cancel-Lock: sha1:qjd7Ux8p6qCUkVCjFNdIKO+0+NM=
 by: Rene Kita - Thu, 26 Oct 2023 09:04 UTC

Rene Kita <mail@rkta.de> wrote:
> rsutton <rsutton43@comcast.net> wrote:
>> Hi all,
>> I am fairly new to python (ie < 2 years). I have a question about
>> pylint. I am running on windows 10/11, python 3.10.11.
> [...]
>> if p.returncode >= 8:
>> raise Exception(f'Invalid result: {p.returncode}')
>>
>> It actually runs fine. But pylint is not having it. I get:
>>
>> win_get_put_tb_filters.py:61:12: W0719: Raising too general exception:
>> Exception (broad-exception-raised)
>
> pylint is just a linter, ignore it if the code works and you like it the
> way it is.
>
> pylint complains because you use Exception. Use e.g. RuntimeException to
> silence it.
^^^^^^^^^^^^^^^^

Ingrid says it's a RuntimeError, not RuntimeException.

Re: Too Broad of an exception

<mailman.90.1698340231.3828.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24245&group=comp.lang.python#24245

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: mat...@wichmann.us (Mats Wichmann)
Newsgroups: comp.lang.python
Subject: Re: Too Broad of an exception
Date: Thu, 26 Oct 2023 11:10:20 -0600
Lines: 34
Message-ID: <mailman.90.1698340231.3828.python-list@python.org>
References: <uhb85v$pu1o$1@dont-email.me> <uhb8h4$ppm7$1@dont-email.me>
<uhda2p$1fp8c$1@dont-email.me>
<1b484d6f-cdda-4fbf-9be1-fbedd0f82c48@wichmann.us>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de Bttb+/kGnVT0dyLT87Ba3QQ0T3MDW54dw4hgfjmT+e8A==
Cancel-Lock: sha1:E2bBV5CfFlL1RcyYvYqadQl/KKA= sha256:52lkayp3cxlSS85dEdSP8OLEQAskEmiwyHMz5ykrpcU=
Return-Path: <mats@wichmann.us>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="1024-bit key; unprotected key"
header.d=pobox.com header.i=@pobox.com header.b=luYBMBl1;
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.022
X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'fairly': 0.05; 'is.':
0.05; 'e.g.': 0.07; 'skip:^ 10': 0.09; '(ie': 0.16; 'exception.':
0.16; 'instance': 0.16; 'pylint': 0.16; 'received:64.147': 0.16;
'silence': 0.16; 'turns': 0.16; 'wrote:': 0.16; 'python': 0.16;
'says': 0.17; 'to:addr:python-list': 0.20; 'all,': 0.20;
'exception': 0.22; 'code': 0.23; '(and': 0.25; 'saying': 0.25;
'>>>': 0.28; 'purpose': 0.28; 'header:User-Agent:1': 0.30;
'raise': 0.31; 'question': 0.32; 'fine.': 0.32; 'python-list':
0.32; 'but': 0.32; 'windows': 0.34; 'header:In-Reply-To:1': 0.34;
'running': 0.34; 'runs': 0.35; "it's": 0.37; 'class': 0.37;
'received:192.168': 0.37; 'way': 0.38; 'put': 0.38; 'use': 0.39;
'want': 0.40; 'pass': 0.64; 'received:64': 0.67; 'too.': 0.70;
'ignore': 0.71; '....': 0.76; '"warning",': 0.84; 'car': 0.84;
'dead,': 0.84; 'convey': 0.91; 'battery': 0.93
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=message-id
:date:mime-version:subject:to:references:from:in-reply-to
:content-type:content-transfer-encoding; s=sasl; bh=At8E7sR3ZehI
rh4asUkx7Dh8dnZqTUTfMyfM5fP7AxE=; b=luYBMBl14LpNVfFAufLJHHWi65Ok
mqzfo/TuBeGT5qf9m5DgIzE6+bZbgKJdhN0Qps0JO50+qNi/NzEAjUHCfQugoQoT
hJSQl3kQtLqqR1OohCwLYr+ZateYwoAZdQrWVrVUM81Adq2Lu13T97GcPUDtAH6R
sRXmcmxkaHM+SwI=
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=wichmann.us;
h=message-id:date:mime-version:subject:to:references:from:in-reply-to:content-type:content-transfer-encoding;
s=2018-07.pbsmtp; bh=At8E7sR3ZehIrh4asUkx7Dh8dnZqTUTfMyfM5fP7AxE=;
b=Y3TL8682I4juQ7CG8hUUi0Fva6Dt2hfM/H/UbXMy95plyM550e6X/1WAK0xI78Qpd1x2CkSLnayzFmq4UVx30iVNusdkz7k+2SS1CstBbUpk8PXtjLsexIZvmGReHraXJu1YSBJX51HxHgmuW2dxMSePz7C4T04N3pJc+0DSFDY=
User-Agent: Mozilla Thunderbird
Content-Language: en-US
Autocrypt: addr=mats@wichmann.us; keydata=
xsDiBD9xp6oRBAC1vd3YI8Gcr1CxpV1gldNQu0uQsNaICDk+Ai3+R163s/P83JOYG+SBEA3P
v7iZx70qpQ3RzP7KrjF1Nm6j0em9ccUX2fPQUCAxXw5Hiq7CSMiwQQZRI6shcnyMh9XTKViT
WK5MrKDyvjDEn7epjKzKwPS5SG039l6XaOKU0A4uGwCgsNqUQqC0gMMcbKlJV8ql58iKmbMD
/ii8FPQrXmyS/FnsPs7UddV5qMHKm7NUH5oiKuMVyakInRyq9iIxuu3D4Ec6mWRKcGsjmIkW
HXCSz0aefs6dsqNqpU54cYioJ3wP5LzHK7oclgJPryVt5Qezbdutf8SQf8gVkaNIlkxwGUzi
bKTZ6CHzwlz9nNgeel0XPUcZzFxGA/4paeCg2rMSVuAhUQbsLYHu4XzTs9P16zaXkrtxc4m5
b+BF5xsLgTpyO5l859XudS2Gp+7/Y37dAU4QlyGGOboWmF1y9U5DnzBwG8ghsnym+ga58MJh
LdRdQQ6xQolCpEXOuzm40f2r5uMxF3KOJ7WpIPuGAkeCPru9BmlATH+zOs0gTWF0cyBXaWNo
bWFubiA8bWF0c0B3aWNobWFubi51cz7CYQQTEQIAIQIbAwYLCQgHAwIDFQIDAxYCAQIeAQIX
gAUCT0VyZwIZAQAKCRDAMaCQc9hUxiZBAJ9cWziGp7hVfsu5T+cQptc3rLNndQCgrZh8u5LW
BfJ5e/Y+3PwZ8UEm+ELOwE0EP5is8BAEAMtwzcA8TYf5UTjDMgwcSNoErTc9ag+IX05QFgL8
aF8sfJRv5atcitqQy0gSIsOzI+L/AFdPN/+QQI3dL1tCq14t32KPDtigDhzm6jVPXX5z+V9u
xnD8XTp+ZvNcWoHXjViM8aXeLLEiCpiVCho307h3XShvqoKINWRQWeAsKKDDAAMFA/48zaey
wiiEyvI0meJ1KkNHxdLP0yLODr1WV6j9xkPkLWOaIDw7dlwEOlF1N1YtZ2wa0p1wsttdIbIx
ffgwXmcH4zrdxUIMz3U0BqYzk5H+5cYFXECXTFVOmweS+JECYMj80PjRoKCO1eVO1N30zksB
36NnhZWPRWIhjK3ZarIYH8JGBBgRAgAGBQI/mKzwAAoJEMAxoJBz2FTG6VEAoKDYHfDp5Q3q
PuPvPahCE9HsXMgAAJ9INTqcLSJrOfyJ8q95nBO1T26H2Q==
In-Reply-To: <uhda2p$1fp8c$1@dont-email.me>
X-Pobox-Relay-ID: 8BC30994-7422-11EE-9E26-25B3960A682E-81526775!pb-smtp2.pobox.com
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: <1b484d6f-cdda-4fbf-9be1-fbedd0f82c48@wichmann.us>
X-Mailman-Original-References: <uhb85v$pu1o$1@dont-email.me>
<uhb8h4$ppm7$1@dont-email.me>
<uhda2p$1fp8c$1@dont-email.me>
 by: Mats Wichmann - Thu, 26 Oct 2023 17:10 UTC

On 10/26/23 03:04, Rene Kita via Python-list wrote:
> Rene Kita <mail@rkta.de> wrote:
>> rsutton <rsutton43@comcast.net> wrote:
>>> Hi all,
>>> I am fairly new to python (ie < 2 years). I have a question about
>>> pylint. I am running on windows 10/11, python 3.10.11.
>> [...]
>>> if p.returncode >= 8:
>>> raise Exception(f'Invalid result: {p.returncode}')
>>>
>>> It actually runs fine. But pylint is not having it. I get:
>>>
>>> win_get_put_tb_filters.py:61:12: W0719: Raising too general exception:
>>> Exception (broad-exception-raised)
>>
>> pylint is just a linter, ignore it if the code works and you like it the
>> way it is.
>>
>> pylint complains because you use Exception. Use e.g. RuntimeException to
>> silence it.
> ^^^^^^^^^^^^^^^^
>
> Ingrid says it's a RuntimeError, not RuntimeException.

Meanwhile, the purpose of this complaint from pylint (and notice it's a
"warning", not an "error", so take that for what it's worth), is that
you usually want to convey some information when you raise an exception.
Of course, you can put that into the message you pass to the class
instance you raise, but the type of exception is informational too.
Raising just "Exception" is equivalent to saying "my car is broken",
without specifying that the starter turns but won't "catch", or starts
but the transmission won't engage, or the battery is dead, or .... so
it's *advising* (not forcing) you to be more informative.

Re: Too Broad of an exception

<type-20231026184329@ram.dialup.fu-berlin.de>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24246&group=comp.lang.python#24246

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram...@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.python
Subject: Re: Too Broad of an exception
Date: 26 Oct 2023 17:43:51 GMT
Organization: Stefan Ram
Lines: 14
Expires: 1 Sep 2024 11:59:58 GMT
Message-ID: <type-20231026184329@ram.dialup.fu-berlin.de>
References: <uhb85v$pu1o$1@dont-email.me> <uhb8h4$ppm7$1@dont-email.me> <uhda2p$1fp8c$1@dont-email.me> <1b484d6f-cdda-4fbf-9be1-fbedd0f82c48@wichmann.us> <mailman.90.1698340231.3828.python-list@python.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de 1OpdlLDSZrF6omOuDVEFKwD2VNaqfgd8sNYsZpv7XxegDw
Cancel-Lock: sha1:QdAF1rR96HNUH8KMtB3MDBjkaMc= sha256:8Jn9zyZevZ+7xLuGZ7J1pATwXRG5VF774OtWDVIzhb4=
X-Copyright: (C) Copyright 2023 Stefan Ram. All rights reserved.
Distribution through any means other than regular usenet
channels is forbidden. It is forbidden to publish this
article in the Web, to change URIs of this article into links,
and to transfer the body without this notice, but quotations
of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
services to mirror the article in the web. But the article may
be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en-US
Accept-Language: de-DE-1901, en-US, it, fr-FR
 by: Stefan Ram - Thu, 26 Oct 2023 17:43 UTC

Mats Wichmann <mats@wichmann.us> writes:
>Of course, you can put that into the message you pass to the class
>instance you raise, but the type of exception is informational too.

|Note: Exception messages are not part of the Python API.
|Their contents may change from one version of Python to the
|next without warning and should not be relied on by code
|which will run under multiple versions of the interpreter.
The Python Language Reference, Release 3.13.0a0

So, when it comes to the standard library, /only/ the type
of exception is informational (for interpretation by code).

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor