Bug 216208 - textproc/py-tabletext: configure target fails under py3k with UnicodeDecodeError
Summary: textproc/py-tabletext: configure target fails under py3k with UnicodeDecodeError
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Kris Moore
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-18 03:42 UTC by John W. O'Brien
Modified: 2021-05-23 02:39 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (kmoore)


Attachments
textproc/py-tabletext: Specify encoding of files in setup.py (1.19 KB, patch)
2017-01-18 03:42 UTC, John W. O'Brien
no flags Details | Diff
textproc/py-tabletext: Specify encoding of files in setup.py (1.35 KB, patch)
2017-01-29 15:35 UTC, John W. O'Brien
john: maintainer-approval?
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John W. O'Brien 2017-01-18 03:42:57 UTC
Created attachment 179022 [details]
textproc/py-tabletext: Specify encoding of files in setup.py

Sample error:

===>  Configuring for py34-tabletext-0.1
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "setup.py", line 10, in <module>
    + open("CHANGELOG.rst").read(),
  File "/usr/local/lib/python3.4/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 1321: ordinal not in range(128)
*** Error code 1

I reported this upstream https://github.com/Thibauth/tabletext/issues/1

A fix is attached.
Comment 1 John W. O'Brien 2017-01-26 03:50:13 UTC
The attached patch appears to break the build under python2.

===>  Configuring for py27-tabletext-0.1
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "setup.py", line 10, in <module>
    + open("CHANGELOG.rst", encoding='utf8').read(),
TypeError: 'encoding' is an invalid keyword argument for this function
*** Error code 1
Comment 2 John W. O'Brien 2017-01-29 15:35:05 UTC
Created attachment 179398 [details]
textproc/py-tabletext: Specify encoding of files in setup.py

This version of the patch only passes `encoding` to `open` when built with py3k or later.

poudriere testport: OK (py2.7, py3.4, py3.5, py3.6)
Comment 3 Dmitry Sivachenko freebsd_committer 2017-02-14 10:54:23 UTC
It doesn't look like FreeBSD-specific problem.
Did you submit your patch to the author?
Comment 4 John W. O'Brien 2017-02-14 13:06:21 UTC
(In reply to Dmitry Sivachenko from comment #3)

I opened a bug [0] but haven't yet submitted the patch.

[0] https://github.com/Thibauth/tabletext/issues/1
Comment 5 John W. O'Brien 2017-02-14 14:08:58 UTC
(In reply to Dmitry Sivachenko from comment #3)

Submitted pull request [0]

[0] https://github.com/Thibauth/tabletext/pull/2
Comment 6 commit-hook freebsd_committer 2017-02-14 17:08:04 UTC
A commit references this bug:

Author: demon
Date: Tue Feb 14 17:07:11 UTC 2017
New revision: 434129
URL: https://svnweb.freebsd.org/changeset/ports/434129

Log:
  Fix build with python3.x

  PR:		216208
  Submitted by:	John W. O'Brien <john@saltant.com>
  maintainer timeout.

Changes:
  head/textproc/py-tabletext/files/
  head/textproc/py-tabletext/files/patch-setup.py