# OOT Module Attribute Error module object has no attribute 'blockname'

**URL:** <https://www.ruby-forum.com/t/oot-module-attribute-error-module-object-has-no-attribute-blockname/243071>\
**Category:** GNU Radio\
**Created:** [August 19, 2015, 4:40pm UTC](https://www.ruby-forum.com/t/oot-module-attribute-error-module-object-has-no-attribute-blockname/243071 "2015-08-19T16:40:03Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rafa\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/958977/32.png) [@Rafa\_F](https://www.ruby-forum.com/u/Rafa_F)\
**Post date:** [August 19, 2015, 4:40pm UTC](https://www.ruby-forum.com/t/oot-module-attribute-error-module-object-has-no-attribute-blockname/243071/1 "2015-08-19T16:40:03Z")

</div>

Hello all,

I know this question has been asked before, several times, but I didn’t  
find a solution that allowed me to use my OOT blocks without running  
into  
the error stated in the subject of this email.

I scoured through this webpage(  
[http://gnuradio.org/redmine/projects/gnuradio/wiki/OutOfTreeModulesConfig](http://gnuradio.org/redmine/projects/gnuradio/wiki/OutOfTreeModulesConfig))  
and tried adding:  
set(GR\_REQUIRED\_COMPONENTS RUNTIME PMT)

to my top level CMakeLists.txt file, because I am using PMT objects in  
my  
block, but that didn’t get rid of the error.

The full error thrown is this:

Executing: “/home/comm1/Logan/Thesis/top\_block.py”

Traceback (most recent call last):  
File “/home/comm1/Logan/Thesis/top\_block.py”, line 92, in   
tb = top\_block()  
File “/home/comm1/Logan/Thesis/top\_block.py”, line 65, in **init**  
self.ACK\_Text\_Sanitize\_0 = ACK.Text\_Sanitize()  
AttributeError: ‘module’ object has no attribute ‘Text\_Sanitize’

I looked on the mailing list for that last line error and it pointed me  
to  
doing what I mentioned above with the CMakeLists.txt file, but could it  
be  
an actual problem with the top\_block.py file?

In the addendum is all of the files I could think would be necessary for  
someone to look at if they chose to, if including this much text is  
frowned  
upon, please let me know.

Addendum:

Text\_Sanitize\_impl.cc

* * *

#ifdef HAVE\_CONFIG\_H  
#include “config.h”  
#endif

#include \<gnuradio/io\_signature.h\>  
#include “Text\_Sanitize\_impl.h”  
#include \<pmt/pmt.h\>  
#include \<stdio.h\>  
#include   
#include   
#include

namespace gr {  
namespace ACK {

```
Text_Sanitize::sptr
Text_Sanitize::make(char* message)
{
  return gnuradio::get_initial_sptr
    (new Text_Sanitize_impl(message));
}

void
Text_Sanitize_impl::print_message(pmt::pmt_t d_message)
{
pmt::print(d_message);
}

/*
void
Text_Sanitize_impl::forecast (int noutput_items, gr_vector_int

```

&ninput\_items\_required)  
{  
\<+forecast+\> e.g. ninput\_items\_required[0] = noutput\_items  
}  
\*/  
int  
Text\_Sanitize\_impl::general\_work (int noutput\_items,  
gr\_vector\_int &ninput\_items,  
gr\_vector\_const\_void\_star &input\_items,  
gr\_vector\_void\_star &output\_items)  
{  
const int \*in = (int \*) input\_items[0];  
pmt::pmt\_t \*out = (pmt::pmt\_t \*) output\_items[0];

```
d_out_msg = pmt::string_to_symbol(d_message);
//for(int i = 0; i<strlen(d_message); i++)
//{
// pmt::vector_set(d_out_msg,i,d_message[i]);
//}

    // Do <+signal processing+>
    // Tell runtime system how many input items we consumed on
    // each input stream.
    consume_each (noutput_items);

    // Tell runtime system how many output items we produced.
    return noutput_items;
}

/*
 * The private constructor
 */
Text_Sanitize_impl::Text_Sanitize_impl(char* message)
  : gr::block("Text_Sanitize",
          gr::io_signature::make(1, 1, sizeof(int)),
          gr::io_signature::make(1, 1, sizeof(pmt::pmt_t))),
    d_out_msg(pmt::string_to_symbol(std::string(""))),
    d_message(message)
{

message_port_register_out(pmt::mp("print_message"));
set_msg_handler(pmt::mp("print"),

```

boost::bind(&Text\_Sanitize\_impl::print\_message, this, \_1));  
}

```
/*
 * Our virtual destructor.
 */
Text_Sanitize_impl::~Text_Sanitize_impl()
{
}

```

} /\* namespace ACK _/  
} /_ namespace gr \*/

* * *

Text\_Sanitize\_impl.h

* * *

#ifndef INCLUDED\_ACK\_TEXT\_SANITIZE\_IMPL\_H  
#define INCLUDED\_ACK\_TEXT\_SANITIZE\_IMPL\_H

#include \<ACK/Text\_Sanitize.h\>  
#include \<gnuradio/block.h\>  
#include \<gnuradio/thread/thread.h\>  
#include \<pmt/pmt.h\>

namespace gr {  
namespace ACK {

```
class Text_Sanitize_impl : public Text_Sanitize
{
 private:
  // Nothing to declare in this block.
pmt::pmt_t d_out_msg;
char* d_message;
void print_message(pmt::pmt_t d_message);

 public:
  Text_Sanitize_impl(char* message);
  ~Text_Sanitize_impl();

  // Where all the action really happens
  void forecast (int noutput_items, gr_vector_int

```

&ninput\_items\_required);

```
  int general_work(int noutput_items,
           gr_vector_int &ninput_items,
           gr_vector_const_void_star &input_items,
           gr_vector_void_star &output_items);
};

```

} // namespace ACK  
} // namespace gr

#endif /\* INCLUDED\_ACK\_TEXT\_SANITIZE\_IMPL\_H \*/

* * *

Text\_Sanitize.h

* * *

#ifndef INCLUDED\_ACK\_TEXT\_SANITIZE\_H  
#define INCLUDED\_ACK\_TEXT\_SANITIZE\_H

#include \<ACK/api.h\>  
#include \<gnuradio/block.h\>

namespace gr {  
namespace ACK {

```
/*!
 * \brief <+description of block+>
 * \ingroup ACK
 *
 */
class ACK_API Text_Sanitize : virtual public gr::block
{
 public:
  typedef boost::shared_ptr<Text_Sanitize> sptr;

  /*!
   * \brief Return a shared_ptr to a new instance of 

```

ACK::Text\_Sanitize.  
\*  
\* To avoid accidental use of raw pointers, ACK::Text\_Sanitize’s  
\* constructor is in a private implementation  
\* class. ACK::Text\_Sanitize::make is the public interface for  
\* creating new instances.  
_/  
static sptr make(char_ message);  
};

} // namespace ACK  
} // namespace gr

#endif /\* INCLUDED\_ACK\_TEXT\_SANITIZE\_H \*/

* * *

Top Level CMakeLists.txt

* * *

########################################################################

# Project setup

########################################################################  
cmake\_minimum\_required(VERSION 2.6)  
project(gr-ACK CXX C)  
enable\_testing()

#select the release build type by default to get optimization flags  
if(NOT CMAKE\_BUILD\_TYPE)  
set(CMAKE\_BUILD\_TYPE “Release”)  
message(STATUS “Build type not specified: defaulting to release.”)  
endif(NOT CMAKE\_BUILD\_TYPE)  
set(CMAKE\_BUILD\_TYPE ${CMAKE\_BUILD\_TYPE} CACHE STRING “”)

#make sure our local CMake Modules path comes first  
list(INSERT CMAKE\_MODULE\_PATH 0 ${CMAKE\_SOURCE\_DIR}/cmake/Modules)

########################################################################

# Compiler specific setup

########################################################################  
if(CMAKE\_COMPILER\_IS\_GNUCXX AND NOT WIN32)  
#[Visibility - GCC Wiki](http://gcc.gnu.org/wiki/Visibility)  
add\_definitions(-fvisibility=hidden)  
endif()

########################################################################

# Find boost

########################################################################  
if(UNIX AND EXISTS “/usr/lib64”)  
list(APPEND BOOST\_LIBRARYDIR “/usr/lib64”) #fedora 64-bit fix  
endif(UNIX AND EXISTS “/usr/lib64”)  
set(Boost\_ADDITIONAL\_VERSIONS  
“1.35.0” “1.35” “1.36.0” “1.36” “1.37.0” “1.37” “1.38.0” “1.38”  
“1.39.0” “1.39”  
“1.40.0” “1.40” “1.41.0” “1.41” “1.42.0” “1.42” “1.43.0” “1.43”  
“1.44.0” “1.44”  
“1.45.0” “1.45” “1.46.0” “1.46” “1.47.0” “1.47” “1.48.0” “1.48”  
“1.49.0” “1.49”  
“1.50.0” “1.50” “1.51.0” “1.51” “1.52.0” “1.52” “1.53.0” “1.53”  
“1.54.0” “1.54”  
“1.55.0” “1.55” “1.56.0” “1.56” “1.57.0” “1.57” “1.58.0” “1.58”  
“1.59.0” “1.59”  
“1.60.0” “1.60” “1.61.0” “1.61” “1.62.0” “1.62” “1.63.0” “1.63”  
“1.64.0” “1.64”  
“1.65.0” “1.65” “1.66.0” “1.66” “1.67.0” “1.67” “1.68.0” “1.68”  
“1.69.0” “1.69”  
)  
find\_package(Boost “1.35” COMPONENTS filesystem system)

if(NOT Boost\_FOUND)  
message(FATAL\_ERROR “Boost required to compile ACK”)  
endif()

########################################################################

# Install directories

########################################################################  
include(GrPlatform) #define LIB\_SUFFIX  
set(GR\_RUNTIME\_DIR bin)  
set(GR\_LIBRARY\_DIR lib${LIB\_SUFFIX})  
set(GR\_INCLUDE\_DIR include/ACK)  
set(GR\_DATA\_DIR share)  
set(GR\_PKG\_DATA\_DIR ${GR\_DATA\_DIR}/${CMAKE\_PROJECT\_NAME})  
set(GR\_DOC\_DIR ${GR\_DATA\_DIR}/doc)  
set(GR\_PKG\_DOC\_DIR ${GR\_DOC\_DIR}/${CMAKE\_PROJECT\_NAME})  
set(GR\_CONF\_DIR etc)  
set(GR\_PKG\_CONF\_DIR ${GR\_CONF\_DIR}/${CMAKE\_PROJECT\_NAME}/conf.d)  
set(GR\_LIBEXEC\_DIR libexec)  
set(GR\_PKG\_LIBEXEC\_DIR ${GR\_LIBEXEC\_DIR}/${CMAKE\_PROJECT\_NAME})  
set(GRC\_BLOCKS\_DIR ${GR\_PKG\_DATA\_DIR}/grc/blocks)

########################################################################

# On Apple only, set install name and use rpath correctly, if not

already  
set  
########################################################################  
if(APPLE)  
if(NOT CMAKE\_INSTALL\_NAME\_DIR)  
set(CMAKE\_INSTALL\_NAME\_DIR  
${CMAKE\_INSTALL\_PREFIX}/${GR\_LIBRARY\_DIR} CACHE  
PATH “Library Install Name Destination Directory” FORCE)  
endif(NOT CMAKE\_INSTALL\_NAME\_DIR)  
if(NOT CMAKE\_INSTALL\_RPATH)  
set(CMAKE\_INSTALL\_RPATH  
${CMAKE\_INSTALL\_PREFIX}/${GR\_LIBRARY\_DIR} CACHE  
PATH “Library Install RPath” FORCE)  
endif(NOT CMAKE\_INSTALL\_RPATH)  
if(NOT CMAKE\_BUILD\_WITH\_INSTALL\_RPATH)  
set(CMAKE\_BUILD\_WITH\_INSTALL\_RPATH ON CACHE  
BOOL “Do Build Using Library Install RPath” FORCE)  
endif(NOT CMAKE\_BUILD\_WITH\_INSTALL\_RPATH)  
endif(APPLE)

########################################################################

# Find gnuradio build dependencies

########################################################################  
find\_package(CppUnit)  
find\_package(Doxygen)

# Search for GNU Radio and its components and versions. Add any

# components required to the list of GR\_REQUIRED\_COMPONENTS (in all

# caps such as FILTER or FFT) and change the version to the minimum

# API compatible version required.

set(GR\_REQUIRED\_COMPONENTS RUNTIME PMT STRING)  
find\_package(Gnuradio “3.7.2” REQUIRED)

if(NOT CPPUNIT\_FOUND)  
message(FATAL\_ERROR “CppUnit required to compile ACK”)  
endif()

########################################################################

# Setup doxygen option

########################################################################  
if(DOXYGEN\_FOUND)  
option(ENABLE\_DOXYGEN “Build docs using Doxygen” ON)  
else(DOXYGEN\_FOUND)  
option(ENABLE\_DOXYGEN “Build docs using Doxygen” OFF)  
endif(DOXYGEN\_FOUND)

########################################################################

# Setup the include and linker paths

########################################################################  
include\_directories(  
${CMAKE\_SOURCE\_DIR}/lib  
${CMAKE\_SOURCE\_DIR}/include  
${CMAKE\_BINARY\_DIR}/lib  
${CMAKE\_BINARY\_DIR}/include  
${Boost\_INCLUDE\_DIRS}  
${CPPUNIT\_INCLUDE\_DIRS}  
${GNURADIO\_RUNTIME\_INCLUDE\_DIRS}  
${GNURADIO\_ALL\_INCLUDE\_DIRS}  
)

link\_directories(  
${Boost\_LIBRARY\_DIRS}  
${CPPUNIT\_LIBRARY\_DIRS}  
${GNURADIO\_RUNTIME\_LIBRARY\_DIRS}  
)

# Set component parameters

set(GR\_ACK\_INCLUDE\_DIRS ${CMAKE\_CURRENT\_SOURCE\_DIR}/include CACHE  
INTERNAL  
“” FORCE)  
set(GR\_ACK\_SWIG\_INCLUDE\_DIRS ${CMAKE\_CURRENT\_SOURCE\_DIR}/swig CACHE  
INTERNAL “” FORCE)

########################################################################

# Create uninstall target

########################################################################  
configure\_file(  
${CMAKE\_SOURCE\_DIR}/cmake/cmake\_uninstall.cmake.in  
${CMAKE\_CURRENT\_BINARY\_DIR}/cmake\_uninstall.cmake  
@ONLY)

add\_custom\_target(uninstall  
${CMAKE\_COMMAND} -P  
${CMAKE\_CURRENT\_BINARY\_DIR}/cmake\_uninstall.cmake  
)

########################################################################

# Add subdirectories

########################################################################  
add\_subdirectory(include/ACK)  
add\_subdirectory(lib)  
add\_subdirectory(swig)  
add\_subdirectory(python)  
add\_subdirectory(grc)  
add\_subdirectory(apps)  
add\_subdirectory(docs)

########################################################################

# Install cmake search helper for this library

########################################################################  
if(NOT CMAKE\_MODULES\_DIR)  
set(CMAKE\_MODULES\_DIR lib${LIB\_SUFFIX}/cmake)  
endif(NOT CMAKE\_MODULES\_DIR)

install(FILES cmake/Modules/ACKConfig.cmake  
DESTINATION ${CMAKE\_MODULES\_DIR}/ACK  
)

* * *

top\_block.py

* * *

#!/usr/bin/env python2  
##################################################

# GNU Radio Python Flow Graph

# Title: Top Block

# Generated: Tue Aug 18 11:02:34 2015

##################################################

if **name** == ‘ **main** ’:  
import ctypes  
import sys  
if sys.platform.startswith(‘linux’):  
try:  
x11 = ctypes.cdll.LoadLibrary(‘libX11.so’)  
x11.XInitThreads()  
except:  
print “Warning: failed to XInitThreads()”

from PyQt4 import Qt  
from gnuradio import analog  
from gnuradio import blocks  
from gnuradio import eng\_notation  
from gnuradio import gr  
from gnuradio.eng\_option import eng\_option  
from gnuradio.filter import firdes  
from optparse import OptionParser  
import ACK  
import sys

class top\_block(gr.top\_block, Qt.QWidget):

```
def __init__ (self):
    gr.top_block. __init__ (self, "Top Block")
    Qt.QWidget. __init__ (self)
    self.setWindowTitle("Top Block")
    try:
         self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc'))
    except:
         pass
    self.top_scroll_layout = Qt.QVBoxLayout()
    self.setLayout(self.top_scroll_layout)
    self.top_scroll = Qt.QScrollArea()
    self.top_scroll.setFrameStyle(Qt.QFrame.NoFrame)
    self.top_scroll_layout.addWidget(self.top_scroll)
    self.top_scroll.setWidgetResizable(True)
    self.top_widget = Qt.QWidget()
    self.top_scroll.setWidget(self.top_widget)
    self.top_layout = Qt.QVBoxLayout(self.top_widget)
    self.top_grid_layout = Qt.QGridLayout()
    self.top_layout.addLayout(self.top_grid_layout)

    self.settings = Qt.QSettings("GNU Radio", "top_block")
    self.restoreGeometry(self.settings.value("geometry").toByteArray())

    ##################################################
    # Variables
    ##################################################
    self.samp_rate = samp_rate = 32000

    ##################################################
    # Blocks
    ##################################################
    self.blocks_message_debug_0 = blocks.message_debug()
    self.analog_const_source_x_0 = analog.sig_source_i(0,

```

analog.GR\_CONST\_WAVE, 0, 0, 2)  
self.ACK\_Text\_Sanitize\_0 = ACK.Text\_Sanitize()

```
    ##################################################
    # Connections
    ##################################################
    self.msg_connect((self.ACK_Text_Sanitize_0, 'out'),

```

(self.blocks\_message\_debug\_0, ‘print’))  
self.connect((self.analog\_const\_source\_x\_0, 0),  
(self.ACK\_Text\_Sanitize\_0, 0))

```
def closeEvent(self, event):
    self.settings = Qt.QSettings("GNU Radio", "top_block")
    self.settings.setValue("geometry", self.saveGeometry())
    event.accept()

def get_samp_rate(self):
    return self.samp_rate

def set_samp_rate(self, samp_rate):
    self.samp_rate = samp_rate

```

if **name** == ‘ **main** ’:  
parser = OptionParser(option\_class=eng\_option, usage=“%prog:  
[options]”)  
(options, args) = parser.parse\_args()  
from distutils.version import StrictVersion  
if StrictVersion(Qt.qVersion()) \>= StrictVersion(“4.5.0”):

Qt.QApplication.setGraphicsSystem(gr.prefs().get\_string(‘qtgui’,‘style’,‘raster’))  
qapp = Qt.QApplication(sys.argv)  
tb = top\_block()  
tb.start()  
tb.show()

```
def quitting():
    tb.stop()
    tb.wait()
qapp.connect(qapp, Qt.SIGNAL("aboutToQuit()"), quitting)
qapp.exec_()
tb = None # to clean up Qt widgets

```

* * *

Logan Washbourne  
Electrical Engineering Graduate Student  
(Electromagnetics)

---

<div class="post-metadata">

**Author:** ![WashbourneS\_Logan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ec9cab/32.png) [@WashbourneS\_Logan](https://www.ruby-forum.com/u/WashbourneS_Logan)\
**Post date:** [August 19, 2015, 5:12pm UTC](https://www.ruby-forum.com/t/oot-module-attribute-error-module-object-has-no-attribute-blockname/243071/2 "2015-08-19T17:12:11Z")

</div>

Hi!  
You only seem to define a version of make with a char\*parameter, but try  
to call it without parameters. Can you try doing something like  
ACK.Text\_Sanitize(“rubber ducky”) ?

Best regards,  
Marcus

Am 19. August 2015 16:38:30 MESZ, schrieb “Washbourne, Logan”  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<div class="post-metadata">

**Author:** ![WashbourneS\_Logan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ec9cab/32.png) [@WashbourneS\_Logan](https://www.ruby-forum.com/u/WashbourneS_Logan)\
**Post date:** [August 19, 2015, 8:52pm UTC](https://www.ruby-forum.com/t/oot-module-attribute-error-module-object-has-no-attribute-blockname/243071/3 "2015-08-19T20:52:27Z")

</div>

My gut is telling me this is a swig problem. I don’t know that it’s  
frowned  
upon, but it’s not easy to read without some kind of highlighting that  
we’d  
get from github or a gist with files. If I’m correct we’d also need to  
see  
swig/ACK.i (probably missing an include and/or gr swig block magic.  
compare  
to tutorial swig for sanity check)

On Wed, Aug 19, 2015 at 10:38 AM, Washbourne, Logan \<

---

<div class="post-metadata">

**Author:** ![WashbourneS\_Logan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ec9cab/32.png) [@WashbourneS\_Logan](https://www.ruby-forum.com/u/WashbourneS_Logan)\
**Post date:** [August 20, 2015, 10:52pm UTC](https://www.ruby-forum.com/t/oot-module-attribute-error-module-object-has-no-attribute-blockname/243071/4 "2015-08-20T22:52:48Z")

</div>

Nathan and Patrick,

Thanks for the tips!

I started with running: nm -C -u libgnuradio-.so

and the results of that can be found here:  
[loganwashbourne’s gists · GitHub](https://gist.github.com/loganwashbourne) under the _nm -C -u  
libgnuradio-.so_  
[https://gist.github.com/loganwashbourne/3bb90d787308b45211d0](https://gist.github.com/loganwashbourne/3bb90d787308b45211d0) file. (I  
think github thinks I’m a robot so I can’t link to the direct page yet).

I’ll be honest, I’m not really sure what I’m looking at in this return,  
I  
do see some error statements but I’m not sure if they are just stating  
how  
it would handle an error or if it is an actual error.

I really don’t think I have any callbacks in my XML code, I just  
reference  
certain input variables in the XML code.

Next, the ACK\_swig.i file can be found here :  
[loganwashbourne’s gists · GitHub](https://gist.github.com/loganwashbourne) under the same file name. I  
checked  
it against the gr-tutorial swig file and the only difference was that  
the  
ACK\_swig.i file included a magic2 function call for each of my OOT  
blocks(check and Text\_Sanitize), while the gr-tutorial didn’t.

Last thing, I realized that I am creating the forecast function in the  
Text\_Sanitize\_impl.h file but not referencing it it the .cc file (I  
commented it out). I tried commenting out the void deceleration of the  
forecast function in the .h file but then I get a new error when I try  
to  
run the grc file(which is just a constant int source connected to my  
Text\_Sanitize block, which is connected the the message debug “print”  
port).

The new error is :

Traceback (most recent call last):  
File “/home/comm1/Logan/Thesis/top\_block.py”, line 92, in   
tb = top\_block()  
File “/home/comm1/Logan/Thesis/top\_block.py”, line 65, in **init**  
self.ACK\_Text\_Sanitize\_0 = ACK.Text\_Sanitize()  
File “/usr/local/lib/python2.7/dist-packages/ACK/ACK\_swig.py”, line  
399,  
in make  
return \_ACK\_swig.Text\_Sanitize\_make(\*args, \*\*kwargs)  
TypeError: Required argument ‘message’ (pos 1) not found

I do apologize for the long questions, if any of you feel like I need to  
spend more time looking into this myself before asking the mailing list,  
please don’t hesitate to mention it.

Logan Washbourne  
Electrical Engineering Graduate Student  
(Electromagnetics)

On Wed, Aug 19, 2015 at 5:06 PM, Patrick Sathyanathan  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![WashbourneS\_Logan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ec9cab/32.png) [@WashbourneS\_Logan](https://www.ruby-forum.com/u/WashbourneS_Logan)\
**Post date:** [August 20, 2015, 11:07pm UTC](https://www.ruby-forum.com/t/oot-module-attribute-error-module-object-has-no-attribute-blockname/243071/5 "2015-08-20T23:07:24Z")

</div>

One simple thing that can cause this is forgetting to do “sudo ldconfig”  
after you do your first “sudo make install”

Various things can cause this, it’s a cryptic error that I always hate  
seeing.

Rich

On Wed, Aug 19, 2015 at 11:51 AM, West, Nathan  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![WashbourneS\_Logan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ec9cab/32.png) [@WashbourneS\_Logan](https://www.ruby-forum.com/u/WashbourneS_Logan)\
**Post date:** [August 21, 2015, 2:55am UTC](https://www.ruby-forum.com/t/oot-module-attribute-error-module-object-has-no-attribute-blockname/243071/6 "2015-08-21T02:55:52Z")

</div>

Marcus,

Thanks for the reply! So I made the make function parameterless and  
removed  
the instances of that parameter throughout my code, tried to run the GRC  
again and got the same error as before.

I then changed the: self.ACK\_Text\_Sanitize\_0 = ACK.Text\_Sanitize()  
to: self.ACK\_Text\_Sanitize\_0 = ACK.Text\_Sanitize(“Rubber Ducky”)

reran the GRC and got the same error.

Any other hints? I’m just not sure what it’s throwing an error about.

I appreciate your help,

Logan Washbourne  
Electrical Engineering Graduate Student  
(Electromagnetics)

On Wed, Aug 19, 2015 at 10:10 AM, Marcus Müller  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![WashbourneS\_Logan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ec9cab/32.png) [@WashbourneS\_Logan](https://www.ruby-forum.com/u/WashbourneS_Logan)\
**Post date:** [August 22, 2015, 8:58pm UTC](https://www.ruby-forum.com/t/oot-module-attribute-error-module-object-has-no-attribute-blockname/243071/7 "2015-08-22T20:58:24Z")

</div>

Patrick,

Thanks for the advice! So I added that string parameter(or char array)  
to  
the Top\_Block.py file

the new line looks like this:self.ACK\_Text\_Sanitize\_0 =  
ACK.Text\_Sanitize(“String”).

When I run “python top\_block.py” this error occurs:

comm1@comm1:~/Logan/Thesis$ python top\_block.py  
Traceback (most recent call last):  
File “top\_block.py”, line 92, in   
tb = top\_block()  
File “top\_block.py”, line 65, in **init**  
self.ACK\_Text\_Sanitize\_0 = ACK.Text\_Sanitize(“String”)  
File “/usr/local/lib/python2.7/dist-packages/ACK/ACK\_swig.py”, line  
399,  
in make  
return \_ACK\_swig.Text\_Sanitize\_make(\*args, \*\*kwargs)  
RuntimeError: attempt to set\_msg\_handler() on bad input message port!

My XML file can be found here:

> <https://gist.github.com/loganwashbourne/68367a93b7fe9bf28bce>

So the RuntimeError seems to be the problem, I’m leaning towards the  
idea  
that I am not handling the PMT’s correctly. Thoughts?

Richard,

I appreciate the advice, I’ve been pretty diligent about using sudo  
ldconfig after I read that not using it could create problems. All  
advice  
helps!

Logan Washbourne  
Electrical Engineering Graduate Student  
(Electromagnetics)

On Fri, Aug 21, 2015 at 4:37 PM, Patrick Sathyanathan  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![WashbourneS\_Logan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ec9cab/32.png) [@WashbourneS\_Logan](https://www.ruby-forum.com/u/WashbourneS_Logan)\
**Post date:** [August 20, 2015, 12:07am UTC](https://www.ruby-forum.com/t/oot-module-attribute-error-module-object-has-no-attribute-blockname/243071/8 "2015-08-20T00:07:35Z")

</div>

Hi Logan,  
I have faced the same error twice recently in my OOT module and finally  
tracked it down to two causes. The basic reason for the ‘object has no  
attribute’ error is that Python’s import of your module failed. In the  
two cases that I saw it was due to undefined symbols in the shared  
library for my module. My module was called ‘tutorial’ so the  
corresponding library is libgnuradio-tutorial.so and you can find it in  
the …/build/lib directory. To find out the undefined symbols do the  
following:  
nm -C -u libgnuradio-.so  
and search for method names in your class. So if your class is ‘MyClass’  
you could do:  
nm -C -u libgnuradio-.so | grep MyClass  
The two cases that I ran into were:

1. A non-virtual method in my implementation class was undefined because  
I had forgotten to prefix the method definition with the class name. So  
the .cc file had “void foo(…)” instead of “void  
MyClass\_impl::foo(…)” and foo was compiled as a ordinary function.  
Then the command above will report “MyClass\_impl::foo” as undefined.
2. The second case I ran into was with defining callbacks in the XML  
file. If you do then you will need to add matching virtual function  
declarations in the header file. This is needed for SWIG to work  
correctly. For my case the callback “foo” needed a virtual function  
declaration “virtual foo(…) = 0;” in the actual class  
declaration (not the …\_impl version) in the header file.  
Do you have callbacks ? If this is the issue then you should do a “make  
clean” before running make again to force SWIG to run.  
Hope this helps.  
–Patrick

Date: Wed, 19 Aug 2015 14:51:27 -0400  
From: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
To: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
CC: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Subject: Re: [Discuss-gnuradio] OOT Module Attribute Error module object  
has no attribute ‘blockname’

My gut is telling me this is a swig problem. I don’t know that it’s  
frowned upon, but it’s not easy to read without some kind of  
highlighting that we’d get from github or a gist with files. If I’m  
correct we’d also need to see swig/ACK.i (probably missing an include  
and/or gr swig block magic. compare to tutorial swig for sanity check)  
On Wed, Aug 19, 2015 at 10:38 AM, Washbourne, Logan  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:  
Hello all,

I know this question has been asked before, several times, but I didn’t  
find a solution that allowed me to use my OOT blocks without running  
into the error stated in the subject of this email.

I scoured through this  
webpage([http://gnuradio.org/redmine/projects/gnuradio/wiki/OutOfTreeModulesConfig](http://gnuradio.org/redmine/projects/gnuradio/wiki/OutOfTreeModulesConfig))  
and tried adding:  
set(GR\_REQUIRED\_COMPONENTS RUNTIME PMT)

to my top level CMakeLists.txt file, because I am using PMT objects in  
my block, but that didn’t get rid of the error.

The full error thrown is this:

Executing: “/home/comm1/Logan/Thesis/top\_block.py”

Traceback (most recent call last):  
File “/home/comm1/Logan/Thesis/top\_block.py”, line 92, in   
tb = top\_block()  
File “/home/comm1/Logan/Thesis/top\_block.py”, line 65, in **init**  
self.ACK\_Text\_Sanitize\_0 = ACK.Text\_Sanitize()  
AttributeError: ‘module’ object has no attribute ‘Text\_Sanitize’

I looked on the mailing list for that last line error and it pointed me  
to doing what I mentioned above with the CMakeLists.txt file, but could  
it be an actual problem with the top\_block.py file?

In the addendum is all of the files I could think would be necessary for  
someone to look at if they chose to, if including this much text is  
frowned upon, please let me know.

Addendum:

Text\_Sanitize\_impl.cc

* * *

#ifdef HAVE\_CONFIG\_H  
#include “config.h”  
#endif

#include \<gnuradio/io\_signature.h\>  
#include “Text\_Sanitize\_impl.h”  
#include \<pmt/pmt.h\>  
#include \<stdio.h\>  
#include   
#include   
#include

namespace gr {  
namespace ACK {

```
Text_Sanitize::sptr
Text_Sanitize::make(char* message)
{
  return gnuradio::get_initial_sptr
    (new Text_Sanitize_impl(message));
}

void
Text_Sanitize_impl::print_message(pmt::pmt_t d_message)
{
pmt::print(d_message);
}

/*
void
Text_Sanitize_impl::forecast (int noutput_items, gr_vector_int 

```

&ninput\_items\_required)  
{  
\<+forecast+\> e.g. ninput\_items\_required[0] = noutput\_items  
}  
\*/  
int  
Text\_Sanitize\_impl::general\_work (int noutput\_items,  
gr\_vector\_int &ninput\_items,  
gr\_vector\_const\_void\_star &input\_items,  
gr\_vector\_void\_star &output\_items)  
{  
const int \*in = (int \*) input\_items[0];  
pmt::pmt\_t \*out = (pmt::pmt\_t \*) output\_items[0];

```
d_out_msg = pmt::string_to_symbol(d_message);
//for(int i = 0; i<strlen(d_message); i++)
//{
// pmt::vector_set(d_out_msg,i,d_message[i]);
//}

    // Do <+signal processing+>
    // Tell runtime system how many input items we consumed on
    // each input stream.
    consume_each (noutput_items);

    // Tell runtime system how many output items we produced.
    return noutput_items;
}

/*
 * The private constructor
 */
Text_Sanitize_impl::Text_Sanitize_impl(char* message)
  : gr::block("Text_Sanitize",
          gr::io_signature::make(1, 1, sizeof(int)),
          gr::io_signature::make(1, 1, sizeof(pmt::pmt_t))),
    d_out_msg(pmt::string_to_symbol(std::string(""))),
    d_message(message)
{

message_port_register_out(pmt::mp("print_message"));
set_msg_handler(pmt::mp("print"), 

```

boost::bind(&Text\_Sanitize\_impl::print\_message, this, \_1));  
}

```
/*
 * Our virtual destructor.
 */
Text_Sanitize_impl::~Text_Sanitize_impl()
{
}

```

} /\* namespace ACK _/  
} /_ namespace gr \*/

* * *

Text\_Sanitize\_impl.h

* * *

#ifndef INCLUDED\_ACK\_TEXT\_SANITIZE\_IMPL\_H  
#define INCLUDED\_ACK\_TEXT\_SANITIZE\_IMPL\_H

#include \<ACK/Text\_Sanitize.h\>  
#include \<gnuradio/block.h\>  
#include \<gnuradio/thread/thread.h\>  
#include \<pmt/pmt.h\>

namespace gr {  
namespace ACK {

```
class Text_Sanitize_impl : public Text_Sanitize
{
 private:
  // Nothing to declare in this block.
pmt::pmt_t d_out_msg;
char* d_message;
void print_message(pmt::pmt_t d_message);

 public:
  Text_Sanitize_impl(char* message);
  ~Text_Sanitize_impl();

  // Where all the action really happens
  void forecast (int noutput_items, gr_vector_int 

```

&ninput\_items\_required);

```
  int general_work(int noutput_items,
           gr_vector_int &ninput_items,
           gr_vector_const_void_star &input_items,
           gr_vector_void_star &output_items);
};

```

} // namespace ACK  
} // namespace gr

#endif /\* INCLUDED\_ACK\_TEXT\_SANITIZE\_IMPL\_H \*/

* * *

Text\_Sanitize.h

* * *

#ifndef INCLUDED\_ACK\_TEXT\_SANITIZE\_H  
#define INCLUDED\_ACK\_TEXT\_SANITIZE\_H

#include \<ACK/api.h\>  
#include \<gnuradio/block.h\>

namespace gr {  
namespace ACK {

```
/*!
 * \brief <+description of block+>
 * \ingroup ACK
 *
 */
class ACK_API Text_Sanitize : virtual public gr::block
{
 public:
  typedef boost::shared_ptr<Text_Sanitize> sptr;

  /*!
   * \brief Return a shared_ptr to a new instance of 

```

ACK::Text\_Sanitize.  
\*  
\* To avoid accidental use of raw pointers, ACK::Text\_Sanitize’s  
\* constructor is in a private implementation  
\* class. ACK::Text\_Sanitize::make is the public interface for  
\* creating new instances.  
_/  
static sptr make(char_ message);  
};

} // namespace ACK  
} // namespace gr

#endif /\* INCLUDED\_ACK\_TEXT\_SANITIZE\_H \*/

* * *

Top Level CMakeLists.txt

* * *

########################################################################

# Project setup

########################################################################  
cmake\_minimum\_required(VERSION 2.6)  
project(gr-ACK CXX C)  
enable\_testing()

#select the release build type by default to get optimization flags  
if(NOT CMAKE\_BUILD\_TYPE)  
set(CMAKE\_BUILD\_TYPE “Release”)  
message(STATUS “Build type not specified: defaulting to release.”)  
endif(NOT CMAKE\_BUILD\_TYPE)  
set(CMAKE\_BUILD\_TYPE ${CMAKE\_BUILD\_TYPE} CACHE STRING “”)

#make sure our local CMake Modules path comes first  
list(INSERT CMAKE\_MODULE\_PATH 0 ${CMAKE\_SOURCE\_DIR}/cmake/Modules)

########################################################################

# Compiler specific setup

########################################################################  
if(CMAKE\_COMPILER\_IS\_GNUCXX AND NOT WIN32)  
#[Making sure you're not a bot!](http://gcc.gnu.org/wiki/Visibility)  
add\_definitions(-fvisibility=hidden)  
endif()

########################################################################

# Find boost

########################################################################  
if(UNIX AND EXISTS “/usr/lib64”)  
list(APPEND BOOST\_LIBRARYDIR “/usr/lib64”) #fedora 64-bit fix  
endif(UNIX AND EXISTS “/usr/lib64”)  
set(Boost\_ADDITIONAL\_VERSIONS  
“1.35.0” “1.35” “1.36.0” “1.36” “1.37.0” “1.37” “1.38.0” “1.38”  
“1.39.0” “1.39”  
“1.40.0” “1.40” “1.41.0” “1.41” “1.42.0” “1.42” “1.43.0” “1.43”  
“1.44.0” “1.44”  
“1.45.0” “1.45” “1.46.0” “1.46” “1.47.0” “1.47” “1.48.0” “1.48”  
“1.49.0” “1.49”  
“1.50.0” “1.50” “1.51.0” “1.51” “1.52.0” “1.52” “1.53.0” “1.53”  
“1.54.0” “1.54”  
“1.55.0” “1.55” “1.56.0” “1.56” “1.57.0” “1.57” “1.58.0” “1.58”  
“1.59.0” “1.59”  
“1.60.0” “1.60” “1.61.0” “1.61” “1.62.0” “1.62” “1.63.0” “1.63”  
“1.64.0” “1.64”  
“1.65.0” “1.65” “1.66.0” “1.66” “1.67.0” “1.67” “1.68.0” “1.68”  
“1.69.0” “1.69”  
)  
find\_package(Boost “1.35” COMPONENTS filesystem system)

if(NOT Boost\_FOUND)  
message(FATAL\_ERROR “Boost required to compile ACK”)  
endif()

########################################################################

# Install directories

########################################################################  
include(GrPlatform) #define LIB\_SUFFIX  
set(GR\_RUNTIME\_DIR bin)  
set(GR\_LIBRARY\_DIR lib${LIB\_SUFFIX})  
set(GR\_INCLUDE\_DIR include/ACK)  
set(GR\_DATA\_DIR share)  
set(GR\_PKG\_DATA\_DIR ${GR\_DATA\_DIR}/${CMAKE\_PROJECT\_NAME})  
set(GR\_DOC\_DIR ${GR\_DATA\_DIR}/doc)  
set(GR\_PKG\_DOC\_DIR ${GR\_DOC\_DIR}/${CMAKE\_PROJECT\_NAME})  
set(GR\_CONF\_DIR etc)  
set(GR\_PKG\_CONF\_DIR ${GR\_CONF\_DIR}/${CMAKE\_PROJECT\_NAME}/conf.d)  
set(GR\_LIBEXEC\_DIR libexec)  
set(GR\_PKG\_LIBEXEC\_DIR ${GR\_LIBEXEC\_DIR}/${CMAKE\_PROJECT\_NAME})  
set(GRC\_BLOCKS\_DIR ${GR\_PKG\_DATA\_DIR}/grc/blocks)

########################################################################

# On Apple only, set install name and use rpath correctly, if not

already set  
########################################################################  
if(APPLE)  
if(NOT CMAKE\_INSTALL\_NAME\_DIR)  
set(CMAKE\_INSTALL\_NAME\_DIR  
${CMAKE\_INSTALL\_PREFIX}/${GR\_LIBRARY\_DIR} CACHE  
PATH “Library Install Name Destination Directory” FORCE)  
endif(NOT CMAKE\_INSTALL\_NAME\_DIR)  
if(NOT CMAKE\_INSTALL\_RPATH)  
set(CMAKE\_INSTALL\_RPATH  
${CMAKE\_INSTALL\_PREFIX}/${GR\_LIBRARY\_DIR} CACHE  
PATH “Library Install RPath” FORCE)  
endif(NOT CMAKE\_INSTALL\_RPATH)  
if(NOT CMAKE\_BUILD\_WITH\_INSTALL\_RPATH)  
set(CMAKE\_BUILD\_WITH\_INSTALL\_RPATH ON CACHE  
BOOL “Do Build Using Library Install RPath” FORCE)  
endif(NOT CMAKE\_BUILD\_WITH\_INSTALL\_RPATH)  
endif(APPLE)

########################################################################

# Find gnuradio build dependencies

########################################################################  
find\_package(CppUnit)  
find\_package(Doxygen)

# Search for GNU Radio and its components and versions. Add any

# components required to the list of GR\_REQUIRED\_COMPONENTS (in all

# caps such as FILTER or FFT) and change the version to the minimum

# API compatible version required.

set(GR\_REQUIRED\_COMPONENTS RUNTIME PMT STRING)  
find\_package(Gnuradio “3.7.2” REQUIRED)

if(NOT CPPUNIT\_FOUND)  
message(FATAL\_ERROR “CppUnit required to compile ACK”)  
endif()

########################################################################

# Setup doxygen option

########################################################################  
if(DOXYGEN\_FOUND)  
option(ENABLE\_DOXYGEN “Build docs using Doxygen” ON)  
else(DOXYGEN\_FOUND)  
option(ENABLE\_DOXYGEN “Build docs using Doxygen” OFF)  
endif(DOXYGEN\_FOUND)

########################################################################

# Setup the include and linker paths

########################################################################  
include\_directories(  
${CMAKE\_SOURCE\_DIR}/lib  
${CMAKE\_SOURCE\_DIR}/include  
${CMAKE\_BINARY\_DIR}/lib  
${CMAKE\_BINARY\_DIR}/include  
${Boost\_INCLUDE\_DIRS}  
${CPPUNIT\_INCLUDE\_DIRS}  
${GNURADIO\_RUNTIME\_INCLUDE\_DIRS}  
${GNURADIO\_ALL\_INCLUDE\_DIRS}  
)

link\_directories(  
${Boost\_LIBRARY\_DIRS}  
${CPPUNIT\_LIBRARY\_DIRS}  
${GNURADIO\_RUNTIME\_LIBRARY\_DIRS}  
)

# Set component parameters

set(GR\_ACK\_INCLUDE\_DIRS ${CMAKE\_CURRENT\_SOURCE\_DIR}/include CACHE  
INTERNAL “” FORCE)  
set(GR\_ACK\_SWIG\_INCLUDE\_DIRS ${CMAKE\_CURRENT\_SOURCE\_DIR}/swig CACHE  
INTERNAL “” FORCE)

########################################################################

# Create uninstall target

########################################################################  
configure\_file(  
${CMAKE\_SOURCE\_DIR}/cmake/cmake\_uninstall.cmake.in  
${CMAKE\_CURRENT\_BINARY\_DIR}/cmake\_uninstall.cmake  
@ONLY)

add\_custom\_target(uninstall  
${CMAKE\_COMMAND} -P  
${CMAKE\_CURRENT\_BINARY\_DIR}/cmake\_uninstall.cmake  
)

########################################################################

# Add subdirectories

########################################################################  
add\_subdirectory(include/ACK)  
add\_subdirectory(lib)  
add\_subdirectory(swig)  
add\_subdirectory(python)  
add\_subdirectory(grc)  
add\_subdirectory(apps)  
add\_subdirectory(docs)

########################################################################

# Install cmake search helper for this library

########################################################################  
if(NOT CMAKE\_MODULES\_DIR)  
set(CMAKE\_MODULES\_DIR lib${LIB\_SUFFIX}/cmake)  
endif(NOT CMAKE\_MODULES\_DIR)

install(FILES cmake/Modules/ACKConfig.cmake  
DESTINATION ${CMAKE\_MODULES\_DIR}/ACK  
)

* * *

top\_block.py

* * *

#!/usr/bin/env python2  
##################################################

# GNU Radio Python Flow Graph

# Title: Top Block

# Generated: Tue Aug 18 11:02:34 2015

##################################################

if **name** == ‘ **main** ’:  
import ctypes  
import sys  
if sys.platform.startswith(‘linux’):  
try:  
x11 = ctypes.cdll.LoadLibrary(‘libX11.so’)  
x11.XInitThreads()  
except:  
print “Warning: failed to XInitThreads()”

from PyQt4 import Qt  
from gnuradio import analog  
from gnuradio import blocks  
from gnuradio import eng\_notation  
from gnuradio import gr  
from gnuradio.eng\_option import eng\_option  
from gnuradio.filter import firdes  
from optparse import OptionParser  
import ACK  
import sys

class top\_block(gr.top\_block, Qt.QWidget):

```
def __init__ (self):
    gr.top_block. __init__ (self, "Top Block")
    Qt.QWidget. __init__ (self)
    self.setWindowTitle("Top Block")
    try:
         self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc'))
    except:
         pass
    self.top_scroll_layout = Qt.QVBoxLayout()
    self.setLayout(self.top_scroll_layout)
    self.top_scroll = Qt.QScrollArea()
    self.top_scroll.setFrameStyle(Qt.QFrame.NoFrame)
    self.top_scroll_layout.addWidget(self.top_scroll)
    self.top_scroll.setWidgetResizable(True)
    self.top_widget = Qt.QWidget()
    self.top_scroll.setWidget(self.top_widget)
    self.top_layout = Qt.QVBoxLayout(self.top_widget)
    self.top_grid_layout = Qt.QGridLayout()
    self.top_layout.addLayout(self.top_grid_layout)

    self.settings = Qt.QSettings("GNU Radio", "top_block")
    self.restoreGeometry(self.settings.value("geometry").toByteArray())

    ##################################################
    # Variables
    ##################################################
    self.samp_rate = samp_rate = 32000

    ##################################################
    # Blocks
    ##################################################
    self.blocks_message_debug_0 = blocks.message_debug()
    self.analog_const_source_x_0 = analog.sig_source_i(0, 

```

analog.GR\_CONST\_WAVE, 0, 0, 2)  
self.ACK\_Text\_Sanitize\_0 = ACK.Text\_Sanitize()

```
    ##################################################
    # Connections
    ##################################################
    self.msg_connect((self.ACK_Text_Sanitize_0, 'out'), 

```

(self.blocks\_message\_debug\_0, ‘print’))  
self.connect((self.analog\_const\_source\_x\_0, 0),  
(self.ACK\_Text\_Sanitize\_0, 0))

```
def closeEvent(self, event):
    self.settings = Qt.QSettings("GNU Radio", "top_block")
    self.settings.setValue("geometry", self.saveGeometry())
    event.accept()

def get_samp_rate(self):
    return self.samp_rate

def set_samp_rate(self, samp_rate):
    self.samp_rate = samp_rate

```

if **name** == ‘ **main** ’:  
parser = OptionParser(option\_class=eng\_option, usage=“%prog:  
[options]”)  
(options, args) = parser.parse\_args()  
from distutils.version import StrictVersion  
if StrictVersion(Qt.qVersion()) \>= StrictVersion(“4.5.0”):  
Qt.QApplication.setGraphicsSystem(gr.prefs().get\_string(‘qtgui’,‘style’,‘raster’))  
qapp = Qt.QApplication(sys.argv)  
tb = top\_block()  
tb.start()  
tb.show()

```
def quitting():
    tb.stop()
    tb.wait()
qapp.connect(qapp, Qt.SIGNAL("aboutToQuit()"), quitting)
qapp.exec_()
tb = None # to clean up Qt widgets

```

* * *

Logan Washbourne  
Electrical Engineering Graduate Student  
(Electromagnetics)

* * *

Discuss-gnuradio mailing list

[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> **[Discuss-gnuradio Info Page](https://lists.gnu.org/mailman/listinfo/discuss-gnuradio)**

---

<div class="post-metadata">

**Author:** ![WashbourneS\_Logan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ec9cab/32.png) [@WashbourneS\_Logan](https://www.ruby-forum.com/u/WashbourneS_Logan)\
**Post date:** [August 21, 2015, 11:39pm UTC](https://www.ruby-forum.com/t/oot-module-attribute-error-module-object-has-no-attribute-blockname/243071/9 "2015-08-21T23:39:05Z")

</div>

I see the following in the output of “nm -C -u”:  
U gr::ACK::Text\_Sanitize\_impl::forecast(int, std::vector\<int,  
std::allocator \>&)  
This was the undefined symbol that was causing the module import to  
fail… as you have discovered yourself. Now that the module import has  
succeeded you are seeing a different error.  
This error is because of the following in the generated python file:  
self.ACK\_Text\_Sanitize\_0 = ACK.Text\_Sanitize()  
Note that this will invoke “Text\_Sanitize::make” which expects a “char \*  
message” argument. That causes the error message below. For some reason  
GRC is not adding that parameter in the above statement. Did you add a  
declaration for that parameter in the XML file ?  
To verify that the XML file is the issue just try editing the generated  
python file and changing the above to:  
self.ACK\_Text\_Sanitize\_0 = ACK.Text\_Sanitize(“some string”)  
and running it from the command line (run “python top\_block.py” in a  
terminal window).  
–Patrick  
Date: Thu, 20 Aug 2015 11:08:56 -0500  
From: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
To: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Subject: Re: [Discuss-gnuradio] OOT Module Attribute Error module object  
has no attribute ‘blockname’

Nathan and Patrick,

Thanks for the tips!

I started with running: nm -C -u libgnuradio-.so

and the results of that can be found here:  
[loganwashbourne’s gists · GitHub](https://gist.github.com/loganwashbourne) under the nm -C -u  
libgnuradio-.so file. (I think github thinks I’m a robot so  
I can’t link to the direct page yet).

I’ll be honest, I’m not really sure what I’m looking at in this return,  
I do see some error statements but I’m not sure if they are just stating  
how it would handle an error or if it is an actual error.

I really don’t think I have any callbacks in my XML code, I just  
reference certain input variables in the XML code.

Next, the ACK\_swig.i file can be found here :  
[loganwashbourne’s gists · GitHub](https://gist.github.com/loganwashbourne) under the same file name. I  
checked it against the gr-tutorial swig file and the only difference was  
that the ACK\_swig.i file included a magic2 function call for each of my  
OOT blocks(check and Text\_Sanitize), while the gr-tutorial didn’t.

Last thing, I realized that I am creating the forecast function in the  
Text\_Sanitize\_impl.h file but not referencing it it the .cc file (I  
commented it out). I tried commenting out the void deceleration of the  
forecast function in the .h file but then I get a new error when I try  
to run the grc file(which is just a constant int source connected to my  
Text\_Sanitize block, which is connected the the message debug “print”  
port).

The new error is :

Traceback (most recent call last):  
File “/home/comm1/Logan/Thesis/top\_block.py”, line 92, in   
tb = top\_block()  
File “/home/comm1/Logan/Thesis/top\_block.py”, line 65, in **init**  
self.ACK\_Text\_Sanitize\_0 = ACK.Text\_Sanitize()  
File “/usr/local/lib/python2.7/dist-packages/ACK/ACK\_swig.py”, line  
399, in make  
return \_ACK\_swig.Text\_Sanitize\_make(\*args, \*\*kwargs)  
TypeError: Required argument ‘message’ (pos 1) not found

I do apologize for the long questions, if any of you feel like I need to  
spend more time looking into this myself before asking the mailing list,  
please don’t hesitate to mention it.

Logan Washbourne  
Electrical Engineering Graduate Student  
(Electromagnetics)

On Wed, Aug 19, 2015 at 5:06 PM, Patrick Sathyanathan  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

Hi Logan,  
I have faced the same error twice recently in my OOT module and finally  
tracked it down to two causes. The basic reason for the ‘object has no  
attribute’ error is that Python’s import of your module failed. In the  
two cases that I saw it was due to undefined symbols in the shared  
library for my module. My module was called ‘tutorial’ so the  
corresponding library is libgnuradio-tutorial.so and you can find it in  
the …/build/lib directory. To find out the undefined symbols do the  
following:  
nm -C -u libgnuradio-.so  
and search for method names in your class. So if your class is ‘MyClass’  
you could do:  
nm -C -u libgnuradio-.so | grep MyClass  
The two cases that I ran into were:

1. A non-virtual method in my implementation class was undefined because  
I had forgotten to prefix the method definition with the class name. So  
the .cc file had “void foo(…)” instead of “void  
MyClass\_impl::foo(…)” and foo was compiled as a ordinary function.  
Then the command above will report “MyClass\_impl::foo” as undefined.
2. The second case I ran into was with defining callbacks in the XML  
file. If you do then you will need to add matching virtual function  
declarations in the header file. This is needed for SWIG to work  
correctly. For my case the callback “foo” needed a virtual function  
declaration “virtual foo(…) = 0;” in the actual class  
declaration (not the …\_impl version) in the header file.  
Do you have callbacks ? If this is the issue then you should do a “make  
clean” before running make again to force SWIG to run.  
Hope this helps.  
–Patrick

Date: Wed, 19 Aug 2015 14:51:27 -0400  
From: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
To: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
CC: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Subject: Re: [Discuss-gnuradio] OOT Module Attribute Error module object  
has no attribute ‘blockname’

My gut is telling me this is a swig problem. I don’t know that it’s  
frowned upon, but it’s not easy to read without some kind of  
highlighting that we’d get from github or a gist with files. If I’m  
correct we’d also need to see swig/ACK.i (probably missing an include  
and/or gr swig block magic. compare to tutorial swig for sanity check)  
On Wed, Aug 19, 2015 at 10:38 AM, Washbourne, Logan  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:  
Hello all,

I know this question has been asked before, several times, but I didn’t  
find a solution that allowed me to use my OOT blocks without running  
into the error stated in the subject of this email.

I scoured through this  
webpage([http://gnuradio.org/redmine/projects/gnuradio/wiki/OutOfTreeModulesConfig](http://gnuradio.org/redmine/projects/gnuradio/wiki/OutOfTreeModulesConfig))  
and tried adding:  
set(GR\_REQUIRED\_COMPONENTS RUNTIME PMT)

to my top level CMakeLists.txt file, because I am using PMT objects in  
my block, but that didn’t get rid of the error.

The full error thrown is this:

Executing: “/home/comm1/Logan/Thesis/top\_block.py”

Traceback (most recent call last):  
File “/home/comm1/Logan/Thesis/top\_block.py”, line 92, in   
tb = top\_block()  
File “/home/comm1/Logan/Thesis/top\_block.py”, line 65, in **init**  
self.ACK\_Text\_Sanitize\_0 = ACK.Text\_Sanitize()  
AttributeError: ‘module’ object has no attribute ‘Text\_Sanitize’

I looked on the mailing list for that last line error and it pointed me  
to doing what I mentioned above with the CMakeLists.txt file, but could  
it be an actual problem with the top\_block.py file?

In the addendum is all of the files I could think would be necessary for  
someone to look at if they chose to, if including this much text is  
frowned upon, please let me know.

Addendum:

Text\_Sanitize\_impl.cc

* * *

#ifdef HAVE\_CONFIG\_H  
#include “config.h”  
#endif

#include \<gnuradio/io\_signature.h\>  
#include “Text\_Sanitize\_impl.h”  
#include \<pmt/pmt.h\>  
#include \<stdio.h\>  
#include   
#include   
#include

namespace gr {  
namespace ACK {

```
Text_Sanitize::sptr
Text_Sanitize::make(char* message)
{
  return gnuradio::get_initial_sptr
    (new Text_Sanitize_impl(message));
}

void
Text_Sanitize_impl::print_message(pmt::pmt_t d_message)
{
pmt::print(d_message);
}

/*
void
Text_Sanitize_impl::forecast (int noutput_items, gr_vector_int 

```

&ninput\_items\_required)  
{  
\<+forecast+\> e.g. ninput\_items\_required[0] = noutput\_items  
}  
\*/  
int  
Text\_Sanitize\_impl::general\_work (int noutput\_items,  
gr\_vector\_int &ninput\_items,  
gr\_vector\_const\_void\_star &input\_items,  
gr\_vector\_void\_star &output\_items)  
{  
const int \*in = (int \*) input\_items[0];  
pmt::pmt\_t \*out = (pmt::pmt\_t \*) output\_items[0];

```
d_out_msg = pmt::string_to_symbol(d_message);
//for(int i = 0; i<strlen(d_message); i++)
//{
// pmt::vector_set(d_out_msg,i,d_message[i]);
//}

    // Do <+signal processing+>
    // Tell runtime system how many input items we consumed on
    // each input stream.
    consume_each (noutput_items);

    // Tell runtime system how many output items we produced.
    return noutput_items;
}

/*
 * The private constructor
 */
Text_Sanitize_impl::Text_Sanitize_impl(char* message)
  : gr::block("Text_Sanitize",
          gr::io_signature::make(1, 1, sizeof(int)),
          gr::io_signature::make(1, 1, sizeof(pmt::pmt_t))),
    d_out_msg(pmt::string_to_symbol(std::string(""))),
    d_message(message)
{

message_port_register_out(pmt::mp("print_message"));
set_msg_handler(pmt::mp("print"), 

```

boost::bind(&Text\_Sanitize\_impl::print\_message, this, \_1));  
}

```
/*
 * Our virtual destructor.
 */
Text_Sanitize_impl::~Text_Sanitize_impl()
{
}

```

} /\* namespace ACK _/  
} /_ namespace gr \*/

* * *

Text\_Sanitize\_impl.h

* * *

#ifndef INCLUDED\_ACK\_TEXT\_SANITIZE\_IMPL\_H  
#define INCLUDED\_ACK\_TEXT\_SANITIZE\_IMPL\_H

#include \<ACK/Text\_Sanitize.h\>  
#include \<gnuradio/block.h\>  
#include \<gnuradio/thread/thread.h\>  
#include \<pmt/pmt.h\>

namespace gr {  
namespace ACK {

```
class Text_Sanitize_impl : public Text_Sanitize
{
 private:
  // Nothing to declare in this block.
pmt::pmt_t d_out_msg;
char* d_message;
void print_message(pmt::pmt_t d_message);

 public:
  Text_Sanitize_impl(char* message);
  ~Text_Sanitize_impl();

  // Where all the action really happens
  void forecast (int noutput_items, gr_vector_int 

```

&ninput\_items\_required);

```
  int general_work(int noutput_items,
           gr_vector_int &ninput_items,
           gr_vector_const_void_star &input_items,
           gr_vector_void_star &output_items);
};

```

} // namespace ACK  
} // namespace gr

#endif /\* INCLUDED\_ACK\_TEXT\_SANITIZE\_IMPL\_H \*/

* * *

Text\_Sanitize.h

* * *

#ifndef INCLUDED\_ACK\_TEXT\_SANITIZE\_H  
#define INCLUDED\_ACK\_TEXT\_SANITIZE\_H

#include \<ACK/api.h\>  
#include \<gnuradio/block.h\>

namespace gr {  
namespace ACK {

```
/*!
 * \brief <+description of block+>
 * \ingroup ACK
 *
 */
class ACK_API Text_Sanitize : virtual public gr::block
{
 public:
  typedef boost::shared_ptr<Text_Sanitize> sptr;

  /*!
   * \brief Return a shared_ptr to a new instance of 

```

ACK::Text\_Sanitize.  
\*  
\* To avoid accidental use of raw pointers, ACK::Text\_Sanitize’s  
\* constructor is in a private implementation  
\* class. ACK::Text\_Sanitize::make is the public interface for  
\* creating new instances.  
_/  
static sptr make(char_ message);  
};

} // namespace ACK  
} // namespace gr

#endif /\* INCLUDED\_ACK\_TEXT\_SANITIZE\_H \*/

* * *

Top Level CMakeLists.txt

* * *

########################################################################

# Project setup

########################################################################  
cmake\_minimum\_required(VERSION 2.6)  
project(gr-ACK CXX C)  
enable\_testing()

#select the release build type by default to get optimization flags  
if(NOT CMAKE\_BUILD\_TYPE)  
set(CMAKE\_BUILD\_TYPE “Release”)  
message(STATUS “Build type not specified: defaulting to release.”)  
endif(NOT CMAKE\_BUILD\_TYPE)  
set(CMAKE\_BUILD\_TYPE ${CMAKE\_BUILD\_TYPE} CACHE STRING “”)

#make sure our local CMake Modules path comes first  
list(INSERT CMAKE\_MODULE\_PATH 0 ${CMAKE\_SOURCE\_DIR}/cmake/Modules)

########################################################################

# Compiler specific setup

########################################################################  
if(CMAKE\_COMPILER\_IS\_GNUCXX AND NOT WIN32)  
#[Making sure you're not a bot!](http://gcc.gnu.org/wiki/Visibility)  
add\_definitions(-fvisibility=hidden)  
endif()

########################################################################

# Find boost

########################################################################  
if(UNIX AND EXISTS “/usr/lib64”)  
list(APPEND BOOST\_LIBRARYDIR “/usr/lib64”) #fedora 64-bit fix  
endif(UNIX AND EXISTS “/usr/lib64”)  
set(Boost\_ADDITIONAL\_VERSIONS  
“1.35.0” “1.35” “1.36.0” “1.36” “1.37.0” “1.37” “1.38.0” “1.38”  
“1.39.0” “1.39”  
“1.40.0” “1.40” “1.41.0” “1.41” “1.42.0” “1.42” “1.43.0” “1.43”  
“1.44.0” “1.44”  
“1.45.0” “1.45” “1.46.0” “1.46” “1.47.0” “1.47” “1.48.0” “1.48”  
“1.49.0” “1.49”  
“1.50.0” “1.50” “1.51.0” “1.51” “1.52.0” “1.52” “1.53.0” “1.53”  
“1.54.0” “1.54”  
“1.55.0” “1.55” “1.56.0” “1.56” “1.57.0” “1.57” “1.58.0” “1.58”  
“1.59.0” “1.59”  
“1.60.0” “1.60” “1.61.0” “1.61” “1.62.0” “1.62” “1.63.0” “1.63”  
“1.64.0” “1.64”  
“1.65.0” “1.65” “1.66.0” “1.66” “1.67.0” “1.67” “1.68.0” “1.68”  
“1.69.0” “1.69”  
)  
find\_package(Boost “1.35” COMPONENTS filesystem system)

if(NOT Boost\_FOUND)  
message(FATAL\_ERROR “Boost required to compile ACK”)  
endif()

########################################################################

# Install directories

########################################################################  
include(GrPlatform) #define LIB\_SUFFIX  
set(GR\_RUNTIME\_DIR bin)  
set(GR\_LIBRARY\_DIR lib${LIB\_SUFFIX})  
set(GR\_INCLUDE\_DIR include/ACK)  
set(GR\_DATA\_DIR share)  
set(GR\_PKG\_DATA\_DIR ${GR\_DATA\_DIR}/${CMAKE\_PROJECT\_NAME})  
set(GR\_DOC\_DIR ${GR\_DATA\_DIR}/doc)  
set(GR\_PKG\_DOC\_DIR ${GR\_DOC\_DIR}/${CMAKE\_PROJECT\_NAME})  
set(GR\_CONF\_DIR etc)  
set(GR\_PKG\_CONF\_DIR ${GR\_CONF\_DIR}/${CMAKE\_PROJECT\_NAME}/conf.d)  
set(GR\_LIBEXEC\_DIR libexec)  
set(GR\_PKG\_LIBEXEC\_DIR ${GR\_LIBEXEC\_DIR}/${CMAKE\_PROJECT\_NAME})  
set(GRC\_BLOCKS\_DIR ${GR\_PKG\_DATA\_DIR}/grc/blocks)

########################################################################

# On Apple only, set install name and use rpath correctly, if not

already set  
########################################################################  
if(APPLE)  
if(NOT CMAKE\_INSTALL\_NAME\_DIR)  
set(CMAKE\_INSTALL\_NAME\_DIR  
${CMAKE\_INSTALL\_PREFIX}/${GR\_LIBRARY\_DIR} CACHE  
PATH “Library Install Name Destination Directory” FORCE)  
endif(NOT CMAKE\_INSTALL\_NAME\_DIR)  
if(NOT CMAKE\_INSTALL\_RPATH)  
set(CMAKE\_INSTALL\_RPATH  
${CMAKE\_INSTALL\_PREFIX}/${GR\_LIBRARY\_DIR} CACHE  
PATH “Library Install RPath” FORCE)  
endif(NOT CMAKE\_INSTALL\_RPATH)  
if(NOT CMAKE\_BUILD\_WITH\_INSTALL\_RPATH)  
set(CMAKE\_BUILD\_WITH\_INSTALL\_RPATH ON CACHE  
BOOL “Do Build Using Library Install RPath” FORCE)  
endif(NOT CMAKE\_BUILD\_WITH\_INSTALL\_RPATH)  
endif(APPLE)

########################################################################

# Find gnuradio build dependencies

########################################################################  
find\_package(CppUnit)  
find\_package(Doxygen)

# Search for GNU Radio and its components and versions. Add any

# components required to the list of GR\_REQUIRED\_COMPONENTS (in all

# caps such as FILTER or FFT) and change the version to the minimum

# API compatible version required.

set(GR\_REQUIRED\_COMPONENTS RUNTIME PMT STRING)  
find\_package(Gnuradio “3.7.2” REQUIRED)

if(NOT CPPUNIT\_FOUND)  
message(FATAL\_ERROR “CppUnit required to compile ACK”)  
endif()

########################################################################

# Setup doxygen option

########################################################################  
if(DOXYGEN\_FOUND)  
option(ENABLE\_DOXYGEN “Build docs using Doxygen” ON)  
else(DOXYGEN\_FOUND)  
option(ENABLE\_DOXYGEN “Build docs using Doxygen” OFF)  
endif(DOXYGEN\_FOUND)

########################################################################

# Setup the include and linker paths

########################################################################  
include\_directories(  
${CMAKE\_SOURCE\_DIR}/lib  
${CMAKE\_SOURCE\_DIR}/include  
${CMAKE\_BINARY\_DIR}/lib  
${CMAKE\_BINARY\_DIR}/include  
${Boost\_INCLUDE\_DIRS}  
${CPPUNIT\_INCLUDE\_DIRS}  
${GNURADIO\_RUNTIME\_INCLUDE\_DIRS}  
${GNURADIO\_ALL\_INCLUDE\_DIRS}  
)

link\_directories(  
${Boost\_LIBRARY\_DIRS}  
${CPPUNIT\_LIBRARY\_DIRS}  
${GNURADIO\_RUNTIME\_LIBRARY\_DIRS}  
)

# Set component parameters

set(GR\_ACK\_INCLUDE\_DIRS ${CMAKE\_CURRENT\_SOURCE\_DIR}/include CACHE  
INTERNAL “” FORCE)  
set(GR\_ACK\_SWIG\_INCLUDE\_DIRS ${CMAKE\_CURRENT\_SOURCE\_DIR}/swig CACHE  
INTERNAL “” FORCE)

########################################################################

# Create uninstall target

########################################################################  
configure\_file(  
${CMAKE\_SOURCE\_DIR}/cmake/cmake\_uninstall.cmake.in  
${CMAKE\_CURRENT\_BINARY\_DIR}/cmake\_uninstall.cmake  
@ONLY)

add\_custom\_target(uninstall  
${CMAKE\_COMMAND} -P  
${CMAKE\_CURRENT\_BINARY\_DIR}/cmake\_uninstall.cmake  
)

########################################################################

# Add subdirectories

########################################################################  
add\_subdirectory(include/ACK)  
add\_subdirectory(lib)  
add\_subdirectory(swig)  
add\_subdirectory(python)  
add\_subdirectory(grc)  
add\_subdirectory(apps)  
add\_subdirectory(docs)

########################################################################

# Install cmake search helper for this library

########################################################################  
if(NOT CMAKE\_MODULES\_DIR)  
set(CMAKE\_MODULES\_DIR lib${LIB\_SUFFIX}/cmake)  
endif(NOT CMAKE\_MODULES\_DIR)

install(FILES cmake/Modules/ACKConfig.cmake  
DESTINATION ${CMAKE\_MODULES\_DIR}/ACK  
)

* * *

top\_block.py

* * *

#!/usr/bin/env python2  
##################################################

# GNU Radio Python Flow Graph

# Title: Top Block

# Generated: Tue Aug 18 11:02:34 2015

##################################################

if **name** == ‘ **main** ’:  
import ctypes  
import sys  
if sys.platform.startswith(‘linux’):  
try:  
x11 = ctypes.cdll.LoadLibrary(‘libX11.so’)  
x11.XInitThreads()  
except:  
print “Warning: failed to XInitThreads()”

from PyQt4 import Qt  
from gnuradio import analog  
from gnuradio import blocks  
from gnuradio import eng\_notation  
from gnuradio import gr  
from gnuradio.eng\_option import eng\_option  
from gnuradio.filter import firdes  
from optparse import OptionParser  
import ACK  
import sys

class top\_block(gr.top\_block, Qt.QWidget):

```
def __init__ (self):
    gr.top_block. __init__ (self, "Top Block")
    Qt.QWidget. __init__ (self)
    self.setWindowTitle("Top Block")
    try:
         self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc'))
    except:
         pass
    self.top_scroll_layout = Qt.QVBoxLayout()
    self.setLayout(self.top_scroll_layout)
    self.top_scroll = Qt.QScrollArea()
    self.top_scroll.setFrameStyle(Qt.QFrame.NoFrame)
    self.top_scroll_layout.addWidget(self.top_scroll)
    self.top_scroll.setWidgetResizable(True)
    self.top_widget = Qt.QWidget()
    self.top_scroll.setWidget(self.top_widget)
    self.top_layout = Qt.QVBoxLayout(self.top_widget)
    self.top_grid_layout = Qt.QGridLayout()
    self.top_layout.addLayout(self.top_grid_layout)

    self.settings = Qt.QSettings("GNU Radio", "top_block")
    self.restoreGeometry(self.settings.value("geometry").toByteArray())

    ##################################################
    # Variables
    ##################################################
    self.samp_rate = samp_rate = 32000

    ##################################################
    # Blocks
    ##################################################
    self.blocks_message_debug_0 = blocks.message_debug()
    self.analog_const_source_x_0 = analog.sig_source_i(0, 

```

analog.GR\_CONST\_WAVE, 0, 0, 2)  
self.ACK\_Text\_Sanitize\_0 = ACK.Text\_Sanitize()

```
    ##################################################
    # Connections
    ##################################################
    self.msg_connect((self.ACK_Text_Sanitize_0, 'out'), 

```

(self.blocks\_message\_debug\_0, ‘print’))  
self.connect((self.analog\_const\_source\_x\_0, 0),  
(self.ACK\_Text\_Sanitize\_0, 0))

```
def closeEvent(self, event):
    self.settings = Qt.QSettings("GNU Radio", "top_block")
    self.settings.setValue("geometry", self.saveGeometry())
    event.accept()

def get_samp_rate(self):
    return self.samp_rate

def set_samp_rate(self, samp_rate):
    self.samp_rate = samp_rate

```

if **name** == ‘ **main** ’:  
parser = OptionParser(option\_class=eng\_option, usage=“%prog:  
[options]”)  
(options, args) = parser.parse\_args()  
from distutils.version import StrictVersion  
if StrictVersion(Qt.qVersion()) \>= StrictVersion(“4.5.0”):  
Qt.QApplication.setGraphicsSystem(gr.prefs().get\_string(‘qtgui’,‘style’,‘raster’))  
qapp = Qt.QApplication(sys.argv)  
tb = top\_block()  
tb.start()  
tb.show()

```
def quitting():
    tb.stop()
    tb.wait()
qapp.connect(qapp, Qt.SIGNAL("aboutToQuit()"), quitting)
qapp.exec_()
tb = None # to clean up Qt widgets

```

* * *

Logan Washbourne  
Electrical Engineering Graduate Student  
(Electromagnetics)

* * *

Discuss-gnuradio mailing list

[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> **[Discuss-gnuradio Info Page](https://lists.gnu.org/mailman/listinfo/discuss-gnuradio)**

* * *

Discuss-gnuradio mailing list  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> **[Discuss-gnuradio Info Page](https://lists.gnu.org/mailman/listinfo/discuss-gnuradio)**

---

<div class="post-metadata">

**Author:** ![WashbourneS\_Logan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ec9cab/32.png) [@WashbourneS\_Logan](https://www.ruby-forum.com/u/WashbourneS_Logan)\
**Post date:** [August 24, 2015, 6:31pm UTC](https://www.ruby-forum.com/t/oot-module-attribute-error-module-object-has-no-attribute-blockname/243071/10 "2015-08-24T18:31:50Z")

</div>

Patrick and All,

I figured out my original error. In my XML file I was trying to use a  
variable without including it in the line:

ACK.Text\_Sanitize($msg)

the $msg is what I added and that error no longer occurs.

This error: RuntimeError: attempt to set\_msg\_handler() on bad input  
message  
port!

still occurs, but that’s just going to take some time for me to learn  
about  
PMTs and PDUs.

Thanks for everyone’s help!

Logan Washbourne  
Electrical Engineering Graduate Student  
(Electromagnetics)

On Sat, Aug 22, 2015 at 1:57 PM, Washbourne, Logan \<
