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.
[Bugs(s)] Pythonista 2 (build 201005)
-
Ok, so I've encountered a strange bug that makes Pythonista 2 and Pythonista 3 betas hang. Pythonista 3 beta recovers, but Pythonista 2 remains stuck. Uh oh.
The file
'/aGovChatter/candidator.py'
in the Pythonista 2 directory containing the following code, upon trying to open this file hangs Pythonista. If I try to open it in Pythonista 3 it hangs but eventually crashes and when I open up pythonista 3 again it isn't still stuck on this opening file screen like Pythonista 2 beta is. I can't figure out how to get around this in pythonista 2 short of uninstalling the app....I tried force-quitting it, restarting iOS. Again in Pythonista 2 beta 201005 it hangs and crashes, but when opening the app again it's still on the same thing making it impossible to use Pythonista 2 beta.The script in question I've uploaded to a gist because the forum said it made the post too long....
https://gist.github.com/Tkizzy/09117750cb44595e2b41
CAUTION: RUNNING THE ABOVE SCRIPT IN PYTHONISTA WILL MAKE IT HANG, SO DO NOT DO THIS IN A PRODUCTION ENVIRONMENT OF ANY SORT MAY LEAD TO DATA LOSS======================================================
ENTIRELY SEPARATE BUG:Fairly often with the latest Pythonista 2 beta 201005 After running a script the keyboard changes as such, sometimes with ALL the keys blacked out. Generally hiding/unhiding the keyboard then pressing keys seems to fix it:
-
The fix for being able to use Pythonista 2 beta again is as follows.
1.open Pythonista 3 beta.
2.navigate to the folder with the script causing this.
3.delete it.Now Pythonista 2 opens. Yay for Pythonista 3 beta and shared app folders.
-
commenting out the below huge dict changes the behavior slightly. It will still hang, but after crashing you'll be able to use pythonista again. Also the "loading file" progress bar of pythonista is not in the middle with this commented out.
self.andTweetsStaticDict = { u'DarrellIssa': ([u"Judge gets it right. Can't force Apple to undermine users' privacy https://t.co/4uaV6n1k2A", u'Unlocking the iPhone would set a dangerous precedent for our right to privacy. Check out my op-ed in WIRED https://t.co/N35fzaw8LX', u'Remember that slippery slope everyone warned about if the FBI forced Apple to unlock the iPhone? https://t.co/pVMeDr2vIe #TechTuesday', u"RT @RepZoeLofgren: Gov't backdoor access to iPhone would undo years of progress in online security. Read my op-ed w/@DarrellIssa here: http\u2026", u"Judge gets it right. Can't force Apple to undermine users' privacy https://t.co/4uaV6n1k2A", u'Unlocking the iPhone would set a dangerous precedent for our right to privacy. Check out my op-ed in WIRED https://t.co/N35fzaw8LX', u'RT @WIRED: Opinion: Forcing Apple to hack that iPhone sets a dangerous precedent https://t.co/4IURimSBSF', u'Remember that slippery slope everyone warned about if the FBI forced Apple to unlock the iPhone? https://t.co/pVMeDr2vIe #TechTuesday'], u'http://pbs.twimg.com/profile_images/454338555456663552/phM7MZu5_normal.jpeg'), u'RepMikeHonda': ([u'"We do not want to make a mistake as nation who believes in the rule of law." to the @FBI Director about the #Apple case.'], u'http://pbs.twimg.com/profile_images/699984788933976065/JM9bUwRn_normal.jpg'), u'RepMimiWalters': ([u"About to go live on @KNX1070 to discuss today's @HouseJudiciary hearing on #Apple & the #FBI. Tune in! #AppleVsFBI https://t.co/vLGt6Z1Fpx", u"Tune into today's @HouseJudiciary hearing on encryption featuring the #FBI & #Apple starting @1PM. Watch live here: https://t.co/c8G6XkPA49", u'About to speak on @FoxNews on the debate between #Apple and the #FBI. Tune in! #AppleVsFBI https://t.co/5brNeT0cFm'], u'http://pbs.twimg.com/profile_images/568467816089546752/n3BHuNVi_normal.jpeg'), u'RepAnnaEshoo': ([u'ICYMI: My statement on the Apple court order. https://t.co/ssLWV4s9bV', u'My statement on the Apple court order: https://t.co/ssLWV4s9bV'], u'http://pbs.twimg.com/profile_images/621705739485233152/XOBUJmeN_normal.jpg'), u'RepBarbaraLee': ([u"RT @RepZoeLofgren: Gov't backdoor access to iPhone would undo years of progress in online security. Read my op-ed w/@DarrellIssa here: http\u2026"], u'http://pbs.twimg.com/profile_images/430378206353317888/3QKYak-Z_normal.jpeg'), u'RepTedLieu': ([u"RT @tedlieu: I commend court's rejection of #FBI & #DOJ in NY case where govt is compelling #Apple to take extraordinary actions. https://t\u2026", u'RT @tedlieu: Hack of #IRS records shows why weakening encryption hurts our national security, US businesses & YOU. #FBI #Apple https://t.co\u2026', u"My statement on #Apple's motion to vacate >> https://t.co/z6DVHWV3ax #APPLEvsFBI #Encryption #Privacy #Apple", u'ICYMI: My interview w/ @questCNN @richardquest on #APPLEvsFBI #Encryption #Privacy https://t.co/fXSRmuE1LT #Apple https://t.co/UbznFCpSDM', u"ICYMI: My interview w/ @CNBC @squawk on #AppleVsFBI #Encryption #Privacy. Here's why I agree w/ #Apple in this case: https://t.co/Ry5zjKhcRM", u'LIVE with @CNBC @SquawkStreet talking about #AppleVsFBI #Privacy #Encryption #Apple https://t.co/k34Y040DQp', u"RT @dnvolz: .@RepTedLieu to Comey: Don't use a law passed 87 years before invention of phone to force Apple to unlock iPhone https://t.co/a\u2026", u'RT @dnvolz: Scoop: @RepTedLieu sends letter to FBI Director Comey telling him to withdraw demand against Apple in unlocking case https://t.\u2026', u'Democratic lawmaker Ted Lieu asks FBI director to withdraw Apple unlocking case https://t.co/0Y1L7HznVT via @Reuters @RepTedLieu #AppleVsFBI'], u'http://pbs.twimg.com/profile_images/568758808978022400/2pH8o48y_normal.jpeg'), u'RepZoeLofgren': ([u"Gov't backdoor access to iPhone would undo years of progress in online security. Read my op-ed w/@DarrellIssa here: https://t.co/wMXYvNiRvE", u"Gov't backdoor access to iPhone would undo years of progress in online security. Read my op-ed w/@DarrellIssa here: https://t.co/wMXYvNiRvE"], u'http://pbs.twimg.com/profile_images/510125443094024192/eVbv3QDN_normal.jpeg') }
-
..AAAAAND update: Commenting out the 2nd SUPER LARGE DICT gets rid of the problem entirely.
The forum won't let me post it here because it's too large. but it's the second one in the gist called
self.candidateStaticDict
Which begs the question: what is the issue here? Is the dict just too big to store in code in python? Is it formatted incorrectly somehow? Something having to do with encoding?
-
Pythonista doesn't like long lines, presumably because of all the line-wrapping that has to be done. Opening files with very long lines will cause the app to hang and eventually crash, as you described. If you need to open Pythonista without loading any previously open editor files, enter the URL pythonista:// or pythonista3:// into the Safari address bar.
-
@dgelessus thanks for the url tip for things like this.
About the line wrapping - thing is just commenting out the dicts stops the hanging. The lines being wrapped are still just as long, they're just commented out, so I'm not sure what that means and/or if there's another reason for the hanging.
-
Syntax-highlighting, probably. A comment is easy - everything between
#
and end of line gets "comment formatting". With an uncommenteddict
containing many string and number literals, the syntax highligher has a lot more work to do. Compare a regex for comments (#.*
) with one for (double-quoted) string literals ("(?:[^\\"]|\\.)*"
).