|
From: Jeffrey B. <jef...@ea...> - 2009-01-12 15:52:14
|
On Monday 12 January 2009 08:16:57 Michael Foord wrote:
> Jeffrey Barish wrote:
> > I write the repr of a tuple to my configuration file on exit. Usually, I
> > find "<tuple>" in my configuration file afterward, but occasionally the
> > quotation marks are missing. I have not been able to detect a pattern.
> > Any suggestions?
>
> Is it actually causing any problems?
When I subsequently read the value from the configuration file, I get a list
instead of a string. For example, when I write
('a', ['b'])
I expect to see
"('a', ['b'])"
in the configuration file. When I read that value, I get a string. I eval
the string to get the original tuple. Occasionally I find
('a', ['b'])
in the configuration file. When I read that value, I get
["('a'", "['b'])"]
When I eval that value, I get an error. It seems that I could circumvent the
problem by restoring the string when I get a list, but the unexpected
behavior is disturbing.
--
Jeffrey Barish
|