Author: laukpe
Date: Thu Sep 18 04:12:19 2008
New Revision: 755
Modified:
trunk/atest/testdata/standard_libraries/operating_system/path.html
trunk/src/robot/libraries/OperatingSystem.py
Log:
split_extension changed so that '.foo' -> ('.foo', '') and not
('', 'foo'). this has changed in py2.6, and it's better for us to use same
approach regardless the interpreter.
Modified: trunk/atest/testdata/standard_libraries/operating_system/path.html
==============================================================================
--- trunk/atest/testdata/standard_libraries/operating_system/path.html
(original)
+++ trunk/atest/testdata/standard_libraries/operating_system/path.html Thu
Sep 18 04:12:19 2008
@@ -89,7 +89,6 @@
<title>Robot Test Cases</title><link type="text/css"
href="resources/css/testdata.css" rel="stylesheet"></head>
-
<body>
@@ -4850,7 +4849,7 @@
- <td></td>
+ <td>.abc</td>
@@ -4858,7 +4857,7 @@
- <td align="undefined" valign="undefined">abc</td>
+ <td align="undefined" valign="undefined">\<br></td>
Modified: trunk/src/robot/libraries/OperatingSystem.py
==============================================================================
--- trunk/src/robot/libraries/OperatingSystem.py (original)
+++ trunk/src/robot/libraries/OperatingSystem.py Thu Sep 18 04:12:19 2008
@@ -959,7 +959,11 @@
- ${p3} = 'path/file' & ${e3} = ''
- ${p4} = 'p2/file' & ${e4} = 'ext'
"""
- base, ext = os.path.splitext(self.normalize_path(path))
+ path = self.normalize_path(path)
+ basename = os.path.basename(path)
+ if basename.startswith('.') and basename.count('.') == 1:
+ return path, ''
+ base, ext = os.path.splitext(path)
if ext.startswith('.'):
ext = ext[1:]
return base, ext