homebysix / recipe-robot

A kick ass tool for creating AutoPkg recipes.
Apache License 2.0
300 stars 28 forks source link

UnicodeDecodeError when looking up description for Hummingbird app #152

Closed homebysix closed 10 months ago

homebysix commented 4 years ago
% python scripts/recipe-robot --verbose ~/Downloads/Hummingbird-3.0.1-2.zip     

                      -----------------------------------
                     |  Welcome to Recipe Robot v1.1.3.  |
                      -----------------------------------
                                \   _[]_
                                 \  [oo]
                                   d-||-b
                                     ||
                                   _/  \_

Processing: ~/Downloads/Hummingbird-3.0.1-2.zip
Input path looks like an archive.
    Download URL found in file metadata: https://static1.squarespace.com/static/54c75522e4b025e1ccf5b88f/t/5db82d043177df4ee3d9957d/1572351352489/Hummingbird-3.0.1-2.zip
    Successfully unarchived zip
Validating app...
    This app seems valid
Getting bundle name...
    Bundle name is: Hummingbird
Getting bundle identifier...
    Bundle identifier is: co.finestructure.Hummingbird
Checking for a Sparkle feed...
    No Sparkle feed
Determining whether app was downloaded from the Mac App Store...
    App did not come from the App Store
Looking for version key...
    Version key is: CFBundleShortVersionString (3.0.1)
Looking for icon...
    Icon is: ~/Library/Caches/Recipe Robot/2019-12-06_11-14-53_023291/unpacked/Hummingbird.app/Contents/Resources/AppIcon
Getting description...
[ERROR] Recipe Robot exploded with unexpected error: 
Traceback (most recent call last):
  File "scripts/recipe-robot", line 86, in main
    process_input_path(facts)
  File "~/Developer/_personal/recipe-robot/scripts/recipe_robot_lib/inspect.py", line 154, in process_input_path
    facts = inspect_func(input_path, args, facts)
  File "~/Developer/_personal/recipe-robot/scripts/recipe_robot_lib/inspect.py", line 643, in inspect_archive
    os.path.join(unpacked_dir, this_file), args, facts
  File "~/Developer/_personal/recipe-robot/scripts/recipe_robot_lib/inspect.py", line 423, in inspect_app
    "Description (from {}): {}".format(source, description),
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2019' in position 159: ordinal not in range(128)

[ERROR] 
                                    _[]_
                                    [xx]
                                   q-||-p
                                     ||
                                   _/  \_
qu1gl3s commented 4 years ago

Hi,

Having the same issue in my environment as well, the error messages seem to match your above example.

recipe-robot --ignore-existing --verbose --debug "https://fjinstallers.s3.amazonaws.com/FlowJo/FlowJo-OSX64-10.6.2.dmg"
Processing: https://fjinstallers.s3.amazonaws.com/FlowJo/FlowJo-OSX64-10.6.2.dmg
Input path looks like a download URL.
    Download URL is: https://fjinstallers.s3.amazonaws.com/FlowJo/FlowJo-OSX64-10.6.2.dmg
[WARNING] Careful, this might be a version-specific URL. Better to give me a "latest" URL or a Sparkle feed.
Downloading file for further inspection...
    Downloaded to /Users/****/Library/Caches/Recipe Robot/2020-02-26_10-03-14_704984/FlowJo-OSX64-10.6.2.dmg
Determining download format...
    File extension is dmg
[DEBUG] Download format is unknown, so we're going to try mounting it as a disk image first, then unarchiving it. This may produce errors, but will hopefully result in a success.
Opening downloaded file...
    Successfully mounted disk image
Validating app...
    This app seems valid
Getting bundle name...
    Bundle name is: FlowJo
Getting bundle identifier...
    Bundle identifier is: com.flowjollc.flowjo
Checking for a Sparkle feed...
    No Sparkle feed
Looking for version key...
    Version key is: CFBundleShortVersionString (10.6.2)
Looking for icon...
    Icon is: /Users/****/Library/Caches/Recipe Robot/2020-02-26_10-03-14_704984/unpacked/FlowJo.app/Contents/Resources/fj-icon-mac-new.icns
Getting description...
[ERROR] Recipe Robot exploded with unexpected error: 
Traceback (most recent call last):
  File "/usr/local/bin/recipe-robot", line 86, in main
    process_input_path(facts)
  File "/usr/local/bin/recipe_robot_lib/inspect.py", line 154, in process_input_path
    facts = inspect_func(input_path, args, facts)
  File "/usr/local/bin/recipe_robot_lib/inspect.py", line 1308, in inspect_download_url
    facts = inspect_disk_image(os.path.join(CACHE_DIR, filename), args, facts)
  File "/usr/local/bin/recipe_robot_lib/inspect.py", line 1009, in inspect_disk_image
    facts = inspect_app(cached_app_path, args, facts)
  File "/usr/local/bin/recipe_robot_lib/inspect.py", line 423, in inspect_app
    "Description (from {}): {}".format(source, description),
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2019' in position 142: ordinal not in range(128)
homebysix commented 3 years ago

Hi @qu1gl3s - Could you try again with RC3? https://github.com/homebysix/recipe-robot/releases/tag/v2.0.0-rc3

homebysix commented 10 months ago

Should be resolved in 7ab0dd2, which is due to be released with Recipe Robot 2.3.0.