Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Know Thy User.


devel / comp.lang.python / Re: email.message_from_file & quoted printable

SubjectAuthor
o Re: email.message_from_file & quoted printableSkip Montanaro

1
Re: email.message_from_file & quoted printable

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: skip.mon...@gmail.com (Skip Montanaro)
Newsgroups: comp.lang.python
Subject: Re: email.message_from_file & quoted printable
Date: Sat, 25 Dec 2021 16:23:42 -0600
Lines: 29
Message-ID: <mailman.32.1640471035.3079.python-list@python.org>
References: <CANc-5Ux=GODZmx-MyyO9a6UyfqjWv9FnSXWf5qiabZW8enxj5A@mail.gmail.com>
<YcZMlFqMU6xqFzvh@cskk.homeip.net>
<CANc-5UyKPRqQFP9FVsqe7kFi1_X4hx2ZG8AprFmjpCLx7wX8DQ@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de rkA+C25ZCuFZpSuHFyPLaA9s809EU53yQEWM/09V4gQw==
Return-Path: <skip.montanaro@gmail.com>
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=gmail.com header.i=@gmail.com header.b=SpXIEngX;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.021
X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; '(which': 0.04; 'file?':
0.05; ':-)': 0.09; 'browser,': 0.09; 'install,': 0.09; 'later,':
0.09; 'message.\xc2\xa0': 0.09; 'received:209.85.219': 0.09;
'user.': 0.09; '&gt;': 0.14; 'frequently': 0.16; 'hints': 0.16;
'pull': 0.17; 'to:addr:python-list': 0.20; 'written': 0.22;
"i've": 0.22; "isn't": 0.27; 'function': 0.27; 'thinking': 0.28;
'default': 0.31; 'module': 0.31; 'saved': 0.31; 'think': 0.32;
'false,': 0.32; 'gotten': 0.32; 'raw': 0.32; 'to:name:python':
0.32; 'message-id:@mail.gmail.com': 0.32; 'but': 0.32; "i'm":
0.33; "i'll": 0.33; 'there': 0.33; "didn't": 0.34; 'package':
0.34; 'header:In-Reply-To:1': 0.34; 'received:google.com': 0.34;
'trying': 0.35; 'from:addr:gmail.com': 0.35; 'display': 0.36;
'possibly': 0.36; 'using': 0.37; 'received:209.85': 0.37; 'way':
0.38; 'could': 0.38; 'read': 0.38; 'received:209': 0.39; 'ide':
0.40; 'want': 0.40; 'should': 0.40; 'method': 0.61; 'mental':
0.62; 'simply': 0.63; 'email': 0.63; 'complete': 0.64; 'back':
0.67; 'entire': 0.67; 'content': 0.72; 'choice': 0.76; 'out.':
0.80; 'add-on': 0.84; 'subject:skip:e 20': 0.84
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
h=mime-version:references:in-reply-to:from:date:message-id:subject:to;
bh=BWPsg7j5JJk163ofalI5L7SzpXk84hBon2HuwSHtYiE=;
b=SpXIEngXBLOI2n4PukSacZgKe6Jsg6X8llJ5sf5PSOpy/Y85GHjk3DofgUJTyF+QLL
VZUC/hct4vP0i9XnFzlHeGIiwvSxQrkNi5BIYct2YEm201GO1Oj6gX1OqtRt/zsCdUQM
0Hh4YmMF/UUjzen6i5jwI/FQnyg5X6tn9x4OMWASenV4wWRr1aYSTW7TiJukatC+T8uW
udKJadRM3TVsNC/QCUS8zZGoJWyMsYNiT/0aAFgD2OVEZnzRNU33aevRFrviT9YkF69p
WnD1/9sGntZgz1buO4rDEnQcYP3o/AFoK9Ugs2SdLgd+y4ZxpVA8lTt4Ufal1lzOtwqd
m2Lw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112;
h=x-gm-message-state:mime-version:references:in-reply-to:from:date
:message-id:subject:to;
bh=BWPsg7j5JJk163ofalI5L7SzpXk84hBon2HuwSHtYiE=;
b=V9vMioCB7EOhB3KOrEuxfn1ujBqKMHZ88aD8kKgsdNw+wZP4vQHiTnaHG5QSFLnhia
40bLYTaZ9UnIuNZrsru0CztOqLtwTsKTsrjv0RvOxCU/nqFPOwmYURUcSFfY/Jn4CNg2
EmnRDP+4MTxJLXnFVkF1P/PAr+d0w9XHnk7HIMa1uaHCTz+rTk02FYrY+J6C7yldaZ0b
vJ7yTpxx7PcO2k9qtgq9Hjq18eRkrpsVWAqWv9A7oQ65ua96u2AeZMTG0UV/oM+Pkfv1
y+XXrGLdbDCM/yxhgQG0ETOf2bwpv3XD4Xy4jM2VBwxltsbL/PJQdvf7mdvZoTj69EMF
k88Q==
X-Gm-Message-State: AOAM531/DEC7APWZoCRqgKOU3SOHnPq2X5hch/Sk+rT3AnbP99DHiuCp
f36xMX8XmLTKSNG20fXHfozDidrKMe7ECt1Y5DAKZrCRIdRP
X-Google-Smtp-Source: ABdhPJzDA9WZ3XjILiHc6wJdCZfScrg7KMw2F+fbXlIKlDbY//jw3FO3xHl7U8ukoIKodUiL3Zt11xLl2Vr2dWiX/jo=
X-Received: by 2002:a5b:b44:: with SMTP id b4mr5037497ybr.678.1640471033071;
Sat, 25 Dec 2021 14:23:53 -0800 (PST)
In-Reply-To: <YcZMlFqMU6xqFzvh@cskk.homeip.net>
X-Content-Filtered-By: Mailman/MimeDel 2.1.39
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: <CANc-5UyKPRqQFP9FVsqe7kFi1_X4hx2ZG8AprFmjpCLx7wX8DQ@mail.gmail.com>
X-Mailman-Original-References: <CANc-5Ux=GODZmx-MyyO9a6UyfqjWv9FnSXWf5qiabZW8enxj5A@mail.gmail.com>
<YcZMlFqMU6xqFzvh@cskk.homeip.net>
 by: Skip Montanaro - Sat, 25 Dec 2021 22:23 UTC

> That sometimes you want the raw content as it was in the file? That if
> you have that choice (decoded or raw) the default should be False, as it
> does less?

Yeah, thinking back later, the round-trip possibility seemed plausible.
I'll stop overthinking this now...

> That we my _first_ instinct - I've never used get_payload(), myself, and
> I've written my own complete mailfiler :-)

I'm only trying to display email through a web browser, possibly with a
link to the raw message.

> Really, if a function isn't doing what you want you should always read
> the docs for that function specificly, even if you don't want to read
> the entire module docs (which is a big ask).

Yeah, my mental model was simply off. I frequently pull up docs in my
browser. I was thinking the message contents would be normalized when
reading. It didn't occur to me the transformation would occur on the way
out.

I think another way I might have saved myself was if I was using a modern
IDE where I might have gotten some hints hovering over the method call.
But, I'm an End user. I'm sure there is some add-on package I could
install, but I haven't looked.

Skip

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor