Bug 261388

Summary: sysutils/uefi-edk2-qemu: Fix build with Python 3.9
Product: Ports & Packages Reporter: Eric Camachat <eric>
Component: Individual Port(s)Assignee: Rebecca Cran <bcran>
Status: Closed FIXED    
Severity: Affects Some People CC: python
Priority: --- Keywords: needs-patch, needs-qa
Version: LatestFlags: bugzilla: maintainer-feedback? (bcran)
koobs: merge-quarterly?
Hardware: Any   
OS: Any   

Description Eric Camachat 2022-01-21 17:37:06 UTC

    
Comment 1 Rebecca Cran freebsd_committer freebsd_triage 2022-01-21 18:15:33 UTC
I have an update in progress for the port, but I'll make sure to test it with Python 3.9.
Comment 2 Kubilay Kocak freebsd_committer freebsd_triage 2022-01-21 23:01:12 UTC
What's the build issue?
Comment 3 Eric Camachat 2022-01-21 23:11:05 UTC
BaseTools/Source/Python/AutoGen/UniClassObject.py:
codecs.lookup('ucs-2') --> LookupError: unknown encoding: ucs-2
So, change to codecs.lookup('utf-16')

BaseTools/Source/Python/Common/Misc.py:
array.tostring() has been renamed to array.tobytes()
ref. https://docs.python.org/3/library/array.html#array.array.tobytes

Note, the document says "New in version 3.2: tostring() is renamed to tobytes() for clarity.", but seems pkg.freebsd.org can build it with Python 3.8.
Comment 4 Rebecca Cran freebsd_committer freebsd_triage 2023-03-12 22:38:40 UTC
I'm fairly sure this will have been fixed with the update to edk2-stable202202:

commit 7d47e1f2971cabf764770d0388b2c6ad671e9f94
Author: Emmanuel Vadot <manu@FreeBSD.org>
Date:   Mon May 2 18:49:56 2022 +0200

    sysutils/edk2: Update to stable202202

    Release notes: https://github.com/tianocore/edk2/releases/tag/edk2-stable202202
    Release notes: https://github.com/tianocore/edk2/releases/tag/edk2-stable202111
    Release notes: https://github.com/tianocore/edk2/releases/tag/edk2-stable202108
    Release notes: https://github.com/tianocore/edk2/releases/tag/edk2-stable202105