peritus / bumpversion

Version-bump your software with a single command
https://pypi.python.org/pypi/bumpversion
MIT License
1.5k stars 148 forks source link

Fixes #135 - TypeError in Python 3 on Windows #138

Open smsearcy opened 8 years ago

smsearcy commented 8 years ago

Fixes #135 "TypeError: environment can have only strings" by using str() instead of b'' for preparing environment settings. Tested to make sure it works in both Python 2.7 and Python 3.4 on Windows.

TAGC commented 7 years ago

pip install git+git://github.com/smsearcy/bumpversion.git@issue-135 for anyone who wants to use bumpversion with Python 3 until this gets merged into master. I can confirm that this works with Python 3.5.

deisi commented 7 years ago

for me using pip install git+git://github.com/smsearcy/bumpversion.git@issue-135 doesnt help. It still fails with:

warning: LF will be replaced by CRLF in setup.cfg.
The file will have its original line endings in your working directory.
Traceback (most recent call last):
  File "c:\users\deiseroth\anaconda3\lib\runpy.py", line 184, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\deiseroth\anaconda3\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\deiseroth\Anaconda3\Scripts\bumpversion.exe\__main__.py", line 9, in <module>
  File "c:\users\deiseroth\anaconda3\lib\site-packages\bumpversion\__init__.py", line 994, in main
    vcs.commit(message=commit_message)
  File "c:\users\deiseroth\anaconda3\lib\site-packages\bumpversion\__init__.py", line 73, in commit
    list(os.environ.items()) + [(b'HGENCODING', b'utf-8')]
  File "c:\users\deiseroth\anaconda3\lib\subprocess.py", line 626, in check_output
    **kwargs).stdout
  File "c:\users\deiseroth\anaconda3\lib\subprocess.py", line 693, in run
    with Popen(*popenargs, **kwargs) as process:
  File "c:\users\deiseroth\anaconda3\lib\subprocess.py", line 947, in __init__
    restore_signals, start_new_session)
  File "c:\users\deiseroth\anaconda3\lib\subprocess.py", line 1224, in _execute_child
    startupinfo)
TypeError: environment can only contain strings

But I'm not sure if the pip install works at all. My pip freeze | grep bump shows:

bumpversion==0.5.3

I was expecting to see the git ref there but maybe I'm wrong.

evanunderscore commented 7 years ago

I just encountered this issue with Python 3.6.1 and pip install git+git://github.com/smsearcy/bumpversion.git@issue-135 resolved it for me.

Nurdok commented 7 years ago

Is there a chance this will be fixed (the CI is failing) and merged? I use this version on Windows and I would love to go back to using the main branch version.

Nurdok commented 7 years ago

Actually, it seems that the build is only failing because of Python 3.2, which is really dead and should not be supported anymore (it is no longer supported by pip). So this really can and should be merged.

smsearcy commented 7 years ago

@Nurdok, I had another PR (#139) to deal with the failing Python 3.2 tests, but I think you're right, dropping Python 3.2 support makes more sense. Unfortunately it does not appear there has been any recent activity on this project.

jwaschkau commented 7 years ago

Works for me with Python3.4.4 x86 Windows