[edk2-devel] EDK2 build errors with Python 3.9

Kiselev, Sergey sergey.kiselev at intel.com
Thu Dec 10 16:15:59 UTC 2020


Hi,

The array object in Python 3.9 no longer supports fromstring() and tostring() methods. EDK2 BaseTools use these methods, and therefore the EDK2 build fails when using Python 3.9. See the trace below.

Thanks,
Sergey

build.py...
: error C0DE: Tools code failure
        Please send email to devel at edk2.groups.io for help, attaching following call stack trace!

Traceback (most recent call last):
  File "C:\edk2-upx\edk2\BaseTools\Source\Python\GenFds\GenFds.py", line 371, in GenFdsApi
    GenFds.GenFd('', FdfParserObj, BuildWorkSpace, ArchList)
  File "C:\edk2-upx\edk2\BaseTools\Source\Python\GenFds\GenFds.py", line 510, in GenFd
    FdObj.GenFd()
  File "C:\edk2-upx\edk2\BaseTools\Source\Python\GenFds\Fd.py", line 131, in GenFd
    RegionObj.AddToBuffer (FdBuffer, self.BaseAddress, self.BlockSizeList, self.ErasePolarity, GenFdsGlobalVariable.ImageBinDict, self.DefineVarDict, Flag=Flag)
  File "C:\edk2-upx\edk2\BaseTools\Source\Python\GenFds\Region.py", line 134, in AddToBuffer
    FvObj.AddToBuffer(FvBuffer, FvBaseAddress, BlockSize, BlockNum, ErasePolarity, Flag=Flag)
  File "C:\edk2-upx\edk2\BaseTools\Source\Python\GenFds\Fv.py", line 127, in AddToBuffer
    FileName = FfsFile.GenFfs(MacroDict, FvParentAddr=BaseAddress, IsMakefile=Flag, FvName=self.UiFvName)
  File "C:\edk2-upx\edk2\BaseTools\Source\Python\GenFds\FfsFileStatement.py", line 153, in GenFfs
    sectList, align = section.GenSection(OutputDir, self.NameGuid, SecIndex, self.KeyStringList, None, Dict)
  File "C:\edk2-upx\edk2\BaseTools\Source\Python\GenFds\GuidSection.py", line 95, in GenSection
    ReturnSectList, align = Sect.GenSection(OutputPath, ModuleName, SecIndex, KeyStringList, FfsInf, Dict, IsMakefile=IsMakefile)
  File "C:\edk2-upx\edk2\BaseTools\Source\Python\GenFds\FvImageSection.py", line 108, in GenSection
    FvFileName = Fv.AddToBuffer(Buffer, self.FvAddr, MacroDict = Dict, Flag=IsMakefile)
  File "C:\edk2-upx\edk2\BaseTools\Source\Python\GenFds\Fv.py", line 127, in AddToBuffer
    FileName = FfsFile.GenFfs(MacroDict, FvParentAddr=BaseAddress, IsMakefile=Flag, FvName=self.UiFvName)
  File "C:\edk2-upx\edk2\BaseTools\Source\Python\GenFds\FfsFileStatement.py", line 153, in GenFfs
    sectList, align = section.GenSection(OutputDir, self.NameGuid, SecIndex, self.KeyStringList, None, Dict)
  File "C:\edk2-upx\edk2\BaseTools\Source\Python\GenFds\UiSection.py", line 70, in GenSection
    GenFdsGlobalVariable.GenerateSection(OutputFile, None, 'EFI_SECTION_USER_INTERFACE', Ui=NameString, IsMakefile=IsMakefile)
  File "C:\edk2-upx\edk2\BaseTools\Source\Python\GenFds\GenFdsGlobalVariable.py", line 466, in GenerateSection
    SectionData.fromstring(Ui.encode("utf_16_le"))
AttributeError: 'array.array' object has no attribute 'fromstring'



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#68668): https://edk2.groups.io/g/devel/message/68668
Mute This Topic: https://groups.io/mt/78859177/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/edk2-devel-archive/attachments/20201210/3eaf5f5d/attachment.htm>


More information about the edk2-devel-archive mailing list