Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When trying to use a Python script I get this error:

socket.error: [Errno 10013] An attempt was made to access a socket in a way forbidden by its access permissions

I put the post on Stackoverflow and I have been guided to come here and follow up with why I get the error.

http://stackoverflow.com/questions/18370235/socket-error-sending-email-using-gmail

As the post on stackoverflow suggests, the issue is not with Python, but my computer. I can even telnet to smtp.gmail.com

Can anyone provide any suggestions?

EDIT: SOLVED

The problem was McAfee Antivirus. It was blocking the socket connection.

From McAfee Access Protection Log

23/08/2013 10:23:54 a.m. Blocked by port blocking rule C:\Program Files (x86)\Python26\python.exe Anti-virus Standard Protection:Prevent mass mailing worms from sending mail 74.125.25.108:25

I disabled McAfee completely and it worked fine after that.

Thanks

share|improve this question
    
What OS are you using. Maybe you need to open firewall or router ports. – Doktoro Reichard Aug 22 '13 at 22:21
    
My OS is Windows 7 x64. – user1494941 Aug 22 '13 at 22:23
    
I think I found it. I tried disabling McAfee, but it still logs it in the log file 23/08/2013 10:23:54 a.m. Blocked by port blocking rule C:\Program Files (x86)\Python26\python.exe Anti-virus Standard Protection:Prevent mass mailing worms from sending mail 74.125.25.108:25. – user1494941 Aug 22 '13 at 22:25
    
Great, please make an answer post so that other who run into this problem can easily find the solution :) – David Aug 22 '13 at 22:28
    
McAfee's warning comes from a good thought, be careful writing code like this :) – Doktoro Reichard Aug 22 '13 at 22:37

VirusScan Console->Access Protection->Anti-Virus Standard protection->Prevent mass-mailing worms from sending mails (uncheck from Block tab)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.