You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ambari.apache.org by "caijialiang (Jira)" <ji...@apache.org> on 2024/02/18 02:33:00 UTC
[jira] [Updated] (AMBARI-26049) Fix type error in ambari port alert
[ https://issues.apache.org/jira/browse/AMBARI-26049?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
caijialiang updated AMBARI-26049:
---------------------------------
Description: 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.
> Fix type error in ambari port alert
> -----------------------------------
>
> Key: AMBARI-26049
> URL: https://issues.apache.org/jira/browse/AMBARI-26049
> Project: Ambari
> Issue Type: Bug
> Reporter: caijialiang
> Priority: Major
>
> 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.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ambari.apache.org
For additional commands, e-mail: issues-help@ambari.apache.org