Skip to content

git expects boolean value to be lower case #578

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

Closed
wants to merge 16 commits into from
Closed

git expects boolean value to be lower case #578

wants to merge 16 commits into from

Conversation

barry-scott
Copy link
Contributor

str(bool) returns capitialised True and False
that is not what git expects or compatible with
getboolean.

andy-maier and others added 16 commits February 2, 2017 17:21
Details:

- Added Python 2.6 again to .travis.yml (it was removed in commit 4486bcb).

- Replaced the use of dictionary comprehensions in `git/cmd.py` around
  line 800 with the code before that change (in commit 25a2ebf).
  Reason: dict comprehensions were introduced only in Python 2.7.

- Changed the import source for `SkipTest` and `skipIf` from `unittest.case`
  to first trying `unittest` and upon ImportError from `unittest2`.
  This was done in `git/util.py` and in several testcases.
  Reason: `SkipTest` and `skipIf` were introduced to unittest only
  in Python 2.7, and `unittest2` is a backport of `unittest` additions
  to Python 2.6.

- In git/test/lib/helper.py, fixed the definition of `assertRaisesRegex`
  to work on py26.

- For Python 2.6, added the `unittest2` dependency to `requirements.txt`
  and changed `.travis.yml` to install `unittest2`. Because git/util.py
  uses SkipTest from unittest/unittest2, the dependency could not be added
  to `test-requirements.txt`.

- Fixed an assertion in `git/test/test_index.py` to also allow
  a Python 2.6 specific exception message.

- In `is_cygwin_git()` in `git/util.py`, replaced `check_output()` with
  `Popen()`. It was added in Python 2.7.

- Enabled Python 2.6 for Windows:

  - Added Python 2.6 for MINGW in .appveyor.yml.

  - When defining `PROC_CREATIONFLAGS` in `git/cmd.py`, made use of certain
    win32 and subprocess flags that were introduced in Python 2.7, dependent
    on whether we run on Python 2.7 or higher.

  - In `AutoInterrupt.__del__()` in `git/cmd.py`, allowed for `os` not having
    `kill()`. `os.kill()` was added for Windows in Python 2.7 (For Linux, it
    existed in Python 2.6 already).
Interestingly only shows in particular python versions
on travis.
Maybe some caching effect?

Locally it is reproducible easily, with the latest flake8
As it does not appear to be the case.
See #547 (comment)

[skip ci]
The handling is similar, but the error message makes clear
what is happening, and what can be done to handle such a case.

Related to #561
Should have paid more attention to the test-failure before
pushing the fix.
str(bool) returns capitialised True and False
that is not what git expects or compatible with
getboolean.
@codecov-io
Copy link

Codecov Report

Merging #578 into master will increase coverage by 0.01%.

@@            Coverage Diff             @@
##           master     #578      +/-   ##
==========================================
+ Coverage    94.5%   94.51%   +0.01%     
==========================================
  Files          63       63              
  Lines        9932     9936       +4     
==========================================
+ Hits         9386     9391       +5     
+ Misses        546      545       -1
Impacted Files Coverage Δ
git/config.py 92.53% <80%> (-0.24%)
git/test/test_repo.py 97.39% <ø> (+0.34%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b197de0...47f3ce8. Read the comment docs.

@barry-scott
Copy link
Contributor Author

This is a bad PR. I'll put a god one together.

@barry-scott barry-scott closed this Feb 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

7 participants