Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Remember, UNIX spelled backwards is XINU. -- Mt.


devel / comp.lang.python / Re: tail

SubjectAuthor
o Re: tailMarco Sulla

1
Re: tail

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: Marco.Su...@gmail.com (Marco Sulla)
Newsgroups: comp.lang.python
Subject: Re: tail
Date: Sat, 7 May 2022 18:28:47 +0200
Lines: 16
Message-ID: <mailman.337.1651940967.20749.python-list@python.org>
References: <CABbU2U-_Z546umxtnZXL8b1LUERCnyOxYw6osKTvKncOHFkJ3A@mail.gmail.com>
<60454E09-0ADA-4881-A84B-6C11397D244F@barrys-emacs.org>
<CABbU2U99Jpa6nuYg0sXw6=GjBEKVk9u-_oyxSoL8hLrW_2FoBA@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Trace: news.uni-berlin.de vJQ7mJS9AZ3iZtFI9K49nQE9sJepxO+jtOQBZyYgwvgw==
Return-Path: <elbarbun@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=WXGoZiWR;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.028
X-Spam-Evidence: '*H*': 0.94; '*S*': 0.00; '2022': 0.05; 'bin': 0.09;
'cc:addr:python-list': 0.09; 'received:209.85.219': 0.09; 'cc:no
real name:2**0': 0.14; 'barry': 0.16; 'encoding': 0.16;
'from:name:marco sulla': 0.16; 'wrote:': 0.16;
'cc:addr:python.org': 0.20; 'sat,': 0.22; 'cc:2**1': 0.23; '>>>':
0.28; 'message-id:@mail.gmail.com': 0.32; 'skip:" 20': 0.34;
'header:In-Reply-To:1': 0.34; 'received:google.com': 0.34;
'handling': 0.35; 'from:addr:gmail.com': 0.35; 'cases': 0.36;
'received:209.85': 0.37; 'hard': 0.37; 'file': 0.38;
'received:209': 0.39; 'handle': 0.39; 'use': 0.39; 'mode': 0.62;
'skip:b 20': 0.63; 'skip:b 10': 0.63; 'skip:" 40': 0.84; 'trick':
0.91
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
:cc:content-transfer-encoding;
bh=RkNDCaVMdNWoy3QJrX9PthUV+z2wsjlFikx53I5YCYs=;
b=WXGoZiWRCprflUuv/ZG8vbmm/nnPfamHMEN6bPJEho+1GSI95HNaaJS18j+bqH/NOH
jKK4P61sx3gWFsdbSRbbpoDQkPJigbGIiFA1R8Ia0pnSrR0XQDjw2t4XH/RSvwrDaGdG
nhZmAcu+SVx8yBnMuKh9YEJOkXeMiYxDUaaLg5uhwvO+wYxD8MGfX0esibGGmJL3nuQP
3PIRySS7eTb0uhf0K8OOm2BS41Sb8E+zM+tN9742UeoCf8oc0F23JDtsaRT6g5vgHxZ5
623kLB53nt2513y/zYqgg2hmyH5EIa7YrjAaxlt7SRA+48IbPMTU6qWgCJuZFpt4rEpe
cvHw==
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:cc:content-transfer-encoding;
bh=RkNDCaVMdNWoy3QJrX9PthUV+z2wsjlFikx53I5YCYs=;
b=Fv5ebnVCEzcKmA9T74E5v6sd8HoTxGNnxB0rNVcvoUuMopxiDYADqcuFdSnlBLxXaX
4B9o7lCmrNXnsGhd44DpeSQDgBsVtKgFvsv6Z9W0viATlQfVnDEYrQVd6p/D2Jh+4ojL
lFszxwXnwlG0pllazZdRzy8GGMSZ6TPL0cWgu5DqQdTJu4nI2MEHYAE2TPrDcH6zPf+8
m+miGDf345G6mb8EJVp/wnA8aHB4NWl2WHvPmrUItjHIUZmBoF0WPh6UEHJssD746oVi
TLKVt1rPjLoqE4UxVx7TPmt+Rr4lhL0KfGYt76tB8xA7kr1uHF08kkTOn9HPDWhzN4SW
SJMA==
X-Gm-Message-State: AOAM5312/ecw2isF8waM5QYVASdtKydbLlbgJQ16DdITzfJN8otSfXIT
05RSgY6sxL2OT5Ww0euXl+qb22jPpRm8n7eEjuQ=
X-Google-Smtp-Source: ABdhPJxEBeTFFFn135XZ8KZUNWLaBhYsGuOTy4cLBijod5FChcUlTUXWc1Kimk4bHG6rReDokLyMlI7Oqqv9kMC1WkI=
X-Received: by 2002:a25:fc6:0:b0:649:96cc:1213 with SMTP id
189-20020a250fc6000000b0064996cc1213mr6781410ybp.119.1651940964554; Sat, 07
May 2022 09:29:24 -0700 (PDT)
In-Reply-To: <60454E09-0ADA-4881-A84B-6C11397D244F@barrys-emacs.org>
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: <CABbU2U99Jpa6nuYg0sXw6=GjBEKVk9u-_oyxSoL8hLrW_2FoBA@mail.gmail.com>
X-Mailman-Original-References: <CABbU2U-_Z546umxtnZXL8b1LUERCnyOxYw6osKTvKncOHFkJ3A@mail.gmail.com>
<60454E09-0ADA-4881-A84B-6C11397D244F@barrys-emacs.org>
 by: Marco Sulla - Sat, 7 May 2022 16:28 UTC

On Sat, 7 May 2022 at 16:08, Barry <barry@barrys-emacs.org> wrote:
> You need to handle the file in bin mode and do the handling of line endings and encodings yourself. It’s not that hard for the cases you wanted.

>>> "\n".encode("utf-16")
b'\xff\xfe\n\x00'
>>> "".encode("utf-16")
b'\xff\xfe'
>>> "a\nb".encode("utf-16")
b'\xff\xfea\x00\n\x00b\x00'
>>> "\n".encode("utf-16").lstrip("".encode("utf-16"))
b'\n\x00'

Can I use the last trick to get the encoding of a LF or a CR in any encoding?

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor