• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Valloric / ycmd / 1803
94%

Build:
DEFAULT BRANCH: master
Ran 03 Apr 2016 06:48PM UTC
Jobs 1
Files 40
Run time 1s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
1803

push

travis-ci

homu
Auto merge of #448 - micbou:fix-future-import, r=puremourning

[READY] Add python-future to sys.path just before packages path

### Problem

Modules from our `python-future` package may be overridden by ones from already installed packages: a package using the same name for its modules (ex: `builtins`) or a different version of `python-future`.

### How to reproduce

With a package installing a `builtins` module:
```sh
pip install pies2overrides
```
results in:
```
Traceback (most recent call last):
  File "<string>", line 24, in <module>
  File "C:\\Users\\micbou\\.vim\\bundle\\YouCompleteMe\\autoload\..\python\ycm\setup.py", line 49, in SetUpYCM
    base.LoadJsonDefaultsIntoVim()
  File "C:\\Users\\micbou\\.vim\\bundle\\YouCompleteMe\\autoload\..\python\ycm\base.py", line 55, in LoadJsonDefaultsIntoVim
    defaults = user_options_store.DefaultOptions()
  File "C:\Users\micbou\.vim\bundle\YouCompleteMe\python\ycm\..\..\third_party\ycmd\ycmd\user_options_store.py", line 55, in DefaultOptions
    options = json.loads( ReadFile( settings_path ) )
  File "C:\Users\micbou\.vim\bundle\YouCompleteMe\python\ycm\..\..\third_party\ycmd\ycmd\utils.py", line 55, in ReadFile
    with open( filepath, encoding = 'utf8' ) as f:
TypeError: 'encoding' is an invalid keyword argument for this function
```

With a different version of `python-future`:
```sh
pip install future==0.10.0
```
gives this error:
```
Traceback (most recent call last):
  File "<string>", line 22, in <module>
  File "C:\\Users\\micbou\\.vim\\bundle\\YouCompleteMe\\autoload\..\python\ycm\base.py", line 23, in <module>
    standard_library.install_aliases()
AttributeError: 'module' object has no attribute 'install_aliases'
```

### Solution

Instead of appending `python-future` to `sys.path`, insert it just before the first `site-packages` (`dist-packages` on Debian-like distributions) path. If no `site/dist-packages` are found, fall back to appending it.

Tested on Windows 7, Ubuntu 14.04, and OS X 10.11.

Fixes Valloric/YouCompleteMe#2024
Closes #446

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/ycmd/448)
<!-- Reviewable:end -->

2961 of 3511 relevant lines covered (84.33%)

0.84 hits per line

Jobs
ID Job ID Ran Files Coverage
1 1803.1 (USE_CLANG_COMPLETER=true YCMD_PYTHON_VERSION=2.7 COVERAGE=true) 03 Apr 2016 06:48PM UTC 0
84.33
Travis Job 1803.1
Source Files on build 1803
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #1803
  • 89f0c5b3 on github
  • Prev Build on master (#1797)
  • Next Build on master (#1806)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc