JiaLiangC opened a new pull request, #3772: URL: https://github.com/apache/ambari/pull/3772
## What changes were proposed in this pull request? This PR addresses a bug that was introduced after upgrading from Python 2 to Python 3. The original code was using byte strings for socket communication, which is the default string type in Python 2. However, in Python 3, strings are Unicode by default and need to be explicitly encoded to byte strings before being sent over a socket. Similarly, received data must be decoded back into a Unicode string. The changes in this PR ensure that the socket_command is properly encoded before sending and the received data is decoded back into a string for further processing. This fix restores proper socket communication functionality under Python 3. (Please fill in changes proposed in this fix) ## How was this patch tested? unit test manual test (Please explain how this patch was tested. Ex: unit tests, manual tests) (If this patch involves UI changes, please attach a screen-shot; otherwise, remove this) Please review [Ambari Contributing Guide](https://cwiki.apache.org/confluence/display/AMBARI/How+to+Contribute) before opening a pull request. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
