Closed Bug 1605465 Opened 4 years ago Closed 4 years ago

"moz-phab patch" throws exception when logging "patching revision"

Categories

(Conduit :: moz-phab, defect, P1)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mhentges, Assigned: mhentges)

Details

Attachments

(1 file)

To reproduce:

  1. Open a terminal in mozilla-central
  2. moz-phab patch D57796
Assignee: nobody → mhentges
Status: NEW → ASSIGNED

We recently modified our logging logic to use the built-in formatting (%-style). I'm guessing that this refactor
caused the issue fixed in this commit - one of the logger.info(...) calls was receiving a tuple, rather than just a bunch
of positional arguments.

Priority: -- → P1

The stack trace is:

--- Logging error ---
Traceback (most recent call last):
  File "/home/mitch/.pyenv/versions/3.5.9/lib/python3.5/logging/__init__.py", line 986, in emit
    msg = self.format(record)
  File "/home/mitch/.pyenv/versions/3.5.9/lib/python3.5/logging/__init__.py", line 836, in format
    return fmt.format(record)
  File "/home/mitch/dev/conduit/review/mozphab/mozphab.py", line 4941, in format
    result = super().format(record)
  File "/home/mitch/.pyenv/versions/3.5.9/lib/python3.5/logging/__init__.py", line 573, in format
    record.message = record.getMessage()
  File "/home/mitch/.pyenv/versions/3.5.9/lib/python3.5/logging/__init__.py", line 336, in getMessage
    msg = msg % self.args
TypeError: not enough arguments for format string
Call stack:
  File "/home/mitch/.pyenv/versions/3.5.9/bin/moz-phab", line 11, in <module>
    load_entry_point('MozPhab', 'console_scripts', 'moz-phab')()
  File "/home/mitch/dev/conduit/review/mozphab/mozphab.py", line 5320, in run
    main(sys.argv[1:])
  File "/home/mitch/dev/conduit/review/mozphab/mozphab.py", line 5300, in main
    args.func(repo, args)
  File "/home/mitch/dev/conduit/review/mozphab/mozphab.py", line 4713, in patch
    ("s" if len(revs) > 1 else "", " ".join(["D%s" % r["id"] for r in revs])),
Message: 'Patching revision%s: %s'
Arguments: (('', 'D57796'),)
--- Logging error ---
Traceback (most recent call last):
  File "/home/mitch/.pyenv/versions/3.5.9/lib/python3.5/logging/handlers.py", line 71, in emit
    if self.shouldRollover(record):
  File "/home/mitch/.pyenv/versions/3.5.9/lib/python3.5/logging/handlers.py", line 187, in shouldRollover
    msg = "%s\n" % self.format(record)
  File "/home/mitch/.pyenv/versions/3.5.9/lib/python3.5/logging/__init__.py", line 836, in format
    return fmt.format(record)
  File "/home/mitch/.pyenv/versions/3.5.9/lib/python3.5/logging/__init__.py", line 573, in format
    record.message = record.getMessage()
  File "/home/mitch/.pyenv/versions/3.5.9/lib/python3.5/logging/__init__.py", line 336, in getMessage
    msg = msg % self.args
TypeError: not enough arguments for format string
Call stack:
  File "/home/mitch/.pyenv/versions/3.5.9/bin/moz-phab", line 11, in <module>
    load_entry_point('MozPhab', 'console_scripts', 'moz-phab')()
  File "/home/mitch/dev/conduit/review/mozphab/mozphab.py", line 5320, in run
    main(sys.argv[1:])
  File "/home/mitch/dev/conduit/review/mozphab/mozphab.py", line 5300, in main
    args.func(repo, args)
  File "/home/mitch/dev/conduit/review/mozphab/mozphab.py", line 4713, in patch
    ("s" if len(revs) > 1 else "", " ".join(["D%s" % r["id"] for r in revs])),
Message: 'Patching revision%s: %s'
Arguments: (('', 'D57796'),)

This should be fixed in the newly-released 0.1.71 moz-phab.

Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: