Python Forum
Working socket() program...isn't
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Working socket() program...isn't
#10
(Nov-01-2019, 08:58 PM)nilamo Wrote:
Quote:
(pagesniff) [a-ptrivino@insecpydev pagesniff]$ sudo python sniffsms.py server
sys.version_info(major=2, minor=7, micro=5, releaselevel='final', serial=0)
/usr/lib64/python2.7/socket.pyc

So, as not-root, python resolves to 2.7. What about sudo python3 sniffsms.py server to try to force python3?

(Nov-01-2019, 09:46 PM)Gribouillis Wrote: I don't think sudo is the correct way to force python 3. Running as administrator serves radically different purposes than running another version of python.

No, by running in the virtual environment (created with "python3.6 -m venv pagesniff" in this case) I get python v3.6.6 - you can see that from the first dir(socket.socket()) I posted (actually you can't, I cut that line off, but all I entered was 'python' and I get 3.6). Using sudo is necessary at this point to be able to use socket() - once this is fully put together it will be a systemd service and that need goes away.

Hold up a bit on this - I just spoke with my Linux admin and he doesn't think it was the AD Domain add process, but possibly adding the system to our Ansible and/or Satelite setup that may have bit me. One thing I will try is creating a new virtual environment and see if THAT makes it happier.

Paul
Reply


Messages In This Thread
Working socket() program...isn't - by ptrivino - Nov-01-2019, 01:50 AM
RE: Working socket() program...isn't - by ptrivino - Nov-01-2019, 05:07 PM
RE: Working socket() program...isn't - by ptrivino - Nov-01-2019, 06:54 PM
RE: Working socket() program...isn't - by nilamo - Nov-01-2019, 07:14 PM
RE: Working socket() program...isn't - by ptrivino - Nov-01-2019, 07:51 PM
RE: Working socket() program...isn't - by nilamo - Nov-01-2019, 08:58 PM
RE: Working socket() program...isn't - by ptrivino - Nov-01-2019, 10:35 PM
RE: Working socket() program...isn't - by ptrivino - Nov-02-2019, 12:25 AM

Forum Jump:

User Panel Messages

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