2012-11-12 84 views
0

我想加入一个plf路径来建立位置使用下面的代码,但我注意到plf名称被覆盖的构建位置,请参阅下面的详细信息,我是什么在这里失踪?os.path.join给出不正确的结果

rPlf = os.path.join(buildLocation,'au_connect_build.plf') 
    print rPlf 
    print rPlf 

实际输出: -

rPlf 
\au_connect_build.plfNTEGRATION\M1234BAAAANAA120080.1 

预期输出: -

\\Location\builds435\INTEGRATION\M1234BAAAANAA120080.1\au_connect_build.plf 

回答

1

buildLocation包含\r字符 - 运行print repr(rPlf),你会看到发生了什么。您可以通过以下方式解决该问题:

buildLocation = buildLocation.strip('\r')