Opened 5 years ago

#6470 enhancement new

Error when passing non-string args to spawnProcess doesn't say which args are not strings

Reported by: Jonathan Lange Owned by:
Priority: normal Milestone:
Component: core Keywords:
Cc: Branch:
Author:

Description

When I pass a non-string argument to spawnProcess, the error does not tell me which argument was not a string, nor indeed which arguments were passed at all.

The error (from 12.3.0) is:

  File "twisted/internet/utils.py", line 126, in getProcessOutput
  File "twisted/internet/utils.py", line 27, in _callProtocolWithDeferred
  File "twisted/internet/posixbase.py", line 336, in spawnProcess
  File "twisted/internet/base.py", line 891, in _checkProcessArgs
TypeError: Arguments contain a non-string value

Checking truck, the problem still exists: http://twistedmatrix.com/trac/browser/trunk/twisted/internet/base.py#L910

A suggested alternative:

TypeError: Arguments ['foo', None, 'baz'] contain a non-string value: None

Change History (0)

Note: See TracTickets for help on using tickets.