• Re: RPi & Python 3

    From Daniel Stephens@3:633/280.2 to All on Wed Feb 8 15:34:01 2023
    Hello and thank you for creating this wonderful BBS!

    I'm in the process of building a front end to a Node.js API for keeping tra=
    ck of all of my ICs and other active electronics. I want to be able to acce=
    ss it from my Amiga 1000, and so I've decided that Mystic BBS is the best o= ption for this. I already use Mystic for moving text files back and forth f= rom WP 4.1 on my Amiga to NeoOffice on my Mac and it works great.

    Anyway, I am using the Python3 module 'requests' for handling HTTP requests=
    to the Node.js API on an Ubuntu machine on the interwebs.

    However, simply importing this module into a Mystic Python3 script causes a=
    n error to show up in the error.log:
    EAccessViolation Access violation

    I am running Mystic version 1.12 A48
    It's running on a Raspi 4 with the latest Raspbian
    It's running Python 3.9.2

    The python script is simply:
    import mystic_bbs as bbs
    import requests
    bbs.writeln("Hello from Python 3")
    bbs.writeln("We have imported requests module")
    bbs.writeln("|PA")

    The script runs fine until it ends at which point it abruptly ends the conn= ection. It even properly executes the |PA pause; but as soon as a key is pr= essed the connection terminates.

    If I comment out the "import requests" line, the script runs without termin= ating the connection and there is no error in the log file.

    Any help would be most appreciated.

    ps: I did do a fresh install of everything and tried with Python 2.7. The s= ame script did not cause the connection to terminate, however it did give m=
    e a RunTimeWarning of an API version mismatch for module mystic_bbs.

    Thank you!

    --- MBSE BBS v1.0.8 (Linux-x86_64)
    * Origin: ---:- FTN<->UseNet Gate -:--- (3:633/280.2@fidonet)
  • From Daniel Stephens@3:633/280.2 to All on Tue Feb 14 14:18:14 2023
    On Sunday, February 12, 2023 at 5:20:23 PM UTC-5, Nicola Mettimano wrote:
    Hello, same problem here with my VM under headless Ubuntu server.=20
    Here only Py3 ai used but same error, i don't know how to solve, do you h=
    ave=20
    news?=20

    No, I=E2=80=99ve not found a solution. I reinstalled everything from the OS=
    up and only installed Python 3.9 and I still get the error: EAccessViolati=
    on Access violation

    And while my script runs perfectly, as soon as it ends the telnet session c= loses,and the error above appears. It=E2=80=99s really quite strange.

    --- MBSE BBS v1.0.8 (Linux-x86_64)
    * Origin: ---:- FTN<->UseNet Gate -:--- (3:633/280.2@fidonet)
  • From Nicola Mettimano@2:335/601 to Daniel Stephens on Tue Feb 14 10:45:45 2023
    No, I’ve not found a solution. I reinstalled everything from the OS up and only installed Python 3.9 and I still get the error:
    EAccessViolation Access violation

    that's what I was about to try...

    And while my script runs perfectly, as soon as it ends the telnet session closes,and the error above appears. It’s really quite strange.

    weird....can't use python with mystic, this is terrible news...

    -------------------------------------------------
    Violence is the last refuge of the incompetent!


    --- MBSE BBS v1.0.8 (Linux-x86_64)
    * Origin: Agency HUB, Dunedin - New Zealand (2:335/601@fidonet)
  • From g00r00@1:129/215 to Daniel Stephens on Tue Feb 14 11:14:57 2023
    Hello, same problem here with my VM under headless Ubuntu server.
    Here only Py3 ai used but same error, i don't know how to solve, do you news?

    No, I’ve not found a solution. I reinstalled everything from the OS up and only installed Python 3.9 and I still get the error:
    EAccessViolation Access violation

    Their problem does not appear to be the same issue, just off the little knowledge I have. Their setup sounds like an environment issue and yours I don't think is.

    Since your script is running and throwing an access issue when closing, its more likely to be a bug. As you may or may not know,
    the current version for 64-bit ARM is the first release of it, so that makes it
    even more likely to be an issue with Mystic. I can only assume when you say latest Pi OS that means you're using 64-bit OS and Mystic 64-bit for ARM.

    The reason I hadn't responded yet is because I haven't had time to get my 64-bit Pi out to see if I can reproduce the issue on my own.

    .... Read messages, not taglines


    --- MBSE BBS v1.0.8 (Linux-x86_64)
    * Origin: Agency HUB, Dunedin - New Zealand (1:129/215@fidonet)
  • From Travis Mehrer@1:134/303 to Daniel Stephens on Tue Feb 14 13:02:25 2023
    I'm not certain this is related but I've noticed similar issues with Python 3 in Mystic. Particularly when my script is making any sort of external http(s) connection.

    A while back I was writing my own "This Day in History" type script. Everything
    worked fine until the script finished and then the connection would get dropped
    from the BBS. In the end it was easier to make cron job that downloaded the history to a file and then open it via open().

    More recently while trying to use feedparser to read RSS I've noticed the same behavior: once the script finished, my session gets disconnected.

    I haven't had time to dig into it more but I suspect if I make a cronjob to save the feed as an XML file and then open() the file and work with it, I suspect it will work. It's not the cleanest way and perhaps not a final solution it's a possible work-around for the time being.

    blade

    .... Error, no Keyboard - Press F1 to Continue.


    --- MBSE BBS v1.0.8 (Linux-x86_64)
    * Origin: Agency HUB, Dunedin - New Zealand (1:134/303@fidonet)
  • From Daniel Stephens@3:633/280.2 to All on Thu Feb 16 08:21:53 2023
    g00r00, thank you for the response! I know how busy you are.

    I'm running the following Raspbian version:
    Release date: September 22nd 2022
    System: 32-bit
    Kernel version: 5.15

    So it's 32 bit Raspbian on a Raspi 4 and 32 bit Mystic with Python 3.9.

    If I run the following script:
    ---------------------------------------
    import mystic_bbs as bbs
    import requests

    bbs.writeln( "Testing importing requests" )
    bbs.writeln( "All Done |CR|PA" )
    -------------------------------------

    I get the "EAccessViolation Access violation" error right after pressing any key at the very end of the script and the telnet session closes.

    If I run the same script without importing requests, I get no error. Just importing requests causes the error to happen at the end of the script - I don't even have to use it.

    But if I do use it, the script runs fine all the way to the end and then throws the error and closes the telnet session.

    Very strange indeed. And thank you for helping with this!

    --- MBSE BBS v1.0.8 (Linux-x86_64)
    * Origin: ---:- FTN<->UseNet Gate -:--- (3:633/280.2@fidonet)