report: 0.15 selftest result of Slackware Linux

John Arbash Meinel john at arbash-meinel.com
Tue Apr 3 20:46:21 BST 2007


Alexander Belchenko wrote:
> Python 2.4 @ Slackware Linux 10.2.
> 
> Selftest running from sources. I ran selftest twice to reduce
> spurious failings.
> I don't know is this failed tests say something important.
> Just FYI.
> 
> 


...

> ^^^^[log from bzrlib.tests.test_lockdir.TestLockDir.test_lock_permission]-----
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "/tmp/bzr/bzr-0.15/bzrlib/tests/test_lockdir.py", line 614, in test_lock_permission
>     self.assertRaises(errors.PermissionDenied, ld1.attempt_lock)
>   File "/tmp/bzr/bzr-0.15/bzrlib/tests/__init__.py", line 814, in assertRaises
>     raise self.failureException, "%s not raised" % excName
> AssertionError: PermissionDenied not raised


This is little disconcerting. I'm assuming we are expecting
"Transport.rename('dir', 'existing')" to raise PermissionDenied when the
target exists. At least for the case when both the source and the target
are directories containing data.

Can you try doing:

import os
os.mkdir('a')
open('a/file', 'wb').write('foo\n')
os.mkdir('b')
open('b/file2', 'wb').write('bar\n')

os.rename('b', 'a')

Here I get:
OSError: [Errno 66] Directory not empty
where 66 == ENOTEMPTY

It sounds like 'os.rename()' is succeeding. And I'm curious why. (Is it
renaming b => a/b?)

> 
> ======================================================================
> FAIL: test_readonly_file (bzrlib.tests.per_lock.test_lock.TestLock)
> 
> vvvv[log from bzrlib.tests.per_lock.test_lock.TestLock.test_readonly_file(fcntl)]
> 
> ^^^^[log from bzrlib.tests.per_lock.test_lock.TestLock.test_readonly_file(fcntl)]
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "/tmp/bzr/bzr-0.15/bzrlib/tests/per_lock/test_lock.py", line 67, in test_readonly_file
>     self.assertRaises(IOError, open, 'a-file', 'rb+')
>   File "/tmp/bzr/bzr-0.15/bzrlib/tests/__init__.py", line 814, in assertRaises
>     raise self.failureException, "%s not raised" % excName
> AssertionError: IOError not raised
> 
> ----------------------------------------------------------------------
> Ran 5696 tests in 2318.444s
> 
> FAILED (failures=2)
> 586 tests skipped

Again, something weird is happening. In the set-up for this code, I do:

import os
f = open('file', 'wb')
f.write('foo\n')
f.close()
os.chmod('file', 0444)

f2 = open('file', 'rb+')

IOError: [Errno 13] Permission denied: 'file'


Now, I would expect 'rb+' (read+write, binary mode) to fail. Because we
shouldn't be able to open a 0444 (r--r--r--) file for writing.
Now maybe the os has opened it up for only reading, and if we tried to
write to the file it would fail.

Can you try the above and see what happens? If the f2 = open() succeeds,
can you try f2.read(), and f2.write() to see if that fails?

Thanks,
John
=:->



More information about the bazaar mailing list