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

--query argument fails with: Unsupported operand type(s) for 'dict' #12

Closed
porg opened this issue Aug 15, 2023 · 2 comments
Closed

--query argument fails with: Unsupported operand type(s) for 'dict' #12

porg opened this issue Aug 15, 2023 · 2 comments

Comments

@porg
Copy link

porg commented Aug 15, 2023

After the recent changes in 310b32c for:

✅ Filepath as the only argument works normal

$ get_dropbox_link.py ~/Dropbox/Public/test-2023-08-15a.txt 
https://www.dropbox.com/s/zk0z1wbblfh0e23/test-2023-08-15a.txt?dl=0

Note: Luckily I'm getting the classic /s/ style links again.

❌ Custom arguments result in error

$ get_dropbox_link.py ~/Dropbox/Public/test-2023-08-15a.txt --query 'raw=1'
ERROR:root:unsupported operand type(s) for |: 'dict' and 'dict'

All possible permutations I tried failed with the same error:

  • Arguments before/after filepath
  • --query value in no quotes, single quotes, double quotes.

Environment

  • get_dropbox_link -- latest one: ad71584
  • macOS 11.7.8 Big Sur
  • Python Env: Worked before, nothing changed AFAIK
@nk9
Copy link
Owner

nk9 commented Aug 15, 2023

This is an issue with a newer Python feature, the union operator. In my testing, lower versions of Python 3.8 don't support this, whereas later versions of 3.8 and all versions of 3.9+ do.

I've changed to using the more broadly-supported {**a, **b} dict merging syntax.

@nk9 nk9 closed this as completed Aug 15, 2023
@porg
Copy link
Author

porg commented Aug 15, 2023

Tested and now worked with Python 3.11.4 on macOS 11.8.8 Big Sur.

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

2 participants