[issue3840] test_urllib fails on cygwin

2008-09-11 Thread Hirokazu Yamamoto

Hirokazu Yamamoto <[EMAIL PROTECTED]> added the comment:

I cannot create patch now, but test_site error comes from same reason.
>test_support.TESTFN is /tmp/@test on cygwin

After I applied following adhok patch, test passed.

Index: Lib/test/test_site.py
===
--- Lib/test/test_site.py   (revision 66385)
+++ Lib/test/test_site.py   (working copy)
@@ -126,7 +126,7 @@
 class PthFile(object):
 """Helper class for handling testing of .pth files"""

-def __init__(self, filename_base=TESTFN, imported="time",
+def __init__(self, filename_base="@test", imported="time",
 good_dirname="__testdir__", bad_dirname="__bad"):
 """Initialize instance variables"""
 self.filename = filename_base + ".pth"

site.py's addpackage() is doing

fullname = os.path.join(sitedir, name)

and on my cygwin, this equals to

os.path.join(
"/home/WhiteRabbit/python-dev/trunk/lib/test",
"/tmp/@test.pth") #=> "/tmp/@test.pth"

probably this is not good. (I cannot figure out what site.py is doing
though)

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3840] test_urllib fails on cygwin

2008-09-11 Thread Hirokazu Yamamoto

New submission from Hirokazu Yamamoto <[EMAIL PROTECTED]>:

test_urllib's test_geturl fails with following messege.

test_urllib
test test_urllib failed -- Traceback (most recent call last):
  File "/home/WhiteRabbit/python-dev/trunk/Lib/test/test_urllib.py",
line 84, in
 test_geturl
self.assertEqual(self.returned_obj.geturl(), self.pathname)
AssertionError: 'file:///tmp/@test' != '/tmp/@test'

test_support.TESTFN is /tmp/@test on cygwin, and Lib/urllib.py(484,485)
specially cares about leading slash. 

if file[:1] == '/':
urlfile = 'file://' + file

If this is geturl()'s design, probably test should be changed like
attached patch.

--
components: Tests
files: test_urllib.patch
keywords: patch
messages: 73047
nosy: ocean-city
severity: normal
status: open
title: test_urllib fails on cygwin
versions: Python 2.5, Python 2.6, Python 3.0
Added file: http://bugs.python.org/file11468/test_urllib.patch

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com