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
    36163
    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.
    • smath
      smath last edited by

      @inoddy - Thank you! I was wondering what was causing me to crash when hitting backspace on a carraige return. I would have never guessed.

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

        Two more things:

        1. When in the interactive console, tapping an autocomplete suggestion (that is not a callable) will always add an extra space after the name. This makes sense for assignments and most operators, but for attributes and function calls it will produce strange results, such as something .attrib .do_stuff(arg1 , arg2 ). I know it's just a minor style thing, but the code just looks wrong with the extra space. And it doesn't work the same as the completion in the editor does.
        2. Large files can (and will) lock you out of the app. Accidentally opening one causes Pythonista to practically hang on the "loading file" screen, and although the app isn't considered as "crashed" or "hung up" by the system, no input is accepted anymore until the file is loaded. Quitting and restarting the app won't help either, as it will try to open the large file before displaying any UI. Would it be possible to add a warning before opening a file larger than X megabtyes, or a switch in the external Settings sheet for the app that disables opening the last file temporarily? The latter is common for apps with file management and viewing capabilities to prevent these kinds of lockouts.
        1 Reply Last reply Reply Quote 0
        • omz
          omz last edited by

          @dgelessus I know this isn't ideal, but for now, if you're "locked out", you could open Pythonista by entering pythonista:// in Safari. This will skip the "reload last file" step.

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

            Thanks, that works perfectly! Now to clean up the C lexer cache files that caused this...

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

              Yet another thing: when typing any kind of opening parenthesis inside a string or comment without "closing" it in the same line, the next line will be indented like e. g. with multiline dicts. For example:

              dict = { # expected indentation
                      "a": "b",
                      "c": "d",
                      "e": "f",
              }
              
              if char == "{": # curly brace inside string should be ignored
                           # gets indented up to here
                  # but should only be up to here
              
              1 Reply Last reply Reply Quote 0
              • coolius
                coolius last edited by

                Pythonista crashes when I try to save any kind of image, no matter what size. I am using an iPad 4.

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

                  Coolius, can you provide an example?

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

                    @dgelessus Thank you to your keyboard setting advice. And sorry to late reply.

                    I miss understood, actually iOS doesn't accept inputting English with Japanese hardware keyboard layout.
                    This mean, in the hardware keyboard setting, no option to choose input ASCII character with Japanese keyboard layout.

                    Note: With "Kana", it means inputting Japanese character, not ASCII.

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

                      sys.exitfunc isn't called when Pythonista catches a SystemExit, and the atexit module doesn't work either. On the contrary, os._exit(status) is not caught and will actually exit the app.

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

                        @dgelessus mentioned it, but I'd like to confirm the whole hud_alert sending a constant KeyboardInterupt when you hide the cancel button. I don't know why it was never noted when I posted in July.

                        https://omz-forums.appspot.com/pythonista/post/5284607821873152#post-5284607821873152

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

                          I'm having weird behavior when using the ui module. I'll post an example of when it happens, though I think it can happen in other instances as well but I haven't narrowed it down.

                          I have 2 unrelated scripts that both use the ui module and use the same names for delegate handlers for ListDataSource e.g. the name of the method for tableview_accessory_button_tapped is foobar. I run one script (but don't call the delegate method) and then leave Pythonista. When I come back and run the second [unrelated] script and (e.g.) tap the detail_button in my TableViewCell it calls the method of the OTHER script with the data of the CURRENT script (and outputs that result and/or throws an error, for obvious reasons).

                          I think the key issue is Pythonista caching of code - when it sees a method name that it already knows (even if it wasn't called prior) it will call that method. Is this expected behavior and/or is there a workaround (other than renaming all my methods)?

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

                            Are you running these as scripts? Or do you import?

                            If importing, note that if you have already imported a module, it won't reimport unless you specifically reload the module.

                            When you say you leave pythonista and come back, do you actually kill the app?
                            If you just task switch away, then come back within 15 minutes or so, generally the interpreter hasn't been cleared. If you see the large >>> splash screen, I think that means the interpreter has restarted, otherwise your old interpreter session is active(unless you set the setting to clear globals). You can also hold the clear button in the console screen, which lets you restart pythonista.

                            Also, are you setting delegate handlers in the ui editor, or in the script?
                            If you have set a custom class in the ui editor, loading the pyui actually creates an instance of that custom class, so if you were sharing a pyui between two scripts...maybe you might get unexpected things happening.

                            Are you sure that your second script defines the method before using it? You should be able to redefine a method and it will overwrite the existing definition..

                            It might help if you can post an example of two minimal scripts that show this problem, and steps to recreate.

                            1 Reply Last reply Reply Quote 0
                            • 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
                                            • First post
                                              Last post
                                            Powered by NodeBB Forums | Contributors