[Python-Dev] os.defpath for Windows

2008-12-21 Thread Yinon Ehrlich

Hi,

just saw that os.defpath for Windows is defined as
Lib/ntpath.py:30:defpath = '.;C:\\bin'

Most Windows machines I saw has no c:\bin directory.

Any reason why it was defined this way ?
Thanks,
Yinon
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] patch suggestion for webbrowser

2009-01-01 Thread Yinon Ehrlich

Hi,

enclosed a patch for webbrowser which will find applications/batch files 
ending with .com or .cmd too.

Yinon

Index: Lib/webbrowser.py
===
--- Lib/webbrowser.py(revision 68118)
+++ Lib/webbrowser.py(working copy)
@@ -103,10 +103,11 @@

if sys.platform[:3] == "win":
def _isexecutable(cmd):
+win_exts = (".exe", ".com", ".bat", ".cmd")
cmd = cmd.lower()
-if os.path.isfile(cmd) and cmd.endswith((".exe", ".bat")):
+if os.path.isfile(cmd) and cmd.endswith(win_exts):
return True
-for ext in ".exe", ".bat":
+for ext in win_exts:
if os.path.isfile(cmd + ext):
return True
return False

___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com