[issue9808] Implement os.getlogin on Windows
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: The patch looks good. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9808 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9808] Implement os.getlogin on Windows
Brian Curtin cur...@acm.org added the comment: Committed in r84983. Thanks! -- components: +Extension Modules -Library (Lib) resolution: accepted - fixed stage: patch review - committed/rejected ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9808 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9808] Implement os.getlogin on Windows
Changes by Jon Anglin jang...@fortresgrand.com: -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9808 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9808] Implement os.getlogin on Windows
Jon Anglin jang...@fortresgrand.com added the comment: The _countof(_x_) macro expands to something like this: sizeof(_x_)/sizeof(_x_[0]) This was an attempt by Microsoft to mitigate some buffer overrun issues. I have gotten in the habit of using it as it is less verbose. I have uploaded a new issue9808.diff file that removes the _countof macro. I will leave it up to those with commit privileges which version gets checked in. Personally I like it because it clarifies the programmers intent. Why not introduce it to the Python code base? -- Added file: http://bugs.python.org/file18912/issue9808.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9808 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9808] Implement os.getlogin on Windows
Jon Anglin jang...@fortresgrand.com added the comment: I went ahead and moved the test skip decorator to the class level as suggested by Brian Curtin, see issue9808-new.diff. -- Added file: http://bugs.python.org/file18886/issue9808-new.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9808 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9808] Implement os.getlogin on Windows
Changes by Giampaolo Rodola' g.rod...@gmail.com: -- nosy: +giampaolo.rodola ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9808 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9808] Implement os.getlogin on Windows
Brian Curtin cur...@acm.org added the comment: After a quick glance the patch looks alright, just cleaned a few things up in issue9808.diff (moved the #include up with others, removed 'is not None' from tests). The test skip decorator could also be moved to the LoginTests class level. Is there any reason the variables could legitimately be different from what getlogin reports? -- assignee: - brian.curtin stage: - patch review Added file: http://bugs.python.org/file18811/issue9808.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9808 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9808] Implement os.getlogin on Windows
Jon Anglin jang...@fortresgrand.com added the comment: I can't answer that for the 'LOGNAME' environment variable on non-Windows systems, I was just keying off of what the docs claimed. As for Windows, I just came across this article http://support.microsoft.com/kb/273633 that shows we can not rely on this in the test. I only put those environment variables in the test because I thought this test was a little weak (what else can we do?) user_name = os.getlogin() self.assertNotEqual(0, len(user_name)) Even though %USERNAME% == os.getlogin() MOST of the time. It should be removed from the test. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9808 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9808] Implement os.getlogin on Windows
Jon Anglin jang...@fortresgrand.com added the comment: Here is an updated patch with the updated test. This test does not use either the LOGNAME or USERNAME environment variables. -- Added file: http://bugs.python.org/file18814/issue9808.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9808 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9808] Implement os.getlogin on Windows
Tim Golden m...@timgolden.me.uk added the comment: +1 on the idea in general; I'm away at the moment and not in a position to review the patch. Hopefully Brian can review/commit -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9808 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9808] Implement os.getlogin on Windows
New submission from Jon Anglin jang...@fortresgrand.com: This is a feature request to implement the os.getlogin function on Windows systems. This may not be a widely used function, but implementing on Windows will bring Python on Windows one step closer to Python on Unix (like) systems. The os_getlogin.diff file contains my proposed patch to add this functionality for Windows. -- components: Library (Lib), Windows files: os_getlogin.diff keywords: patch messages: 115927 nosy: janglin priority: normal severity: normal status: open title: Implement os.getlogin on Windows type: feature request versions: Python 3.2 Added file: http://bugs.python.org/file18808/os_getlogin.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9808 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9808] Implement os.getlogin on Windows
Changes by R. David Murray rdmur...@bitdance.com: -- nosy: +brian.curtin, tim.golden ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9808 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com