(Apr-02-2024, 10:24 AM)pyDream Wrote: So this part not only defines how the script would read a dictionary, but also how it will write to the console, correct?No,the error happens before all the reading and use of argparse.
Just to be clear.
The problem happens in
setup.py
where read
function is reading files like,README.rst
or __init__.py
that contain metadata or other information needed in the setup script. This can be hard to understand if you have not deal with building a package in Python.
If you want try as a excerice,here is step how it did rebuild this so it work in eg Python 3.12
# Make Virtual enviroemnt G:\div_code λ python -m venv lsdreader_env G:\div_code λ cd lsdreader_env\ G:\div_code\lsdreader_env λ G:\div_code\lsdreader_env\Scripts\activate # Install build tools G:\div_code\lsdreader_env (lsdreader_env) λ pip install setuptools wheel ..... Installing collected packages: wheel, setuptools Successfully installed setuptools-69.2.0 wheel-0.43.0 # Clone down Repo G:\div_code\lsdreader_env (lsdreader_env) λ git clone https://github.com/sv99/lsdreader.git Cloning into 'lsdreader'... remote: Enumerating objects: 153, done. remote: Counting objects: 100% (17/17), done. remote: Compressing objects: 100% (16/16), done. Receiving objects: 88% (135/153) Receiving objects: 100% (153/153), 1.05 MiB | 3.56 MiB/s, done. Resolving deltas: 100% (77/77), done. G:\div_code\lsdreader_env (lsdreader_env) λ cd lsdreader\ # Make the changes to <read> in setup.py G:\div_code\lsdreader_env\lsdreader (master -> origin) (lsdreader_env) λ ls decoder.rar LICENSE.md lingvoreader/ README.rst setup.py* test/ testdata/ # Make the wheel G:\div_code\lsdreader_env\lsdreader (master -> origin) (lsdreader_env) λ python setup.py bdist_wheel running bdist_wheel running build .... # Cd to dist folder G:\div_code\lsdreader_env\lsdreader (master -> origin) (lsdreader_env) λ cd dist G:\div_code\lsdreader_env\lsdreader\dist (master -> origin) (lsdreader_env) λ ls lingvoreader-0.2.15-py3-none-any.whl # Install wheel G:\div_code\lsdreader_env\lsdreader\dist (master -> origin) (lsdreader_env) λ pip install lingvoreader-0.2.15-py3-none-any.whl Processing g:\div_code\lsdreader_env\lsdreader\dist\lingvoreader-0.2.15-py3-none-any.whl Installing collected packages: lingvoreader Successfully installed lingvoreader-0.2.15 # Test that it work G:\div_code\lsdreader_env (lsdreader_env) λ lsdreader --help usage: lsdreader [-h] (-i INPUT | -a) [--header] [-o OUTDIR] [-c] [-v] [--version] Decode Lingvo lsd dictionary to dsl options: -h, --help show this help message and exit -i INPUT, --input INPUT Dictionary to decode -a, --all All dictionary in current directory --header Print dictionary header and exit -o OUTDIR, --outdir OUTDIR Output directory -c, --codecs print supported languages and their codes -v, --verbose --version show program's version number and exit