diff --git a/hgext/mq.py b/hgext/mq.py
--- a/hgext/mq.py
+++ b/hgext/mq.py
@@ -1012,12 +1012,10 @@ class queue(object):
     # if the exact patch name does not exist, we try a few
     # variations.  If strict is passed, we try only #1
     #
-    # 1) a number to indicate an offset in the series file
+    # 1) a number (as string) to indicate an offset in the series file
     # 2) a unique substring of the patch name was given
     # 3) patchname[-+]num to indicate an offset in the series file
     def lookup(self, patch, strict=False):
-        patch = patch and str(patch)
-
         def partialname(s):
             if s in self.series:
                 return s
@@ -2874,7 +2872,7 @@ def select(ui, repo, *args, **opts):
                 if i == 0:
                     q.pop(repo, all=True)
                 else:
-                    q.pop(repo, i - 1)
+                    q.pop(repo, str(i - 1))
                 break
     if popped:
         try:
diff --git a/tests/test-mq-guards.t b/tests/test-mq-guards.t
--- a/tests/test-mq-guards.t
+++ b/tests/test-mq-guards.t
@@ -478,19 +478,19 @@ excercise cornercases in "qselect --reap
   $ hg qselect --reapply not-c
   popping guarded patches
   popping d.patch
-  now at: c.patch
+  popping c.patch
+  now at: new.patch
   reapplying unguarded patches
   applying d.patch
   patch d.patch is empty
   now at: d.patch
   $ hg qser -v
   0 A new.patch
-  1 A c.patch
+  1 G c.patch
   2 A d.patch
   $ hg qselect --reapply not-new
   popping guarded patches
   popping d.patch
-  popping c.patch
   popping new.patch
   patch queue now empty
   reapplying unguarded patches