unexpected end of regular expression

Bug #178813 reported by Anton Veretenenko
2
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Low
Parth Malwankar

Bug Description

I've just did bzr add in my project directory and got this (and i have the same error using bzr ignore ./ignorefile):

bzr: ERROR: sre_constants.error: unexpected end of regular expression

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 802, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 758, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 492, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.5/site-packages/bzrlib/builtins.py", line 384, in run
    no_recurse, action=action, save=not dry_run)
  File "/usr/lib/python2.5/site-packages/bzrlib/mutabletree.py", line 51, in tree_write_locked
    return unbound(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/mutabletree.py", line 417, in smart_add
    ignore_glob = self.is_ignored(subp)
  File "/usr/lib/python2.5/site-packages/bzrlib/workingtree.py", line 1669, in is_ignored
    return self._ignoreglobster.match(filename)
  File "/usr/lib/python2.5/site-packages/bzrlib/globbing.py", line 213, in match
    match = regex.match(filename)
  File "/usr/lib/python2.5/site-packages/bzrlib/lazy_regex.py", line 69, in __getattr__
    self._compile_and_collapse()
  File "/usr/lib/python2.5/site-packages/bzrlib/lazy_regex.py", line 55, in _compile_and_collapse
    **self._regex_kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/lazy_regex.py", line 61, in _real_re_compile
    return _real_re_compile(*args, **kwargs)
  File "re.py", line 180, in compile
    return _compile(pattern, flags)
  File "re.py", line 233, in _compile
    raise error, v # invalid expression
error: unexpected end of regular expression

bzr 1.0.0 on python 2.5.1.final.0 (linux2)
arguments: ['/usr/bin/bzr', 'add']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_US.UTF-8'
plugins:
  launchpad /usr/lib/python2.5/site-packages/bzrlib/plugins/launchpad [unknown]
  multiparent /usr/lib/python2.5/site-packages/bzrlib/plugins/multiparent.pyc [unknown]
*** Bazaar has encountered an internal error.
    Please report a bug at https://bugs.launchpad.net/bzr/+filebug
    including this traceback, and a description of what you
    were doing when the error occurred.

Tags: trivial
description: updated
Revision history for this message
Vincent Ladeuil (vila) wrote :

The content of of your .bzrignore file will surely help solve your problem.

Most probably it uses a '(' (or '[') without the corresponding close.

Changed in bzr:
status: New → Incomplete
Revision history for this message
Anton Veretenenko (anton.veretenenko) wrote :

Got it. I've mistyped my first ignore file as *.k[f, i deleted this line from .bzrignore and all goes fine, thx

Vincent Ladeuil (vila)
Changed in bzr:
importance: Undecided → Low
status: Incomplete → Confirmed
Revision history for this message
Martin Packman (gz) wrote :

Parth, have your regexp changes fixed this bug already?

Changed in bzr:
assignee: nobody → Parth Malwankar (parthm)
Revision history for this message
Parth Malwankar (parthm) wrote :

Yup. This is fixed. We get a clear error message now.

[foo]% bzr st
bzr: ERROR: Invalid pattern(s) found. File ~/.bazaar/ignore or .bzrignore contains error(s).
  *.k[f
[foo]%

Changed in bzr:
status: Confirmed → Fix Released
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.