Skip to content

fix: improve pyopenjtalk compatibility for newer versions and localhost binding#239

Open
Ryo722 wants to merge 1 commit into
litagin02:masterfrom
Ryo722:fix/pyopenjtalk-compatibility
Open

fix: improve pyopenjtalk compatibility for newer versions and localhost binding#239
Ryo722 wants to merge 1 commit into
litagin02:masterfrom
Ryo722:fix/pyopenjtalk-compatibility

Conversation

@Ryo722

@Ryo722 Ryo722 commented Mar 29, 2026

Copy link
Copy Markdown

Summary

  • Add hasattr check for unset_user_dict() which was removed in pyopenjtalk 0.4+
  • Handle missing function names in worker server gracefully
  • Change socket binding from socket.gethostname() to "localhost" for reliable connection on macOS
  • Wrap unset_user_dict() call with try-except for backward compatibility

Motivation

When running on macOS, socket.gethostname() can fail to resolve properly, causing connection errors in the pyopenjtalk worker. Additionally, newer versions of pyopenjtalk (0.4+) removed the unset_user_dict() method, causing AttributeError.

Changes

File Change
pyopenjtalk_worker/__init__.py hasattr check before calling unset_user_dict()
pyopenjtalk_worker/worker_client.py socket.gethostname()"localhost"
pyopenjtalk_worker/worker_server.py "localhost" binding + missing func handling
user_dict/__init__.py try-except wrapper for unset_user_dict()

Testing

Tested on macOS 14 (Apple Silicon M4) with pyopenjtalk 0.3.x and 0.4+.

These changes are backward-compatible and do not affect existing CUDA/Linux environments.

…st binding

- Add hasattr check for `unset_user_dict()` which was removed in
  pyopenjtalk 0.4+. This prevents AttributeError on newer versions.
- Handle missing function names in worker server gracefully instead
  of raising KeyError.
- Change socket binding from `socket.gethostname()` to `"localhost"`
  for more reliable connection on macOS and other environments where
  hostname resolution may be unreliable.
- Wrap `unset_user_dict()` call in user_dict/__init__.py with
  try-except for backward compatibility.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant