launch_gateway fails to parse server port when enabling a JVM debug port
ehigham opened this issue · comments
Edmund Higham commented
When calling launch_gateway
with javaopts=['-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005']
it'll fail to parse the server port from stdout:
File py4j/java_gateway.py:337, in launch_gateway(port, jarpath, classpath, javaopts, die_on_exit, redirect_stdout, redirect_stderr, daemonize_redirect, java_path, create_new_process_group, enable_auth, cwd, return_proc, use_shell)
331 proc = Popen(
332 command, stdout=PIPE, stdin=PIPE, stderr=stderr, cwd=cwd,
333 **popen_kwargs)
335 # Determine which port the server started on (needed to support
336 # ephemeral ports)
--> 337 _port = int(proc.stdout.readline())
339 # Read the auth token from the server if enabled.
340 _auth_token = None
ValueError: invalid literal for int() with base 10: b'Listening for transport dt_socket at address: 5005\n'
Hyukjin Kwon commented
Thanks for reporting this. Are you interested in making a PR?
Edmund Higham commented
Thanks for reporting this. Are you interested in making a PR?
Sure :)
Edmund Higham commented
@HyukjinKwon can someone take a look at the PR please?