This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: try to open /dev/null as directory
Type: Stage:
Components: Interpreter Core Versions: Python 2.4
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, georg.brandl, isandler, robang
Priority: normal Keywords:

Created on 2005-04-15 08:56 by robang, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (5)
msg25015 - (view) Author: Roberto A. Foglietta (robang) Date: 2005-04-15 08:56
bash-2.05b# strace python 2>&1 | grep open | grep null
open("/dev/null", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = -1
ENOTDIR (Not a directory) 
msg25016 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2005-04-16 07:54
Logged In: YES 
user_id=849994

I don't quite understand what you're trying to tell us here.

Are you just calling Python this way and observing the
system calls? Then, what system do you use? What version?
What kernel, etc.
msg25017 - (view) Author: Roberto A. Foglietta (robang) Date: 2005-04-20 18:02
Logged In: YES 
user_id=36141

I downloaded the python-2.4.1 sources and compiled under
slack 10 and Mandrake 10.1 and in both case it tried to open
/dev/null as a directory.
Some debian users reported me the same behaviure.

[roberto@wsraf roberto]$ uname -ar
Linux wsraf.sad.it 2.6.8.1-24mdksmp #1 SMP Thu Jan 13
23:11:43 MST 2005 i686 Intel(R) Pentium(R) 4 CPU 2.80GHz
unknown GNU/Linux

msg25018 - (view) Author: Ilya Sandler (isandler) Date: 2005-05-17 05:02
Logged In: YES 
user_id=971153


2 questions though:

1. Does this cause any problems?

2. I observe exactly the same behaviour for ls! (I'm on
Debian, kernel 2.4.25)


 bagira:~> strace ls | & grep open | grep null
 open("/dev/null", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = -1        
    ENOTDIR (Not a directory)

 and for du:

  bagira:~> strace du /etc | & grep open |grep null
  open("/dev/null", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = -1
ENOTDIR (Not a directory)

So, I'm almost ready to say that even if it's a bug, it's
not a python's bug... (Search for /dev/null in python source
also does not find anything interesting)..


msg25019 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2005-06-05 12:49
Logged In: YES 
user_id=1188172

I think this isn't Python's fault, as isandler's post shows.
I would rather look for a bug in the C lib.
History
Date User Action Args
2022-04-11 14:56:10adminsetgithub: 41859
2005-04-15 08:56:31robangcreate