-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AttributeError: 'NoneType' object has no attribute 'parent' #3
Comments
Looking at the message:
I see this message being generated on line 85 in frameUtils.py.
FWIW, _handle_device_created() is a global function (not a class method) that is declared as follows:
Don't know if this helps any though... |
Can you set your log level to debug and rerun it, it looks like there's a full debug printout of the parsed information related to the frames? https://github.com/Cobertos/bobskater/blob/master/bobskater/obfuscate.py#L314-L317
Feel free to censor anything you don't want to show. I hadn't ever used or learned about Python's async syntax when I wrote this so it wasn't something I tested. If it has different a different AST object format that's one thing that might cause this issue. Looks like https://greentreesnakes.readthedocs.io/en/latest/nodes.html#AsyncFunctionDef would need to be handled in https://github.com/Cobertos/bobskater/blob/master/bobskater/frameUtils.py#L189 and possibly adding a warning or something when I'm also not familiar with the |
Here is the output with DEBUG enabled (I only redacted one thing -> "xxxxx"):
I see the line To be clear,
As for the |
IIRC, So It looks like it's reading the callback registration (where it loads/reads the identifier This seems in line with my original hunch:
so when I have time to debug/look at this again, I'd probably be adding support for The
makes me think I'm wrong though but I cant remember how that one gets printed out at the moment |
Yes, this is definitely an asyncio issue. The below (non-async) test code obfuscates correctly:
However, this asyncio code throws errors:
|
Changing line #189 as follows:
Resolves the obfuscation error, but the result is not obfuscated, though you can tell that it's been processed due to the docstring being converted...
Any more "hunches" ??? |
Docstrings should be obfuscating properly (it works in the tests) so I would assume it's another async function thing. Looks like this line https://github.com/Cobertos/bobskater/blob/master/bobskater/obfuscate.py#L282 In your example, You're also going to want to make sure you change this line https://github.com/Cobertos/bobskater/blob/master/bobskater/frameUtils.py#L225 . When it gets an ID from |
I was about to say that the docstring DID get modified, but I think your point is that the docstring shouldn't appear at all... Changing line 112 of
Produces the following output with
This result matches what I saw before (without async). The docstring is changed, to being a one-liner, but not removed. |
Changing line 225 as follows:
Didn't help. ORIGINAL (UNOBFUSCATED):
AFTER OBFUSCATION:
BTW, note that the "types" (e.g., Here is the debug output:
|
I note the DEBUG output says:
The message is found on line 246 in bobskater/obfuscate.py:
Does make sense that these variables are "ast.ClassDef" or "ast.Module"? - or is it that an earlier test above didn't catch before this block was hit? |
I updated my test and found an anomaly. The "update" is essentially to have both the async and non-async func defs in the same file so as to do A-B tests. Here's the new input:
Here's the new output (obfuscated):
And here's the output (reduced, see "SNIP"):
Note how the |
Hiya! Is the debug output provided not helping? |
Any update here? Would a donation of some sort help? I thought that your AST-based approach was elegant, hence my desire to see it along. I know that it's not much code, but it would undoubtedly take your a fraction of the time it would take me... |
Ah sorry, I missed the last comment, been busy. I can set aside some more time to look at this hopefully before my next project ramps up. If you wanted to contribute financially and this is more an indie project, you can check out my Patreon. I don't have any of the tiers fleshed out but if you wanted to donate to the Supporter or Commisioner tier it helps me justify working on things like this more. If you're part of a larger company, consider subscribing to TideLift. The prices are pretty steep but I can get this package "lifted" and integrating with their systems gives a lot of assurances to future stability. |
Sorry for the long delay, but I finally got around to packaging and, well, here we are again... :)
Unfortunately, I hit an issue right away. This code similar to the code you provided in Issue #2.
FILE: obfuscate.py
Output:
Any thoughts?
The text was updated successfully, but these errors were encountered: