Forum Archive

Pythonista 3.2 Bug Report.

wolf71

Upgrade to V3.2.

On iPad Pro 9.7 (iOS V11.2.1). When start app. this error message show on console:

Traceback (most recent call last):
  File "/var/containers/Bundle/Application/A44685BD-F481-4B46-A86F-DF888CAC5D0D/Pythonista3.app/Frameworks/Py3Kit.framework/pykit_startup.py", line 51, in <module>
    main()
  File "/var/containers/Bundle/Application/A44685BD-F481-4B46-A86F-DF888CAC5D0D/Pythonista3.app/Frameworks/Py3Kit.framework/pykit_startup.py", line 47, in main
    import importcompletion
  File "/var/containers/Bundle/Application/A44685BD-F481-4B46-A86F-DF888CAC5D0D/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/importcompletion.py", line 26, in <module>
    import imp
  File "/var/containers/Bundle/Application/A44685BD-F481-4B46-A86F-DF888CAC5D0D/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/imp.py", line 28, in <module>
    import tokenize
  File "/var/containers/Bundle/Application/A44685BD-F481-4B46-A86F-DF888CAC5D0D/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/tokenize.py", line 34, in <module>
    import re
  File "/var/containers/Bundle/Application/A44685BD-F481-4B46-A86F-DF888CAC5D0D/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/re.py", line 143, in <module>
    class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'

And when console run: import re, the pythonista crash.

dgelessus

Can you look in your site-packages and site-packages-3 folders and check if there is a file enum.py or a folder enum? If there is one, try deleting it, then restart Pythonista.

This happens sometimes when installing modules with Stash pip. Stash runs on Python 2, and sometimes it installs compatibility modules that only work correctly in Python 2.

Also, thanks for telling me about the new version :) I have the beta installed right now, which means I don't see normal App Store updates for Pythonista.

wolf71

thanks.

Del the enum folder,and restart, all ok.

ccc

Where are 3.2 release notes on web? http://omz-software.com/pythonista/docs/ios/new.html are 3.0 release notes.

cvp

@ccc In the app, console, ?

Sorry, I didn't see the "on web" part of your question...mea culpa

cvp

@omz In the sample here-after, the ButtonItem color does not change if it's title is not changed, and that was correct in previous version of Pythonista.
```
import ui

class my_view(ui.View):
def init(self,w,h):
self.width = w
self.height = h
self.name = 'test'

    ok = ui.ButtonItem()
    ok.title = 'green'
    ok.tint_color = 'red'
    ok.action = self.ok_action
    self.right_button_items = [ok]

def ok_action(self,sender):
    #sender.title = 'red'
    sender.tint_color = 'green'

def main():
w, h = (540,620)
back = my_view(w,h)
back.present('sheet')

if name == 'main':
main()```

cvp

@omz Do I need to put this post in another topic? I wrote it here because the topic title was general

omz

@ccc I didn’t get to update the online docs yet, will happen soon.

@cvp It‘s fine either way. You can also report bugs on GitHub btw: https://github.com/omz/Pythonista-Issues/