Skip to content

Commit ccb4656

Browse files
Fix Python RPC server crash on Windows due to hardcoded /tmp log path (#6787)
1 parent d8886d2 commit ccb4656

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • rewrite-python/rewrite/src/rewrite/rpc

rewrite-python/rewrite/src/rewrite/rpc/server.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import os
2828
import select
2929
import sys
30+
import tempfile
3031
import traceback
3132
import threading
3233
from pathlib import Path
@@ -35,7 +36,7 @@
3536

3637
# Configure logging - log to file by default to avoid filling stderr buffer
3738
# (which can cause deadlock if parent process doesn't read stderr)
38-
_default_log_file = '/tmp/python-rpc.log'
39+
_default_log_file = os.path.join(tempfile.gettempdir(), 'python-rpc.log')
3940
logging.basicConfig(
4041
level=logging.INFO,
4142
format='%(asctime)s - %(levelname)s - %(message)s',

0 commit comments

Comments
 (0)