Tuesday, April 7, 2015

Tuesday doin's

Ubuntu #4

Referring to the last couple of posts, this was the issue where the locale-aware sort no longer sorted uppercase-initial words apart from lowercase-initial ones. I'd accepted that this was how it would be. But at the end of the day yesterday the natsort maintainer popped up with a new feature to fix it! This morning I tried it, and by golly, it works! So that's fixed. Thanks, Seth!

Windows #2

This was that Wing IDE didn't find the Python 3 interpreter. Well, after a reboot, it did. So lesson learned: when anything strange happens in Windows, reboot it! Seems to be the case in Win 7 just like in the old days. So that's fixed.

Another oddity was that Wing claimed its settings (including an error log) were to be found in C:\Users\Administrator\AppData\something (yes, I am running as the Admin even though I know I shouldn't). But when I opened a Windows Explorer (file browser) and tried to navigate to that, it didn't seem to be there. But if I clicked in the address bar and typed in the \Appdata part, there it was. So who knows. Anyway that mystery is kind of solved; I can now get to the Wing error log should I ever want to again.

Pyinstaller #1

This is the problem where a PyInstaller bundle dies looking for "orig-prefix.txt" which should only exist in a venv and is irrelevant to a bundled app. After my longer note to the list, one of the maintainers pointed out there is a hook, hook-site, which is supposed to fix exactly this. Oh! A hook! There are issues with hooks in the Python3 branch of PyInstaller (much of which I wrote last year) so I dived into it expecting to find either some problem with my code, or else a hook that needed updating to use the Python3 facility.

Good news: not a problem with my code, which is just fine and working perfectly for another hook that does a similar task. Bad news: the code the hook-site.py code uses ought to work, also, but doesn't.

The issue is detecting when a virtual environment is in effect. The test it is using is sys.prefix!=sys.base_prefix, and that is exactly what the Python3 doc says to do. But for some reason, in my installation, first, sys.prefix==sys.base_prefix and both point to the virtualized Python, and second, there is a sys.real_prefix which has the correct not-virtual prefix. However, that sys variable is not supposed to exist in Python3 at all! It was a Python2.x thing. The hook code tests to see, am I in Python2 or 3? If 2, it tests sys.real_prefix, if 3, sys.prefix. So I don't know what is supposed to be happening here. I kludged the hook code so it worked, but not in a way I would want to expose to a pull request against PyInstaller.

But with that, the bundled PPQT2 started up...

Pyinstaller #2

...and immediately died with "failed to start because it could not find or load the Qt platform plugin 'xcb'." So there is something new to diagnose. Qt fucking platform modules are the bane of my existence.

To Review...

So I started this silly thing of numbering my problems. Let's review them and see where we stand.

  • Nuitka #1, couldn't import sortedcontainers. Fixed by Kay.
  • Nuitka #2, can't copy qliboffscreen.dll; Kay acknowledged my debugging trace and said he'd look at it tomorrow. Pending.
  • Ubuntu #1, PyQt5 couldn't install; fixed by repairing broken symlinks to libGL.
  • Ubuntu #2, horrible graphic mess on launch, fixed by forcing QApplication to use something other than the default GTK. Kind of a hack but I'm not going to worry about it.
  • Ubuntu #3, PPQT error initializing fonts, a one-line coding error. Fixed.
  • Ubuntu #4, word sorting of initial caps, fixed by natsort maintainer.
  • Ubuntu #5, spellcheck not working, went away by itself.
  • Mac OS #1, 69MB zipped bundle. It is what it is, but possibly a Nuitka bundle would be smaller.
  • Pyinstaller #2, Qt plugin not found. Open.

So there's just two open problems, the Qt plugin on Ubuntu and getting Nuitka to bundled on Mac OS. And to complete the Win7 installation process and begin testing there.

No comments: