Libervis Network - For a Free WorldLibervis Projects | Nuxified Projects
Welcome guest. Register | Login | Show what's new

[SOLVED] Python Sockets ...

[SOLVED] Python Sockets ...

It was working perfectly today, dident touch it at all, then I came back a few hours later and ran the program and got an error.

tyler@tyler-laptop:~$ python chat.py
Traceback (most recent call last):
  File "chat.py", line 1, in 
    from socket import socket, gethostbyname, AF_INET, SOCK_STREAM;
  File "/usr/lib/python2.5/socket.py", line 5, in 
    This module provides socket operations and some related functions.
AttributeError: 'module' object has no attribute 'AF_INET'
Error in sys.excepthook:
Traceback (most recent call last):
  File "/var/lib/python-support/python2.5/apport_python_hook.py", line 38, in apport_excepthook
    from apport.fileutils import likely_packaged
  File "/var/lib/python-support/python2.5/apport/__init__.py", line 1, in 
    from apport.report import Report
  File "/var/lib/python-support/python2.5/apport/report.py", line 14, in 
    import subprocess, tempfile, os.path, urllib, re, pwd, grp, os, sys
  File "/usr/lib/python2.5/urllib.py", line 26, in 
    import socket
  File "/usr/lib/python2.5/socket.py", line 5, in 
    This module provides socket operations and some related functions.
AttributeError: 'module' object has no attribute 'AF_INET'

Original exception was:
Traceback (most recent call last):
  File "chat.py", line 1, in 
    from socket import socket, gethostbyname, AF_INET, SOCK_STREAM;
  File "/usr/lib/python2.5/socket.py", line 5, in 
    This module provides socket operations and some related functions.
AttributeError: 'module' object has no attribute 'AF_INET'

Any idea how to fix this :S, I dont understand why it would randomly stop working?

Thanks.


possible reasons: 1) you

possible reasons:

1) you have multiple copies of your script, and accidentally ran a different one
2) automatic update run by a cron job?
3) filesystem corruption - how old is your hard disk?

__________________

CAN I HAS FIXD CAPSLOK KEE PLZ?

1) Nope 2) Nope 3) 2 years

1) Nope
2) Nope
3) 2 years

filesystem corruption

I doubt this will work, but try fscking the partitions that the script and Python are on anyway.

__________________

Disclaimer: My posts may change (dramatically) within the first 15 minutes they're posted.

Ah I found the problem, it

Ah I found the problem, it seems I cant run socket things from my home folder ... I moved the script into a new folder and it worked.

Thanks.

odd. are you using SElinux

odd. are you using SElinux or something?

__________________

CAN I HAS FIXD CAPSLOK KEE PLZ?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

We have 3847 members who wrote 2063 articles and 11938 comments. Welcome to our newest member, hutopire!

Who's online

There are currently 0 users and 16 guests online.
Nuxified RSS feed