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

Error: Retry.__init__() got an unexpected keyword argument 'method_whitelist' #11

Open
dverlotta opened this issue Jul 5, 2023 · 3 comments

Comments

@dverlotta
Copy link

  • git-notion version:0.2.4
  • Python version:3.11
  • Operating System:MAc

Description

run git-notion to upload docs on notion.

What I Did

export NOTION_TOKEN_V2=xxxxx
export NOTION_ROOT_PAGE=https://www.notion.so/xxxxx....
git-notion
Error
running sync Traceback (most recent call last): File "/usr/local/bin/git-notion", line 33, in <module> sys.exit(load_entry_point('git-notion', 'console_scripts', 'git-notion')()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1130, in __call__ return self.main(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1055, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1404, in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/click/core.py", line 760, in invoke return __callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/domenico.verlotta/git-notion/git_notion/cli.py", line 12, in main git_notion.sync_to_notion(path) File "/Users/domenico.verlotta/git-notion/git_notion/git_notion.py", line 63, in sync_to_notion root_page = get_client().get_block(root_page_url) ^^^^^^^^^^^^ File "/Users/domenico.verlotta/git-notion/git_notion/git_notion.py", line 21, in get_client _client = NotionClient(token_v2=TOKEN) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/notion/client.py", line 77, in __init__ self.session = create_session(client_specified_retry) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/notion/client.py", line 39, in create_session retry = Retry( ^^^^^^ TypeError: Retry.__init__() got an unexpected keyword argument 'method_whitelist'

I don't know Payton, can someone help me?

@fclairamb
Copy link

This is because of urllib3/urllib3#2092. They decided to break their API to introduce a racially neutral parameter. Supporting (possibly with a warning from the previous one) would have been nice.
To avoid it, install a previous version of urllib3:

pip3 install urllib3==1.25.0

@Panetes
Copy link

Panetes commented Nov 17, 2023

urllib3 v1.25.0 is not compatible with the current version of git-notion. However, you can fix this issue by using v1.26.15 which is the earliest compatible version of the tool. You can do that by adding this line to requirements.in

urllib3==1.26.15

@pascalwhoop
Copy link

this leads to

  File "/Users/pascalwhoop/Code/matrix/docs/.venv/lib/python3.12/site-packages/notion/client.py", line 260, in post
    raise HTTPError(
requests.exceptions.HTTPError: Something went wrong. (400)

for me now, following @Panetes and @fclairamb recommendations

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

4 participants