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


Groups > comp.lang.python > #38503

python3 binascii.hexlify ...

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder3.xlned.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <cameron@cskk.homeip.net>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'example:': 0.03; 'string.': 0.04; 'python3': 0.05; 'subject:skip:b 10': 0.07; 'python': 0.09; 'skip:[ 30': 0.09; 'from:addr:cs': 0.16; 'from:addr:zip.com.au': 0.16; 'from:name:cameron simpson': 0.16; 'message-id:@cskk.homeip.net': 0.16; 'received:202.125.174': 0.16; 'received:202.125.174.133': 0.16; 'received:boardofstudies.nsw.edu.au': 0.16; 'received:cskk.homeip.net': 0.16; 'received:edu.au': 0.16; 'received:harvey.boardofstudies.nsw.edu.au': 0.16; 'received:homeip.net': 0.16; 'received:nsw.edu.au': 0.16; 'simpson': 0.16; 'subject:python3': 0.16; 'bytes': 0.17; '>>>': 0.18; 'import': 0.21; '4.0': 0.22; 'cheers,': 0.23; 'seems': 0.23; 'header:User-Agent:1': 0.26; "i'm": 0.29; 'compatible': 0.30; 'url:python': 0.32; 'mac': 0.32; 'to:addr:python-list': 0.33; 'skip:b 20': 0.34; 'nov': 0.35; 'but': 0.36; 'url:org': 0.36; 'apple': 0.36; 'received:au': 0.36; 'url:library': 0.36; 'too': 0.36; 'charset:us-ascii': 0.36; 'keeps': 0.37; 'skip:( 30': 0.38; 'object': 0.38; 'url:docs': 0.38; 'to:addr:python.org': 0.39; 'content-disposition:inline': 0.60; 'here:': 0.62; 'subject:...': 0.63; 'more': 0.63; 'hoping': 0.72; '4.2.1': 0.84; 'subject: ...': 0.84
Date Sat, 9 Feb 2013 21:44:33 +1100
From Cameron Simpson <cs@zip.com.au>
To python-list@python.org
Subject python3 binascii.hexlify ...
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
User-Agent Mutt/1.5.21 (2010-09-15)
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://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 <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1535.1360406684.2939.python-list@python.org> (permalink)
Lines 26
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1360406684 news.xs4all.nl 6925 [2001:888:2000:d::a6]:46540
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:38503

Show key headers only | View raw


This seems to return a bytes object in Python 3.3.0. I was expecting a
string. The documentation here:

  http://docs.python.org/3/library/binascii.html#binascii.hexlify

also keeps me expecting a string. Am I missing something?

Example:

  [hg/css-venti-bytes+utf8]fleet*2> python3
  Python 3.3.0 (default, Nov 11 2012, 08:47:42) 
  [GCC 4.2.1 Compatible Apple Clang 4.0 ((tags/Apple/clang-421.0.60))]
  on darwin
  Type "help", "copyright", "credits" or "license" for more information.
  >>> import binascii
  >>> binascii.hexlify(b'abc')
  b'616263'
  >>> 

I'm on a Mac but am hoping that is irrelevant.

Cheers,
-- 
Cameron Simpson <cs@zip.com.au>

You can fool too many of the people too much of the time. - James Thurber

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


Thread

python3 binascii.hexlify ... Cameron Simpson <cs@zip.com.au> - 2013-02-09 21:44 +1100

csiph-web