Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'scripts': 0.03; 'syntax': 0.04; 'error:': 0.07; 'subject:code': 0.07; 'method,': 0.09; 'subject:2.7': 0.09; 'python': 0.11; 'def': 0.12; 'assembler': 0.16; 'parse,': 0.16; 'struck': 0.16; 'subject:Converting': 0.16; 'syntaxerror:': 0.16; 'tokenize,': 0.16; 'url:title': 0.16; 'url:whatsnew': 0.16; 'looked': 0.18; 'trying': 0.19; 'subject:Issue': 0.19; 'written': 0.21; 'import': 0.22; 'error': 0.23; 'skip:" 40': 0.26; 'code:': 0.26; 'url:edu': 0.26; 'skip:" 20': 0.27; 'skip:& 60': 0.30; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; 'url:wiki': 0.31; 'piece': 0.31; 'file': 0.32; 'figure': 0.32; 'run': 0.32; 'url:python': 0.33; '(most': 0.33; 'skip:& 30': 0.33; 'convert': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'skip:" 50': 0.36; 'thanks': 0.36; 'hi,': 0.36; 'url:org': 0.36; 'skip:& 10': 0.38; 'to:addr:python- list': 0.38; 'recent': 0.39; "couldn't": 0.39; 'to:addr:python.org': 0.39; 'url:3': 0.61; 'url:index': 0.63; 'field': 0.63; 'url:0': 0.67; 'invalid': 0.68; '2.7.': 0.84; 'url:php': 0.85 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=V6bTHpTpUROPviU1daEkQXTHLy7cLTE48r8DCOR+Ey4=; b=aAuhRnPc7UAlIRA+uoi9jGfiqu0At/6fskY7WmREGBcgLX0ZCn+QFgbMoTkm81128r z1NbPTb/wg01KUCFrwiOni6IwYWwLe8qRGIU5n2mzhoZXim1VxDraOIGftcVr8oFucCk ZsHaYq3NkI4n+4pyq3NhgILZk6PefisqVDMbiRWbWk7kbR04h7VlCLUowewm6RZWOqQb sLtzL0eCr75u+4HuLqds1OLlUzdr8fKKcQWD3uixN4Z/4qHHxNdDgNrofz1haf6ntjk+ 3cKw9obxWJAEr0/LBOTr7O+lMGD8Ue1g/B8NWhLPN6kram9EujjgjCTSZsrfDQyphgHq jWkg== X-Received: by 10.68.102.165 with SMTP id fp5mr2778175pbb.83.1377310291978; Fri, 23 Aug 2013 19:11:31 -0700 (PDT) MIME-Version: 1.0 From: shankha Date: Sat, 24 Aug 2013 07:40:51 +0530 Subject: Conversion Issue in Converting code of 2.7 to 3 To: python-list@python.org Content-Type: multipart/alternative; boundary=047d7b675b8cb2ff3a04e4a80af1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 89 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1377310300 news.xs4all.nl 15871 [2001:888:2000:d::a6]:37365 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:52922 --047d7b675b8cb2ff3a04e4a80af1 Content-Type: text/plain; charset=ISO-8859-1 Hi, I am trying to run the following piece of code: https://greyhat.gatech.edu/wiki/index.php?title=Java_Bytecode_Tutorial/Getting_Started python Krakatau/assemble.py minimal.j. The scripts are written for 2.7. I want to convert them to 3.3. I am struck with the following error: []$ python Krakatau/assemble.py minimal.j Traceback (most recent call last): File "Krakatau/assemble.py", line 4, in from Krakatau.assembler import tokenize, parse, assembler File "c:\tmp\ByteCode\Krakatau\Krakatau\assembler\tokenize.py", line 3, in from ..classfile import ClassFile File "c:\tmp\ByteCode\Krakatau\Krakatau\classfile.py", line 1, in from . import constant_pool, method, field File "c:\tmp\ByteCode\Krakatau\Krakatau\constant_pool.py", line 10 def decodeStr((s,)): ^ SyntaxError: invalid syntax The code where this error originates from: def decodeStr((s,)): return s.replace('\xc0\x80','\0').decode('utf8'), I looked at http://docs.python.org/3/whatsnew/3.0.html but I couldn't figure out where I am going wrong? -- Thanks --047d7b675b8cb2ff3a04e4a80af1 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi,
I am trying to run the following piece o= f code:

https://greyhat.gatech.edu/wiki/= index.php?title=3DJava_Bytecode_Tutorial/Getting_Started

python Krakatau/assemble.py min=
imal.j.

The scripts are written for 2.7. I wan=
t to convert them to 3.3. 

I am struck with th=
e following error:

[]$ python Krakatau/assemble.py minimal.j
Traceback (most recent cal= l last):
File "Krakatau/assemble.py", line 4, in <module&= gt;
from Krakatau.assembler import tokenize, parse, assembler
File "c:\tmp\ByteCode\Krakatau\Krakatau\assembler\tokenize.py",= line 3, in <module>
from ..classfile import ClassFile
Fi= le "c:\tmp\ByteCode\Krakatau\Krakatau\classfile.py", line 1, in &= lt;module>
from . import constant_pool, method, field
File "c:\tmp\ByteC= ode\Krakatau\Krakatau\constant_pool.py", line 10
def decodeStr(= (s,)):
^
SyntaxError: invalid syntax



The code where this error originates from:
def decodeStr((s,)):
return s.replace('\x= c0\x80','\0').decode('utf8'),



I looked at http://d=
ocs.python.org/3/whatsnew/3.0.html but I couldn't figure out where<=
br>
I am going wrong?

--
Thanks
--047d7b675b8cb2ff3a04e4a80af1--