Skip to content
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

Cannot build on RHEL6 #13

Closed
awilliam opened this issue Jan 24, 2018 · 5 comments
Closed

Cannot build on RHEL6 #13

awilliam opened this issue Jan 24, 2018 · 5 comments

Comments

@awilliam
Copy link

$ python --version
Python 2.6.6
$ git describe
v0.18-90-ga56e7126a7c5
$ make
python setup.py build
Traceback (most recent call last):
File "setup.py", line 10, in
from stgit import version
File "/home/alwillia/Work/stgit.git/stgit/version.py", line 8, in
from stgit import run, utils
File "/home/alwillia/Work/stgit.git/stgit/run.py", line 96
for k, v in self.__env.items()}
^
SyntaxError: invalid syntax
make: *** [all] Error 1

Code originates from:

commit 3bb4bb8
Author: Peter Grayson jpgrayson@gmail.com
Date: Sun Sep 24 22:38:32 2017 -0400

Unicode support for Run()
@jpgrayson
Copy link
Collaborator

TL;DR I can restore support for Python 2.6, but I cannot guarantee how long stgit will support Python 2.6.

Over the past year, I've been working on a series of patches to allow stgit to run with Python3 while retaining compatibility with Python2. The first Python2 to fall was 2.4, then 2.5 shortly thereafter. It was challenging enough to support Python3 and Python2.7 in the same code base, so I made the conscious decision to abandon support for Python2.6 in order to reduce my test matrix.

To get Python 2.6 to pass unit tests, the only change I'm seeing is to replace the dict comprehension shown in your backtrace. I will submit a PR with that change.

Given that RHEL6 is in the title and redhat.com is in your email address, could you (@awilliam) provide some color on the need for stgit on RHEL and/or at RedHat? I.e. are there RHEL customers who want stgit? Or is this scratching an itch for an enlightened few RH engineers? I only ask so that I can have better intuition about ongoing and future demand for Python 2.6 support.

@awilliam
Copy link
Author

Thanks Peter, understood that Python 2.6 is stretch target, I can continue to file bugs if it breaks and you can decide if it becomes too much effort. This is a personal request, I do work for RH and I do use stgit on a personal RHEL6 server as part of my work, but I don't know of any broad use within RH or customer requests. I am aware of other individual stgit users within RH though. I'm currently using v0.18, but decided to try the latest based on the upstream discussion with Bjorn and Linus as I'm also a kernel sub-maintainer and use stgit in a similar way to Bjorn. Thanks again

jpgrayson referenced this issue in jpgrayson/stgit Jan 26, 2018
With this dict comprehension replaced, unit tests pass with Python 2.6.

Repairs #13.

Signed-off-by: Peter Grayson <jpgrayson@gmail.com>
jpgrayson referenced this issue in jpgrayson/stgit Jan 27, 2018
With this dict comprehension replaced, unit tests pass with Python 2.6.

Repairs #13.

Signed-off-by: Peter Grayson <jpgrayson@gmail.com>
@awilliam
Copy link
Author

With the latest commits, I can now build on RHEL6, thanks! Testing the original reason for the update, unicode character handling in imported commits, I get the following:

$ stg show
Error: Unhandled exception:
Traceback (most recent call last):
File "/home/alwillia/lib/python2.6/site-packages/stgit/main.py", line 194, in _main
ret = command.func(parser, options, args)
File "/home/alwillia/lib/python2.6/site-packages/stgit/commands/show.py", line 83, in func
pager(commit_str)
File "/usr/lib64/python2.6/pydoc.py", line 1312, in pager
pager(text)
File "/usr/lib64/python2.6/pydoc.py", line 1326, in
return lambda text: pipepager(text, os.environ['PAGER'])
File "/usr/lib64/python2.6/pydoc.py", line 1353, in pipepager
pipe.write(text)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in position 75: ordinal not in range(128)

'git show' displays the unicode correctly and 'stg edit' does as well, so perhaps this is something I can work around. On a system with python 2.7, looking at the same nfs mounted tree, 'stg show' works. Is this fixable as well? Would you prefer I open a new issue? Thanks

@jpgrayson
Copy link
Collaborator

A new issue would be appreciated. I have a hunch as to what is happening. I also suspect that you would see the same behavior with either Python 2.6 or 2.7. Please confirm your LC_ALL and LANG environment variables as well. I will attempt to reproduce and repair.

Also, thank you for the background on your use cases for stgit with Python 2.6--that is helpful.

@jpgrayson
Copy link
Collaborator

Closing, but note that #19 is a related Python 2.6 issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants