bzr should not show stack trace on bad filename

Bug #589008 reported by Parth Malwankar
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Medium
Unassigned

Bug Description

while trying at this bug comment https://bugs.edge.launchpad.net/bzr/+bug/187267/comments/3 i noticed that its fixed. However, a slightly modified script (with `add`) it does show an internal error. Is this intentional? I think just showing a error message may be better as bzr has clearly aborted the operation saying its a bad file name.

[tmp]% cat bugtest.sh
#!/bin/sh
rm -rf bugtest
mkdir bugtest
cd bugtest/
bzr init
touch `printf "\x83"`
bzr add
bzr status

[tmp]% ./bugtest.sh
Created a standalone tree (format: 2a)
adding \x83
bzr: ERROR: bzrlib.errors.InvalidEntryName: Invalid entry name: \x83

Traceback (most recent call last):
  File "/storage/parth/src/bzr.dev/trunk/bzrlib/commands.py", line 911, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/storage/parth/src/bzr.dev/trunk/bzrlib/commands.py", line 1109, in run_bzr
    ret = run(*run_argv)
  File "/storage/parth/src/bzr.dev/trunk/bzrlib/commands.py", line 689, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/storage/parth/src/bzr.dev/trunk/bzrlib/commands.py", line 704, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/storage/parth/src/bzr.dev/trunk/bzrlib/cleanup.py", line 122, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/storage/parth/src/bzr.dev/trunk/bzrlib/cleanup.py", line 156, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/storage/parth/src/bzr.dev/trunk/bzrlib/builtins.py", line 688, in run
    no_recurse, action=action, save=not dry_run)
  File "/storage/parth/src/bzr.dev/trunk/bzrlib/mutabletree.py", line 49, in tree_write_locked
    return unbound(self, *args, **kwargs)
  File "/storage/parth/src/bzr.dev/trunk/bzrlib/mutabletree.py", line 523, in smart_add
    _add_one(self, inv, parent_ie, directory, kind, action)
  File "/storage/parth/src/bzr.dev/trunk/bzrlib/mutabletree.py", line 720, in _add_one
    file_id=file_id)
  File "/storage/parth/src/bzr.dev/trunk/bzrlib/inventory.py", line 926, in make_entry
    return make_entry(kind, name, parent_id, file_id)
  File "/storage/parth/src/bzr.dev/trunk/bzrlib/inventory.py", line 2320, in make_entry
    return factory(file_id, name, parent_id)
  File "/storage/parth/src/bzr.dev/trunk/bzrlib/inventory.py", line 537, in __init__
    super(InventoryFile, self).__init__(file_id, name, parent_id)
  File "/storage/parth/src/bzr.dev/trunk/bzrlib/inventory.py", line 216, in __init__
    raise errors.InvalidEntryName(name=name)
InvalidEntryName: Invalid entry name: \x83

You can report this problem to Bazaar's developers by running
    apport-bug /var/crash/bzr.1000.2010-06-03T03:43.crash
if a bug-reporting window does not automatically appear.
unknown:
  \x83
[tmp]%

Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 589008] [NEW] bzr should not show stack trace on bad filename

A clearer error would be better, however its worrying that the bad
data got that far down the stack. I'd fix this one by figuring out
where the bad data entered, and correcting that code path.

Parth Malwankar (parthm)
Changed in bzr:
status: New → Confirmed
importance: Undecided → Medium
Martin Pool (mbp)
tags: added: unicode
Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.