-
Notifications
You must be signed in to change notification settings - Fork 774
Description
Hello,
I ran into an issue when importing clr. In the end, it was caused by my current directory being protected against write operations. I fixed it by changing the current directory, with os.chdir before loading pythonnet but it feels like a dirty workaround. In my opinion, it would be best if pythonnet does not rely on the current directory as all. At least, it should be configurable.
Pythonnet uses pycparser which uses PLY. PLY wants to create a lextab.py file for optimization purposes. You can specify the directory where it is created through the outputdir argument (see dabeaz/ply#96). In pycparser, there is an argument called taboutputdir (see https://github.com/eliben/pycparser/blob/9cd0027f874fcceacca87fdfb163a387bf4d56b6/pycparser/c_parser.py#L70). I guess it can be used to control the outputdir but I'm not sure because I didn't investigate in the code.
In pythonnet, no argument can be passed to c_parser so we cannot control this directory:
pythonnet/tools/geninterop/geninterop.py
Line 327 in fc6c9e9
| parser = c_parser.CParser() |
Could we make this output directory configurable?