Changes between Version 5 and Version 6 of Ticket #22044, comment 18


Ignore:
Timestamp:
12/14/16 13:13:03 (3 years ago)
Author:
embray
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #22044, comment 18

    v5 v6  
    11It is absolutely, 100% against the philosophy and design of Python 3 to be passing around `bytes` objects for filenames, or much anything else that isn't meant to be interacted with as binary data.  As soon as a user tries to join a (unicode) string to it all hell breaks loose.  In this specific example it is mostly irrelevant, but you're basically arguing that all filenames should be passed around in Sage as `bytes` objects which:
    22
    3     a) You haven't implemented yet--either be 100% consistent or go home.  To be clear, this also means that you have to fight a constant uphill battle with every Python API that returns  `str`, not `bytes` for filenames, such as `os.listdir`, `os.getcwd`, `os.curdir`, `os.sep`, and many others.
     3    a) You haven't implemented yet--either be 100% consistent or go home.  To be clear, this also means that you have to fight a constant uphill battle with every Python API that returns  `str`, not `bytes` for filenames, such as `os.listdir`, `os.getcwd`, `os.curdir`, `os.sep`, and many others.  Some of these are functions that when passed bytes return bytes (which means if you want bytes you have to make sure they are ''always'' passed bytes regardless what some users pastes into their terminal).  In other cases they are not.
    44
    55    b) Is, as previously stated, not the right thing to do and is user- and developer-hostile.