View Issue Details

IDProjectCategoryView StatusLast Update
0000563Other Unix PortBugpublic2022-05-14 07:14
ReporterSteven Levine Assigned Topsmedley  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionwon't fix 
PlatformeCS/OS2OSeComstation or OS/2OS Version1.x 2.x or 4.5
Summary0000563: hg import fails with abort: error: file not on local host
DescriptionThe command

  hg import ./remove_include_dir

where remove_include_dir is a file fails with the error

  abort: error: file not on local host

This occurs because the drive letter confuses the url parsing code urllib2.py. The attached patch to open_local_file() resolves this issue. Long term, the patch should be implemented to splithost() in urllib.py so that all calls to get_host() and get_selector() return valid values.
TagsNo tags attached.
Attached Files
urllib2.py.diff (640 bytes)   
--- D:\usr\python27\lib\.saved\urllib2-20120430-0217.py	2012-04-30 02:17:12.000000000 -0700
+++ D:\usr\python27\lib\urllib2.py	2013-02-06 23:17:14.000000000 -0800
@@ -1327,6 +1327,13 @@
         import mimetypes
         host = req.get_host()
         filename = req.get_selector()
+
+        # 2013-02-06 SHL FIXME to be done in splithost() in urllib.py
+        # YD hack: add again drive name
+        if os.name == 'os2' and len(host)>1 and host[1] == ':':
+            filename = host + filename
+            host = ""
+
         localfile = url2pathname(filename)
         try:
             stats = os.stat(localfile)
urllib2.py.diff (640 bytes)   

Activities

psmedley

2022-05-14 07:14

administrator   ~0004293

I no longer maintain this port.

Issue History

Date Modified Username Field Change
2013-02-07 07:38 Steven Levine New Issue
2013-02-07 07:38 Steven Levine File Added: urllib2.py.diff
2022-05-14 07:14 psmedley Assigned To => psmedley
2022-05-14 07:14 psmedley Status new => resolved
2022-05-14 07:14 psmedley Resolution open => won't fix
2022-05-14 07:14 psmedley Note Added: 0004293
2022-05-14 07:14 psmedley Status resolved => closed