Skip to content

Move to Python 3.8 #36

Open
Open

Description

@dhowland

Python 2.7 is about to become obsolete. Could the scripting host be upgraded?

Activity

  1. chcg commented on May 27, 2018

    @chcg
    Collaborator

    See sergey-shandar/getboost#43, currently no nuget packet seems to be available for boost python which is correctly build against python 3.

    Initial test branch created at https://github.com/chcg/PythonScript/tree/python36_test.

    See also http://python3porting.com/cextensions.html

  2. jacktose commented on Aug 9, 2018

    @jacktose

    boostorg/python#129 is closed and apparently fixed as of April. That should fix sergey-shandar/getboost#43.

    Edit: sergey-shandar/getboost#43 is closed now.

  3. chcg commented on Oct 3, 2018

    @chcg
    Collaborator

    Ideas on this task from Claudia:

    Hast du noch ein paar nette Ideen zum Umstieg auf Python 3? Mit Boost 1.68 sollte der möglich sein.
    Ich habe scintilla 4.0.1 mit python3 getestet und bis dato ist mir nur aufgefallen das Python-Text nach oder von bytes konvertiert
    werden muß.
    Heisst, mit Python Version2 war ein String standardmäßig ein Byte-Object, mit Python3 ist dies nun ein Unicode-Object, wenn also ein
    Script nun etwas wie editor.addText('some text') macht, wird dies nicht funktionieren da es eigentlich editor.addText(b'some text')heißen
    müsste. Das ist aber unschön aus Sicht des Users so dass ein automatisches prüfen und konvertieren nötig wäre.
    Gleiches gilt für die PS-Console.

    Oder sonst noch Gedanken, was geändert/verbessert werden könnte?
    Man könnte ein Feature eibauen, welches dynamische generierte dialog erlaubt.
    Siehe hierzu https://blogs.msdn.microsoft.com/oldnewthing/20050429-00/?p=35743
    Wenn man das auf static, radio/checkbox und normale button sowie ein text control beschränkt sollte es auch mit
    überschaubaren Aufwand realisierbar sein.
    Die Idee war in etwa sowas:

    editor.customDialog('Custom Dialog Title',
    (x,y,w,h),
    [('static', 'Convert document', x,y,w,h),
    ('radio', 'ALL TO UPPERCASE', x,y, w,h),
    ('radio', 'all to lowercase', x,y, w,h),
    ('button', 'OK - let's do it', x,y, w,h),
    ('button', 'Ignore and close', x,y, w,h),])

    Das skript übergibt also den Titel, x,y Koordinaten sowie die Breite und Höhe des Dialogssowie eine Liste
    von dynamisch generierten Controls. Deren x,y sollten relative zum Dialog sein. Also ein x,y = 0 von static
    wäre der erste linke obere Punkt innerhalb des Dialogs und nicht auf dem Monitor.

    Bezüglich Beispielskripten, die werde ich Dir noch zukommen lassen werde sie nur ein bisschen überarbeiten,
    heißt, vorallem, dokumentieren.

  4. changed the title [-]Move to Python 3.6[/-] [+]Move to Python 3.7[/+] on Oct 4, 2018
  5. added this to the v3.0 milestone on Apr 26, 2020
  6. changed the title [-]Move to Python 3.7[/-] [+]Move to Python 3.8[/+] on Apr 26, 2020
  7. 23 remaining items

  8. Ekopalypse commented on Jul 7, 2020

    @Ekopalypse
    Contributor

    @pete312
    download a zip from https://github.com/bruderstein/PythonScript/releases/tag/v3.0.1.
    Depending on your notepad++ configuration you either have to unpack into %APPDATA%\notepad++ or
    into the installation directory of notepad++.

  9. vsrawat commented on Jul 7, 2020

    @vsrawat
  10. Ekopalypse commented on Jul 7, 2020

    @Ekopalypse
    Contributor

    @vsrawat
    I don't know as I don't use the installed version.

  11. pryrt commented on Dec 4, 2024

    @pryrt
    Contributor

    @chcg,

    I know I've generally been told that "ANSI/codepages" are the reason that PythonScript 3 has never moved out of Alpha. But there has been nothing on this issue in 4 years, other than a comment in 2023 that this issue was the tracker for PS3.

    The original list of test failures in ANSI were fixed years ago. So what remains to be solved? What is still holding up the transition from PS3 being alpha to releasing it into Plugins Admin? Is there an actionable and testable list of things that still remain to be fixed/implemented, so that if someone wanted to contribute to that part of the effort, they would know what is needed?

    (It can be frustrating in the Forum to have to support both PS2 and PS3 for scripts that I publish, because while I already made the transition to PS3 for my own use, the average Forum member will only install whatever's available in PluginsAdmin, so any public scripts have to work for PS2 as well, or average Forum members aren't likely to be able to use them. Every time I have to fix something, like here, because of differences in behavior or features between Python2.7+libraries and Python3.12+libraries, I am reminded yet again of how much I really wish PS3 were in Plugins Admin rather than just alpha.)

  12. Ekopalypse commented on Dec 4, 2024

    @Ekopalypse
    Contributor

    The issue still exists

    {1D79F866-BD94-467B-B795-B3730AC37B1B}

    and is not easy to fix, I think.
    PS must treat the cases where a buffer is ANSI, DBCS or UNICODE differently.
    In the old PS2 everything was a byte buffer and python2 created, or rather tried to create, a string from it.
    Now Python3 assumes that it is a utf8 encoded byte stream, which means that another encoded buffer would have to be converted to utf8 or converted from utf8 to its original encoding.
    This is feasible in itself, but what happens if you use actions based on different encodings?
    For example, get a substring of X and mark it. Different length!
    My attempt to act as a bytestream again has unfortunately not yet worked.

    And I can understand your frustration.

  13. chcg commented on Dec 5, 2024

    @chcg
    Collaborator

    Failing tests are internal ones from
    https://github.com/bruderstein/PythonScript/blob/master/PythonScript/python_tests/tests/

    The main issue is within

    //TODO how to get str.attr("encode")(codePageName) working again here

    Most likely to overcome that problem the code needs a switch to internally handle the text as byte buffer again and not as python 3 does as utf8 stream.

  14. alankilborn commented on Dec 6, 2024

    @alankilborn

    Questions:

    • Could "PythonScript" and (a new) "PythonScript3" both appear in Plugins Admin? The answer is "they could" but the real question is, would that be reasonable?
    • Can't it just be made known to only use PS3 on UTF-8 files? Those publishing PS3 scripts could assert editor.getCodePage() == 65001 early on in the script...
  15. chcg commented on Dec 30, 2024

    @chcg
    Collaborator
    • Using PythonScript in parallel to PythonScript3 requires renaming of the install folder and the plugin dll on master.
      I think it is not worth the effort to support both versions and would prefer to just switch to PythonScript3 and see how big is the user complain on it.
  16. Ekopalypse commented on Dec 30, 2024

    @Ekopalypse
    Contributor

    As far as I understand, even with the latest Python version it is not possible to host multiple runtimes in one process

  17. alankilborn commented on Dec 30, 2024

    @alankilborn

    even with the latest Python version it is not possible to host multiple runtimes in one process

    Was I or anyone else suggesting this?

  18. Ekopalypse commented on Dec 30, 2024

    @Ekopalypse
    Contributor

    If there will be two versions in the PluginAdmin, there will be people who install both and then ...

  19. alankilborn commented on Dec 30, 2024

    @alankilborn

    Well, appropriate warnings should be added to description in PluginAdmin...

    And really, maybe a deprecation warning for PS2 (I believe it is behind in new features and functions anyway).

  20. chcg commented on Dec 31, 2024

    @chcg
    Collaborator

    What I have in mind is replacing PythonScript(2) in PluginAdmin with PythonScript(3), so it appears as update and the old PS(2) installation is replaced and there should be no issue with a parallel installation of both variants.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions