Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
GoogleCodeExporter opened this issue Mar 16, 2015 · 0 comments
Closed

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

GoogleCodeExporter opened this issue Mar 16, 2015 · 0 comments
Labels

Comments

@GoogleCodeExporter
Copy link

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 [email protected] on 27 Oct 2014 at 7:25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants