Bug 1744037 - Error module 'string' has no attribute 'maketrans'
Summary: Error module 'string' has no attribute 'maketrans'
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: gyp
Version: 31
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Akira TAGOH
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-08-21 07:43 UTC by Vitaly
Modified: 2019-08-23 13:18 UTC (History)
1 user (show)

Fixed In Version: gyp-0.1-0.33.fcd686f1git.fc31
Clone Of:
Environment:
Last Closed: 2019-08-23 13:18:04 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
patch (1.09 KB, patch)
2019-08-22 15:28 UTC, leigh scott
no flags Details | Diff

Description Vitaly 2019-08-21 07:43:49 UTC
Description of problem:
GYP is broken now in Fedora 31+. An error occured when trying to generate cmake project for Telegram Desktop:

module 'string' has no attribute 'maketrans'

Version-Release number of selected component (if applicable):
0.1-0.31.fcd686f1git.fc32

How reproducible:
Always.

Steps to Reproduce:
1. gyp --depth=. --generator-output=../.. -Goutput_dir=out -Dapi_id=X -Dapi_hash=Y -Dbuild_defines=TDESKTOP_DISABLE_AUTOUPDATE,TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME,TDESKTOP_DISABLE_DESKTOP_FILE_GENERATION,TDESKTOP_DISABLE_CRASH_REPORTS,TDESKTOP_LAUNCHER_FILENAME=telegram-desktop.desktop, Telegram.gyp --format=cmake
2.
3.

Actual results:
BUILDSTDERR: Traceback (most recent call last):
BUILDSTDERR:   File "/usr/bin/gyp", line 11, in <module>
BUILDSTDERR:     load_entry_point('gyp==0.1', 'console_scripts', 'gyp')()
BUILDSTDERR:   File "/usr/lib/python3.7/site-packages/gyp/__init__.py", line 551, in script_main
BUILDSTDERR:     return main(sys.argv[1:])
BUILDSTDERR:   File "/usr/lib/python3.7/site-packages/gyp/__init__.py", line 544, in main
BUILDSTDERR:     return gyp_main(args)
BUILDSTDERR:   File "/usr/lib/python3.7/site-packages/gyp/__init__.py", line 520, in gyp_main
BUILDSTDERR:     options.duplicate_basename_check)
BUILDSTDERR:   File "/usr/lib/python3.7/site-packages/gyp/__init__.py", line 97, in Load
BUILDSTDERR:     generator = __import__(generator_name, globals(), locals(), generator_name)
BUILDSTDERR:   File "/usr/lib/python3.7/site-packages/gyp/generator/cmake.py", line 43, in <module>
BUILDSTDERR:     _maketrans = string.maketrans
BUILDSTDERR: AttributeError: module 'string' has no attribute 'maketrans'
BUILDSTDERR: error: Bad exit status from /var/tmp/rpm-tmp.J4hoqc (%build)
~/build/BUILD/tdesktop-1.8.2/Telegram/gyp ~/build/BUILD/tdesktop-1.8.2

Expected results:
Successful cmake manifest generation.

Additional info:
Full build log and additional task information:

http://koji.rpmfusion.org/koji/taskinfo?taskID=350153 (F31)
http://koji.rpmfusion.org/koji/taskinfo?taskID=350152 (Rawhide)

Comment 1 Vitaly 2019-08-22 13:49:52 UTC
Proposed fix: in file pylib/gyp/generator/cmake.py change string.maketrans to str.maketrans.

Comment 2 leigh scott 2019-08-22 15:28:47 UTC
Created attachment 1607029 [details]
patch

This should fix the build issue

Comment 3 Akira TAGOH 2019-08-23 13:18:04 UTC
Fixed in gyp-0.1-0.33.fcd686f1git.fc31


Note You need to log in before you can comment on or make changes to this bug.