Skip to content

'NoneType' object is not callable #33

Description

@International

Hi Peter, I've noticed the following exception happening:

Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/__init__.py", line 859, in emit
    msg = self.format(record)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/__init__.py", line 732, in format
    return fmt.format(record)
  File "/Users/geo/code/cx/lib/python2.7/site-packages/coloredlogs/__init__.py", line 891, in format
    copy = Empty()
TypeError: 'NoneType' object is not callable

I'm using a 3rd party package, happybase, and in the __del__ method, it's calling close, which is doing this:

    def close(self):
        """Close the underyling transport to the HBase instance.

        This method closes the underlying Thrift transport (TCP connection).
        """
        if not self.transport.is_open():
            return

        if logger is not None:
            # If called from __del__(), module variables may no longer
            # exist.

            logger.debug(
                "Closing Thrift transport to %s:%d",
                self.host, self.port)

        self.transport.close()

From what I've been able to tell, Empty() no longer exists, because the garbage collector already disposes it. Would adding such an if test to format, like the guys from happybase did, be the way to go?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions