A deadly error has occurred while I was using the latest version of Pythonista 3 on an iPhone 6 using iOS 11.2.2! After creating a md file called “127.0.0.2.md” with “os.mkfifo” and opening the file, I was unable to edit anything in the file; then everything froze and the app crashed. But now, every time I open the app, Pythonista 3 shows the logo and crashes. I’ve tried holding power & home to do a reset which didn’t work; I’ve tried doing a shutdown which did let me do some things, but if I try to look at other files or change the file name, it will crash; and I have tried using the shortcut “pythonista3://“ but that also results in a crash.
This deeply worries me because I was working on a huge project and now the app is not going to function.
Update: This affects more then just Pythonista, it also kills your keyboard and you cant get your keyboard to pop up in certain apps.
Here is the error log from my device: https://ghostbin.com/paste/oyf27
Update: Pythonista 3 has a safe mode which fixed everything! THANK F*CKING GOD THATS A FEATURE! I would have cried if that didn’t exist
Yeah, FIFOs are strange, I don't think there's any use for them in Pythonista. A FIFO works kind of like a normal pipe in a shell - one side writes to it, the other one reads from it. (Usually the two sides would be different processes, but you can probably do it in a single process if you use threads or non-blocking IO.) The reason why Pythonista froze when you opened the FIFO is because the editor tried to read the file contents, but because there was no writer attached to it, the read (or possibly the file open) blocked forever.
I don't know why Pythonista crashed when you tried to do anything else with the FIFO - my guess would be that the file manipulation methods that Pythonista uses don't handle FIFOs properly. I also have no idea why safe mode helped (I thought it did the same thing as pythonista3:// - disabling
pythonista_startupand closing all editor tabs) but I'm not going to complain.
In case safe mode ever doesn't work, there is another way you can get rid of a problematic file. Pythonista's share extension has full access to all files stored in the app, so you can use the Python console there to delete the file. The share extension has much fewer features than the main app, and the file browser and editor aren't loaded by default, so it's much less likely to crash than the main app.
If that doesn't work either, and you have purchased the old Pythonista 2 when it was still available, you can use it as well. Although you can't see Pythonista 3 files in Pythonista 2's UI anywhere, both versions share the same storage location internally. In Pythonista 2, Pythonista 3's files are located at
os.path.expanduser("~/Pythonista3/Documents"). The chance of a Pythonista 3 file crashing Pythonista 2 is basically zero, because Pythonista 2 never looks at Pythonista 3's files (unless you do so manually using Python).
If that isn't an option either, you can make a backup of your device using iTunes, and then use a tool like iFunbox or iExplorer to extract your Pythonista files from the backup. (I honestly don't know how either of those tools deal with FIFOs and other special files in backups, or if iTunes even backs such files up. If special files cause issues when extracting, you can manually copy out all files except the problematic special files.) Once you're sure that you've gotten all your data out, you can delete and reinstall Pythonista and copy all of your data back.