Repository: conda/conda

Issue:
Exception when accessing S3 custom channel via boto (rather than boto3)
<!--
Hi!

This is an issue tracker for conda -- the package manager.  File feature requests
for conda here, as well as bug reports about something conda has messed up.

If your issue is a bug report or feature request for:
  * a specific conda package from Anaconda ('defaults' channel):
      ==> file at https://github.com/ContinuumIO/anaconda-issues
  * a specific conda package from conda-forge:
      ==> file at the corresponding feedstock under https://github.com/conda-forge
  * repo.anaconda.com access and service:
      ==> file at https://github.com/ContinuumIO/anaconda-issues
  * anaconda.org access and service:
      ==> file at https://anaconda.org/contact/report
  * commands under 'conda build':
      ==> file at https://github.com/conda/conda-build
  * commands under 'conda env':
      ==> please file it here!
  * all other conda commands that start with 'conda':
      ==> please file it here!

-->

**I'm submitting a...**
  - [X] bug report
  - [ ] feature request


## Current Behavior
<!-- What actually happens?
     If you want to include console output, please use "Steps to Reproduce" below. -->
conda search fails and produces an exception.

### Steps to Reproduce
<!-- If the current behavior is a bug, please provide specific, minimal steps to independently reproduce.
     Include the exact conda commands that reproduce the issue and their output between the ticks below. -->
```
1. Ensure you have boto installed, but *not* boto3
2. Add an s3:// URL to your channel list in .condarc or specify the s3:// URL manually on the command line
3. Execute conda search conda (or any other package)
```


## Expected Behavior
<!-- What do you think should happen? -->

The search would work.

## Environment Information
<details open><summary><code>`conda info`</code></summary><p>
<!-- between the ticks below, paste the output of 'conda info' -->

```
$ conda info

     active environment : None
       user config file : /Users/blake/.condarc
 populated config files : /Users/blake/.condarc
          conda version : 4.4.10
    conda-build version : 3.4.1
         python version : 3.6.4.final.0
       base environment : /usr/local/anaconda3  (writable)
           channel URLs : https://repo.continuum.io/pkgs/main/osx-64
                          https://repo.continuum.io/pkgs/main/noarch
                          https://repo.continuum.io/pkgs/free/osx-64
                          https://repo.continuum.io/pkgs/free/noarch
                          https://repo.continuum.io/pkgs/r/osx-64
                          https://repo.continuum.io/pkgs/r/noarch
                          https://repo.continuum.io/pkgs/pro/osx-64
                          https://repo.continuum.io/pkgs/pro/noarch
                          s3://<redacted>/osx-64
                          s3://<redacted>/noarch
          package cache : /usr/local/anaconda3/pkgs
                          /Users/blake/.conda/pkgs
       envs directories : /usr/local/anaconda3/envs
                          /Users/blake/.conda/envs
               platform : osx-64
             user-agent : conda/4.4.10 requests/2.18.4 CPython/3.6.4 Darwin/17.4.0 OSX/10.13.3
                UID:GID : 501:20
             netrc file : None
           offline mode : False
```
</p></details>


<details open><summary><code>`conda config --show-sources`</code></summary><p>
<!-- between the ticks below, paste the output of 'conda config --show-sources' -->

```
==> /Users/blake/.condarc <==
channels:
  - defaults
  - s3://<redacted>
```
</p></details>


<details><summary><code>`conda list --show-channel-urls`</code></summary><p>
<!-- between the ticks below, paste the output of 'conda list --show-channel-urls' -->

```
```
</p></details>

Exception when accessing S3 custom channel via boto (rather than boto3)
<!--
Hi!

This is an issue tracker for conda -- the package manager.  File feature requests
for conda here, as well as bug reports about something conda has messed up.

If your issue is a bug report or feature request for:
  * a specific conda package from Anaconda ('defaults' channel):
      ==> file at https://github.com/ContinuumIO/anaconda-issues
  * a specific conda package from conda-forge:
      ==> file at the corresponding feedstock under https://github.com/conda-forge
  * repo.anaconda.com access and service:
      ==> file at https://github.com/ContinuumIO/anaconda-issues
  * anaconda.org access and service:
      ==> file at https://anaconda.org/contact/report
  * commands under 'conda build':
      ==> file at https://github.com/conda/conda-build
  * commands under 'conda env':
      ==> please file it here!
  * all other conda commands that start with 'conda':
      ==> please file it here!

-->

**I'm submitting a...**
  - [X] bug report
  - [ ] feature request


## Current Behavior
<!-- What actually happens?
     If you want to include console output, please use "Steps to Reproduce" below. -->
conda search fails and produces an exception.

### Steps to Reproduce
<!-- If the current behavior is a bug, please provide specific, minimal steps to independently reproduce.
     Include the exact conda commands that reproduce the issue and their output between the ticks below. -->
```
1. Ensure you have boto installed, but *not* boto3
2. Add an s3:// URL to your channel list in .condarc or specify the s3:// URL manually on the command line
3. Execute conda search conda (or any other package)
```


## Expected Behavior
<!-- What do you think should happen? -->

The search would work.

## Environment Information
<details open><summary><code>`conda info`</code></summary><p>
<!-- between the ticks below, paste the output of 'conda info' -->

```
$ conda info

     active environment : None
       user config file : /Users/blake/.condarc
 populated config files : /Users/blake/.condarc
          conda version : 4.4.10
    conda-build version : 3.4.1
         python version : 3.6.4.final.0
       base environment : /usr/local/anaconda3  (writable)
           channel URLs : https://repo.continuum.io/pkgs/main/osx-64
                          https://repo.continuum.io/pkgs/main/noarch
                          https://repo.continuum.io/pkgs/free/osx-64
                          https://repo.continuum.io/pkgs/free/noarch
                          https://repo.continuum.io/pkgs/r/osx-64
                          https://repo.continuum.io/pkgs/r/noarch
                          https://repo.continuum.io/pkgs/pro/osx-64
                          https://repo.continuum.io/pkgs/pro/noarch
                          s3://<redacted>/osx-64
                          s3://<redacted>/noarch
          package cache : /usr/local/anaconda3/pkgs
                          /Users/blake/.conda/pkgs
       envs directories : /usr/local/anaconda3/envs
                          /Users/blake/.conda/envs
               platform : osx-64
             user-agent : conda/4.4.10 requests/2.18.4 CPython/3.6.4 Darwin/17.4.0 OSX/10.13.3
                UID:GID : 501:20
             netrc file : None
           offline mode : False
```
</p></details>


<details open><summary><code>`conda config --show-sources`</code></summary><p>
<!-- between the ticks below, paste the output of 'conda config --show-sources' -->

```
==> /Users/blake/.condarc <==
channels:
  - defaults
  - s3://<redacted>
```
</p></details>


<details><summary><code>`conda list --show-channel-urls`</code></summary><p>
<!-- between the ticks below, paste the output of 'conda list --show-channel-urls' -->

```
```
</p></details>



Discussion:

Resolving patch:
diff --git a/conda/gateways/connection/adapters/s3.py b/conda/gateways/connection/adapters/s3.py
--- a/conda/gateways/connection/adapters/s3.py
+++ b/conda/gateways/connection/adapters/s3.py
@@ -116,3 +116,5 @@ def _send_boto(self, boto, resp, request):
             resp.close = resp.raw.close
         else:
             resp.status_code = 404
+
+        return resp


Test patch: