Skip to content

detail = re.sub(ur'(\(.{1}\))\[([^倫]{1})\]([^\b\r\n])',r'[\2]\n\1\3', detail) SyntaxError: invalid syntax #36

@net-wayfarer

Description

@net-wayfarer

系統: Linux
Python3 版本: 3.11
pip3 版本: 23.2.1
setuptools 版本: 65.5.0
xlrd3 版本: 1.1.0

Steps to reproduce:

$ git clone https://github.com/g0v/moedict-process.git ; cd moedict-process
$ mkdir dict_revised ; wget https://raw.githubusercontent.com/g0v/moedict-data/master/dict_revised/dict_revised_1.xlsx -O dict_revised/dict_revised_1.xlsx
$ python -m venv .venv
$ source .venv/bin/activate
(.venv) $ pip3 --require-virtualenv install -r requirements.txt
Collecting xlrd3==1.1.0 (from -r requirements.txt (line 1))
  Downloading xlrd3-1.1.0-py2.py3-none-any.whl (105 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 105.3/105.3 kB 486.5 kB/s eta 0:00:00
Installing collected packages: xlrd3
Successfully installed xlrd3-1.1.0
(.venv) $ make json
python parse.py
  File "/home/user/Projects/moedict-process/parse.py", line 84
    detail = re.sub(ur'(\(.{1}\))\[([^倫]{1})\]([^\b\r\n])',r'[\2]\n\1\3', detail)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: invalid syntax
make: *** [Makefile:8: dict-revised.json] Error 1
(.venv) $ pip3 list
Package    Version
---------- -------
pip        23.2.1
setuptools 65.5.0
xlrd3      1.1.0

爲了需要xlrd3版本是比較老的版本,和Python3當時改變 (英文)用virtualenv來代替這些問題。可是改了requirements.txt使用新的版本還是會出現同樣的問題。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions