On Fri, Jun 26, 2015 at 08:13:05PM +0300, Guy Rutenberg wrote:

> Hi,
> 
> I've attached patches for two bugs I've encountered in the lyxpak script:
> 
> The first bug is related to how the common path prefix for the included
> files is calculated. If the common string prefix (the byte-by-byte prefix)
> of the included files is also a file, the script would get the wrong
> path-prefix and fail. The first patch fixes this issue.
> 
> The second bug is related to handling non-ascii filenames when exporting to
> zip file. Zip files created by Python's zipfile module by default store
> filenames as 8-bit cp-437 encoding. This is problematic when filenames use
> characters from any other encdoing. To solve this issue I explicitly pass a
> unicode object as 'arcname' which causes the zipfile module to store the
> file as utf-8 and set the approperiate flag bits for the file in the
> archive.
> 
> I've tested both patches in Linux, but I guess some testing on Windows is
> needed as well. There is one point which I expect trouble with is in the
> conversion to the unicode object. The lyx file itself is utf-8 so the
> conversion to unicode is straight-forward for any filename extracted from
> it. But the filename of the lyxfile is in the file-system encoding, which
> might differ, hence causing problems.

Thanks, I'll have a look.

-- 
Enrico

Reply via email to