Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6857129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:58:33+00:00 2026-05-27T01:58:33+00:00

Below is a code snip with error trace of a python scripted windows service

  • 0

Below is a code snip with error trace of a python scripted windows service I am running. It seems to work fine in python 2.7 on windows xp but the production machine I am using runs python 2.5 on windows server 2003. The main error I am having is 'error' object has no attribute 'errno' Am I doing something that is fundamentally wrong for python 2.5 that works for 2.7?

Code Snip:

try:
     if s == None:
          s = self.connect()
     char = s.recv(1)
     line += char

except socket.timeout:
    if s != None:
        s.close()
    s = None
    continue

except socket.error, socket_error:
    servicemanager.LogErrorMsg(traceback.format_exc())

    if socket_error.errno == errno.ECONNREFUSED:
        if s != None:
            s.close()
        time.sleep(60)

        s =None                    
        continue

    else:
        if s != None:
            s.close()
        os._exit(-1)

else:
    pass

Error Trace Snip:

if socket_error.errno == errno.ECONNREFUSED:
AttributeError: 'error' object has no attribute 'errno' 
%2: %3
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T01:58:34+00:00Added an answer on May 27, 2026 at 1:58 am

    As explained here, in python 2.6 :

    Changed in version 2.6: socket.error is now a child class of IOError.

    and the children classes of IOError have a errno member.

    If you want to get the errno related to your error in python < 2.6, (and assuming that the way described here is valid for raising socket.error) you’ll have to get it from the args attribute of your exception :

    except socket.error, socket_error:
        if socket_error.args[0] == errno.ECONNREFUSED:
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The below code works fine in Chrome, but doesn't work correctly in Firefox. In
The below code seems like it should work; however, the blob in the database
Below code gives this error message Specified method is not supported. But here is
Below code works fine in Firefox, but not in IE8. It triggers mouse click
Below code saying error incorreect syntax near Main INSERT INTO tbl ( 'Week', Main,
My below code works fine and is used to populate a <select> item with
When running the below code a type is never returned, despite there being a
Below code is working properly now. But if I replace 'text.txt' with ' http://google.com
I am stuck now, here below is a snip from my paging code, this
The code below works perfectly fine with Firefox, however, I am having problems with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.