License file call issue in new server

We have a Aspose.Cells.Pythonvia.NET paid license for our excel application. This is a 2 developer multiple deployment OEM purchase. So our issue is that the license is readable and works fine in our Lower linus RHEL8 server but the license call gets stuck in our prod RHEL 7 linux server.
sample code and steps:
license file: Aspose.Cells.Pythonvia.NET.lic

logger.info(“read Aspose license file”)
logger.info(Asposelic)
logger.info(os.path.isfile(Asposelic))

    lic = License()
    lic.set_license(Asposelic)

    # load a  xlsm template
    __logger__.info("Start Aspose")
    workbook = Workbook(path)

Steps run in lower env:
2023-10-02 17:24:32,437 - root - INFO - 0.20.3
2023-10-02 17:24:32,437 - root - INFO - read sql file
2023-10-02 17:24:33,705 - root - INFO - Set paths
2023-10-02 17:24:33,706 - root - INFO - delete excel file if exist in path
2023-10-02 17:24:33,713 - root - INFO - read Aspose license file
2023-10-02 17:24:33,984 - root - INFO - Start Aspose

Steps run in Prod env:
2023-10-04 11:22:11,071 - root - INFO - 0.20.3
2023-10-04 11:22:11,071 - root - INFO - read sql file
2023-10-04 11:22:13,253 - root - INFO - Set paths
2023-10-04 11:22:13,253 - root - INFO - delete excel file if exist in path
2023-10-04 11:22:13,259 - root - INFO - read Aspose license file

basically it gets stuck on read license.
Also would like to note that the permission on the prod server is same as the lower, so no issues there

@psethu01,

Could you please simply try to read the license file (without involving Aspose.Cells library) in python on prod RHEL 7 linux server, if it works?
e.g.,

with open('Aspose.Cells.Pythonvia.NET.lic', 'r') as file:
    contents = file.read()
    print(contents) 

we tried in the RHEL 7 prod server and the license
file content opened without any issue using the With open statement you provided @amjad.sahi

@psethu01
There are two ways to load the LIC file: one is by using the file name, and the other is by using the stream method. Please try using the stream method.

from aspose.cells import License
import io

# Try to set license from the stream.
try:
    lic = License()
    lic_stream = io.FileIO("Aspose.Cells.Pythonvia.NET.lic")
    lic.set_license(lic_stream)
    lic_stream.close()
    print("License set successfully.")
except RuntimeError as err:
    print("\nThere was an error while setting the license: {0}".format(err))

Tried the above approach using stream and we still face the same issue of license call being stuck @xinya.zhu .

@psethu01,

What is the error you get using the suggested sample code?