Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix splits KeyError while downloading #273

Merged
merged 1 commit into from Oct 2, 2021

Commits on Sep 27, 2020

  1. Fix splits KeyError while downloading

    Currently downloading will fail with following error:
    
    ```
    gplaycli --verbose --progress -d com.pushbullet.android
    [INFO] GPlayCli version 3.29 [Python3.8.2]
    [INFO] Configuration file is /home/guoqiao/git/gplaycli/gplaycli.conf
    [INFO] Device is bacon
    [INFO] Using credentials to connect to API
    [INFO] Using plaintext password
    [INFO] 1 / 1 com.pushbullet.android
    /usr/local/lib/python3.8/dist-packages/gpapi/googleplay.py:634: RuntimeWarning: Unexpected end-group tag: Not all data was converted
      response = googleplay_pb2.ResponseWrapper.FromString(response.content)
    Traceback (most recent call last):
      File "/usr/local/bin/gplaycli", line 11, in <module>
        load_entry_point('gplaycli', 'console_scripts', 'gplaycli')()
      File "/home/guoqiao/git/gplaycli/gplaycli/gplaycli.py", line 659, in main
        cli.download(args.download)
      File "/home/guoqiao/git/gplaycli/gplaycli/hooks.py", line 11, in check_connection
        return function(self, *args, **kwargs)
      File "/home/guoqiao/git/gplaycli/gplaycli/gplaycli.py", line 290, in download
        splits = data_iter['splits']
    KeyError: 'splits'
    ```
    
    Use `get` to avoid dict `KeyError` while `splits` not exists in `data_iter`.
    
    Fixes: matlink#272
    
    Signed-off-by: Qiao Guo <guoqiao@gmail.com>
    Joe Guo committed Sep 27, 2020
    Configuration menu
    Copy the full SHA
    711d64f View commit details
    Browse the repository at this point in the history