Bug 173195 - Tools/scripts/getpatch: fix runtime in a case when patch contains non-ascii chars
Summary: Tools/scripts/getpatch: fix runtime in a case when patch contains non-ascii c...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Sofian Brabez
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-29 18:30 UTC by Ruslan Makhmatkhanov
Modified: 2012-11-05 21:15 UTC (History)
0 users

See Also:


Attachments
file.diff (645 bytes, patch)
2012-10-29 18:30 UTC, Ruslan Makhmatkhanov
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ruslan Makhmatkhanov freebsd_committer freebsd_triage 2012-10-29 18:30:01 UTC
Sofian (sbz, author of this script) is already aware of it. I filing this pr to make sure it will not lost. 

Example session:
"""
# /usr/ports/Tools/scripts/getpatch ports/172280
[+] Fetching patch for pr ports/172280
Traceback (most recent call last):
  File "/usr/ports/Tools/scripts/getpatch", line 192, in <module>
    main()
  File "/usr/ports/Tools/scripts/getpatch", line 189, in main
    gp.get(only_last=args.last, output_stdout=args.stdout)
  File "/usr/ports/Tools/scripts/getpatch", line 84, in get
    self.write(p, data)
  File "/usr/ports/Tools/scripts/getpatch", line 60, in write
    f.write(data.decode())
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 99: ordinal not in range(128) 
"""

Attached patch fixing the issue.

Fix: Patch attached with submission follows:
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2012-10-29 18:30:09 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2012-10-29 18:30:09 UTC
Maintainer of Tools/scripts,

Please note that PR ports/173195 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/173195

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 3 Ruslan Makhmatkhanov freebsd_committer freebsd_triage 2012-10-29 18:42:30 UTC
Responsible Changed
From-To: freebsd-ports-bugs->sbz

Over to maintainer.
Comment 4 Sofian Brabez freebsd_committer freebsd_triage 2012-11-05 21:15:30 UTC
State Changed
From-To: feedback->closed

Committed, with minor changes. Thanks!