Search code examples
sublimetext3sublimetextsublime-text-plugin

Sublime Text output incorrect architecture


1. Summary

I have 64-bit Windows. But if I use platform.architecture()[0] or sublime.arch() in my Sublime Text plugin, I get 32bit value.


2. Settings

I create a file ExampleSashaPlugin.py in $packages/TestPlugin folder. Content of this file:

import platform
import sublime

get_bitness = platform.architecture()[0]
print(get_bitness)

get_bitness_2 = sublime.arch()
print(get_bitness_2)

3. Steps to reproduce

I reproduce the problem in a version of Sublime Text without plugins and user settings.

I save ExampleSashaPlugin.py.


4. Expected behavior

If I get Windows bitness in Python interpreter:

>>> import platform
>>> platform.architecture()[0]
'64bit'

5. Actual behavior

Sublime Text console output:

key evt: control+s
command: save
reloading plugin TestPlugin.ExampleSashaPlugin
32bit
x32

6. Environment

Operating system and version:
Windows 10 Enterprise LTSB 64-bit EN
Sublime Text:
Build 3126 portable for Windows 64-bit

Thanks.


Solution

  • 1. Answer

    As Keith Hall say, I had 32-bit Sublime Text in my 64-bit machine. I need use Sublime Text 64-bit for correct working platform.architecture() and sublime.arch() methods.

    I don't understand, why I had 32-bit Sublime Text. I download Sublime Text Build 3126 x64.zip file — 64-bit portable version from official site. Perhaps, in Sublime Text site posted an incorrect version, when I download 64-bit version.


    2. Migrate to 64-bit version

    If you also have 32-bit Sublime Text version in 64-bit PC by some reasons, you can solve the problem use these actions.

    1. Create backup copy your Sublime Text, if something goes wrong.
    2. Download last 64-bit version from official site.
    3. Copy these files from new 64-bit Sublime Text root directory to root Sublime Text directory, that you will use:

      • crash_reporter.exe,
      • msvcr100.dll,
      • plugin_host.exe,
      • python33.dll,
      • subl.exe,
      • sublime_text.exe,
      • update_installer.exe.

    Actually for April 2017.