popen pipes fail when cwd is a UNC path

T

Tim Black

In my recent experience, popen os pipes always fail when cwd is a UNC
path. Can anyone shed any light on this? Although I've seen lots of
UNC path-related problems in this newsgroup, I've not been able to
find anything specifically about os pipes and UNC paths.

Here's a session dump that demonstrates what I'm talking about:

Python 2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 bit (Intel)]
on win32
Type "help", "copyright", "credits" or "license" for more information.1

As you can see, this last pipe fails. This only happens when cwd is a
UNC path. Please let me know if you have seen this, solved this, know
a nice workaround, etc. as I find this quite annoying.

Thanks,
Tim
 
M

Mark Hadfield

Tim said:
In my recent experience, popen os pipes always fail when cwd is a UNC
path. Can anyone shed any light on this? Although I've seen lots of
UNC path-related problems in this newsgroup, I've not been able to
find anything specifically about os pipes and UNC paths.

It's a problem with the Windows command interpreter (cmd.exe on the NT
family) which gets invoked by popen. To demonstrate this. try cd'ing to
a UNC path. You will get a message like

'\\foo\bar' is an invalid current directory path. UNC paths are not
supported.
 
S

Steve Christensen

It's a problem with the Windows command interpreter (cmd.exe on the NT
family) which gets invoked by popen. To demonstrate this. try cd'ing to
a UNC path. You will get a message like

'\\foo\bar' is an invalid current directory path. UNC paths are not
supported.

It won't be directly applicable to the original problem... But, you can
use 'pushd' on a UNC path. It will temporarily map the UNC path to a
drive letter. When you do a 'popd' it will unmap the drive letter.

-Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,999
Messages
2,570,243
Members
46,836
Latest member
login dogas

Latest Threads

Top