Joe McDonnell created IMPALA-11976:
--------------------------------------

             Summary: Fix use of deprecated functions / packages in Python3 
(long, maxint, file, etc)
                 Key: IMPALA-11976
                 URL: https://issues.apache.org/jira/browse/IMPALA-11976
             Project: IMPALA
          Issue Type: Sub-task
          Components: Infrastructure
    Affects Versions: Impala 4.3.0
            Reporter: Joe McDonnell


Python 3 removed several deprecated functions / types.

 
{noformat}
# sys.maxint is removed, replace with sys.maxsize
sys.maxint -> sys.maxsize

# file() is removed, use open()
file() -> open()

# Long is gone, int is now equivalent to long, can use int from future
from builtins import int
long() -> int()

# e.message is gone, replace with str(e) 
e.message -> str(e){noformat}
There are a grab bag of others like strings.letters becoming 
string.ascii_letters and codecs moving to a different package.

This is also a good time to get the new behavior for round().

See these descriptions:

[https://python-future.org/compatible_idioms.html#file]

[https://python-future.org/compatible_idioms.html#long-integers]

This corresponds to these pylint checks:

file-builtin
long-builtin
invalid-str-codec
round-builtin
deprecated-string-function
sys-max-int
exception-message-attribute

 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to