sre_constants.error: unexpected end of pattern on smart search

Bug #525940 reported by Roman Yepishev
42
This bug affects 6 people
Affects Status Importance Assigned to Milestone
Smart Package Manager
Fix Released
Undecided
Unassigned
smart (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

smartpm:
  Installed: 1.2-5
  Candidate: 1.2-5
  Version table:
 *** 1.2-5 0
        500 http://archive.ubuntu.com lucid/universe Packages
        100 /var/lib/dpkg/status

rtg@buzz:~$ smart --shell
Smart Package Manager 1.2 - Shell Mode

Loading cache...
Updating cache... ... [100%]

smart> search test
Traceback (most recent call last):
  File "/usr/bin/smart", line 195, in <module>
    main(sys.argv[1:])
  File "/usr/bin/smart", line 168, in main
    exitcode = iface.run(opts.command, opts.argv)
  File "/usr/lib/pymodules/python2.6/smart/interfaces/text/interactive.py", line 46, in run
    Interpreter(self._ctrl).cmdloop()
  File "/usr/lib/python2.6/cmd.py", line 142, in cmdloop
    stop = self.onecmd(line)
  File "/usr/lib/pymodules/python2.6/smart/interfaces/text/interactive.py", line 195, in onecmd
    return Cmd.onecmd(self, line)
  File "/usr/lib/python2.6/cmd.py", line 219, in onecmd
    return func(arg)
  File "/usr/lib/pymodules/python2.6/smart/interfaces/text/interactive.py", line 742, in do_search
    search.main(self._ctrl, opts, reloadchannels=False)
  File "/usr/lib/pymodules/python2.6/smart/commands/query.py", line 247, in main
    hasname.append(re.compile(token, re.I))
  File "/usr/lib/python2.6/re.py", line 190, in compile
    return _compile(pattern, flags)
  File "/usr/lib/python2.6/re.py", line 245, in _compile
    raise error, v # invalid expression
sre_constants.error: unexpected end of pattern

The same happens with smart search from commandline.

Distributor ID: Ubuntu
Description: Ubuntu lucid (development branch)
Release: 10.04
Codename: lucid

python:
  Installed: 2.6.4-0ubuntu2

Tags: patch
Revision history for this message
Anders F Björklund (afb) wrote :

Hmm, wonder why Python never can print the actual failing value...
Are you able to dump the value of token ? Insert "iface.info(token)"

Also, does `smart query --name test` give you the same traceback ?
Can't seem to reproduce the problem here with either of 1.2 or 1.3.

Revision history for this message
Anders F Björklund (afb) wrote :

OK, the lucid python2.6 has a patch that conflicts with what smart is "expecting":

Index: Lib/fnmatch.py
===================================================================
--- Lib/fnmatch.py (.../tags/r264) (Revision 78201)
+++ Lib/fnmatch.py (.../branches/release26-maint) (Revision 78201)
@@ -104,4 +104,4 @@
                 res = '%s[%s]' % (res, stuff)
         else:
             res = res + re.escape(c)
- return res + "$"
+ return res + '\Z(?ms)'

Smart tries to do fnmatch.translate(token)[:-1], which now doesn't work anymore...

Changed in smart:
status: New → Confirmed
Revision history for this message
Anders F Björklund (afb) wrote :
Revision history for this message
Anders F Björklund (afb) wrote :

Easy to reproduce this issue with:
python2.7 ./smart.py search test

Revision history for this message
Anders F Björklund (afb) wrote :
Changed in smart:
milestone: none → 1.3.1
status: Confirmed → Fix Committed
Changed in smart:
status: Fix Committed → Fix Released
Changed in smart (Ubuntu):
status: New → Confirmed
tags: added: patch
Revision history for this message
John Bray (johnbray) wrote :

The problem still occurs with a clean install of Ubuntu 10.10 beta. Why hasn't the fix made it there?

Revision history for this message
John Bray (johnbray) wrote :

Still occurs in Ubuntu 10.10 beta. Why hasn't the patch made it in there?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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