python / cpython

The Python programming language
https://www.python.org
Other
67.61k stars 32.2k forks source link

plat-mac/applesingle.py needs cosmetic changes #39206

Closed 8bb2fe13-d245-4fef-8aa2-70d7108db3c3 closed 21 years ago

8bb2fe13-d245-4fef-8aa2-70d7108db3c3 commented 21 years ago
BPO 803498
Nosy @jackjansen, @etrepum
Files
  • applesingle.py: cross-platform applesingle module (req python 2.3)
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields: ```python assignee = 'https://github.com/jackjansen' closed_at = created_at = labels = ['OS-mac'] title = 'plat-mac/applesingle.py needs cosmetic changes' updated_at = user = 'https://github.com/etrepum' ``` bugs.python.org fields: ```python activity = actor = 'jackjansen' assignee = 'jackjansen' closed = True closed_date = None closer = None components = ['macOS'] creation = creator = 'bob.ippolito' dependencies = [] files = ['1025'] hgrepos = [] issue_num = 803498 keywords = [] message_count = 2.0 messages = ['18109', '18110'] nosy_count = 2.0 nosy_names = ['jackjansen', 'bob.ippolito'] pr_nums = [] priority = 'normal' resolution = 'accepted' stage = None status = 'closed' superseder = None type = None url = 'https://bugs.python.org/issue803498' versions = ['Python 2.3'] ```

    8bb2fe13-d245-4fef-8aa2-70d7108db3c3 commented 21 years ago

    1) it uses a string exception 2) it has a warning every time you use it: /Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/plat-mac/applesingle.py:40: FutureWarning: %u/ %o/%x/%X of negative int will return a signed string in Python 2.4 and up 3) its decode function overloads __builtin__ names (input, id) and uses type(input) == type('') when it really means: isinstance(input, basestring).. or maybe even better: not hasattr(input, 'read') 4) it can be useful on platforms other than MacOS (bub-n- bob uses it for example)

    Attached is a revamped and backwards compatible version.

    jackjansen commented 21 years ago

    Logged In: YES user_id=45365

    Accepted for 2.4 as rev. 1.3 (with minor changes by me, to make it pass the new test_applesingle test), but not for 2.3: it seems the one thing that would make this a bug fix (point 2) doesn't happen for me.