Skip to content

Conversation

@xunyinzhe
Copy link
Contributor

@xunyinzhe xunyinzhe commented Feb 27, 2025

make sure jieba.load_userdict() have a string parameter

Purpose

fix #13392: jieba 'PosixPath' object is not iterable

jieba.load_userdict only accept file-like object or string path (not Path object) .

JIEBA_DEFAULT_DICT is a PosixPath object, when key dict not in options, the code
options.get('dict', JIEBA_DEFAULT_DICT) will return a PoixPath object, which
will cause errors in jieba.load_userdict.

References

寻隐者 and others added 2 commits February 27, 2025 16:48
make sure jieba.load_userdict() have a string parameter
@AA-Turner AA-Turner added this to the 8.3.0 milestone Mar 1, 2025
@AA-Turner AA-Turner changed the title fix #13392, jieba 'PosixPath' object is not iterable Fix argument type for jieba.load_userdict() Mar 1, 2025
@AA-Turner AA-Turner merged commit 162f7b1 into sphinx-doc:master Mar 1, 2025
23 checks passed
@AA-Turner AA-Turner modified the milestones: 8.3.0, 8.2.x Mar 2, 2025
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 31, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Jieba fails in 8.2.0+: 'PosixPath' object is not iterable

2 participants