NewLionwang / dpkt

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

Cannot Install - Python 2.6 - BGP uses 'as' as member name #22

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I get the following when I try to install the library under Python 2.6:

C:\proj\python\dpkt-1.6>python setup.py install
Traceback (most recent call last):
  File "setup.py", line 4, in <module>
    import dpkt
  File "C:\proj\python\dpkt-1.6\dpkt\__init__.py", line 17, in <module>
    import bgp
  File "C:\proj\python\dpkt-1.6\dpkt\bgp.py", line 678
    self.failUnless(c.as == 65215)

The problem seems to stem from BGP defining a field that shares the same
name as a keyword: 'as'.  Changing this to 'AS', and changing all
references to the field to the same cleared the issue, and I was able to
install.

The modified file is attached.

Original issue reported on code.google.com by eric.t.a...@gmail.com on 30 Jun 2009 at 3:16

Attachments:

GoogleCodeExporter commented 8 years ago
see r51 and r52, this has already been corrected in the subversion repository 
here.

Original comment by yard...@gmail.com on 30 Jun 2009 at 5:39

GoogleCodeExporter commented 8 years ago
to compile 1.6 (simpler than downloading the file or switching to svn):
cat bgp.py|sed "s/\(['.]\)as\([' ]\)/\1asn\2/" > bgp.py

Original comment by acsp...@gmail.com on 22 Aug 2009 at 5:38