This is a hack to allow Python to compute correctly the priorities w.r.t. locally installed (on eggs and develop-eggs) packages. I have not yet tested if we still need this hack, after the move away from pkg_resources and the adoption of the built-in pkgutil. If we still do need this, we'll need to put and if branch somewhere. Otherwise, we can remove it all together (that would be preferable).
This problem can be reproduced w/o involving any of our buildout stuff:
$ source activate test$ pythonPython 3.6.0rc1 | packaged by conda-forge | (default, Dec 7 2016, 22:57:23)[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.54)] on darwinType "help", "copyright", "credits" or "license"for more information.>>> import site>>> site.main()Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/andre/.conda/envs/base36/lib/python3.6/site.py", line 525, in main abs_paths() File "/Users/andre/.conda/envs/base36/lib/python3.6/site.py", line 110, in abs_paths m.__cached__ = os.path.abspath(m.__cached__) File "/Users/andre/.conda/envs/base36/lib/python3.6/posixpath.py", line 369, in abspath path = os.fspath(path)TypeError: expected str, bytes or os.PathLike object, not NoneType
So, this problem must be reported upstream (i.e., to Python's bug tracking system) - it is not related to this package.
@amohammadi: Note this Python bug may be mitigated if we can remove the use of "import site; site.main()" from our scripts. Anyways, this is clearly an issue with the standard module site rather than with this package itself. Also note this you're using an rc release, which will probably contain bugs such as this.
% pythonPython 3.6.0rc1 | packaged by conda-forge | (default, Dec 7 2016, 16:50:55) [GCC 4.8.2 20140120 (Red Hat 4.8.2-15)] on linuxType "help", "copyright", "credits" or "license" for more information.>>> import site>>> site.main()>>> % conda list python# packages in environment at /home/amir/miniconda/envs/test:#Using Anaconda API: https://api.anaconda.orgpython 3.6.0rc1 0 conda-forge
So - the problem now seems to be bob/bob.extension still depends a lot on bootstrap and the fact there will be a script in ./bin/buildout. I just uploaded bob.extension!33 (merged) which is supposed to fix this problem.
$ python3.6 -c'os.path.abspath(None)'Traceback (most recent call last): File "<string>", line 1, in <module>NameError: name 'os' is not defined$ python3.6 -c'import os; os.path.abspath(None)'Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/lib/python3.6/posixpath.py", line 369, in abspath path = os.fspath(path)TypeError: expected str, bytes or os.PathLike object, not NoneType$ which python3.6/usr/bin/python3.6
So, the issue is present as TypeError is produced as a response to os.path.abspath(None) (instead of AttributeError as was before Python 3.6).
The question is - what are you doing differently to make it work? For one, your last test uses the system python instead of Conda's. Could you please re-check? This consistently does not work for me:
$pythonPython 3.6.0 |Anaconda 4.3.0 (x86_64)| (default, Dec 23 2016, 13:19:00)[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwinType "help", "copyright", "credits" or "license" for more information.>>> import site>>> site.main()Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/andre/conda/envs/bob-devel-py36/lib/python3.6/site.py", line 525, in main abs_paths() File "/Users/andre/conda/envs/bob-devel-py36/lib/python3.6/site.py", line 110, in abs_paths m.__cached__ = os.path.abspath(m.__cached__) File "/Users/andre/conda/envs/bob-devel-py36/lib/python3.6/posixpath.py", line 369, in abspath path = os.fspath(path)TypeError: expected str, bytes or os.PathLike object, not NoneType
Notice that, if you use the -c option, you can't reproduce the problem - in this case sys.modules will not have __main__, which triggers the problem. You must start the prompt in interactive mode.
If you look at my first comment, I tested this both in interactive mode and using -c. The difference I see here is that I am using Python 3.6.1 and you 3.6.0.
Something is different in our setups... I'm not sure why it does not work for me and it does for you. Could you test it on an Idiap Linux box? (for me, this does not work.)
Got it! As I suspected, I have a setting for the environment variable $PYTHONSTARTUP. If you set it and then python executes that file before it runs, then it creates the issue.
This is still an issue with Python 3.6 and the upstream bug report is fine. Our hack should also be OK for now. I'll leave this opened until the upstream bug is fixed.
André Anjoschanged title from Buildouts are broken on python 3.6 to Buildouts are broken on python 3.6, because of a Python bug
changed title from Buildouts are broken on python 3.6 to Buildouts are broken on python 3.6, because of a Python bug