[Boost-bugs] [Boost C++ Libraries] #3362: PySte crashes with TypeError

Subject: [Boost-bugs] [Boost C++ Libraries] #3362: PySte crashes with TypeError
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-08-24 21:00:49


#3362: PySte crashes with TypeError
--------------------------------+-------------------------------------------
 Reporter: nneonneo@… | Owner: dave
     Type: Patches | Status: new
Milestone: Boost 1.40.0 | Component: Python
  Version: Boost 1.39.0 | Severity: Problem
 Keywords: |
--------------------------------+-------------------------------------------
 Certain C++ declarations can create unnamed classes, which cause GCCXML
 output to omit the name field. This in turn will trigger the following
 nasty exception (only the last part of the long traceback is shown):

 {{{
   File "C:\Python26\lib\site-packages\Pyste\GCCXMLParser.py", line 350, in
 ParsePointerType
     type = self.GetType(element.get('type'))
   File "C:\Python26\lib\site-packages\Pyste\GCCXMLParser.py", line 126, in
 GetType
     decl = self.GetDecl(id)
   File "C:\Python26\lib\site-packages\Pyste\GCCXMLParser.py", line 108, in
 GetDecl
     self.ParseElement(id, elem)
   File "C:\Python26\lib\site-packages\Pyste\GCCXMLParser.py", line 70, in
 ParseElement
     func(id, element)
   File "C:\Python26\lib\site-packages\Pyste\GCCXMLParser.py", line 319, in
 ParseStruct
     self.ParseClass(id, element)
   File "C:\Python26\lib\site-packages\Pyste\GCCXMLParser.py", line 306, in
 ParseClass
     self.AddDecl(class_)
   File "C:\Python26\lib\site-packages\Pyste\GCCXMLParser.py", line 57, in
 AddDecl
     if decl.FullName() in self._names:
   File "C:\Python26\lib\site-packages\Pyste\declarations.py", line 49, in
 FullName
     return namespace + self.name
 TypeError: cannot concatenate 'str' and 'NoneType' objects
 }}}

 The fix is quite simple: change
 {{{
     def ParseClass(self, id, element):
         name = element.get('name')
 }}}
 to
 {{{
     def ParseClass(self, id, element):
         name = element.get('name', id)
 }}}
 on line 290 of GCCXMLParser.py.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/3362>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:01 UTC