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

(quick fixes) Fixing various issues #18

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

(quick fixes) Fixing various issues #18

wants to merge 3 commits into from

Conversation

gabyfle
Copy link

@gabyfle gabyfle commented Apr 13, 2020

  • Fix a possible problem using open which can give the following error depending on the Python environnement :
Collecting steamfiles
  Using cached https://files.pythonhosted.org/packages/7a/f4/a55dad3536ce0547c87e49d744797bcaa2474a5363ef688576ac60c3d3c2/steamfiles-0.1.4.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-Bp3_YZ/steamfiles/setup.py", line 26, in <module>
        long_description=read('README.rst'),
      File "/tmp/pip-install-Bp3_YZ/steamfiles/setup.py", line 12, in read
        return open(os.path.join(os.path.dirname(__file__), fname), encoding='utf-8').read()
    TypeError: 'encoding' is an invalid keyword argument for this function
  • Fixed an installation issue cause by the usage of pip._internal that shouldn't be used in a production-ready package. Warning, this fix still uses pip._internal so this is not very accurate but it does the job

Error before this fix :

Defaulting to user installation because normal site-packages is not writeable
Processing ./Downloads/steamfiles
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3.7 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-8kzv1u6x/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-8kzv1u6x/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-req-build-8kzv1u6x/pip-egg-info
         cwd: /tmp/pip-req-build-8kzv1u6x/
    Complete output (12 lines):
    Traceback (most recent call last):
      File "/tmp/pip-req-build-8kzv1u6x/setup.py", line 7, in <module>
        from pip._internal.network import PipSession
    ImportError: cannot import name 'PipSession' from 'pip._internal.network' (/home/gabyfle/.local/lib/python3.7/site-packages/pip/_internal/network/__init__.py)
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-req-build-8kzv1u6x/setup.py", line 9, in <module>
        from pip.req import parse_requirements
    ModuleNotFoundError: No module named 'pip.req'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) to 90.506% when pulling 066c53f on Gabyfle:master into 3b03ec3 on leovp:master.

@leovp
Copy link
Owner

leovp commented Apr 16, 2020

Fix a possible problem using open which can give the following error depending on the Python environnement

Is it possible to get such an error with Python 3? Python 2 is not supported, and I think open has always had an encoding argument in 3.x

@gabyfle
Copy link
Author

gabyfle commented Apr 16, 2020

I don't really know but I ran this script on both 2.7 & 3.8 and I got this bug.

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

Successfully merging this pull request may close these issues.

None yet

3 participants