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

'NoneType' object is not subscriptable #138

Closed
ford--prefect opened this issue Nov 20, 2017 · 14 comments
Closed

'NoneType' object is not subscriptable #138

ford--prefect opened this issue Nov 20, 2017 · 14 comments

Comments

@ford--prefect
Copy link

Hi,
on Archlinux 64bit, Python 3.6, gplaycli 3.10 (via setup.py), credentials, I get a fail that looks like an uncaught exception:

Traceback (most recent call last):
File "/usr/bin/gplaycli", line 11, in
load_entry_point('GPlayCli==3.10', 'console_scripts', 'gplaycli')()
File "/usr/lib/python3.6/site-packages/gplaycli/gplaycli.py", line 513, in main
cli.prepare_analyse_apks()
File "/usr/lib/python3.6/site-packages/gplaycli/gplaycli.py", line 213, in prepare_analyse_apks
self.prepare_download_updates)
File "/usr/lib/python3.6/site-packages/gplaycli/gplaycli.py", line 233, in analyse_local_apks
store_version_code = detail['versionCode']
TypeError: 'NoneType' object is not subscriptable

Another user reported something similar, seems not to be an isolated incident.
Will happily provide more info if needed.

@matlink
Copy link
Owner

matlink commented Nov 21, 2017

Can you give the command you're using and apks in the folder you're trying to update ?

@ford--prefect
Copy link
Author

ford--prefect commented Nov 21, 2017

I feared this question, since I observed this embedded in my script only so far. I can try to reproduce this in a clean manner, might take some days though…

@wetterfroschdus
Copy link

Hi, i'm getting the same kind of error downloading this app: "com.tellm.android.app"
After a couple of retries it downloads the apk.

gplaycli -d com.tellm.android.app
Traceback (most recent call last):
File "/usr/local/bin/gplaycli", line 11, in
load_entry_point('GPlayCli==3.10', 'console_scripts', 'gplaycli')()
File "/usr/local/lib/python3.6/site-packages/gplaycli/gplaycli.py", line 528, in main
cli.download_packages(args.packages_to_download)
File "/usr/local/lib/python3.6/site-packages/gplaycli/gplaycli.py", line 399, in download_packages
self.after_download)
File "/usr/local/lib/python3.6/site-packages/gplaycli/gplaycli.py", line 291, in download_selection
vc = detail['versionCode']
TypeError: 'NoneType' object is not subscriptable

@matlink
Copy link
Owner

matlink commented Nov 23, 2017

Hum, it seems to be related to python 3.6. Since I'm using 3.5, I was not able to reproduce. I'll dig deeper :)

@matlink matlink changed the title Run Issues 'NoneType' object is not subscriptable Nov 27, 2017
@matlink
Copy link
Owner

matlink commented Nov 27, 2017

Duplicate #126

@matlink matlink closed this as completed Nov 27, 2017
@ford--prefect
Copy link
Author

ford--prefect commented Nov 27, 2017

The described solution in #126 does not work for me, I am running with credentials and token=False but get the error nonetheless.
Also 3.11 does not fix this.
EDIT: Works with previous versions (3.2 at hand), so account isn't blocked either.

@matlink
Copy link
Owner

matlink commented Dec 2, 2017

You have no error when running the 3.2 version of gplaycli?

@ford--prefect
Copy link
Author

Exactly.
I now went back some Versions (jumped from 3.2 to 3.10 before) to test regressions.
Turns out that from 3.7 I see the Nonetype subscription error, 3.6 and earlier shows an AttributeError: 'GPlaycli' object has no attribute 'token' (prob. due to a gpapi version mismatch).

I also realize just now that the 3.2 package I am using as fallback is using python2.7.

Sorry for this rather inconsistent error, but this problem clearly is not fixed for me.

@matlink matlink reopened this Dec 3, 2017
@matlink
Copy link
Owner

matlink commented Dec 3, 2017

How do you fallback to version 3.2? In this case, which version of gpapi are you using?

@ford--prefect
Copy link
Author

Falling back to 3.2 means for me re-installing the package i built. That also means using the python2 version of gpapi wich is 0.1.5 (compared to 0.3.1 for python3).
This is getting more complicated every day.

@matlink
Copy link
Owner

matlink commented Dec 8, 2017

The issue is that token expires between Google login and downloading apks.
I'm currently fixing this issue by getting a new token and login again when empty response is detected.
I'll let you try when this is ready.

@matlink
Copy link
Owner

matlink commented Dec 8, 2017

I've pushed the fix to the tokenexpiration branch.
Could you try again with that branch?

@ford--prefect
Copy link
Author

will test asap, hopefully tonight. Thank you for looking into this, despite my rather messy problem description.

@matlink
Copy link
Owner

matlink commented Dec 11, 2017

It has been merge to master in version 3.12 and pushed to pypi.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants