You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It will give this error: AttributeError: module 'csv' has no attribute 'reader'
@garsuga ran into this error, and I was confused by it. I now see that sys.path gets PWD inserted. This broke @garsuga's code that we had to stop using the program, because sirepo.numpy exists. (The program cd'd to the module being debugged, which is a separate issue.)
I think we should consider dropping the first element in sys.path in pykern.pkcli. (We should also add a fixup to projex that imports everything unqualified to reduce [but not eliminate] collisions.)
Since all processes are started with pykern.pkcli.main (except sirepo_jupyterhub which could be changed), it could strip '.' from the first element of sys.path. I think this would avoid problems and be more secure.
The text was updated successfully, but these errors were encountered:
Thanks for the link @e-carlin. It led me to _PyPathConfig_ComputeSysPath0, which computes syspath0. The function with documentation is 142 lines long. More importantly it uses readlink. Furthermore, py.test inserts pwd in sys.path. Kind of messy.
Try this from any directory (not in sys.path):
It will give this error:
AttributeError: module 'csv' has no attribute 'reader'
@garsuga ran into this error, and I was confused by it. I now see that sys.path gets PWD inserted. This broke @garsuga's code that we had to stop using the program, because sirepo.numpy exists. (The program cd'd to the module being debugged, which is a separate issue.)
I think we should consider dropping the first element in sys.path in pykern.pkcli. (We should also add a fixup to projex that imports everything unqualified to reduce [but not eliminate] collisions.)
This has been known in Unix since 1984.
Go recently added something to prevent this. I think this is a breaking change.
Since all processes are started with pykern.pkcli.main (except sirepo_jupyterhub which could be changed), it could strip '.' from the first element of sys.path. I think this would avoid problems and be more secure.
The text was updated successfully, but these errors were encountered: