rambleraptor commented on code in PR #3721: URL: https://github.com/apache/iceberg-python/pull/3721#discussion_r3686305379
########## pyiceberg/io/__init__.py: ########## @@ -41,6 +42,17 @@ logger = logging.getLogger(__name__) + +def _is_windows_drive_letter(scheme: str) -> bool: + r"""Check if a parsed URL scheme is actually a Windows drive letter. + + On Windows, Python's urlparse treats paths like 'C:\\Users\\...' as having + scheme='c'. This detects that case so callers can route to the local filesystem. + Only returns True on Windows — no behavior change on other platforms. + """ + return sys.platform == "win32" and len(scheme) == 1 and scheme.isalpha() Review Comment: Windows newb here: I'm looking at https://stackoverflow.com/questions/446209/possible-values-from-sys-platform. There's a couple other Windows derivatives mentioned. Should we do that for these too? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
