Config should preserve case of setting

Bug #1031355 reported by Curt Moore
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Dulwich
Triaged
Medium
Unassigned

Bug Description

When reading a config from a file, config.py currently performs a lower() operation on any setting keys read from the configuration file. In the event that the config file contains a camelCase configuration option, this option is lowercased. When the config is re-written to disk, the result is that we have two copies of the same config setting key, one camelCase and one lowercase.

The attached patch does not lowercase the settings keys upon reading them, resulting in only one config option being written to disk.

Revision history for this message
Curt Moore (jcmoore) wrote :
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

I'm not sure if this is the right fix - lookups should be case insensitive, that's why we lower case the setting.

Any chance you can add a unit test for this?

Changed in dulwich:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
milki (milki-p) wrote : Re: [Bug 1031355] Re: Config should preserve case of setting

On 14:24 Sun 16 Sep , Jelmer Vernooij wrote:
> I'm not sure if this is the right fix - lookups should be case
> insensitive, that's why we lower case the setting.

lookups should be case insensitive, but I believe the case should be
preserved in the file itself. That's why in my approach to config, I
explicitly had a key that contained the original case of the config in
'_name'

https://github.com/milki/dulwich/commit/2595eb32b0bfda5667c384bca5dad7f23a485b93

-milki

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Yeah, I agree lookups be case insensitive but we should preserve case.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.