On Oct 4, 2010, at 11:26 AM, jeff2 wrote:
> File "C:\Python25\lib\urllib2.py", line 1134, in unknown_open
> raise URLError('unknown url type: %s' % type)
> urllib2.URLError: <urlopen error unknown url type: c>
urllib.urlopen does not work on Windows with absolute paths unless the path is
prefixed with 'file:path/to/something.png'
I fixed this problem in Cascadenik a while back but I assume this got lost in
recent refactoring.
The fix was part of:
http://code.google.com/p/mapnik-utils/source/detail?r=900
and was basically:
+ if os.path.exists(src): # local file
+ # using 'file:' enables support on win32
+ # for opening local files with urllib.urlopen
+ # Note: this must only be used with abs paths to local files
+ # otherwise urllib will think they are absolute,
+ # therefore in the future it will likely be
+ # wiser to just open local files with open()
+ if os.path.isabs(src) and sys.platform == "win32":
+ src = 'file:%s' % src
So, basically Jeff, my guess is that Cascadenik HEAD is currently not
compatible with windows, but it should be a fairly easy fix.
Dane
_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users