Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

6 May, 2024: The networking issue during the past two days has been identified and appears to be fixed. Will keep monitoring.


devel / comp.lang.python / Re: imaplib: is this really so unwieldy?

SubjectAuthor
o Re: imaplib: is this really so unwieldy?MRAB

1
Re: imaplib: is this really so unwieldy?

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: pyt...@mrabarnett.plus.com (MRAB)
Newsgroups: comp.lang.python
Subject: Re: imaplib: is this really so unwieldy?
Date: Tue, 25 May 2021 18:25:47 +0100
Lines: 28
Message-ID: <mailman.343.1621963737.3087.python-list@python.org>
References: <21fb6c5f-97a4-654b-887f-2c31a549bcbe@adminart.net>
<hd6qag98c37mvqurlu3mfcvie38o63kn6n@4ax.com>
<d0e29810-858a-8a32-fda6-a68c63224606@mrabarnett.plus.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de +fQooDc1ZhrPlmwxjucj0gRIKttFUW9qaO3fLCPpYvvw==
Return-Path: <python@mrabarnett.plus.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=plus.com header.i=@plus.com header.b=ZY0b/SX7;
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.001
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; '(which': 0.04; 'utf-8':
0.07; 'convert': 0.09; 'forced': 0.09; 'from:addr:python': 0.09;
'received:192.168.1.64': 0.09; "shouldn't": 0.09; '+0200,': 0.16;
'bytes)': 0.16; 'characters.': 0.16; 'cpython': 0.16; 'encoding':
0.16; 'expressions': 0.16; 'from:addr:mrabarnett.plus.com': 0.16;
'from:name:mrab': 0.16; 'message-id:@mrabarnett.plus.com': 0.16;
'recall': 0.16; 'received:84.93': 0.16; 'received:84.93.230':
0.16; 'received:plus.net': 0.16; 'skip:> 10': 0.16; 'wrote:':
0.16; 'python': 0.16; 'tue,': 0.18; 'to:addr:python-list': 0.23;
'binary': 0.27; 'extract': 0.27; 'wrong': 0.27; 'function': 0.28;
'input': 0.29; 'header:User-Agent:1': 0.31; 'received:192.168.1':
0.31; 'there': 0.31; 'stuff': 0.31; 'expect': 0.31; "i'm": 0.32;
'half': 0.32; 'using': 0.33; 'header:In-Reply-To:1': 0.33;
'functions': 0.34; 'received:192.168': 0.37; 'really': 0.37;
'use': 0.38; 'subject:this': 0.63; 'per': 0.64; 'your': 0.64;
'produce': 0.69; '2021': 0.84; 'strings': 0.84; 'subject:really':
0.84; 'weird': 0.84
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=plus.com; s=042019;
t=1621963548; bh=TaDrRari/GZei7h08pfzgy7fAMELnYOY1SFpniNN13U=;
h=Subject:To:References:From:Date:In-Reply-To;
b=ZY0b/SX7/xgEZ5v+dLpJEh/0eDleV8335O7CMKqduyhv1E3HyuV6mFImFOJxaakmW
E42gFO06pmNRrSIHuJyEU2R536Z4u8L1j6tpMqzuvH9NqykIzUUKh+QikpylJrFLep
0KFEL721v8uBfR/R0OnJgOUx27Mg5LnMS3RvN1gz51iGA8RLnN40IRKV/lNtniM8yk
uMFwKn9+MeJ9okj3pZo+d4TpISBP92oA7+PB2fvq/IxZ4PQ+OF1WNfwTnNLkp77mZU
3ichYOGos4p9/fT7kIvblBTSqy6ruB/nplFrWjrRQ2asX7ETYbOla3E/nEDTGWUt0h
oQWaJbLNZN4hQ==
X-Clacks-Overhead: "GNU Terry Pratchett"
X-CM-Score: 0.00
X-CNFS-Analysis: v=2.3 cv=KZJJTTQD c=1 sm=1 tr=0
a=0nF1XD0wxitMEM03M9B4ZQ==:117 a=0nF1XD0wxitMEM03M9B4ZQ==:17
a=IkcTkHD0fZMA:10 a=0KU9oN4GAAAA:8 a=1AFl_gOaZcBCinoXkK8A:9 a=QEXdDO2ut3YA:10
a=vZUsqdSGfhw7UDhy8bVS:22
X-AUTH: mrabarnett@:2500
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.10.2
In-Reply-To: <hd6qag98c37mvqurlu3mfcvie38o63kn6n@4ax.com>
Content-Language: en-GB
X-CMAE-Envelope: MS4wfBif0WqkEEoGkIbeazbEQuAc/yphz30tIGAXD/gjfz8bMBG/uWhvAsNwWyjMkkwy3HLGMoHGK2egA14gRc4VoW/dtLpY7TC0PMkMy6kLdQ42v2NacNPN
AA2s5VhO2sADP3IHfJCsJzPCos+KLIIe0ZATDgrMxxr5zFYDBh0QPsCZceO04/2hWgoq0GrvdyVA2w==
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.34
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: <d0e29810-858a-8a32-fda6-a68c63224606@mrabarnett.plus.com>
X-Mailman-Original-References: <21fb6c5f-97a4-654b-887f-2c31a549bcbe@adminart.net>
<hd6qag98c37mvqurlu3mfcvie38o63kn6n@4ax.com>
 by: MRAB - Tue, 25 May 2021 17:25 UTC

On 2021-05-25 16:41, Dennis Lee Bieber wrote:
> On Tue, 25 May 2021 10:23:41 +0200, hw <hw@adminart.net> declaimed the
> following:
>
>>
>>So I'm forced to convert stuff from bytes to strings (which is weird
>>because bytes are bytes) and to use regular expressions to extract the
>>message-uids from what the functions return (which I shouldn't have to
>>because when I'm asking a function to give me a uid, I expect it to
>>return a uid).
>>
> In Python 3, strings are UNICODE, using 1, 2, or 4 bytes PER CHARACTER
> (I don't recall if there is a 3-byte version). If your input bytes are all
> 7-bit ASCII, then they map directly to a 1-byte per character string. If
> they contain any 8-bit upper half character they may map into a 2-byte per
> character string.
>
In CPython 3.3+:

U+0000..U+00FF are stored in 1 byte.
U+0100..U+FFFF are stored in 2 bytes.
U+010000..U+10FFFF are stored in 4 bytes.

> Bytes in Python 3 are just a binary stream, which needs an encoding to
> produce characters. Use the wrong encoding (say ISO-Latin-1) when the data
> is really UTF-8 will result in garbage.
>
>

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor