Skip to content

Fix hardcoded /tmp path for Unix socket in unix_connect#288

Open
luckyabsoluter wants to merge 1 commit into
python-xlib:masterfrom
luckyabsoluter:fix-hardcoded-tmp-path
Open

Fix hardcoded /tmp path for Unix socket in unix_connect#288
luckyabsoluter wants to merge 1 commit into
python-xlib:masterfrom
luckyabsoluter:fix-hardcoded-tmp-path

Conversation

@luckyabsoluter

Copy link
Copy Markdown

Problem:

  • The unix_connect function previously hardcoded /tmp as the directory for the Unix socket path.
  • This causes compatibility issues on platforms or specific environments that use a different temporary directory, or even lack access to /tmp entirely.

Actions:

  • Imported the tempfile module in unix_connect.
  • Updated the X11 Unix socket path generation to dynamically use tempfile.gettempdir().

Result:

  • The Unix socket path now correctly adapts to the system's runtime configuration (e.g., OS defaults or TMPDIR environment variables), improving cross-platform compatibility.

Problem:
- The unix_connect function previously hardcoded /tmp as the directory for the Unix socket path.
- This causes compatibility issues on platforms or specific environments that use a different temporary directory, or even lack access to /tmp entirely.

Actions:
- Imported the tempfile module in unix_connect.
- Updated the X11 Unix socket path generation to dynamically use tempfile.gettempdir().

Result:
- The Unix socket path now correctly adapts to the system's runtime configuration (e.g., OS defaults or TMPDIR environment variables), improving cross-platform 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