Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Munch Errors with IronPython #13

Closed
yiyuan1840 opened this issue Mar 17, 2017 · 0 comments
Closed

Munch Errors with IronPython #13

yiyuan1840 opened this issue Mar 17, 2017 · 0 comments

Comments

@yiyuan1840
Copy link

yiyuan1840 commented Mar 17, 2017

I was testing another python library in IronPython which calls munch, I found some errors when importing munch in IronPython. Here's what I did:

>>>import munch
Runtime error (ArgumentTypeException): unicode_escape_decode() takes no arguments (1 given)
Traceback:
  line 337, in <module>, "C:\Anaconda2\Lib\site-packages\munch\__init__.py"
  line 6, in script
  line 14, in u, "C:\Anaconda2\Lib\site-packages\munch\python3_compat.py"

I had consulted @dglassman for this issue, and here is his solution:
The conflicts are in python3_compat.py. "The issue is that munch includes a shim for compatibility with Python3, but IronPython doesn't understand it. And since we're working with Python 2.7, we don't need it."

The line 14 of the original python3_compat.py was:
return codecs.unicode_escape_decode(string)[0]

Is replaced with:
return unicode(string)

After I made this change, the munch library is imported successfully.

This might be a potential issue for IronPython users, if the solution is correct, please make the updates in next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant