OpenLP picks up macOS hidden files when loading plugins

Bug #1738047 reported by Raoul Snyman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenLP
Fix Committed
Low
Phill

Bug Description

macOS *loves* to litter the filesystem with hidden files which are somehow useful to it. Unfortunately this means that if a user moves OpenLP out of the Applications directory, macOS will create these silly ._* files, and then OpenLP chokes on them when trying to find its plugins.

To work around macOS's ridiculous behaviour, we simply need to make sure we exclude files starting with "._" when searching for plugins.

See the original bug report below:

Version: {'version': '2.4.6', 'full': '2.4.6', 'build': None}

--- Details of the Exception. ---

Hi,

I have a need to keep some applications on the USB sticlk, so I moved entire OpenLP folder from
/Volumes/Macintosh HD/Applications/
to
/Volumes/KINGSTONE64/Applications/

The trick above works fine to other applications like Evenote, Gimp, Nozbe, Google Earth, etc... while OpenLP won't start after that. Even OpenSong starts propelry after move to USB stick.

Thank you in advance for the correction, I would appreciate for the patch or woraround as soon as possible.

Best regards

--- Exception Traceback ---
Traceback (most recent call last):
  File "tokenize.py", line 392, in find_cookie
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb0 in position 37: invalid start byte

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "openlp-run.py", line 44, in <module>
  File "openlp/core/__init__.py", line 437, in main
  File "openlp/core/__init__.py", line 142, in run
  File "openlp/core/common/registry.py", line 137, in execute
  File "openlp/core/lib/pluginmanager.py", line 54, in bootstrap_initialise
  File "openlp/core/lib/pluginmanager.py", line 92, in find_plugins
  File "imp.py", line 302, in find_module
  File "tokenize.py", line 433, in detect_encoding
  File "tokenize.py", line 397, in find_cookie
  File "<string>", line None
SyntaxError: invalid or missing encoding declaration for '/Volumes/KINGSTONE64/Applications/OpenLP.app/Contents/MacOS/plugins/.___init__.py'

--- System information ---
Platforma: Darwin-16.7.0-x86_64-i386-64bit

--- Library Versions ---
Python: 3.4.6
Qt5: 5.6.2
PyQt5: 5.7.1
QtWebkit: 538.1
SQLAlchemy: 1.1.5
SQLAlchemy Migrate: -
BeautifulSoup: 4.4.1
lxml: 3.6.0
Chardet: 2.3.0
PyEnchant: 1.6.6
Mako: 1.0.6
pyICU: -
pyUNO bridge: -
VLC: -

Related branches

Phill (phill-ridout)
Changed in openlp:
assignee: nobody → Phill (phill-ridout)
status: New → In Progress
Tim Bentley (trb143)
Changed in openlp:
milestone: none → 2.9.1
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.