[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Square brackets in file names and authz (in VisualSVN 2.5.5)

From: Johan Corveleyn <jcorvel_at_gmail.com>
Date: Thu, 12 Jul 2012 16:45:36 +0200

On Thu, Jul 12, 2012 at 2:05 PM, Daniel Shahaf <d.s_at_daniel.shahaf.name> wrote:
> Johan Corveleyn wrote on Thu, Jul 12, 2012 at 11:28:18 +0200:
>> I think the only character that causes problems is ']' (which ends the
>> section name parsing). It seems not too hard to change that parsing
>
> Technically, 0x0A (newline) would likely be a problem too. Not sure
> that anyone uses it...
>
>> function to make it handle some kind of escape sequence for ']'
>
> What escape syntax does http://docs.python.org/library/configparser use?

I think it uses none.

I've just checked the source of ConfigParser.py in my Python 2.7
distribution, which contains this:

[[[
    SECTCRE = re.compile(
        r'\[' # [
        r'(?P<header>[^]]+)' # very permissive!
        r'\]' # ]
        )
]]]

This regex is matched against lines, and the group named "header" is
taken as section name. So this seems to be effectively the same as our
parsing routine: after the '[', we take all non-']' until we encounter
']'.

On Thu, Jul 12, 2012 at 2:06 PM, Daniel Shahaf <d.s_at_daniel.shahaf.name> wrote:
> Johan Corveleyn wrote on Thu, Jul 12, 2012 at 12:06:07 +0200:
>> I think ']]' would be the best choice, but still not 100% backwards
>> compatible. But I mean, who in their right mind would write sections
>> like this:
>>
>> [repo:/path/to/file.ext]]haha, this isn't parsed
>
> We document the format as "ini format" and more specifically "same as
> Python's ConfigParser", and the above isn't valid in either of those, so
> we needn't provide back compat for it.

Where is this documented?

Besides: for Python's ConfigParser (if I understand the code
correctly) I think the above is valid in the way that it doesn't
generate errors: everything after the first ']' is simply ignored.

-- 
Johan
Received on 2012-07-12 16:46:30 CEST

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.