[issue40025] enum: _generate_next_value_ is not called if its definition occurs after calls to auto()
Ankesh Saha added the comment: Hi, I have ran the code with with _generate_next_value_ method at the bottom of the class and didn't run into any exceptions. Please refer my python file. Please let me know if I am missing something. from enum import Enum, auto class E(Enum): A = auto() B = auto() def _generate_next_value_(name, *args): return name for l in (E): print(l.name) print(l.value) -- nosy: +ankeshsaha Added file: https://bugs.python.org/file49014/Issue40025.PNG ___ Python tracker <https://bugs.python.org/issue40025> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue28859] os.path.ismount sometimes raises FileNotFoundError on Windows
Ankesh Saha added the comment: s I have tried to workout a solution for the problem. Below is my observation and possible solution. os.path.ismount("F:\\doesnotexist") Exception occurs for the above line if the system fails to find both drive and the path that follows it. A 'FileNotFoundError' exception is thrown. If we can handle this exception and return false for method ismount(), then problem can be resolved. I changed the existing code ismount method and it is working. Existing code=> if _getvolumepathname: return path.rstrip(seps) == _getvolumepathname(path).rstrip(seps) else: return False Changed Code=> if _getvolumepathname: try: return path.rstrip(seps) == _getvolumepathname(path).rstrip(seps) except FileNotFoundError: return False Please check, if this solution is correct. -- nosy: +ankeshsaha ___ Python tracker <https://bugs.python.org/issue28859> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com