[Pkg-javascript-devel] Bug#963320: libtgvoip: FTBFS: AttributeError: module 'string' has no attribute 'maketrans'

Xavier yadd at debian.org
Fri Nov 6 21:50:56 GMT 2020


Le 06/11/2020 à 22:23, Nicholas Guriev a écrit :
> On Fri, 2020-11-06 at 22:06 +0100, Xavier wrote:
>> sorry, I launched a full rebuild in unstable and didn't see this change.
>> However I don't understand this error (I'm not Python dev), code is:
>>
>>  try:
>>    # maketrans moved to str in python3.
>>    _maketrans = string.maketrans
>>  except NameError:
>>    _maketrans = str.maketrans
>>
>> So error should be discarded, isn't it?
> 
> It seems wrong exception is handled here. NameError[1] happens when
> unknown top-level variable is referenced. However, above this line,
> there is importing of string module. So NameError is not possible here.
> I daresay an original author meant AttributeError[2] here that is raised
> when code is trying to get non-existent attribute (a thing after dot).
> 
> I suggest replace NameError with AttributeError:
> 
>    try:
>      # maketrans moved to str in python3.
>      _maketrans = string.maketrans
>    except AttributeError:
>      _maketrans = str.maketrans
> 
> (not tested)

I tried but now I've a new error:

Traceback (most recent call last):
  File "/usr/bin/gyp", line 11, in <module>
    load_entry_point('gyp==0.1', 'console_scripts', 'gyp')()
  File "/usr/lib/python3/dist-packages/gyp/__init__.py", line 552, in
script_main
    return main(sys.argv[1:])
  File "/usr/lib/python3/dist-packages/gyp/__init__.py", line 545, in main
    return gyp_main(args)
  File "/usr/lib/python3/dist-packages/gyp/__init__.py", line 530, in
gyp_main
    generator.GenerateOutput(flat_list, targets, data, params)
  File "/usr/lib/python3/dist-packages/gyp/generator/cmake.py", line
1238, in GenerateOutput
    GenerateOutputForConfig(target_list, target_dicts, data,
  File "/usr/lib/python3/dist-packages/gyp/generator/cmake.py", line
1194, in GenerateOutputForConfig
    WriteTarget(namer, qualified_target, target_dicts, build_dir,
config_to_use,
  File "/usr/lib/python3/dist-packages/gyp/generator/cmake.py", line
990, in WriteTarget
    for xcode_setting, xcode_value in xcode_settings.viewitems():
AttributeError: 'dict' object has no attribute 'viewitems'



More information about the Pkg-javascript-devel mailing list