omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    General bug report thread

    Pythonista
    15
    49
    36157
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • userista
      userista last edited by

      @JonB It does seem to only happen when there is a pyui file although if 1 script has a pyui and one doesn't (no shared pyui) it still happens. I'm trying to make a minimal example that reproduces this.

      1 Reply Last reply Reply Quote 0
      • userista
        userista last edited by

        OK here's a minimal example that I extracted from my code. 1 script uses a pyui file and the other does not.

        2 ways to reproduce:

        1. when starting Pythonista from a cold start and launching test1.py (has a pyui file) and tapping the accessory button nothing happens. If I re-launch it then the proper action is executed.

        2. launch test2.py and then launch test1.py and tap the accessory button, the console.alert will have the data from test2.py

        gist of test1.py

        gist of test1.pyui

        gist of test2.py

        1 Reply Last reply Reply Quote 0
        • JonB
          JonB last edited by

          The problem is, your action and accessory action must be define BEFORE your load your view, if the pyui references them.
          In test1, when you load the pyui first, the actions are not defined, thus nothing happens, until you run the second time, at which point it is defined.

          When you run test2 first, you are defining the accessory action, which gets used when you load the pyui.

          The solution: in test1.py, define your actions, before you load the pyui. I posted a comment on your gist.

          1 Reply Last reply Reply Quote 0
          • userista
            userista last edited by

            @JonB yes that's it! Thanks so much.

            I guess I'll leave this conversation here - although it's not a bug, the default behavior should be to throw a NameError exception instead of using a "cached" method from a totally different script.

            1 Reply Last reply Reply Quote 0
            • JonB
              JonB last edited by

              If you don't want old scripts to carry over, you can set Clear Global Variables before run in the interpreter options menu. That way it is more like the python commandline. Default behaves more like an interactive interpreter, which personally I prefer, but you do have to be wary of leftover globals that make otherwise invalid code run without exceptions. So, your case 2 doesn't bother me.

              I was surprised that case 1 failed silently. For other actions, like button, if the function cannot be found it doesn't generate a NameError, but does at least print a warning to the console. If delegate actions just fail silently, that may be a bug, or at least an oversight.

              Warning: Couldn't bind action 'some_undefined_action' of 'button1'
              
              1 Reply Last reply Reply Quote 0
              • userista
                userista last edited by

                Yeah it fails silently in both cases if Clear Global Variables is on.

                1 Reply Last reply Reply Quote 0
                • userista
                  userista last edited by

                  1)Since upgrading to iOS 8.x any alert that takes input doesn't open the keyboard. console.input_alert, console.login_alert, when prompted for keychain.master_password. Before iOS 8 the keyboard would automatically pop up.

                  1. switching to a 3rd party keyboard and using it, then switching to another keyboard (maybe only 1st party?) crashes Pythonista.
                  1 Reply Last reply Reply Quote 0
                  • userista
                    userista last edited by

                    The current Paramiko module (version 1.13.0) in Pythonista is not compatible with newer OpenSSH versions
                    https://github.com/paramiko/paramiko/issues/423

                    (I already told Ole on twitter - but just want to put it in the forums also)

                    1 Reply Last reply Reply Quote 0
                    • blmacbeth
                      blmacbeth last edited by

                      @omz I have been playing around with the ui.Image module and have found what I may think is a bug. When I use ui.Image.named('Test_Lenna') it works as expected, but when I do the following: ui.Image.named('_my_Image') it returns None. For now, I have a work-around, where I first open the image in PIL and then convert the Image to a bytes and then use ui.Image.from_data(bIO.getvalue()).

                      Let me know if there is something obvious I have overlooked or if this kind of picture importing is not possible. Thank you!!!

                      1 Reply Last reply Reply Quote 0
                      • Sebastian
                        Sebastian last edited by

                        @blmacbeth If it's not a built in image, I believe you have to use the image's full path.

                        1 Reply Last reply Reply Quote 0
                        • JonB
                          JonB last edited by

                          Perhaps not technically a bug, but a common source of incompatibilities:
                          sys.stdin, std.stdout, and sys.stderr should have an isatty() method which returns false. This might not technically be a "bug", since python docs don't seem to require all file methods to be implemented, except maybe read and write, many other external libraries assume a file-like object.

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post
                          Powered by NodeBB Forums | Contributors