<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
I'm sending to this list with a [MERGE] tag in response to a Daniel
Watkins's comment in the bug that says it is the right way to send a
patch to review.<br>
<br>
-------- Mensagem original --------
<table class="moz-email-headers-table" border="0" cellpadding="0"
cellspacing="0">
<tbody>
<tr>
<th align="right" nowrap="nowrap" valign="baseline">Assunto: </th>
<td>Re: ignore files with invalid filenames</td>
</tr>
<tr>
<th align="right" nowrap="nowrap" valign="baseline">Data: </th>
<td>Thu, 02 Aug 2007 09:10:58 -0300</td>
</tr>
<tr>
<th align="right" nowrap="nowrap" valign="baseline">De: </th>
<td>Fábio Machado de Oliveira <a class="moz-txt-link-rfc2396E" href="mailto:absfabio@terra.com.br"><absfabio@terra.com.br></a></td>
</tr>
<tr>
<th align="right" nowrap="nowrap" valign="baseline">Para: </th>
<td>Martin Pool <a class="moz-txt-link-rfc2396E" href="mailto:mbp@sourcefrog.net"><mbp@sourcefrog.net></a></td>
</tr>
<tr>
<th align="right" nowrap="nowrap" valign="baseline">CC: </th>
<td><a class="moz-txt-link-abbreviated" href="mailto:bazaar@lists.canonical.com">bazaar@lists.canonical.com</a></td>
</tr>
<tr>
<th align="right" nowrap="nowrap" valign="baseline">Referências: </th>
<td><a class="moz-txt-link-rfc2396E" href="mailto:f8nteh$4c0$1@sea.gmane.org"><f8nteh$4c0$1@sea.gmane.org></a>
<a class="moz-txt-link-rfc2396E" href="mailto:e01316480707311440p3c4aabaekadcf137051b26c77@mail.gmail.com"><e01316480707311440p3c4aabaekadcf137051b26c77@mail.gmail.com></a>
<a class="moz-txt-link-rfc2396E" href="mailto:46B0CE4E.8020901@terra.com.br"><46B0CE4E.8020901@terra.com.br></a>
<a class="moz-txt-link-rfc2396E" href="mailto:e01316480708011615j6859d4feuef89a3987924b8fc@mail.gmail.com"><e01316480708011615j6859d4feuef89a3987924b8fc@mail.gmail.com></a></td>
</tr>
</tbody>
</table>
<br>
<br>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
I attached it to the bug 77533 at
<a class="moz-txt-link-freetext"
href="https://bugs.launchpad.net/bzr/+bug/77533">https://bugs.launchpad.net/bzr/+bug/77533</a><br>
<br>
Is it desirable to make add ignore these filenames too? In bug #59968,
Aaron commented something about XML storage that doesn't permit ascii
control codes as being the root of the problem, so I'm not sure if this
is the right way of doing it.<br>
<br>
Martin Pool escreveu:
<blockquote
cite="mide01316480708011615j6859d4feuef89a3987924b8fc@mail.gmail.com"
type="cite">
<pre wrap="">So, until someone writes a test, could you please attach your patch to
the bug about decoding ignored filenames? I'm pretty sure there is a
bug already. Thanks.
On 8/2/07, Fábio Machado de Oliveira <a class="moz-txt-link-rfc2396E"
href="mailto:absfabio@terra.com.br"><absfabio@terra.com.br></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap=""> Martin Pool escreveu:
On 7/31/07, Fabio Machado de Oliveira <a class="moz-txt-link-rfc2396E"
href="mailto:absfabio@terra.com.br"><absfabio@terra.com.br></a> wrote:
I put a try/except for bzr to ignore files that have filenames
containing characters invalid to the filesystem encoding, instead of
generating a bug report.
Hi Fabio,
Thanks, that sounds like a really useful fix, I'm very happy to see
it. I do think in general that we want to be skipping over
untouchable files rather than failing. There are probably some other
places that need an analogous fix.
I have two bits of feedback on this patch:
You should be using trace.warn rather than printing directly to stderr.
Also, we really need a test for this to make sure that it doesn't
regress in future. To test this we need to be able to create a file
with an invalid name. In some encodings (like iso-8859-1) there are
no invalid filenames since any combination of bytes can be
interpreted. In ascii and utf-8 we can do it - I suspect '\xff\xff'
will be invalid everywhere. The best thing is probably to check
whether that string can be decoded in osutils._fs_enc. If it *can*
be, skip the test. Otherwise, create a file and try to version the
directory.
Now this probably should be a workingtree_implementation test, so that
it will be checked on all formats. However, it will probably fail on
some old formats, and it's probably not worth fixing them. So I'd
probably just check the format and if it's one of the old ones, skip
the test.
This is one of those unfortunate cases where testing something
automatically seems much harder than just manually verifying it once.
But especially for environment-specific things like encoding it is
important that we have one to keep up the level of quality we want.
I dont know how to write a new test to bazaar. I was able to create an
invalid file this way:
In VIM, i setted the fileencoding to windows 1252 ( :set
fileencoding=windows-1252 ), and wrote an script like "echo test > óóó.txt".
The script created an óóó.txt file with an windows-1252 encoding that made
bzr status to fail. os.listdir returned this name for it: '\xf3\xe9\xed.txt'
The bzr.dev changed and the problem changed its place, so I changed that
patch to working_tree.extras()
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
</blockquote>
<br>
</body>
</html>