I've now spent some more time digging into this. Thanks to Vekhir
whose further comments on IRC helped point me in the right direction.
The basic problem is that if you have a patch with a name that contains
non-ASCII characters, you can't name a patch bundle file after that
patch when the filesystem encoding is set to ASCII.
The current implementation of darcs send makes this situation worse
because even if "-o" is used to override the bundle name, it tries
to calculate a filename named after the patch, and then throws it away
This involves using "doesFileExist" to check if the proposed name
already
exists.
The behaviour change between directory 1.3.7 and 1.3.8 is that it now
throws when doesFileExist is called on an invalid filename, whereas
before it just returned False. But either way, if we got as far as
trying to write out the bundle with the name, it would fail with
any version of directory/GHC (directory isn't even involved in that).
As it happens, our tests only do "darcs send -o .." in the ASCII
encoding scenario, which is why they passed with directory 1.3.7
and fail with directory 1.3.8.
Overall I think there are two things to fix:
1. Don't calculate the filename based on patch name unless
actually needed
2. If we do get an error calculating it, catch it and give the
user a helpful error message suggesting they use "-o"
1 is a definite bug, 2 is more being helpful in the face of what
is theoretically a user error.
|