Bug 216208

Summary: textproc/py-tabletext: configure target fails under py3k with UnicodeDecodeError
Product: Ports & Packages Reporter: John W. O'Brien <john>
Component: Individual Port(s)Assignee: Kris Moore <kmoore>
Status: Closed FIXED    
Severity: Affects Only Me CC: demon, python
Priority: --- Flags: bugzilla: maintainer-feedback? (kmoore)
Version: Latest   
Hardware: Any   
OS: Any   
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=256084
Attachments:
Description Flags
textproc/py-tabletext: Specify encoding of files in setup.py
none
textproc/py-tabletext: Specify encoding of files in setup.py john: maintainer-approval?

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 freebsd_triage 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 freebsd_triage 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