Code review comment for lp:~renamer-developers/renamer/842236-unicode-filenames

Revision history for this message
Tristan Seligmann (mithrandi) wrote :

26 + # If we put non-ASCII unicode in here, then log.msg just neglects to emit
27 + # it for whatever bizarre reason.

I don't think it so much "neglects to emit it" as "blows up with a UnicodeDecodeError" due to unicode->str coercion. Either way, calling log.msg with a unicode object is not support, so we definitely shouldn't be doing it.

30 + getattr(sys.stdin, 'encoding', None) or sys.getdefaultencoding())

Shouldn't this be sys.stdout? This is kinda awful anyway, but I suppose there's no better way to do it.

107 - Look up TV episode metadata on TV Rage.
108 + Construct the TV Rage URL to the quickinfo page for the seriesName,
109 + season and episode.

The site seems to refer to itself as "TVRage" not "TV Rage", this needs to be fixed in a few places.

237 +class BodyReceiver(Protocol):

_buffer needs to be documented.

261 + def connectionLost(self, reason):
262 + data = self._buffer.getvalue().decode(self.encoding)
263 + self.finished.callback(data)

This needs to do error handling. Something like:

def connectionLost(self, reason):
    if reason.check(PotentialDataLoss, RequestDone) is None:
        self.finished.errback(reason)
    else:
        data = self._buffer.getvalue().decode(self.encoding)
        self.finished.callback(data)

review: Needs Fixing

« Back to merge proposal