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

Valloric / ycmd / 1802 / 1
85%
master: 94%

Build:
Build:
LAST BUILD BRANCH: python-completer-log-level
DEFAULT BRANCH: master
Ran 03 Apr 2016 06:24PM UTC
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

03 Apr 2016 06:15PM UTC coverage: 84.278% (+0.2%) from 84.094%
USE_CLANG_COMPLETER=true YCMD_PYTHON_VERSION=2.7 COVERAGE=true

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 -->

2959 of 3511 relevant lines covered (84.28%)

0.84 hits per line

Source Files on job 1802.1 (USE_CLANG_COMPLETER=true YCMD_PYTHON_VERSION=2.7 COVERAGE=true)
  • Tree
  • List 0
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 1802
  • Travis Job 1802.1
  • 89f0c5b3 on github
  • Prev Job for USE_CLANG_COMPLETER=true YCMD_PYTHON_VERSION=2.7 COVERAGE=true on auto (#1796.1)
  • Next Job for USE_CLANG_COMPLETER=true YCMD_PYTHON_VERSION=2.7 COVERAGE=true on auto (#1844.1)
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