g0v / g0v/moedict-process

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

Open
#36 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
37
Forks
11
PR merge metrics
No merged PRs in 30d

Description

系統: 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使用新的版本還是會出現同樣的問題。

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in parse.py at line 84, where the reported SyntaxError occurs, and run the reproduction command make json in the provided Python 3.11 virtual environment. The work is done when the parser starts successfully and make json completes without this syntax error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.