Closed Bug 1602573 Opened 4 years ago Closed 4 years ago

moz-phab producing excessive amount of unwanted output

Categories

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

Unspecified
Windows
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: bytesized, Assigned: glob)

References

Details

(Keywords: conduit-triaged)

Attachments

(6 files)

Attached file mozphab_output.txt

I went to run moz-phab today, it took quite a while (I was submitting a couple of patches that touch a lot of files, so not unexpected). Once it had finished, I went back to the console window and saw that my entire scrollback was full of output from moz-phab. Clearly this is not desired behavior.

The command I ran seemed simple enough: moz-phab submit bookmark1 bookmark2

I'm posting two versions of the output I've seen. The first time I encountered this, I saw significantly longer output that included an entire section that I have not been able to replicate since. But the first time I encountered it, it went off the end of my scrollback, so that output is incomplete.

Note that both of these output files might seem short if you have word wrap turned off. But since the console wraps lines, they are overwhelmingly long in that context. Also of note is that there is a Python traceback in both versions of the output.

I'm running Windows 10. The patch stack I was submitting is attached to Bug 1585482.

I can't confirm. It looks like it's printing everything. What is your MozPhab version? moz-phab version

Flags: needinfo?(ksteuber)
> moz-phab version
MozPhab (0.1.65)
Flags: needinfo?(ksteuber)

The error is UnicodeEncodeError: 'charmap' codec can't encode characters in position 248871-248873: character maps to <undefined> which is triggered by logger.debug("%s %s" % (url.geturl(), api_call_args)).

The string formatting is applied regardless of the logging level, so any unicode weirdness in api_call_args would result in an error at this line.

Changing logging calls to be lazily evaluated, in this case logger.debug("%s %s", url.geturl(), api_call_args), would allow the code to continue past this statement (and probably fail later on, hopefully without dumping the entire JSON payload). pylint's W1201 rule catches this.

I suspect the core issue is a malformed unicode character (perhaps the source isn't UTF8 because Windows?).

Assignee: nobody → pzalewa
Status: NEW → ASSIGNED

Is the issue solved?
I will try to reproduce it tomorrow.

Flags: needinfo?(ksteuber)
Keywords: conduit-triaged
Priority: -- → P2

It seems to be solved. I'm no longer seeing the unexpected output.

Flags: needinfo?(ksteuber)

Let me know if I should file a new bug for this, but it seemed to be related so I thought I would post it here. I got the attached output today, which was also unwanted.

Here's another instance of what looks like the same problem as last time.

Traceback (most recent call last):
  File "c:\mozilla-build\python3\lib\logging\__init__.py", line 1028, in emit
    stream.write(msg + self.terminator)
  File "c:\mozilla-build\python3\lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u26a0' in position 97664: character maps to <undefined>

moz-phab is using cp1252 encoding when writing to the debug log file.

Assignee: pzalewa → glob
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: