Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 55359 - Type Error while testing setup_network_pre() (actually with _edit_config
Summary: Type Error while testing setup_network_pre() (actually with _edit_config
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Release Media
Classification: Unclassified
Component: Installer (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Linux Installer
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-06-27 14:21 UTC by Preston Cody (RETIRED)
Modified: 2006-03-24 13:46 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Preston Cody (RETIRED) gentoo-dev 2004-06-27 14:21:56 UTC
I was trying to test the functions i could in the installtemplate and have come across a bug i can't figure out.  The actual error given is:
Traceback (most recent call last):
  File "pctest_GLI.py", line 57, in testTemplates
    template.setup_network_pre()
  File "/root/src/installer/installer/src/GLIInstallTemplate.py", line 212, in setup_network_pre
    self._edit_config("/etc/conf.d/net", "gateway", default_gateway)
  File "/root/src/installer/installer/src/GLIInstallTemplate.py", line 79, in _edit_config
    f = open(file_name)
TypeError: coercing to Unicode: need string or buffer, instance found

the string "/etc/conf.d/net" seems to be appearing as an instance instead of a string.  i'm not good enough at python to know what to do.

Reproducible: Always
Steps to Reproduce:
this is reproduced using my own test script and sample profile.
Comment 1 Eric Sammer (RETIRED) gentoo-dev 2004-07-17 09:29:26 UTC
This is a known issue. The core of the problem is that when the XML files are parsed, the string type is incorrect (unicode strings in python are different types than "normal" strings). This type mismatch will manifest all over the place. I haven't had a chance to properly evaluate the situation and decide if we should switch all string types or cast to the appropriate type. This gets into issues of I18N and the like which is important due to the wide range of languages spoken by Gentoo users.

I have to get a few things straightened out, but this is relatively simple to fix. Thanks for the catch, though!
Comment 2 Preston Cody (RETIRED) gentoo-dev 2004-08-09 21:22:26 UTC
esammer found this bug.  wasn't passing looking for self first.
Comment 3 Jeffrey Forman (RETIRED) gentoo-dev 2006-03-24 13:46:24 UTC
Moving to Release Media/Installer.