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

Aaron Bentley aaron.bentley at utoronto.ca
Wed Dec 5 13:15:02 GMT 2007


-----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.

> Should I emit warning when " automatically stripped?

I don't think we want to be stripping ".  This looks like a discrepancy
between the quoting rules of FAR and Python.  We should try to fix that
discrepancy before resorting to hacks like that.

> Does such patch should be win32-specific or for all OSes?

This sounds highly win32-specific to me.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHVqRW0F+nu1YWqI0RAt14AJ9FV2oA3b4sUf6Sl2bsFUMVlsWNlgCeKWNU
lU2UuTxMAM9r3Q1UsHuOs4Q=
=sUcy
-----END PGP SIGNATURE-----



More information about the bazaar mailing list