Skip to content

chown incorrectly accepts non-integer uid/gid arguments #30

@GoogleCodeExporter

Description

@GoogleCodeExporter
What steps will reproduce the problem?
1. Using pyfakefs, run os.chown or a variant (e.g. os.lchown), passing a 
non-integer value as an argument

What is the expected output? What do you see instead?
This should fail with a TypeError.  Here is the same steps run without pyfakefs:

Python 2.7.8 (default, Sep 24 2014, 18:26:21) 
[GCC 4.9.1 20140903 (prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.chown('/tmp/foo', 'foobar', -1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: an integer is required

But pyfakefs's chown succeeds.  Here is os.stat output after chown:

posix.stat_result(st_mode=33188, st_ino=None, st_dev=None, st_nlink=None, 
st_uid='baz', st_gid=None, st_size=0, st_atime=1414437220, st_mtime=1414437220, 
st_ctime=1414437220)

Original issue reported on code.google.com by James.G....@gmail.com on 27 Oct 2014 at 7:25

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions