Puppet::FileSystem methods generally assert that they are passed either a String or Pathname and raise ArgumentError if that isn't the case. For example:
irb(main):009:0> Puppet::FileSystem.mkpath(nil)
...
ArgumentError (FileSystem implementation expected Pathname, got: 'NilClass')
However, Puppet::FileSystem.chmod raises an unhelpful TypeError trying to convert nil to a String:
irb(main):007:0> Puppet::FileSystem.chmod(0644, nil)
TypeError (no implicit conversion of nil into String)
The chmod method should raise ArgumentError like the other methods
I ran into this while researching PUP-11312 and broke it out into a separate ticket and PR
Merged to 6.x in https://github.com/puppetlabs/puppet/commit/7f2e140eb48801f7fd859b00c7ba060e8034d14e
Passed CI in fb4a1dc506