Identify automatic str/unicode coercions

Andrew Bennetts andrew at canonical.com
Wed Jun 11 12:55:29 BST 2008


Martin von Gagern wrote:
> Andrew Bennetts wrote:
>> An simpler option is set the default encoding to "undefined", and run the test
>> suite.  "undefined" raises an error on any implicit conversion:
>>
>> Unfortunately, this currently breaks a lot of things, including the
>> running of the test suite :)
>
> Yes, I read that as well, but there are a number of downsides to  
> aborting on each and every automatic conversion, even besides the fact  
> that the test suite won't work:
> 1. You'd have to fix things in a given order
> 2. You couldn't skip issues where you are not yet sure about the correct  
> encoding
> 3. You coudn't skip cases where you needn't worry as the string's a constant
> 4. The farther along you have proceeded, the more of the test suite  
> you'll need to run before you see the next issue
> 5. You can't weight issues by occurrence
>
> As the difficult part for me was not writing the custom encoding but  
> rather setting the default encoding without site.py interfering, I see  
> little to gain and much to loose by using "undefined" for bazaar  
> development.

Well, the advantage of using "undefined" is you could use it to systematically
find and fix every case in bzrlib with the usual selftest-fix-selftest-fix
cycle.  Given that the test runner doesn't even start running the tests though
it would be a fairly large undertaking, so I can see the advantage of your
approach.

-Andrew.




More information about the bazaar mailing list