This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author darkdragon-001
Recipients darkdragon-001
Date 2017-11-29.02:18:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1511921908.2.0.213398074469.issue32163@psf.upfronthosting.co.za>
In-reply-to
Content
# fail.py
def main():
    patch = './a'
    f = open(patch, 'r')
    a = getattr(f,'encoding','ascii')
    print(str(a))

if __name__ == "__main__":
    main()

---

$ touch a
$ python fail.py

It still prints out 'None' instead of 'ascii'. This issue is fixed in python3.
History
Date User Action Args
2017-11-29 02:18:28darkdragon-001setrecipients: + darkdragon-001
2017-11-29 02:18:28darkdragon-001setmessageid: <1511921908.2.0.213398074469.issue32163@psf.upfronthosting.co.za>
2017-11-29 02:18:28darkdragon-001linkissue32163 messages
2017-11-29 02:18:27darkdragon-001create