atcoder-tools icon indicating copy to clipboard operation
atcoder-tools copied to clipboard

"soft_unicode" is not supported in latest markupsafe

Open shibukazu opened this issue 3 years ago • 2 comments

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.

  1. Clone this repo.
  2. 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"
  1. Execute "poetry update", and confirm that the version of markupsafe in poetry.lock is 2.0.1.
  2. Execute "pip3 install [your local repo path]"

Ref

  • https://github.com/aws/aws-sam-cli/issues/3661

shibukazu avatar Feb 18 '22 15:02 shibukazu

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

chum0n avatar Mar 10 '22 03:03 chum0n

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.

mo124121 avatar Sep 22 '23 23:09 mo124121