[New-bugs-announce] [issue8487] os.mknod() fails on NFS mounted directories

Nikolaus Rath report at bugs.python.org
Wed Apr 21 17:57:19 CEST 2010


New submission from Nikolaus Rath <Nikolaus at rath.org>:

$ cat test.py
#!/usr/bin/env python
import os
import stat
dbfile = './testfile.test'
with open(dbfile, 'w') as fh:
    print('Opened file for writing')
os.unlink(dbfile)
os.mknod(dbfile, stat.S_IRUSR | stat.S_IWUSR | stat.S_IFREG)
print('Mknod\'ed file')

[cliff at ih ~]$ cd tmp              <-- nfs mounted on a 64bit Fedora box
[cliff at ih tmp]$ ~/tmp/test.py
Opened file for writing
Traceback (most recent call last):
  File "/home/cliff/tmp/test.py", line 9, in <module>
    os.mknod(dbfile, stat.S_IRUSR | stat.S_IWUSR | stat.S_IFREG)
OSError: [Errno 2] No such file or directory

[cliff at ih tmp]$ cd /tmp           <-- locally mounted on a HD
[cliff at ih tmp]$ ~/tmp/test.py
Opened file for writing
Mknod'ed file


I think the mknod() call really shouldn't fail if it tries to create an ordinary file that can be created with open() with problems.

----------
components: IO
messages: 103860
nosy: Nikratio
severity: normal
status: open
title: os.mknod() fails on NFS mounted directories
type: behavior
versions: Python 2.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8487>
_______________________________________


More information about the New-bugs-announce mailing list