atcoder-tools
atcoder-tools copied to clipboard
"soft_unicode" is not supported in latest markupsafe
Problem
When atcoder-tools is newly installed, the latest version of markupsafe is used. In that case, we could not execute "atcoder-tools gen" using jinja2.
Solution
I was able to solve this problem following this step.
- Clone this repo.
- Set the version of markupsafe to 2.0.1. in your local repo like below.
[tool.poetry.dependencies]
python = "^3.6"
beautifulsoup4 = "^4.9.3"
requests = "^2.25.1"
colorama = "^0.4.4"
toml = "^0.10.2"
Jinja2 = "^2.11.3"
markupsafe = "2.0.1"
- Execute "poetry update", and confirm that the version of markupsafe in poetry.lock is 2.0.1.
- Execute "pip3 install [your local repo path]"
Ref
- https://github.com/aws/aws-sam-cli/issues/3661
Thank you for sharing your solution! I have solved the problem with the following method: downgrading markupsafe with the pip command.
$ pip list | grep MarkupSafe
MarkupSafe 2.1.0
$ pip install MarkupSafe==2.0.1
$ pip list | grep MarkupSafe
MarkupSafe 2.0.1
I also encountered this issue during setup of new environment for 2023 judge.
I found that this issue comes from that jinja2 doesn't pin markupsafe version, but it seems that jinja maintainer don't have plan to fix it because jinja 2.11.x is unsupported version. https://github.com/pallets/jinja/pull/1606
I think that the ideal way to solve this issue is to update dependency of jinja version on atcoder-tools. However, jinja dev. already moved to 3.x and major version up might cause trouble without investigation. Therefore, pinning markupsafe on atcoder-tools is realistic way to solve this issue.