soroco / pyce

Encrypted Python Execution
Apache License 2.0
198 stars 26 forks source link

ImportError: bad magic number #25

Open VeNoMouS opened 5 years ago

VeNoMouS commented 5 years ago

Hi guys,

A customer is sometimes (rarely) getting the error ImportError: bad magic number , just wondering if anyone else has experienced this... and come up with a solution?

theonewolf commented 5 years ago

@VeNoMouS this is interesting. Is it within your custom / proprietary source code? Or is it from a third-party independent library? The recommendation is not to encrypt third-party, because sometimes they make very odd introspection assumptions (such as reading their files directly). It's possible, but requires careful testing.

What's very odd is that it sounds like this issue is transient. I'd expect it on every execution, although perhaps you have some imports that don't always hit in every exercised path through the code.