]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/AutoGen/UniClassObject.py
There is a limitation on WINDOWS OS for the length of entire file path can’t be large...
[mirror_edk2.git] / BaseTools / Source / Python / AutoGen / UniClassObject.py
index 7b1ce72ea7c0b64b902d15cf6c5ca0704d4dcfcd..e676ad6ec87302ef064d8997d7c00aea1e08a050 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials\r
 # are licensed and made available under the terms and conditions of the BSD License\r
 # which accompanies this distribution.  The full text of the license may be found at\r
 ##\r
 # Import Modules\r
 #\r
-import os, codecs, re\r
+import Common.LongFilePathOs as os, codecs, re\r
 import distutils.util\r
 import Common.EdkLogger as EdkLogger\r
 from Common.BuildToolError import *\r
 from Common.String import GetLineNo\r
 from Common.Misc import PathClass\r
-\r
+from Common.LongFilePathSupport import LongFilePath\r
 ##\r
 # Static definitions\r
 #\r
@@ -210,7 +210,7 @@ class UniFileClassObject(object):
         Lang = distutils.util.split_quoted((Line.split(u"//")[0]))\r
         if len(Lang) != 3:\r
             try:\r
-                FileIn = codecs.open(File.Path, mode='rb', encoding='utf-16').read()\r
+                FileIn = codecs.open(LongFilePath(File.Path), mode='rb', encoding='utf-16').read()\r
             except UnicodeError, X:\r
                 EdkLogger.error("build", FILE_READ_FAILURE, "File read failure: %s" % str(X), ExtraData=File);\r
             except:\r
@@ -292,7 +292,7 @@ class UniFileClassObject(object):
             EdkLogger.error("Unicode File Parser", FILE_NOT_FOUND, ExtraData=File.Path)\r
 \r
         try:\r
-            FileIn = codecs.open(File.Path, mode='rb', encoding='utf-16').readlines()\r
+            FileIn = codecs.open(LongFilePath(File.Path), mode='rb', encoding='utf-16').readlines()\r
         except UnicodeError, X:\r
             EdkLogger.error("build", FILE_READ_FAILURE, "File read failure: %s" % str(X), ExtraData=File.Path);\r
         except:\r