Python and /etc/resolv.conf changes

Jesse Keating jkeating at redhat.com
Tue Jan 20 23:48:30 UTC 2009


I'm looking at what might be a bug in python.  The anaconda installer
launches python, then we get network configs going and write out some
files such as /etc/resolv.conf.  However that original python process
can't seem to resolve anything after this file has been written out,
whereas new python processes started on a different terminal can indeed
use the new /etc/resolv.conf data.

My thought is that the original python process is using stale
information, and that something like a res_init() is needed, but google
doesn't seem to have any real connection between python and calling
res_init.  The guys in #python on freenode aren't exactly sure what to
do here either.

In fact, I just did a simple test of an strace on python, where I import
socket, do a lookup, modify /etc/resolv.conf, do more lookups and review
the results.  Strace shows that python opens /etc/resolv.conf exactly
once (after I've imported socket), and never again, so it never sees any
of the changes made.

Can anybody confirm what I'm seeing as buggy and in need of fixing?

-- 
Jesse Keating
Fedora -- Freedom² is a feature!
identi.ca: http://identi.ca/jkeating
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <http://listman.redhat.com/archives/fedora-devel-list/attachments/20090120/bfcd997e/attachment.sig>


More information about the fedora-devel-list mailing list