[MERGE] Before actually using encoding need to check that Python has corresponding codec (v.2)

Aaron Bentley aaron.bentley at utoronto.ca
Tue Jan 2 14:08:57 GMT 2007


Alexander Belchenko wrote:
>>Also, I think you want "Windows says "cp0" when there is no encoding)",
>>not "Windows tell..."  (The object of "tell" is the person being told.)
> 
> 
> Hmm... I don't see such text in my patch.

Line 132:
+        # test cp0 encoding (Windows tell cp0 when there is no encoding)


> Similar text was written by John Meinel:
> 
>      # Windows returns 'cp0' to indicate there is no code page. So we'll just

He wrote windows "returns", not windows "tell".

> I think it's correct English.

It's not.

>>And when you override getpreferredencoding, shouldn't you set it back to
>>the previous value at the end of the test?
> 
> 
> Yes, I did. I copy approach of John Meinel from TestTerminalEncoding
> where instead of self.tearDown() method is used self.addCleanup(self._reset).

Ah.  I missed it because I looked at the wrong _reset.

> I should admit that I don't completely understand difference between
> .tearDown and ._reset, but I think it's related to problems with
> test cleanup when error in test raised.

We use addCleanup rather than extending tearDown, but I don't remember 
the rationale.  _reset isn't a special name, it's the use of addCleanup 
that makes it special.

> Do you satisfied with my explanations?
> I don't want to resend the patch because only one thing I'll need to fix
> is removing `#class FakeCodec` line.

I still think you should change "tell" to "says" (or better, "returns".) 
  I don't need to see a new patch.

Aaron




More information about the bazaar mailing list