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

distutils is not part of Python's standard library. #4

Closed
mcepl opened this issue Nov 30, 2013 · 3 comments
Closed

distutils is not part of Python's standard library. #4

mcepl opened this issue Nov 30, 2013 · 3 comments

Comments

@mcepl
Copy link
Contributor

mcepl commented Nov 30, 2013

Changeset [[https://bitbucket.org/agr/rope/changeset/b4e28f313b17|b4e28f313b17]] assumes distutils is installed, and that's not always the case, as distutils is not part of Python's standard library.

The change was for OS X specific workaround, but it should be enabled only for that platform (where distutils seems to be installed by default).

The older code was not ideal either, because it reported back the path to the stdlib of the interpreter actually running that function, and not the system wide interpreter.

Point in case: An editor that has an embedded Python interpreter, for which a plugin adds rope's support, would report, on Windows, for example, "python26.zip", while it would be better if it reported "c:\python26\libs" instead.

Maybe rope should allow this setting to be changed from the .ropeproject.py file. That seems the most general solution to me.

@mcepl
Copy link
Contributor Author

mcepl commented Nov 30, 2013

?

@mcepl
Copy link
Contributor Author

mcepl commented Nov 30, 2013

As a possible solution, I would change that function into this:

{{{
#!python

def _stdlib_path():
try:
# Try to get Python's libs path from the systems's default python interpreter.
import subprocess
args = ['python', '-c', 'import os; print os.path.dirname(os.file)']
return subprocess.Popen(args, stdout=subprocess.PIPE).communicate()[0].splitlines()[0]
except OSError:
# Get the Python's libs path for the interpreter executing this function.
import os
return os.path.dirname(os.file)
}}}

@mcepl
Copy link
Contributor Author

mcepl commented Nov 30, 2013

I'm dumb. Of course distutils is a stdlib package. I got it wrong somehow.
Please close this issue as invalid. Sorry for the noise.

@mcepl mcepl closed this as completed Nov 30, 2013
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