liuyug / mdict-utils Goto Github PK
View Code? Open in Web Editor NEWMDict pack/unpack/list/info tool
License: MIT License
MDict pack/unpack/list/info tool
License: MIT License
阁下的
https://github.com/liuyug/mdict-utils/blob/master/mdict_utils/base/readmdict.py
和
https://github.com/mmjang/mdict-query
里的readmdict.py不一样,请问这种改动是不是做了些优化呢还是……?希望给点介绍,正在纠结要用那个项目
in the file __main__.py
, line 82: print(record)
is used to print results to stdout.
But when there are some Chinese characters in the returned results, to use print
directly will return error message as:
UnicodeEncodeError: 'gbk' codec can't encode character '\u2027' in position 208: illegal multibyte sequence
After searching, I added three lines in the __main__.py
, then no more error message.
import sys
import io
sys.stdout = io.TextIOWrapper(sys.stdout.buffer,encoding='utf8')
Hope this is helpful to anyone has the same error.
if in CMD window, the Chinese characters are still messed up codes. Try to run
chcp 65001
, that is to change CodePage
and then the Chinese characters can be well presented.
I have tried the followings:
mdict -q '-ment' oald9.mdx
usage: mdict [-h] [--version] [-k] [-m] [-q <key>] [--txt-db] [--db-txt] [-x] [-d <exdir>] [--exdb] [--exdb-zip] [--split-n <number>]
[--split-az] [-a <resource>] [--title <title>] [--description <description>] [--encoding <encoding>] [--key-size <size>]
[--record-size <size>] [--key-file <key file>] [--convert-chtml]
<mdx/mdd>
mdict: error: argument -q: expected one argument
I get the same error when using double dashes to declare the end of options:
mdict -q -- '-ment' ${f}oald9.mdx
When there is an entry with more than one meaning BUT same spelling, what is the easiest way to return all of them. As I couldn't find any.
query('test.mdx', entry,) --> it will return only one of them.
当输入输出的文件名带有空格时,不能运行。
请求使用方法,或升级支援。
All key list:
mdict -k dict.mdx
mdict -x dict.mdx --exdb
输出
--- Elapsed time: 0.007725 seconds ---
Traceback (most recent call last):
File "/usr/local/bin/mdict", line 8, in
sys.exit(run())
File "/usr/local/lib/python3.10/site-packages/mdict_utils/main.py", line 94, in run
reader.unpack_to_db(args.exdir, args.mdict, zip=args.exdb_zip)
File "/usr/local/lib/python3.10/site-packages/mdict_utils/reader.py", line 299, in unpack_to_db
mdx = MDX(source, encoding, substyle, passcode)
File "/usr/local/lib/python3.10/site-packages/mdict_utils/base/readmdict.py", line 622, in init
MDict.init(self, fname, encoding, passcode)
File "/usr/local/lib/python3.10/site-packages/mdict_utils/base/readmdict.py", line 114, in init
self._key_list = self._read_keys()
File "/usr/local/lib/python3.10/site-packages/mdict_utils/base/readmdict.py", line 364, in _read_keys
return self._read_keys_v1v2()
File "/usr/local/lib/python3.10/site-packages/mdict_utils/base/readmdict.py", line 453, in _read_keys_v1v2
key_list = self._decode_key_block(key_block_compressed, key_block_info_list)
File "/usr/local/lib/python3.10/site-packages/mdict_utils/base/readmdict.py", line 258, in _decode_key_block
key_block = self._decode_block(key_block_compressed[i:i+compressed_size], decompressed_size)
File "/usr/local/lib/python3.10/site-packages/mdict_utils/base/readmdict.py", line 189, in _decode_block
assert(hex(adler32) == hex(zlib.adler32(decompressed_block) & 0xffffffff))
AssertionError
你的工具还蛮好用,感谢一下。
我碰到的问题,用 writemdict 和 mdict_utils 生成的 mdx 在 iOS 欧陆下面,能用,但查词非常缓慢。
当我将python从3.10升级到3.11后,重新安装mdict-utils,出现如下错误,即使我已安装了“vc_redist.x64.exe”以满足错误提示的要求“Microsoft Visual C++ 14.0 or greater”,依然是如下错误。
未升级python之前都是可以正常安装mdict-utils。
完整的安装及提示信息如下:
PS C:\Downloads> pip install mdict-utils
Collecting mdict-utils
Using cached mdict_utils-1.3.12-py3-none-any.whl (36 kB)
Collecting tqdm
Using cached tqdm-4.64.1-py2.py3-none-any.whl (78 kB)
Collecting xxhash
Using cached xxhash-3.1.0.tar.gz (74 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: colorama in c:\users\chenw\appdata\local\programs\python\python311\lib\site-packages (from tqdm->mdict-utils) (0.4.6)
Building wheels for collected packages: xxhash
Building wheel for xxhash (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for xxhash (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [685 lines of output]
--- Logging error ---
Traceback (most recent call last):
File "C:\Users\chenw\AppData\Local\Programs\Python\Python311\Lib\logging\__init__.py", line 1113, in emit
stream.write(msg + self.terminator)
ValueError: underlying buffer has been detached
Call stack:
File "C:\Users\chenw\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 351, in <module>
main()
File "C:\Users\chenw\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 333, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "C:\Users\chenw\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 249, in build_wheel
return _build_backend().build_wheel(wheel_directory, config_settings,
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\build_meta.py", line 412, in build_wheel
return self._build_with_temp_dir(['bdist_wheel'], '.whl',
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\build_meta.py", line 397, in _build_with_temp_dir
self.run_setup()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\build_meta.py", line 484, in run_setup
self).run_setup(setup_script=setup_script)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\build_meta.py", line 335, in run_setup
exec(code, locals())
File "<string>", line 33, in <module>
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\__init__.py", line 87, in setup
return distutils.core.setup(**attrs)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
return run_commands(dist)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
dist.run_commands()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
self.run_command(cmd)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\dist.py", line 1217, in run_command
super().run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 985, in run_command
log.info("running %s", command)
Message: 'running %s'
Arguments: ('bdist_wheel',)
--- Logging error ---
Traceback (most recent call last):
File "C:\Users\chenw\AppData\Local\Programs\Python\Python311\Lib\logging\__init__.py", line 1113, in emit
stream.write(msg + self.terminator)
ValueError: underlying buffer has been detached
Call stack:
File "C:\Users\chenw\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 351, in <module>
main()
File "C:\Users\chenw\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 333, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "C:\Users\chenw\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 249, in build_wheel
return _build_backend().build_wheel(wheel_directory, config_settings,
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\build_meta.py", line 412, in build_wheel
return self._build_with_temp_dir(['bdist_wheel'], '.whl',
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\build_meta.py", line 397, in _build_with_temp_dir
self.run_setup()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\build_meta.py", line 484, in run_setup
self).run_setup(setup_script=setup_script)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\build_meta.py", line 335, in run_setup
exec(code, locals())
File "<string>", line 33, in <module>
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\__init__.py", line 87, in setup
return distutils.core.setup(**attrs)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
return run_commands(dist)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
dist.run_commands()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
self.run_command(cmd)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\dist.py", line 1217, in run_command
super().run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\wheel\bdist_wheel.py", line 325, in run
self.run_command("build")
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\dist.py", line 1217, in run_command
super().run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 985, in run_command
log.info("running %s", command)
Message: 'running %s'
Arguments: ('build',)
--- Logging error ---
Traceback (most recent call last):
File "C:\Users\chenw\AppData\Local\Programs\Python\Python311\Lib\logging\__init__.py", line 1113, in emit
stream.write(msg + self.terminator)
ValueError: underlying buffer has been detached
Call stack:
File "C:\Users\chenw\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 351, in <module>
main()
File "C:\Users\chenw\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 333, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "C:\Users\chenw\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 249, in build_wheel
return _build_backend().build_wheel(wheel_directory, config_settings,
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\build_meta.py", line 412, in build_wheel
return self._build_with_temp_dir(['bdist_wheel'], '.whl',
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\build_meta.py", line 397, in _build_with_temp_dir
self.run_setup()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\build_meta.py", line 484, in run_setup
self).run_setup(setup_script=setup_script)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\build_meta.py", line 335, in run_setup
exec(code, locals())
File "<string>", line 33, in <module>
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\__init__.py", line 87, in setup
return distutils.core.setup(**attrs)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
return run_commands(dist)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
dist.run_commands()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
self.run_command(cmd)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\dist.py", line 1217, in run_command
super().run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\wheel\bdist_wheel.py", line 325, in run
self.run_command("build")
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\dist.py", line 1217, in run_command
super().run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\command\build.py", line 132, in run
self.run_command(cmd_name)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\dist.py", line 1217, in run_command
super().run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 985, in run_command
log.info("running %s", command)
Message: 'running %s'
Arguments: ('build_py',)
--- Logging error ---
Traceback (most recent call last):
File "C:\Users\chenw\AppData\Local\Programs\Python\Python311\Lib\logging\__init__.py", line 1113, in emit
stream.write(msg + self.terminator)
ValueError: underlying buffer has been detached
Call stack:
File "C:\Users\chenw\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 351, in <module>
main()
File "C:\Users\chenw\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 333, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "C:\Users\chenw\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 249, in build_wheel
return _build_backend().build_wheel(wheel_directory, config_settings,
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\build_meta.py", line 412, in build_wheel
return self._build_with_temp_dir(['bdist_wheel'], '.whl',
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\build_meta.py", line 397, in _build_with_temp_dir
self.run_setup()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\build_meta.py", line 484, in run_setup
self).run_setup(setup_script=setup_script)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\build_meta.py", line 335, in run_setup
exec(code, locals())
File "<string>", line 33, in <module>
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\__init__.py", line 87, in setup
return distutils.core.setup(**attrs)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
return run_commands(dist)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
dist.run_commands()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
self.run_command(cmd)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\dist.py", line 1217, in run_command
super().run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\wheel\bdist_wheel.py", line 325, in run
self.run_command("build")
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\dist.py", line 1217, in run_command
super().run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\command\build.py", line 132, in run
self.run_command(cmd_name)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\dist.py", line 1217, in run_command
super().run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\command\build_py.py", line 62, in run
self.build_packages()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\command\build_py.py", line 380, in build_packages
self.build_module(module, module_file, package)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\command\build_py.py", line 77, in build_module
outfile, copied = orig.build_py.build_module(self, module, module_file, package)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\command\build_py.py", line 350, in build_module
self.mkpath(dir)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 342, in mkpath
dir_util.mkpath(name, mode, dry_run=self.dry_run)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\dir_util.py", line 71, in mkpath
log.info("creating %s", head)
Message: 'creating %s'
Arguments: ('build',)
--- Logging error ---
Traceback (most recent call last):
File "C:\Users\chenw\AppData\Local\Programs\Python\Python311\Lib\logging\__init__.py", line 1113, in emit
stream.write(msg + self.terminator)
ValueError: underlying buffer has been detached
Call stack:
File "C:\Users\chenw\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 351, in <module>
main()
File "C:\Users\chenw\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 333, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "C:\Users\chenw\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 249, in build_wheel
return _build_backend().build_wheel(wheel_directory, config_settings,
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\build_meta.py", line 412, in build_wheel
return self._build_with_temp_dir(['bdist_wheel'], '.whl',
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\build_meta.py", line 397, in _build_with_temp_dir
self.run_setup()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\build_meta.py", line 484, in run_setup
self).run_setup(setup_script=setup_script)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\build_meta.py", line 335, in run_setup
exec(code, locals())
File "<string>", line 33, in <module>
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\__init__.py", line 87, in setup
return distutils.core.setup(**attrs)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
return run_commands(dist)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
dist.run_commands()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
self.run_command(cmd)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\dist.py", line 1217, in run_command
super().run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\wheel\bdist_wheel.py", line 325, in run
self.run_command("build")
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\dist.py", line 1217, in run_command
super().run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\command\build.py", line 132, in run
self.run_command(cmd_name)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\dist.py", line 1217, in run_command
super().run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\command\build_py.py", line 62, in run
self.build_packages()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\command\build_py.py", line 380, in build_packages
self.build_module(module, module_file, package)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\command\build_py.py", line 77, in build_module
outfile, copied = orig.build_py.build_module(self, module, module_file, package)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\command\build_py.py", line 350, in build_module
self.mkpath(dir)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 342, in mkpath
dir_util.mkpath(name, mode, dry_run=self.dry_run)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\dir_util.py", line 71, in mkpath
log.info("creating %s", head)
Message: 'creating %s'
Arguments: ('build\\lib.win-amd64-cpython-311',)
--- Logging error ---
Traceback (most recent call last):
File "C:\Users\chenw\AppData\Local\Programs\Python\Python311\Lib\logging\__init__.py", line 1113, in emit
stream.write(msg + self.terminator)
ValueError: underlying buffer has been detached
Call stack:
File "C:\Users\chenw\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 351, in <module>
main()
File "C:\Users\chenw\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 333, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "C:\Users\chenw\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 249, in build_wheel
return _build_backend().build_wheel(wheel_directory, config_settings,
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\build_meta.py", line 412, in build_wheel
return self._build_with_temp_dir(['bdist_wheel'], '.whl',
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\build_meta.py", line 397, in _build_with_temp_dir
self.run_setup()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\build_meta.py", line 484, in run_setup
self).run_setup(setup_script=setup_script)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\build_meta.py", line 335, in run_setup
exec(code, locals())
File "<string>", line 33, in <module>
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\__init__.py", line 87, in setup
return distutils.core.setup(**attrs)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
return run_commands(dist)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
dist.run_commands()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
self.run_command(cmd)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\dist.py", line 1217, in run_command
super().run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\wheel\bdist_wheel.py", line 325, in run
self.run_command("build")
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\dist.py", line 1217, in run_command
super().run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\command\build.py", line 132, in run
self.run_command(cmd_name)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\dist.py", line 1217, in run_command
super().run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\command\build_py.py", line 62, in run
self.build_packages()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\command\build_py.py", line 380, in build_packages
self.build_module(module, module_file, package)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\command\build_py.py", line 77, in build_module
outfile, copied = orig.build_py.build_module(self, module, module_file, package)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\command\build_py.py", line 350, in build_module
self.mkpath(dir)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 342, in mkpath
dir_util.mkpath(name, mode, dry_run=self.dry_run)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\dir_util.py", line 71, in mkpath
log.info("creating %s", head)
Message: 'creating %s'
Arguments: ('build\\lib.win-amd64-cpython-311\\xxhash',)
--- Logging error ---
Traceback (most recent call last):
File "C:\Users\chenw\AppData\Local\Programs\Python\Python311\Lib\logging\__init__.py", line 1113, in emit
stream.write(msg + self.terminator)
ValueError: underlying buffer has been detached
Call stack:
File "C:\Users\chenw\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 351, in <module>
main()
File "C:\Users\chenw\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 333, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "C:\Users\chenw\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 249, in build_wheel
return _build_backend().build_wheel(wheel_directory, config_settings,
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\build_meta.py", line 412, in build_wheel
return self._build_with_temp_dir(['bdist_wheel'], '.whl',
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\build_meta.py", line 397, in _build_with_temp_dir
self.run_setup()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\build_meta.py", line 484, in run_setup
self).run_setup(setup_script=setup_script)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\build_meta.py", line 335, in run_setup
exec(code, locals())
File "<string>", line 33, in <module>
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\__init__.py", line 87, in setup
return distutils.core.setup(**attrs)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
return run_commands(dist)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
dist.run_commands()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
self.run_command(cmd)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\dist.py", line 1217, in run_command
super().run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\wheel\bdist_wheel.py", line 325, in run
self.run_command("build")
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\dist.py", line 1217, in run_command
super().run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\command\build.py", line 132, in run
self.run_command(cmd_name)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\dist.py", line 1217, in run_command
super().run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\command\build_py.py", line 62, in run
self.build_packages()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\command\build_py.py", line 380, in build_packages
self.build_module(module, module_file, package)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\command\build_py.py", line 77, in build_module
outfile, copied = orig.build_py.build_module(self, module, module_file, package)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\command\build_py.py", line 351, in build_module
return self.copy_file(module_file, outfile, preserve_mode=0)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\command\build_py.py", line 50, in copy_file
return super().copy_file(infile, outfile, preserve_mode, preserve_times,
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 350, in copy_file
return file_util.copy_file(
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\file_util.py", line 137, in copy_file
log.info("%s %s -> %s", action, src, dir)
Message: '%s %s -> %s'
Arguments: ('copying', 'xxhash\\version.py', 'build\\lib.win-amd64-cpython-311\\xxhash')
--- Logging error ---
Traceback (most recent call last):
File "C:\Users\chenw\AppData\Local\Programs\Python\Python311\Lib\logging\__init__.py", line 1113, in emit
stream.write(msg + self.terminator)
ValueError: underlying buffer has been detached
Call stack:
File "C:\Users\chenw\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 351, in <module>
main()
File "C:\Users\chenw\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 333, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "C:\Users\chenw\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 249, in build_wheel
return _build_backend().build_wheel(wheel_directory, config_settings,
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\build_meta.py", line 412, in build_wheel
return self._build_with_temp_dir(['bdist_wheel'], '.whl',
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\build_meta.py", line 397, in _build_with_temp_dir
self.run_setup()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\build_meta.py", line 484, in run_setup
self).run_setup(setup_script=setup_script)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\build_meta.py", line 335, in run_setup
exec(code, locals())
File "<string>", line 33, in <module>
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\__init__.py", line 87, in setup
return distutils.core.setup(**attrs)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
return run_commands(dist)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
dist.run_commands()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
self.run_command(cmd)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\dist.py", line 1217, in run_command
super().run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\wheel\bdist_wheel.py", line 325, in run
self.run_command("build")
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\dist.py", line 1217, in run_command
super().run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\command\build.py", line 132, in run
self.run_command(cmd_name)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\dist.py", line 1217, in run_command
super().run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\command\build_py.py", line 62, in run
self.build_packages()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\command\build_py.py", line 380, in build_packages
self.build_module(module, module_file, package)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\command\build_py.py", line 77, in build_module
outfile, copied = orig.build_py.build_module(self, module, module_file, package)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\command\build_py.py", line 351, in build_module
return self.copy_file(module_file, outfile, preserve_mode=0)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\command\build_py.py", line 50, in copy_file
return super().copy_file(infile, outfile, preserve_mode, preserve_times,
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 350, in copy_file
return file_util.copy_file(
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\file_util.py", line 137, in copy_file
log.info("%s %s -> %s", action, src, dir)
Message: '%s %s -> %s'
Arguments: ('copying', 'xxhash\\__init__.py', 'build\\lib.win-amd64-cpython-311\\xxhash')
--- Logging error ---
Traceback (most recent call last):
File "C:\Users\chenw\AppData\Local\Programs\Python\Python311\Lib\logging\__init__.py", line 1113, in emit
stream.write(msg + self.terminator)
ValueError: underlying buffer has been detached
Call stack:
File "C:\Users\chenw\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 351, in <module>
main()
File "C:\Users\chenw\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 333, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "C:\Users\chenw\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 249, in build_wheel
return _build_backend().build_wheel(wheel_directory, config_settings,
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\build_meta.py", line 412, in build_wheel
return self._build_with_temp_dir(['bdist_wheel'], '.whl',
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\build_meta.py", line 397, in _build_with_temp_dir
self.run_setup()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\build_meta.py", line 484, in run_setup
self).run_setup(setup_script=setup_script)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\build_meta.py", line 335, in run_setup
exec(code, locals())
File "<string>", line 33, in <module>
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\__init__.py", line 87, in setup
return distutils.core.setup(**attrs)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
return run_commands(dist)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
dist.run_commands()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
self.run_command(cmd)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\dist.py", line 1217, in run_command
super().run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\wheel\bdist_wheel.py", line 325, in run
self.run_command("build")
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\dist.py", line 1217, in run_command
super().run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\command\build.py", line 132, in run
self.run_command(cmd_name)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\dist.py", line 1217, in run_command
super().run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\command\build_py.py", line 63, in run
self.build_package_data()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\command\build_py.py", line 161, in build_package_data
_outf, _copied = self.copy_file(srcfile, target)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\command\build_py.py", line 50, in copy_file
return super().copy_file(infile, outfile, preserve_mode, preserve_times,
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 350, in copy_file
return file_util.copy_file(
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\file_util.py", line 137, in copy_file
log.info("%s %s -> %s", action, src, dir)
Message: '%s %s -> %s'
Arguments: ('copying', 'xxhash\\py.typed', 'build\\lib.win-amd64-cpython-311\\xxhash')
--- Logging error ---
Traceback (most recent call last):
File "C:\Users\chenw\AppData\Local\Programs\Python\Python311\Lib\logging\__init__.py", line 1113, in emit
stream.write(msg + self.terminator)
ValueError: underlying buffer has been detached
Call stack:
File "C:\Users\chenw\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 351, in <module>
main()
File "C:\Users\chenw\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 333, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "C:\Users\chenw\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 249, in build_wheel
return _build_backend().build_wheel(wheel_directory, config_settings,
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\build_meta.py", line 412, in build_wheel
return self._build_with_temp_dir(['bdist_wheel'], '.whl',
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\build_meta.py", line 397, in _build_with_temp_dir
self.run_setup()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\build_meta.py", line 484, in run_setup
self).run_setup(setup_script=setup_script)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\build_meta.py", line 335, in run_setup
exec(code, locals())
File "<string>", line 33, in <module>
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\__init__.py", line 87, in setup
return distutils.core.setup(**attrs)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
return run_commands(dist)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
dist.run_commands()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
self.run_command(cmd)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\dist.py", line 1217, in run_command
super().run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\wheel\bdist_wheel.py", line 325, in run
self.run_command("build")
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\dist.py", line 1217, in run_command
super().run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\command\build.py", line 132, in run
self.run_command(cmd_name)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\dist.py", line 1217, in run_command
super().run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\command\build_py.py", line 63, in run
self.build_package_data()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\command\build_py.py", line 161, in build_package_data
_outf, _copied = self.copy_file(srcfile, target)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\command\build_py.py", line 50, in copy_file
return super().copy_file(infile, outfile, preserve_mode, preserve_times,
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 350, in copy_file
return file_util.copy_file(
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\file_util.py", line 137, in copy_file
log.info("%s %s -> %s", action, src, dir)
Message: '%s %s -> %s'
Arguments: ('copying', 'xxhash\\__init__.pyi', 'build\\lib.win-amd64-cpython-311\\xxhash')
--- Logging error ---
Traceback (most recent call last):
File "C:\Users\chenw\AppData\Local\Programs\Python\Python311\Lib\logging\__init__.py", line 1113, in emit
stream.write(msg + self.terminator)
ValueError: underlying buffer has been detached
Call stack:
File "C:\Users\chenw\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 351, in <module>
main()
File "C:\Users\chenw\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 333, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "C:\Users\chenw\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 249, in build_wheel
return _build_backend().build_wheel(wheel_directory, config_settings,
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\build_meta.py", line 412, in build_wheel
return self._build_with_temp_dir(['bdist_wheel'], '.whl',
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\build_meta.py", line 397, in _build_with_temp_dir
self.run_setup()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\build_meta.py", line 484, in run_setup
self).run_setup(setup_script=setup_script)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\build_meta.py", line 335, in run_setup
exec(code, locals())
File "<string>", line 33, in <module>
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\__init__.py", line 87, in setup
return distutils.core.setup(**attrs)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
return run_commands(dist)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
dist.run_commands()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
self.run_command(cmd)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\dist.py", line 1217, in run_command
super().run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\wheel\bdist_wheel.py", line 325, in run
self.run_command("build")
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\dist.py", line 1217, in run_command
super().run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\command\build.py", line 132, in run
self.run_command(cmd_name)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\dist.py", line 1217, in run_command
super().run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 985, in run_command
log.info("running %s", command)
Message: 'running %s'
Arguments: ('build_ext',)
--- Logging error ---
Traceback (most recent call last):
File "C:\Users\chenw\AppData\Local\Programs\Python\Python311\Lib\logging\__init__.py", line 1113, in emit
stream.write(msg + self.terminator)
ValueError: underlying buffer has been detached
Call stack:
File "C:\Users\chenw\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 351, in <module>
main()
File "C:\Users\chenw\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 333, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "C:\Users\chenw\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 249, in build_wheel
return _build_backend().build_wheel(wheel_directory, config_settings,
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\build_meta.py", line 412, in build_wheel
return self._build_with_temp_dir(['bdist_wheel'], '.whl',
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\build_meta.py", line 397, in _build_with_temp_dir
self.run_setup()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\build_meta.py", line 484, in run_setup
self).run_setup(setup_script=setup_script)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\build_meta.py", line 335, in run_setup
exec(code, locals())
File "<string>", line 33, in <module>
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\__init__.py", line 87, in setup
return distutils.core.setup(**attrs)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
return run_commands(dist)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
dist.run_commands()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
self.run_command(cmd)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\dist.py", line 1217, in run_command
super().run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\wheel\bdist_wheel.py", line 325, in run
self.run_command("build")
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\dist.py", line 1217, in run_command
super().run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\command\build.py", line 132, in run
self.run_command(cmd_name)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\dist.py", line 1217, in run_command
super().run_command(command)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\command\build_ext.py", line 84, in run
_build_ext.run(self)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\command\build_ext.py", line 346, in run
self.build_extensions()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\command\build_ext.py", line 468, in build_extensions
self._build_extensions_serial()
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\command\build_ext.py", line 494, in _build_extensions_serial
self.build_extension(ext)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\command\build_ext.py", line 246, in build_extension
_build_ext.build_extension(self, ext)
File "C:\Users\chenw\AppData\Local\Temp\pip-build-env-pqcup1a8\overlay\Lib\site-packages\setuptools\_distutils\command\build_ext.py", line 522, in build_extension
log.info("building '%s' extension", ext.name)
Message: "building '%s' extension"
Arguments: ('_xxhash',)
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for xxhash
Failed to build xxhash
ERROR: Could not build wheels for xxhash, which is required to install pyproject.toml-based projects
PS C:\Downloads>
thank you for this very nice converter. very practical!
i have bit of a special dictionary (pali to english), and i noticed that when writing from .db -> .mdx the values of two entrys that have the same name (eg. a dictionary with multiple wordentrys/links to one word), both entrys will have the same paraphrase.
this only happens when converting .db -> .mdx, .txt -> .mdx works as expected.
to repoduce:
insert into mdx (entry, paraphrase) values ('ta','first value'),('ta','second value')
mdict -a sample.db sample.mdx
result:
ta will display 'first value' twice when opening with the mdict app
my proposed solution is to use internal rowid of sqlite instead of the entry to query for the paraphrase in the get_record_null() function in writer.py
in my testcase it worked very with only 6 minor code changes.
diff --git a/writer.py b/writer.py
index 6f5060f..b186ce0 100644
--- a/writer.py
+++ b/writer.py
@@ -34,8 +34,8 @@ def get_record_null(mdict_file, key, pos, size, encoding, is_mdd):
obj = MDICT_OBJ.get(mdict_file)
if is_mdd:
if mdict_file.endswith('.db'):
- sql = 'SELECT file FROM mdd WHERE entry=?'
- c = obj.execute(sql, (key,))
+ sql = 'SELECT file FROM mdd WHERE rowid=?'
+ c = obj.execute(sql, (pos,))
row = c.fetchone()
record_null = row[0]
return record_null
@@ -45,8 +45,8 @@ def get_record_null(mdict_file, key, pos, size, encoding, is_mdd):
return f.read()
else:
if mdict_file.endswith('.db'):
- sql = 'SELECT paraphrase FROM mdx WHERE entry=?'
- c = obj.execute(sql, (key,))
+ sql = 'SELECT paraphrase FROM mdx WHERE rowid=?'
+ c = obj.execute(sql, (pos,))
for row in c.fetchall(): # multi entry
record_null = (row[0] + '\0').encode(encoding)
if len(record_null) == size:
@@ -392,13 +392,13 @@ def db2txt(source, encoding='UTF-8', zip=False, callback=None):
def pack_mdx_db(source, encoding='UTF-8', callback=None):
dictionary = []
- sql = 'SELECT entry, paraphrase FROM mdx'
+ sql = 'SELECT entry, paraphrase, rowid FROM mdx'
with sqlite3.connect(source) as conn:
cur = conn.execute(sql)
for c in cur:
dictionary.append({
'key': c[0],
- 'pos': 0,
+ 'pos': c[2],
'path': source,
'size': len((c[1] + '\0').encode(encoding)),
})
@@ -408,13 +408,13 @@ def pack_mdx_db(source, encoding='UTF-8', callback=None):
def pack_mdd_db(source, callback=None):
dictionary = []
- sql = 'SELECT entry, LENGTH(file) FROM mdd'
+ sql = 'SELECT entry, LENGTH(file), rowid FROM mdd'
with sqlite3.connect(source) as conn:
cur = conn.execute(sql)
for c in cur:
dictionary.append({
'key': c[0],
- 'pos': 0,
+ 'pos': c[2],
'path': source,
'size': c[1],
})
what do you think?
对下面的mdx文件可以正常解包,但是打包时会出错,即便我不做任何修改。
链接: https://pan.baidu.com/s/1Dp_aRjYgOs1UYHPpk0q6KA 提取码: h9uv
出错信息如下:
Pack to "牛津英语搭配词典2.mdx"
55%|██████████████████▊ | 6642/11987 [00:00<00:00, 11309.11rec/s] --- Elapsed time: 1.136615 seconds ---
Traceback (most recent call last):
File "/usr/local/bin/mdict", line 10, in <module>
sys.exit(run())
File "/usr/local/lib/python3.7/site-packages/mdict_utils/__main__.py", line 124, in run
encoding=args.encoding, is_mdd=is_mdd)
File "/usr/local/lib/python3.7/site-packages/mdict_utils/writer.py", line 316, in pack
writer.write(outfile, callback=callback)
File "/usr/local/lib/python3.7/site-packages/mdict_utils/writer.py", line 231, in write
self._write_record_sect(outfile, callback=callback)
File "/usr/local/lib/python3.7/site-packages/mdict_utils/writer.py", line 209, in _write_record_sect
b.prepare()
File "/usr/local/lib/python3.7/site-packages/mdict_utils/writer.py", line 86, in prepare
self._offset_table, self._compression_type, self._version)
File "/usr/local/lib/python3.7/site-packages/mdict_utils/base/writemdict.py", line 596, in __init__
_MdxBlock.__init__(self, offset_table, compression_type, version)
File "/usr/local/lib/python3.7/site-packages/mdict_utils/base/writemdict.py", line 551, in __init__
for t in offset_table)
File "/usr/local/lib/python3.7/site-packages/mdict_utils/base/writemdict.py", line 551, in <genexpr>
for t in offset_table)
File "/usr/local/lib/python3.7/site-packages/mdict_utils/writer.py", line 94, in _block_entry
return t.get_record_null()
File "/usr/local/lib/python3.7/site-packages/mdict_utils/writer.py", line 75, in get_record_null
self.record_pos, self.record_size, self.encoding, self.is_mdd)
File "/usr/local/lib/python3.7/site-packages/mdict_utils/writer.py", line 56, in get_record_null
record_null = obj.read(size - 1)
ValueError: read length must be non-negative or -1
65%|██████████████████████▏ | 7833/11987 [00:00<00:00, 10958.37rec/s]
请问如何解决此问题?
Assuming the file ldoce6.mdd
already exists and has data in it, running the command below removes all the data, and replaces with the given file:
mdict -a style.css ldoce6.mdd
ldoce6.mdd
is preserved and style.css
is added to existing keys.style.css
.It must be possible to add new keys to an existing mdx/mdd file without having to unpack and repack everything.
我使用 mdict -a dict.txt dict.mdx 可以正常打包。
但使用mdict --title title.html --description description.html -a dict.txt dict.mdx 就无法打包,扫描dict.txt后就闪退了。
title.html和description.html中都只是写了一行最普通的中文文字,没有任何html元素和特殊符号。
请教:title 和 description 有什么特别要求?
我使用python 3.7.5 x64, Win 10
unpack很多mdx后,发现是compact html格式,例如 这个
按照mdict builder 的说明文件里的说法,compact html格式是
4) MDict的紧凑型html格式(Compat Html)
这个格式由两个文件组成,正文文件格式基本和2)一样,但在正文里可以使用记号。另外
一个是记号文件。
记号文件的格式:
由多个记号定义组成,每个记号定义有3行
第一行: 记号的名称(只能用数字,必须大于0,最大不超过255)
第二行: 开始字符串(可以为空)
第三行: 结束字符串(可以为空)
使用时在正文里使用`记号`(键盘左上角的那个符号)就会将后续的文字直到下一个记号前的文
字用记号定义的开始字符串和结束字符串括起来。正文里如果需要显示` 则用"`"表示。内
码应该和正文的一样(例如正文如果是用Unicode的话,记号文件也应该用Unicode)
例如:
记号文件:
1
<font size=5>
</font>
2
<br>
3
<font face="Kingsoft Phonetic Plain, Tahoma">
</font>
正文文件:
whole
`1`whole`s`2`<p>`3`(hol,hJl; houl)
</>
最后在显示的时候就会被替换成
<font size=5>whole&#%96;s</font><br><p><font face="Kingsoft Phonetic Plain, Tahoma">(hol,hJl; houl)</font>
可否在你的程序里,添加一个选项,将这种compact html,转换成一般的html和css文档?
For instance:
a
@@@LINK=b
</>
Becomes:
a
</>
Error occurred when I tried to execute the following command.
mdict-utils.exe -x "G:\Mdict\test.mdx" --exdb -d "G:\Mdict\Temp"
当前该项目仅有命令行模式的调用方法,无法以函数方式调用。
增加Python交互模式下(.py文件中、模块间)以函数API调用的方法,以便他人在导入此项目的模块时使用更方便的函数API调用该项目。
在本人使用py2app.py开发的ZipMdict.app(适用于Mac平台的mdict打包&解压工具)中,非常希望以调用函数的方式调用您的此项目中的.mdd打包功能:
但将上述代码所在的ZipMdict.py文件使用py2app.py打包为ZipMdict.app后,尽管已在setup.py中添加了您的此项目,但仍无法成功调用您此项目中的.mdd打包功能:
"""
This is a setup.py script generated by py2applet
Usage:
python setup.py py2app
"""
from setuptools import setup
APP = ['ZipMdict.py']
DATA_FILES = ['logo_128.png']
OPTIONS = {
'iconfile':'icon.icns'
}
setup(
app=APP,
data_files=DATA_FILES,
options={'py2app': OPTIONS},
setup_requires=['py2app'],
py_modules=['readmdict', 'ripemd128', 'pureSalsa20', 'writemdict', 'mdict_utils']
)
敬请指导 🙏
--title title.html --description description.html
对mdd好像没有意义啊
Python version 3.6 or higher doesn't seem to be necessary, at least 3.4 worked fine for me when packing and unpacking both .mdx and .mdd.
diff --git a/setup.py b/setup.py
index 5e692b3..4c1e63f 100644
--- a/setup.py
+++ b/setup.py
@@ -24,7 +24,7 @@ setup(
description=about.description,
long_description=long_description,
long_description_content_type='text/x-rst',
- python_requires='>=3.6',
+ python_requires='>=3.4',
platforms=['noarch'],
packages=find_packages(),
entry_points={
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.