Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #109905

Re: base64.b64encode(data)

Path csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Subject Re: base64.b64encode(data)
Date Tue, 14 Jun 2016 03:07:35 +1000
Lines 13
Message-ID <mailman.42.1465837657.2288.python-list@python.org> (permalink)
References <ccd85c61-263c-4ebd-b47f-b35fafa3f521@googlegroups.com> <575e18f1$0$1588$c3e8da3$5496439d@news.astraweb.com> <1465788057.2854167.635655857.445F242C@webmail.messagingengine.com> <mailman.26.1465788060.2288.python-list@python.org> <575e4198$0$1588$c3e8da3$5496439d@news.astraweb.com> <bb6da4a8-165b-6fc7-700e-4c1855bc36fd@gmail.com> <CAPTjJmrCfoKQ7zAVQY9dh=es8q8CJnn8euDpTxF+GYAszfKUWQ@mail.gmail.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
X-Trace news.uni-berlin.de MnfOPLK+uUIapLT8UR3o4Ac3hZbOW+iX+e5aBLF9qpKA==
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'python,': 0.02; 'subject:skip:b 10': 0.07; 'cc:addr:python-list': 0.09; 'behave': 0.09; 'bytes,': 0.09; 'high-level': 0.09; 'subclass': 0.09; 'python': 0.10; '2016': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'received:74.125.82.46': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'bytes': 0.18; 'case.': 0.18; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'text,': 0.22; 'am,': 0.23; 'header :In-Reply-To:1': 0.24; 'message-id:@mail.gmail.com': 0.27; '14,': 0.27; 'str': 0.29; 'strings,': 0.29; 'maybe': 0.33; 'point': 0.33; 'michael': 0.33; 'tue,': 0.34; 'received:google.com': 0.35; 'text': 0.35; 'text.': 0.35; 'received:74.125.82': 0.35; 'but': 0.36; 'subject:: ': 0.37; 'chrisa': 0.84; 'expect.': 0.84; 'to:none': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:cc; bh=9vDiGv1Efgg3r4f5lNPApN6HQ046xw7ECU0qUxj8Yb8=; b=xSCKnbbXwJkfpjWFMB4Yu9rStGApqt8RC22y9UxWI5TnhUjbh/csaqekFSVDazRj9s KZIgQZ88IsvyNhTb9fAN903SErUViFMPUQIzkL8uOhWK+kOR8yvezzIiDidaE2TCM/4R arbg2HWUqgdJZIjSAh7Wyw4wIO5rSBxbPMwfFfVflVDkBDjRPwnV62ZgHEoiiJq5MRuy PwoULJByK8EOGvlmbnojqfUGd80g+yeBco1FtL97Qh9MVYdR1R+Le6iMKeGqKvAmdkZX QrRMRmK3UwH4Zy2Br6gBBv91GCpGMJMPRVkO0t3etvKxZkxdMhIr0eVYR/LwKChZ5H7Q XIDA==
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:cc; bh=9vDiGv1Efgg3r4f5lNPApN6HQ046xw7ECU0qUxj8Yb8=; b=YSZ1mqJapd6TzZRndj0ENOD22Wd2yT8aMyDW6fLKqN176+Oi4n+MblpVFOI5OtLGfo RhZQz5T4jeDg6iSZS81J3He95lbz1sfrRMVpb53GQruT4o+cQ/YXv77Rf6AOw17TaBrY E/BJTyiw0giNUSwtUFGFwfGsV5hT7r3WQd+1I3MyC7rbYkGek5Vz6OUOUeuIHMgQD2Mj /gfRy6wA2x0tqxEDqGc+W5bq66AZxlYRNFYz8/i3IikGWt5xhnRbTsBvJRh3l6TwcyJX elOGdC+CBQHvhNykXE3g4CN5Te16tdzeT/yfeLaQv0ybCZee5XIne6Om3oQot4T4V4fr nKOg==
X-Gm-Message-State ALyK8tLUKBy58MXncYoirQpNttDGeMMxJURmdSpGgObVUa6860M+RJQ8B6B5nslnm1+iIEYpKTrdoUxnXXTBBA==
X-Received by 10.28.55.79 with SMTP id e76mr2200583wma.41.1465837656479; Mon, 13 Jun 2016 10:07:36 -0700 (PDT)
In-Reply-To <bb6da4a8-165b-6fc7-700e-4c1855bc36fd@gmail.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.22
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 <http://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 <CAPTjJmrCfoKQ7zAVQY9dh=es8q8CJnn8euDpTxF+GYAszfKUWQ@mail.gmail.com>
X-Mailman-Original-References <ccd85c61-263c-4ebd-b47f-b35fafa3f521@googlegroups.com> <575e18f1$0$1588$c3e8da3$5496439d@news.astraweb.com> <1465788057.2854167.635655857.445F242C@webmail.messagingengine.com> <mailman.26.1465788060.2288.python-list@python.org> <575e4198$0$1588$c3e8da3$5496439d@news.astraweb.com> <bb6da4a8-165b-6fc7-700e-4c1855bc36fd@gmail.com>
Xref csiph.com comp.lang.python:109905

Show key headers only | View raw


On Tue, Jun 14, 2016 at 1:15 AM, Michael Torrie <torriem@gmail.com> wrote:
>> Looking at this from the high-level perspective of Python, that makes it
>> conceptually bytes not text.
>
> I don't see how this is always the case.  From a high-level python
> perspective it's definitely text.  That's the whole point of base64!

Maybe what Python needs is an "ascii" type that's a subclass of both
str and bytes, and requires that the contents be <0x80. It is text, so
it can be combined with text strings; but it is also bytes, so when
you combine it with bytes strings, it'll behave as most people expect.

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

base64.b64encode(data) Marcin Rak <mrak@sightlineinnovation.com> - 2016-06-12 11:56 -0700
  Re: base64.b64encode(data) Marko Rauhamaa <marko@pacujo.net> - 2016-06-12 22:26 +0300
  Re: base64.b64encode(data) Steven D'Aprano <steve@pearwood.info> - 2016-06-13 12:22 +1000
    Re: base64.b64encode(data) Random832 <random832@fastmail.com> - 2016-06-12 23:20 -0400
      Re: base64.b64encode(data) Steven D'Aprano <steve@pearwood.info> - 2016-06-13 15:16 +1000
        Re: base64.b64encode(data) Random832 <random832@fastmail.com> - 2016-06-13 01:33 -0400
          Re: base64.b64encode(data) Marko Rauhamaa <marko@pacujo.net> - 2016-06-13 09:45 +0300
          Re: base64.b64encode(data) Steven D'Aprano <steve@pearwood.info> - 2016-06-13 20:35 +1000
            Re: base64.b64encode(data) Random832 <random832@fastmail.com> - 2016-06-13 09:36 -0400
              Re: base64.b64encode(data) Steven D'Aprano <steve@pearwood.info> - 2016-06-22 01:56 +1000
            Re: base64.b64encode(data) Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2016-06-13 20:20 -0400
        Re: base64.b64encode(data) Michael Torrie <torriem@gmail.com> - 2016-06-13 09:15 -0600
          Re: base64.b64encode(data) Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2016-06-14 11:04 +1200
        Re: base64.b64encode(data) Chris Angelico <rosuav@gmail.com> - 2016-06-14 03:07 +1000
          Re: base64.b64encode(data) Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2016-06-14 11:12 +1200
            Re: base64.b64encode(data) Random832 <random832@fastmail.com> - 2016-06-13 21:19 -0400

csiph-web