Python Forum
why did python run in this case?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
why did python run in this case?
#1
i was trying to run a big command in a bash shell in a non-root user under Xubuntu 20.04 involving a bash loop, system binary commands, and one binary command i wrote in C and compiled to binary (and have used quite often over the years). this big command took longer than expected so i wanted to try something else. i pressed ^C and got a message that appeared to come from Python. any clue what it could have been run for?

Output:
lt1a/phil/9 /home/phil 8> time(rls +f /usr|egrep '\.h$'|while read f;do fgrep -n ' O_PATH' "$f" /dev/null;done) /usr/include/asm-generic/fcntl.h:84:#ifndef O_PATH /usr/include/asm-generic/fcntl.h:85:#define O_PATH 010000000 /usr/include/linux/un.h:14:#define SIOCUNIXFILE (SIOCPROTOPRIVATE + 0) /* open a socket file with O_PATH */ /usr/include/x86_64-linux-gnu/bits/fcntl-linux.h:150:# define O_PATH __O_PATH /* Resolve pathname but do not open file. */ /usr/src/linux-hwe-5.15-headers-5.15.0-60/arch/alpha/include/uapi/asm/fcntl.h:35:#define O_PATH 040000000 /usr/src/linux-hwe-5.15-headers-5.15.0-60/arch/parisc/include/uapi/asm/fcntl.h:20:#define O_PATH 020000000 /usr/src/linux-hwe-5.15-headers-5.15.0-60/arch/sparc/include/uapi/asm/fcntl.h:38:#define O_PATH 0x1000000 ^CFatal Python error: init_import_size: Failed to import the site module Python runtime state: initialized Traceback (most recent call last): File "<frozen importlib._bootstrap>", line 991, in _find_and_load File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 671, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 844, in exec_module File "<frozen importlib._bootstrap_external>", line 976, in get_code File "<frozen importlib._bootstrap_external>", line 640, in _compile_bytecode KeyboardInterrupt ^C[[ 2m23s real 143.994 - user 109.758 - sys 35.694 - 101.01% ]] lt1a/phil/9 /home/phil 9>
after a few messages it paused for a while and i pressed ^C again and got "KeyboardInterrupt" and then it quit with timing info from the time prefix on the shell loop. i'm just curious WHY Python was running. what it was doing might be helpful to know. any clues?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#2
You already had problems with the site module in this thread, apparently due to invalid links that you defined. Could it be a similar configuration error?
Reply
#3
i wouldn't rule that out. but it is odd the Python is running in this. i need to check each command very closely to see how Python-free it is or not. i have played around with coding common POSIX commands in Python and there may be some leftovers involved. it was ^C-ing about 2-3 minutes into it running. it let it run all the way and it took 7m23s. that seems reasonable to grep every .h file in /usr.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  The Case Against Python 3 snippsat 15 15,784 Nov-25-2016, 07:44 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020