IronPython support

Issue #34 open
Eli Collins repo owner created an issue

(Imported from Google Code)

It would be nice to add IronPython to the list of VMs which passlib supports.

However, IronPython's unicode/bytes handling is a little funky: it's native string type is unicode (ala Python 3), but encoding or decoding a unicode string results in another unicode string:

>>> u'\xA3'.encode('utf-8')
u'\xC2\xA3'
>>> u'\xC2\xA3'.decode("utf-8")
u'\xA3'

Because of this, the following snippet is not idempotent under IronPython (unlike every other python 2 & 3 vm):

if not isinstance(source, bytes):
    source = source.encode("utf-8")

This is particularly a problem for passlib, since passwords have to be encoded just so for the hashes to verify correctly. One alternative might be to research ways to make passlib less strict, but I'm not sure how I feel about that in theory, much less whether it would be sufficient to solve the problem.

So putting the ironpython-support-dev branch on the back burner for now.

Comments (2)

  1. Log in to comment