joxeankoret / pigaios

A tool for matching and diffing source codes directly against binaries.
GNU General Public License v3.0
634 stars 67 forks source link

scrtobindiff.py: popen2 did not exist anymore in python3 #22

Closed dummys closed 5 years ago

dummys commented 5 years ago

-> $ ./srcbindiff.py -create Traceback (most recent call last): File "./srcbindiff.py", line 7, in import popen2 ModuleNotFoundError: No module named 'popen2'

joxeankoret commented 5 years ago

It doesn't support yet Python 3.

dummys commented 5 years ago

ok so why you didnt use as shebang: #!/usr/bin/env python2 ?

Because on ubuntu default now is python2 and on arch for example default is python3

joxeankoret commented 5 years ago

Because I've never considered it a problem and it doesn't support exclusively Linux but also *BSD and MacOSX. Let me search what is the truly multi-platform portable shebang if any...

dummys commented 5 years ago

Oh yeah, let me try to search for it too.

joxeankoret commented 5 years ago

Found it: https://blogs.gnome.org/mcatanzaro/2018/02/16/on-python-shebangs/

So, according to this and other articles, the one that works everywhere is "#!/usr/bin/env python2.7". Patching...

dummys commented 5 years ago

yes same information here: https://stackoverflow.com/questions/2429511/why-do-people-write-the-usr-bin-env-python-shebang-on-the-first-line-of-a-pyt

Another question, under PEP8 it is statuated to use 4 spaces for indent. why use only 2 ?

PS: I relaunched on my other source code where I had the utf8 problem, it is solved. thanks

joxeankoret commented 5 years ago
  1. The shebangs thing is fixed with 47e9940bdf58008d25c42f3d048fa66757f7fff3.
  2. Regarding the PEP8 spaces thing: One ex-employer forced me to code using 2 spaces and I got used to it :) No other reason other than, maybe, that it's more readable to me.
  3. Regarding the UTF-8 problem, glad it worked :+1:
dummys commented 5 years ago
  1. You should send him this link: https://www.python.org/dev/peps/pep-0008/#indentation
joxeankoret commented 5 years ago

Extracted from this link: "Fun fact: Google's internal style guideline dictates indenting by 2 spaces!"

dummys commented 5 years ago

ahahahah, google is evil.

dummys commented 5 years ago

quick question not related, where is the best way to contact you to have a rapid chat on diaphora ? tried twitter...

psifertex commented 5 years ago

Iirc, PEP also states using whatever currently exists is preferable so it's only ever an argument for when starting a new project, not updating an existing one.