Bug 114708 - Error installing extension with a space in the filename; installing in a folder with a space in the name fails too
Summary: Error installing extension with a space in the filename; installing in a fold...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Extensions (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 80959 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-12-27 04:30 UTC by Mark
Modified: 2019-01-06 12:55 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
sample extension (2.34 KB, application/vnd.openofficeorg.extension)
2017-12-27 07:17 UTC, Xisco Faulí
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mark 2017-12-27 04:30:26 UTC
Description:
If you attempt to install an extension with a space in the filename LibreOffice throws an error like this:

(com.sun.star.uno.RuntimeException) { { Message = "<class 'FileNotFoundError'>: [Errno 2] No such file or directory: '/home/mark/.config/libreoffice/4/user/uno_packages/cache/uno_packages/lu25024oiu60e.tmp_/LOC%20(1).oxt/loc.py', traceback follows\X000a  /usr/lib/libreoffice/program/pythonloader.py:94 in function getModuleFromUrl() [fileHandle = open( filename, encoding='utf_8' )]\X000a  /usr/lib/libreoffice/program/pythonloader.py:149 in function writeRegistryInfo() [mod = self.getModuleFromUrl( locationUrl )]\X000a\X000a", Context = (com.sun.star.uno.XInterface) @0 } }

The space in the filename is introduced by the user's browser when downloading an ectension and a previous version still exists in the download location. The workaround is to remove previous versions before downloading a new extension or to manually rename the file after downloading. The bracketed number is not a problem; it is specifically the space in the name which causes LibreOffice a problem.

The extension partially fails to install. It does not show up in the list of installed extensions but if you attempt to install an extension with the same version number it will say the extension is already installed and ask whether to replace it.

Steps to Reproduce:
1. Download any extension. Download it again (resulting in a name like "LOC (1).ext"
2. Try to install it.
3. LibreOffice throws an error.

Actual Results:  
Extension is partially installed. It doesn't appear in the list of installed extensions and cannot be used, but attempting to install a well-named extension with the same version number says the extension is already installed.

Expected Results:
Handle a filename with embedded spaces gracefully.


Reproducible: Always


User Profile Reset: Yes



Additional Info:
Either make it work, or explain it will not work and do not leave the extension in an inconsistent state.

Version: 5.1.6.2
Build ID: 1:5.1.6~rc2-0ubuntu1~xenial2
CPU Threads: 2; OS Version: Linux 4.10; UI Render: default; 
Locale: en-GB (en_GB.UTF-8); Calc: group

and
Version: 5.3.5.2
Build ID: 50d9bf2b0a79cdb85a3814b592608037a682059d
CPU threads: 4; OS: Linux (misparsed version); UI render: default; VCL: kde4; Layout Engine: new; 
Locale: en-GB (en_GB.UTF-8); Calc: group


User-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.71 Safari/537.36
Comment 1 Xisco Faulí 2017-12-27 07:16:29 UTC
Reproduced in

Version: 6.1.0.0.alpha0+
Build ID: 2bf1cc7372088ec31ac5f0fb60de57feda59d3b7
CPU threads: 4; OS: Linux 4.10; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group threaded

and

LibreOffice 3.3.0 
OOO330m19 (Build:6)
tag libreoffice-3.3.0.4
Comment 2 Xisco Faulí 2017-12-27 07:17:04 UTC
Created attachment 138675 [details]
sample extension
Comment 3 QA Administrators 2018-12-28 03:46:08 UTC Comment hidden (obsolete)
Comment 4 Rob Snelders 2019-01-06 10:23:37 UTC
*** Bug 80959 has been marked as a duplicate of this bug. ***
Comment 5 Rob Snelders 2019-01-06 10:28:00 UTC
I have looked at the issue. But if you use a space-bar in the name of a extension based on python then it breaks. But if you use a basic-based plugin then you can use a space-bar. For example the extension "MultiFormatSave" can be installed when it has a space-bar in the name.

I only tested this on Ubuntu 18.04.1 with LibreOffice 6.1.3.2. Maybe somebody else can test other system-configurations to make sure this is correct.