Fix Log Warning on Shutdown #18

Merged
merged 1 commit into from Feb 5, 2013

Projects

None yet

2 participants

@defcube
Contributor
defcube commented Feb 3, 2013

Upon shutdown, this error was displayed:
Exception AttributeError: "'NoneType' object has no attribute 'debug'" in <bound method Connection.del of <happybase.api.Connection object at 0x106878250>> ignored

@defcube defcube Fix Log Warning on Shutdown
Upon shutdown, this error was displayed:
Exception AttributeError: "'NoneType' object has no attribute 'debug'" in <bound method Connection.__del__ of <happybase.api.Connection object at 0x106878250>> ignored
af97c3f
@wbolster

Thanks. Should the code guard self.transport as well? And follow-up question: is the destructor really needed?

Owner

Great questions. I don't know the best practices here, but I'm thinking we're best off just getting rid of the destructor. Any sysadmins around? I'll ask one at my company on Monday.

@wbolster wbolster added a commit that referenced this pull request Feb 5, 2013
@wbolster Avoid warnings on shutdown if the logger is gone
Closes issue #18.
881ca6a
@wbolster wbolster merged commit af97c3f into wbolster:master Feb 5, 2013
@wbolster
Owner
wbolster commented Feb 5, 2013

To answer my own questions (well, try to answer after some quick research):

  • self.transport is not a module variable, so it will not be gone at the time __del__() is called
  • the destructor seems needed; at least the telnetlib module from the standard library does something similar with its socket
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment