Trivial logging bugs #8

Closed
warsaw opened this Issue Sep 24, 2012 · 5 comments

Comments

Projects
None yet
3 participants

warsaw commented Sep 24, 2012

We found this failure when we tried to build the package in Ubuntu, which runs the full test suite:

https://launchpadlibrarian.net/117069272/buildlog_ubuntu-quantal-i386.python-tx-tftp_0.1~bzr31-0ubuntu4_FAILEDTOBUILD.txt.gz

Scroll down to see the tracebacks. The fix is pretty trivial, and applied to our Ubuntu 12.10 version of the package, it allows the test suite to pass and thus build.

warsaw commented Sep 24, 2012

Sorry, I have no idea how to attach a patch to Github, so here's the patch:

--- a/tftp/session.py
+++ b/tftp/session.py
@@ -69,7 +69,7 @@
         if datagram.opcode == OP_DATA:
             return self.tftp_DATA(datagram)
         elif datagram.opcode == OP_ERROR:
-            log.msg("Got error: " % datagram)
+            log.msg("Got error: %s" % datagram)
             self.cancel()

     def tftp_DATA(self, datagram):
@@ -211,7 +211,7 @@
         if datagram.opcode == OP_ACK:
             return self.tftp_ACK(datagram)
         elif datagram.opcode == OP_ERROR:
-            log.msg("Got error: " % datagram)
+            log.msg("Got error: %s" % datagram)
             self.cancel()

     def tftp_ACK(self, datagram):
Owner

shylent commented Sep 25, 2012

Thanks for the heads up. Fixed in 5c57fda

@shylent shylent closed this Sep 25, 2012

jtv commented Oct 5, 2012

We just hit another instance in bootstrap.py, TFTPBootstrap.tftp_ERROR. Exactly the same code, so easy to find:

log.msg("Got error: " % datagram)
Owner

shylent commented Oct 6, 2012

Well, that was shameful. Fixed in fe9aba2.

jtv commented Oct 9, 2012

Thank you. :)

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