python-json-pointer icon indicating copy to clipboard operation
python-json-pointer copied to clipboard

Fix problem creating rpm in python2.7

Open jorgecis opened this issue 6 years ago • 2 comments

Running python setup.py bdist_rpm in pythn2.7, I didnt test any other python versions.

warning: pypandoc module not found, could not convert Markdown to RST
running bdist_rpm
Traceback (most recent call last):
  File "setup.py", line 68, in <module>
    python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',
  File "/usr/lib64/python2.7/distutils/core.py", line 151, in setup
    dist.run_commands()
  File "/usr/lib64/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/lib64/python2.7/distutils/dist.py", line 971, in run_command
    cmd_obj.ensure_finalized()
  File "/usr/lib64/python2.7/distutils/cmd.py", line 109, in ensure_finalized
    self.finalize_options()
  File "/usr/lib64/python2.7/distutils/command/bdist_rpm.py", line 219, in finalize_options
    self.finalize_package_data()
  File "/usr/lib64/python2.7/distutils/command/bdist_rpm.py", line 227, in finalize_package_data
    self.distribution.get_contact_email()))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 8: ordinal not in range(128)

jorgecis avatar Mar 29 '18 16:03 jorgecis

Thanks for your report! Your patch seems to fail on Python 3, as it calls encode on a unicode string.

I'd like to narrow down the error. Can you please test if you can run python setup.py sdist or python setup.py bdist_wheel (with the wheel package installed) on the unmodified code?

stefankoegl avatar Apr 02 '18 08:04 stefankoegl

I recently had a need to package this as an RPM for python 2.7, and ran into this issue. The fix posted here was also how I worked around the issue. My command line was:

python2 setup.py bdist_rpm

The two commands in the previous response here were both successful. Apologies for necromancing a 2 year old pull request, but hopefully this is helpful.

Thanks.

dgalaska avatar May 22 '21 04:05 dgalaska