[RFC] strip out trailing quote character in file paths?

Alexander Belchenko bialix at ukr.net
Wed Dec 5 13:19:30 GMT 2007


Aaron Bentley пишет:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Alexander Belchenko wrote:
>> FAR substitute full
>> path to directory with trailing backslash (\) and hence my problem.
>> If full path contains special characters I end up with:
>>
>> bzr branch "C:\My Documents\my\branch\"
>>
>> But MS shell interpret last 2 characters as simply ",
> 
> My understanding is that commandline parsing on Windows is handled by
> the program's C libraries.
> 
>> and bzr eventually got the 3rd argument (literally) as:
>>
>> C:\My Documents\my\branch"
> 
> This seems like it may be a bug in the way Bazaar parses arguments.
> 
>> IIRC, bzr does not allow " character in paths? Or am I wrong here?
> 
> I'm not aware of a restriction like that.  As far as I know, our only
> restricted characters are \ and /.
> 
>> Windows does not allow such character in paths when someone try to
>> create new file or directory (actually list of forbidden characters is \
>> / :  * ? " < > | ).
> 
> On Unix, only / is a forbidden character in pathnames.
> 
>> I want to provide patch to automatically fix such broken paths inside
>> bzr.
> 
> It would be useful if you could make sure that the broken pathnames are
> present in sys.argv at python startup, not broken path handling later on.

Here is log of standard windows command shell session:

Microsoft Windows 2000 [Версия 5.00.2195]
(С) Корпорация Майкрософт, 1985-2000.

C:\>python -c "import sys; print sys.argv" "C:\My Document\my\branch\"
['-c', 'C:\\My Document\\my\\branch"']

C:\>




More information about the bazaar mailing list