< Per Se
Best of Bookmarks, July-August >

Beautiful Soup Progress Report #3: OK, phase one is almost complete. There's just one test failure left in the generated Python 3 version, and I don't think it can be fixed; HTMLParser is just different between 2 and 3.

I haven't found a way in Python 2 code to indicate that a string should be converted into a byte string when the conversion script runs. In some cases I can stick .encode() onto the end and it works in both 2 and 3, but some of my tests have random binary data that's not in any particular encoding. And in some cases calling .encode() is just ugly. Kind of frustrating because about 40% of my test failures ultimately boiled down to marking such-and-such a string as a byte string. So I'd appreciate any ideas.

Filed under:


[Main] [Edit]

Unless otherwise noted, all content licensed by Leonard Richardson
under a Creative Commons License.