Closed markusschloesser closed 1 year ago
I am not finding a problem decompiling this (under Ubuntu) with the current master branch of uncompyle and the current master branch of xdis:
$ uncompyle6 util.pyc
# uncompyle6 version 3.9.1.dev0
# Python bytecode version base 3.7.0 (3394)
# Decompiled from: Python 3.8.16 (default, Dec 13 2022, 19:27:23)
# [GCC 11.3.0]
# Embedded file name: ..\..\..\output\Live\win_64_static\Release\python-bundle\MIDI Remote Scripts\ableton\v3\base\util.py
# Compiled at: 2023-05-11 03:40:46
# Size of source mod 2**32: 2708 bytes
from __future__ import absolute_import, print_function, unicode_literals
from . import is_iterable
PITCH_NAMES = ('C', 'C#', 'D', 'D#', 'E', 'F', 'F#', 'G', 'G#', 'A', 'A#', 'B')
class CallableBool:
def __init__(self, value: bool):
self.value = value
def __call__(self):
return self.value
def __eq__(self, other):
return self.value == other
def __bool__(self):
return self.value
def __int__(self):
return int(self.value)
def __repr__(self):
return repr(self.value)
def get_default_ascii_translations():
ascii_translations = {chr(i): i for i in range(32, 127)}
ascii_translations[u'\u'] = 35
return ascii_translations
DEFAULT_ASCII_TRANSLATIONS = get_default_ascii_translations()
def as_ascii(string, ascii_translations=DEFAULT_ASCII_TRANSLATIONS):
result = []
for char in string:
translated_char = ascii_translations.get(char, ascii_translations['?'])
if is_iterable(translated_char):
result.extend(translated_char)
else:
result.append(translated_char)
return result
def hex_to_rgb(hex_value):
return (
(hex_value & 16711680) >> 16,
(hex_value & 65280) >> 8,
hex_value & 255)
def pitch_index_to_string(index, pitch_names=PITCH_NAMES):
return pitch_names[index % 12] + str(index // 12 - 2)
# okay decompiling util.pyc
Thanks! I checked and my xdis is v 6.0.5. Also have another file with the same error physical_display.zip So any idea, why this fails on my Windows machine?
Are you using what is in git or what was released? You need to use what is in git.
You are not using the version of xdis that is in the master branch. That is version is 6.1.0.dev0
that worked, thank you!
Are you interested in further issues? (Unfortunately I cannot contribute with code)
that worked, thank you!
Are you interested in further issues? (Unfortunately I cannot contribute with code)
Everyone is free to report bugs. The ones that show effort to narrow the problem down and are thoughtful - follow the information given in posting a bug report or reflect that https://github.com/rocky/python-uncompyle6/blob/master/HOW-TO-REPORT-A-BUG.md has been read and followed - are the one that are more likely to get fixed sooner.
But let me answer your question with one of my own: Are you interested in funding the project? See also this where I talk about the frequent comment: "Unfortunately I cannot contribute with code".
Hi,
Description.
I have a file (Midi Remote Script for Ableton, OK to decompile), which has the char u266f (which the musical sign for sharp #). Uncompyle6 will fail for that file with a unicodeerror:
How to Reproduce
Python bytecode attached: util.zip
-->
Output Given
Expected behavior
Not fail over the sharp sign
Environment
Win10 , Thonny, uncomyple6 version 3.9, other files work fine