]> git.lyx.org Git - lyx.git/blobdiff - lib/scripts/tex_copy.py
Create Chapter 6 Bullets in Additional.lyx and move the bullet section into it; this...
[lyx.git] / lib / scripts / tex_copy.py
index 42ac7a7c4bb7b78294d8f1d1e827523ae4b2d419..529b13e7d0e46401bf992c399d6db441f31e28a0 100644 (file)
@@ -13,7 +13,7 @@
 # tex_copy.py <from file> <to file> <latex name>
 
 # This script will copy a file <from file> to <to file>.
-# <to file> is no exact copy of <from file>, but any occurence of <basename>
+# <to file> is no exact copy of <from file>, but any occurrence of <basename>
 # where <basename> is <from file> without directory and extension parts is
 # replaced by <latex name> without extension.
 
@@ -46,12 +46,15 @@ def main(argv):
         error("%s is no absolute file name.\n%s"\
               % abs_to_file, usage(argv[0]))
     to_dir, rel_to_file = os.path.split(abs_to_file)
-    to_base, to_ext = os.path.splitext(rel_to_file)
 
     # latex file name
     latex_file = argv[3]
     latex_base, latex_ext = os.path.splitext(latex_file)
 
+    # convert strings to bytes since we are using binary files
+    from_base = from_base.encode()
+    latex_base = latex_base.encode()
+
     # Read the input file and write the output file
     if(not os.path.isfile(abs_from_file)):
          error("%s is not a valid file.\n" % abs_from_file)