#1470 closed defect

tahoe.cfg with UTF-8 BOM should be accepted — at Initial Version

Reported by: davidsarah Owned by: somebody
Priority: major Milestone: 1.9.2
Component: code Version: 1.8.2
Keywords: unicode config reviewed Cc:
Launchpad Bug:

Description

tahoe.cfg is supposed to be encoded in UTF-8. Most editors on Windows save UTF-8 files with an initial Byte Order Mark, but that causes an error on starting the node:

C:\tahoe\furry>bin\tahoe start
STARTING 'C:\Documents and Settings\David-Sarah\.tahoe'
Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\twisted-10.2.0-py2.7-win32.egg\twisted\application\app.py", li
ne 631, in run
    runApp(config)
  File "C:\Python27\lib\site-packages\twisted-10.2.0-py2.7-win32.egg\twisted\scripts\twistd.py", lin
e 23, in runApp
    _SomeApplicationRunner(config).run()
  File "C:\Python27\lib\site-packages\twisted-10.2.0-py2.7-win32.egg\twisted\application\app.py", li
ne 374, in run
    self.application = self.createOrGetApplication()
  File "C:\Python27\lib\site-packages\twisted-10.2.0-py2.7-win32.egg\twisted\application\app.py", li
ne 439, in createOrGetApplication
    application = getApplication(self.config, passphrase)
--- <exception caught here> ---
  File "C:\Python27\lib\site-packages\twisted-10.2.0-py2.7-win32.egg\twisted\application\app.py", li
ne 450, in getApplication
    application = service.loadApplication(filename, style, passphrase)
  File "C:\Python27\lib\site-packages\twisted-10.2.0-py2.7-win32.egg\twisted\application\service.py"
, line 400, in loadApplication
    application = sob.loadValueFromFile(filename, 'application', passphrase)
  File "C:\Python27\lib\site-packages\twisted-10.2.0-py2.7-win32.egg\twisted\persisted\sob.py", line
 210, in loadValueFromFile
    exec fileObj in d, d
  File "tahoe-client.tac", line 10, in <module>
    c = client.Client()
  File "c:\tahoe\furry\src\allmydata\client.py", line 133, in __init__
    node.Node.__init__(self, basedir)
  File "c:\tahoe\furry\src\allmydata\node.py", line 73, in __init__
    self.read_config()
  File "c:\tahoe\furry\src\allmydata\node.py", line 122, in read_config
    self.config.read([os.path.join(self.basedir, "tahoe.cfg")])
  File "C:\Python27\lib\ConfigParser.py", line 297, in read
    self._read(fp, filename)
  File "C:\Python27\lib\ConfigParser.py", line 504, in _read
    raise MissingSectionHeaderError(fpname, lineno, line)
ConfigParser.MissingSectionHeaderError: File contains no section headers.
file: C:\Documents and Settings\David-Sarah\.tahoe\tahoe.cfg, line: 1
'\xef\xbb\xbf# -*- mode: conf; coding: utf-8 -*-\n'

Failed to load application: File contains no section headers.
file: C:\Documents and Settings\David-Sarah\.tahoe\tahoe.cfg, line: 1
'\xef\xbb\xbf# -*- mode: conf; coding: utf-8 -*-\n'

This may also apply to other configuration files.

Change History (0)

Note: See TracTickets for help on using tickets.