<html>
    <head>
      <base href="https://bugs.documentfoundation.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_UNCONFIRMED "
   title="UNCONFIRMED - Error installing extension with a space in the filename"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=114708">114708</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Error installing extension with a space in the filename
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>LibreOffice
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>5.3.5.2 release
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>UNCONFIRMED
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Extensions
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>libreoffice-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>mark@walkjivefly.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>