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

[DO NOT MERGE] Hack: Work around (maybe broken?) LocalFSAdapter #4044

Closed
wants to merge 1 commit into from

Conversation

mingwandroid
Copy link
Contributor

Since kennethreitz/requests@34af72c requests no longer handles file://.

Although we have our own LocalFSAdapter, to me, it looks incomplete and doesn't seem to be working:

$ /home/ray/mc-x64-3.5/bin/conda install -c file:///home/ray/gd.cio/r-language/r-3.3.2 r-essentials

    Traceback (most recent call last):
      File "/home/ray/mc-x64-3.5/lib/python3.5/site-packages/conda/exceptions.py", line 479, in conda_exception_handler
        return_value = func(*args, **kwargs)
      File "/home/ray/mc-x64-3.5/lib/python3.5/site-packages/conda/cli/main.py", line 145, in _main
        exit_code = args.func(args, p)
      File "/home/ray/mc-x64-3.5/lib/python3.5/site-packages/conda/cli/main_install.py", line 80, in execute
        install(args, parser, 'install')
      File "/home/ray/mc-x64-3.5/lib/python3.5/site-packages/conda/cli/install.py", line 238, in install
        prefix=prefix)
      File "/home/ray/mc-x64-3.5/lib/python3.5/site-packages/conda/api.py", line 24, in get_index
        index = fetch_index(channel_urls, use_cache=use_cache, unknown=unknown)
      File "/home/ray/mc-x64-3.5/lib/python3.5/site-packages/conda/fetch.py", line 301, in fetch_index
        repodatas = [(u, f.result()) for u, f in zip(urls, futures)]
      File "/home/ray/mc-x64-3.5/lib/python3.5/site-packages/conda/fetch.py", line 301, in <listcomp>
        repodatas = [(u, f.result()) for u, f in zip(urls, futures)]
      File "/home/ray/mc-x64-3.5/lib/python3.5/concurrent/futures/_base.py", line 398, in result
        return self.__get_result()
      File "/home/ray/mc-x64-3.5/lib/python3.5/concurrent/futures/_base.py", line 357, in __get_result
        raise self._exception
      File "/home/ray/mc-x64-3.5/lib/python3.5/concurrent/futures/thread.py", line 55, in run
        result = self.fn(*self.args, **self.kwargs)
      File "/home/ray/mc-x64-3.5/lib/python3.5/site-packages/conda/fetch.py", line 75, in func
        res = f(*args, **kwargs)
      File "/home/ray/mc-x64-3.5/lib/python3.5/site-packages/conda/fetch.py", line 118, in fetch_repodata
        timeout=(6.1, 60))
      File "/home/ray/mc-x64-3.5/lib/python3.5/site-packages/requests/sessions.py", line 501, in get
        return self.request('GET', url, **kwargs)
      File "/home/ray/mc-x64-3.5/lib/python3.5/site-packages/requests/sessions.py", line 488, in request
        resp = self.send(prep, **send_kwargs)
      File "/home/ray/mc-x64-3.5/lib/python3.5/site-packages/requests/sessions.py", line 641, in send
        r.content
      File "/home/ray/mc-x64-3.5/lib/python3.5/site-packages/requests/models.py", line 781, in content
        self._content = bytes().join(self.iter_content(CONTENT_CHUNK_SIZE)) or bytes()
      File "/home/ray/mc-x64-3.5/lib/python3.5/site-packages/requests/models.py", line 714, in generate
        chunk = self.raw.read(chunk_size)
    AttributeError: 'FileNotFoundError' object has no attribute 'read'

I have 'fixed' this by using a different adapter, from the requests-file project in a very hacky way. Using this, I get:

$ /home/ray/mc-x64-3.5/bin/conda install -c file:///home/ray/gd.cio/r-language/r-3.3.2 r-essentials

Fetching package metadata ...........
Solving package specifications: ..........

# All requested packages already installed.
# packages in environment at /home/ray/mc-x64-3.5:
#
r-essentials              1.5.0                         0    file:///home/ray/gd.cio/r-language/r-3.3.2

@kalefranz
Copy link
Contributor

kalefranz commented Dec 12, 2016

Conda's requirements information in repodata.json on defaults restrict requests to version 2.11.1 or less.

We could also cherry-pick the conda/gateways/adapters/localfs.py parts back to #3886 back to 4.2.x.

@mingwandroid
Copy link
Contributor Author

@kalefranz, the backport sounds good to me.

@kalefranz
Copy link
Contributor

superseded by #4059

@kalefranz kalefranz closed this Dec 13, 2016
@github-actions
Copy link

Hi there, thank you for your contribution to Conda!

This pull request has been automatically locked since it has not had recent activity after it was closed.

Please open a new issue or pull request if needed.

@github-actions github-actions bot added the locked [bot] locked due to inactivity label Sep 22, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked [bot] locked due to inactivity source::anaconda created by members of Anaconda, Inc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants