Embedding VSI Python 3.10 IA64


sergey_vorfolomeev
VSI Expert
Valued Contributor
Posts: 99
Joined: Thu Aug 22, 2019 12:17 am
Reputation: 0
Status: Offline

Re: Embedding VSI Python 3.10 IA64

Post by sergey_vorfolomeev » Wed Apr 12, 2023 10:58 am

I deleted the directory PYTHON$ROOT:[lib.python3^.10]encodings.DIR;1 and got the same error:

Code: Select all

VMSLOC> run py_call
Python path configuration:
  PYTHONHOME = '/python$root'
  PYTHONPATH = (not set)
  program name = 'VMSLOC$DKA200:[VORFOLOMEEV.py_call]py_call.EXE;2'
  isolated = 0
  environment = 1
  user site = 1
  import site = 1
  sys._base_executable = ''
  sys.base_prefix = '/python$root'
  sys.base_exec_prefix = '/python$root'
  sys.platlibdir = 'lib'
  sys.executable = ''
  sys.prefix = '/python$root'
  sys.exec_prefix = '/python$root'
  sys.path = [
    '/python$root/lib/python310.zip',
    '/python$root/lib/python3.10',
    '/python$root/lib/python3.10/lib-dynload',
  ]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

Current thread 0x7b628e00 (most recent call first):
  <no Python frame>
So, test whether this directory exist?
Or test the next logicals:

Code: Select all

  "DECC$ARGV_PARSE_STYLE" = "ENABLE"
  "DECC$EFS_CASE_PRESERVE" = "ENABLE"
  "DECC$EFS_CASE_SPECIAL" = "TRUE"
  "DECC$EFS_CHARSET" = "ENABLE"
Last edited by sergey_vorfolomeev on Wed Apr 12, 2023 10:59 am, edited 1 time in total.


Topic author
mgdaniel
Valued Contributor
Posts: 62
Joined: Mon Feb 28, 2022 5:16 pm
Reputation: 0
Location: Adelaide, South Australia
Status: Offline
Contact:

Re: Embedding VSI Python 3.10 IA64

Post by mgdaniel » Wed Apr 12, 2023 11:01 am

Code: Select all

HAVEN$ dir /sec PYTHON$ROOT:[lib.python3^.10]encodings.DIR;1

Directory PYTHON$ROOT:[lib.python3^.10]

encodings.DIR;1              11   4-JAN-2023 13:51  [SYSTEM]
     (RWE,RWE,RE,RE)

Total of 1 file, 11 blocks.

Code: Select all

HAVEN$ dir /sec PYTHON$ROOT:[lib.python3^.10.encodings]

Directory PYTHON$ROOT:[lib.python3^.10.encodings]

aliases.py;1                 31  25-NOV-2021 09:45  [SYSTEM]
     (RWED,RWED,RE,RE)
ascii.py;1                    3  25-NOV-2021 09:45  [SYSTEM]
     (RWED,RWED,RE,RE)
base64_codec.py;1             3  25-NOV-2021 09:45  [SYSTEM]
     (RWED,RWED,RE,RE)
8< snip 8<
zlib_codec.py;1               5  25-NOV-2021 09:45  [SYSTEM]
     (RWED,RWED,RE,RE)
__init__.py;1                11  25-NOV-2021 09:45  [SYSTEM]
     (RWED,RWED,RE,RE)
__pycache__.DIR;1            16   4-JAN-2023 13:51  [SYSTEM]
     (RWE,RWE,RE,RE)

Total of 123 files, 2844 blocks.


sergey_vorfolomeev
VSI Expert
Valued Contributor
Posts: 99
Joined: Thu Aug 22, 2019 12:17 am
Reputation: 0
Status: Offline

Re: Embedding VSI Python 3.10 IA64

Post by sergey_vorfolomeev » Wed Apr 12, 2023 11:03 am

This logical must be enabled

Code: Select all

 define DECC$EFS_CHARSET "ENABLE"
Added in 11 minutes 45 seconds:
I see. The Python initializes a lot of CRTL variables in CRTL_INIT routine. Shared library does not initialize them, it must be done in EXE image.
You can see what variables must be initialized (files vms_crtl_init.c and vms_crtl_values.c in):
https://github.com/vmssoftware/cpython/ ... 3.10.0/vms
Last edited by sergey_vorfolomeev on Wed Apr 12, 2023 11:15 am, edited 1 time in total.


Topic author
mgdaniel
Valued Contributor
Posts: 62
Joined: Mon Feb 28, 2022 5:16 pm
Reputation: 0
Location: Adelaide, South Australia
Status: Offline
Contact:

Re: Embedding VSI Python 3.10 IA64

Post by mgdaniel » Wed Apr 12, 2023 11:16 am

That fixed it Sergey.

Code: Select all

HAVEN$ define DECC$EFS_CHARSET "ENABLE"
HAVEN$ mcr wasd_exe:pyrte3
Today is Thu Apr 13 00:33:58 2023
I'm guessing this is in the release notes (wherever they may be, nowhere obvious).

Although a poor excuse for lack of basic checking, I did not set up this system's Python.

Why not set it as part of the PYTHON$SHR initialisation instead of (obviously) PYTHON.EXE?

Thank you for your assistance with this.

Added in 7 minutes 22 seconds:
sergey_vorfolomeev wrote:
Wed Apr 12, 2023 11:14 am
8< snip 8<
I see. The Python initializes a lot of CRTL variables in CRTL_INIT routine. Shared library does not initialize them, it must be done in EXE image.
You can see what variables must be initialized (files vms_crtl_init.c and vms_crtl_values.c in):
https://github.com/vmssoftware/cpython/ ... 3.10.0/vms
OK. I'll make some notes. Thanks again.

Post Reply