djhenderson / dpkt

Automatically exported from code.google.com/p/dpkt
Other
1 stars 0 forks source link

Install error #25

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

enrico@enrico-laptop:~/workspace/Murena/lib/dpkt-1.6$ sudo python setup.py 
Traceback (most recent call last):
  File "setup.py", line 4, in <module>
    import dpkt
  File "/home/enrico/workspace/Murena/lib/dpkt-1.6/dpkt/__init__.py", line
17, in <module>
    import bgp
  File "/home/enrico/workspace/Murena/lib/dpkt-1.6/dpkt/bgp.py", line 678
    self.failUnless(c.as == 65215)
                       ^
SyntaxError: invalid syntax

What version of the product are you using? On what operating system?
Ubuntu 9.10

Python 2.6.2+ (release26-maint, Sep 24 2009, 06:46:17) 
[GCC 4.4.1] on linux2

Original issue reported on code.google.com by enricope...@gmail.com on 1 Oct 2009 at 3:09

GoogleCodeExporter commented 9 years ago
I received the same issue.  I am running:

Mac OS X 10.5.8,
Python 2.6.2,
GCC 4.0.1

Original comment by chad.rhy...@gmail.com on 7 Oct 2009 at 8:44

GoogleCodeExporter commented 9 years ago
I'm runnihg 2.5.2 on Ubuntu, but it could be that "as" is a reserved word in the
member variable "as" .

>>> class foo:
...     def __init__(self):
...         self.as = 1234
<stdin>:3: Warning: 'as' will become a reserved keyword in Python 2.6

I would change that member variable to a different name going forward.

Original comment by alrho...@gmail.com on 8 Oct 2009 at 2:53

GoogleCodeExporter commented 9 years ago
in bgp.py, renaming c.as to c.asn on line 704, and b4.open.as to b4.open.asn on 
line
741 does make it compile.  When I checked out the code from svn, this problem 
seems
to be fixed already.  The as member was also corrected to asn in the class
definition, which should fix this bug correctly.

Original comment by chad.rhy...@gmail.com on 9 Oct 2009 at 4:12

GoogleCodeExporter commented 9 years ago
I'm running 10.6 (python 2.6) and I've gotten past this error, as it's been 
fixed in the svn branch.

Go checkout the svn trunk and it'll work. I'm now having a different problem 
though.

Original comment by kluik...@gmail.com on 29 Oct 2009 at 9:06

GoogleCodeExporter commented 9 years ago
Ahh, I fixed it by changing all references to 'as' to 'AS' instead.   I 
should've
checked here (or the SVN trunk) first.  :-P

Original comment by phreakmo...@gmail.com on 15 Mar 2010 at 8:03

GoogleCodeExporter commented 9 years ago
This was fixed 2 years ago in revision 51. We will cut a new package shortly so 
we stop 
seeing people running into this.

Original comment by dugsong on 26 Mar 2010 at 2:58