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

NameError: name 'unicode' is not defined #5

Open
GreaterCode opened this issue Jun 29, 2022 · 4 comments
Open

NameError: name 'unicode' is not defined #5

GreaterCode opened this issue Jun 29, 2022 · 4 comments

Comments

@GreaterCode
Copy link

python3 main.py --token_v2 xxxxx

https://s3.us-west-2.amazonaws.com/temporary.notion-static.com/Export-85d43a1a-a0aa-44b9-8783-9410135efd5e.zip?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIAT73L2G45EIPT3X45%2F20220629%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20220629T031308Z&X-Amz-Expires=604800&X-Amz-Signature=c55e628909e28e53fc975408470b86bf4368648c74119a60c6a3ff7abb30da84&X-Amz-SignedHeaders=host&response-content-disposition=attachment%3B%20filename%20%3D%22Export-85d43a1a-a0aa-44b9-8783-9410135efd5e.zip%22&x-id=GetObject
Traceback (most recent call last):
File "E:\workspace\note2-master\main.py", line 50, in
start()
File "E:\workspace\note2-master\main.py", line 25, in start
zips = NotionUp.backup()
File "E:\workspace\note2-master\notion_backup.py", line 95, in backup
filename = slugify(f'{spaceName}-{spaceId}') + '.zip'
File "C:\Users\admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\slugify.py", line 24, in slugify
unicode(
NameError: name 'unicode' is not defined

@GreaterCode
Copy link
Author

这个我是还缺什么东西么?

@wyih
Copy link

wyih commented Jul 25, 2022

我也是,一模一样的错误

@crazyxiaoj
Copy link

我解决了,这个问题来源于slugify.py文件。它的报错代码为:
image
我猜测,它可能是用来过滤非ascii字符的,因为我的用户名为英文,均为ascii字符,我就把它删掉了,变成这样:
image
它现在不会报错了,最后输出如下:

unzip exported zip: D:\notion-up-2021-10-19\build\xxx(你的用户名)-4b2bc172-4237-47f7-8bd3-872821e27647.zip

@Jechin
Copy link

Jechin commented Nov 30, 2022

应该参考这个 https://www.coder.work/article/342530

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