Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #1642 (closed defect: wontfix)

Opened 11 years ago

Last modified 11 years ago

tg2 quickstart fails on Windows when pyDNS installed

Reported by: khorn Owned by: khorn
Priority: normal Milestone: 2.0
Component: TurboGears Version: trunk
Severity: normal Keywords:
Cc:

Description

This isn't directly a TurboGears issue, but I thought I'd document it here.

when running "paster quickstart your-project-name" I got the following traceback:

d:\python24\lib\site-packages\DNS\__init__.py:13: DeprecationWarning: Non-ASCII character '\xf6' in file d:\python24\lib\site-packages\DNS\Type.py on line 67, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details
  import Type,Opcode,Status,Class
d:\python24\lib\site-packages\DNS\__init__.py:15: DeprecationWarning: Non-ASCII character '\xf6' in file d:\python24\lib\site-packages\DNS\Lib.py on line 672, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details
  from Lib import DnsResult
Traceback (most recent call last):
  File "D:\Python24\Scripts\paster-script.py", line 7, in ?
    sys.exit(
  File "d:\python24\lib\site-packages\PasteScript-1.3.6-py2.4.egg\paste\script\command.py", line 77, in run
    command = commands[command_name].load()
  File "D:\Python24\lib\site-packages\setuptools-0.6c3-py2.4.egg\pkg_resources.py", line 1830, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "c:\documents and settings\funsize\desktop\tg2\tg\__init__.py", line 40, in ?
    from tg.controllers import TurboGearsController, redirect
  File "c:\documents and settings\funsize\desktop\tg2\tg\controllers.py", line 2, in ?
    from pylons.controllers import ObjectDispatchController, DecoratedController

  File "c:\documents and settings\funsize\desktop\pylons\pylons\__init__.py", line 4, in ?
    from pylons.config import config
  File "c:\documents and settings\funsize\desktop\pylons\pylons\config.py", line 2, in ?
    from pylons.configuration import *
  File "c:\documents and settings\funsize\desktop\pylons\pylons\configuration.py", line 16, in ?
    import pylons.legacy
  File "c:\documents and settings\funsize\desktop\pylons\pylons\legacy.py", line 10, in ?
    import pylons.decorators
  File "c:\documents and settings\funsize\desktop\pylons\pylons\decorators\__init__.py", line 6, in ?
    import formencode
  File "d:\python24\lib\site-packages\FormEncode-0.7.1-py2.4.egg\formencode\__init__.py", line 6, in ?
    import validators
  File "d:\python24\lib\site-packages\FormEncode-0.7.1-py2.4.egg\formencode\validators.py", line 45, in ?
    DNS.ParseResolvConf()
  File "D:\Python24\Lib\site-packages\DNS\Base.py", line 26, in ParseResolvConf
    lines=open(resolv_path).readlines()
IOError: [Errno 2] No such file or directory: '/etc/resolv.conf'

Looks like FormEncode calls a function in pyDNS that assumes it's on a Unixy platform (it expects the file "/etc/resolve.conf"). Obviously this breaks on Win32. The workaround I used was to rename "site-packages/DNS" temporarily.

pyDNS version 2.3.0

FormEncode version 0.7.1

TG2 [3851]

Change History

comment:1 follow-up: ↓ 2 Changed 11 years ago by mramm

Has this been logged as a bug in pyDNS? That seems like the right thing to do.

comment:2 in reply to: ↑ 1 Changed 11 years ago by khorn

Replying to mramm:

Has this been logged as a bug in pyDNS? That seems like the right thing to do.

Actually, after some more investigation, it looks more like a bug in FormEncode.

in formencode/validators.py, line 45 is:

DNS.ParseResolvConf()

This function parses '/etc/resolv.conf', which fails to exist on Windows.

The function that probably should be called is the next one down in DNS/Base.py, which is DiscoverNameServers?(), which uses the win32 api if available, or ParseResolveConf?() if not.

If I change line 45 in formencode/validators.py to:

DNS.DiscoverNameServers()

then all is well.

So really I think that FormEncode is to blame here.

So I guess I really need to report this to Ian B/Formencode ppl, which I will get around to eventually.

PyDNS does appear to have another bug in it, though, as pointed out to me by Andrew Basson, so I guess I need to tell them about that one, too.

comment:3 Changed 11 years ago by khorn

  • Owner changed from anonymous to khorn
  • Status changed from new to assigned

There appears to have been a similar issue on the mailing list (1), but I can't seem to get a copy of the "attached fix", so I'm not sure if it's the same issue.

(1)  http://webwareforpython.org/archives/message/20070619.091437.2c0291fb.en.html

...after checking out FormEncode's SVN, this appears to have been the same issue...

...after looking in site-packages, it appears that I'm using a somewhat outdated version of FormEncode...

...users who are using FormEncode 0.9 (which is the current version as of this writing) should not have this issue, as the fix is applied...

guess I'll close this ticket now :)

comment:4 Changed 11 years ago by khorn

  • Status changed from assigned to closed
  • Resolution set to wontfix

comment:5 Changed 11 years ago by khorn

  • Status changed from closed to reopened
  • Resolution wontfix deleted

on second though, reopening, since we may want to require a version of FormEncode that has this fix applied in EGG-INFO/requires.txt

comment:6 Changed 11 years ago by mramm

For TG2, the right way to fix this would be to update the FormEncode requirement in Pylons. That will fix the issue in both TG2 and pylons.

comment:7 Changed 11 years ago by mramm

  • Status changed from reopened to closed
  • Resolution set to wontfix
Note: See TracTickets for help on using tickets.