Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!tudelft.nl!txtfeed1.tudelft.nl!multikabel.net!newsfeed20.multikabel.net!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'subject:data': 0.07; 'subject:string': 0.09; 'from:addr:behnel.de': 0.16; 'from:addr:stefan_ml': 0.16; 'from:name:stefan behnel': 0.16; 'received:188.174': 0.16; 'received:80.91': 0.16; 'received:80.91.229': 0.16; 'received:gmane.org': 0.16; 'received:list': 0.16; 'received:m-online.net': 0.16; 'subject:changing': 0.16; 'string': 0.18; 'i.e.': 0.22; 'header :In-Reply-To:1': 0.22; 'header:User-Agent:1': 0.23; 'convert': 0.23; 'stefan': 0.27; 'way?': 0.29; 'subject: (': 0.33; 'bytes': 0.33; 'there': 0.35; 'actually': 0.35; 'why': 0.36; 'subject:)': 0.36; 'header:X-Complaints-To:1': 0.36; 'peter': 0.37; 'data': 0.38; 'something': 0.38; 'received:org': 0.38; 'to:addr:python- list': 0.39; 'how': 0.40; 'to:addr:python.org': 0.40; 'received:188': 0.61 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Stefan Behnel Subject: Re: "convert" string to bytes without changing data (encoding) Date: Wed, 28 Mar 2012 11:08:24 +0200 References: <9tg21lFmo3U1@mid.dfncis.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: host-188-174-143-166.customer.m-online.net User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120310 Thunderbird/11.0 In-Reply-To: <9tg21lFmo3U1@mid.dfncis.de> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 12 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1332925721 news.xs4all.nl 6859 [2001:888:2000:d::a6]:44032 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:22268 Peter Daum, 28.03.2012 10:56: > is there any way to convert a string to bytes without > interpreting the data in any way? Something like: > > s='abcde' > b=bytes(s, "unchanged") If you can tell us what you actually want to achieve, i.e. why you want to do this, we may be able to tell you how to do what you want. Stefan