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 7866569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:26:12+00:00 2026-06-03T00:26:12+00:00

File clienttest.py, line 3, in <module> x = handle.Client() File /home/tmac/Handle/handle.py, line 131, in

  • 0
File "clienttest.py", line 3, in <module>
   x = handle.Client()
File "/home/tmac/Handle/handle.py", line 131, in __init__
   Task.CLT_UPDATE:self.__clt_updates,
AttributeError: 'Client' object has no attribute '_Client__clt_updates'

my code throws this error when creating an instance but the function exists. It seems to be prepending _Client to it and i cant figure out why

heres the class definition

class Client(threading.Thread):
    def __init__(self):
        threading.Thread.__init__(self)
        #create task q
        self.tasks = Queue.Queue(maxsize=0)
        print str(self)
        #create database
        self.database = server.Database()
        self.database.loadconfig()

        #create networking
        self.network = network.Network(self.tasks)

        #put startup tasks
        self.network.cmd_q.put(NetworkCommand(NetworkCommand.CONNECT,('127.0.0.1',self.database.config['Handle']['port'])))

        #create gui
        self.gui = gui.Gui(self)
        #define task handlers
        self.handlers = {
                Task.CLT_UPDATE:self.__clt_updates,
                            ^----The problem seems to be here--------^
                Task.CLT_INPUT:self.__clt_input,
                Task.CLT_LINEUP:self.__clt_lineup
                }

        #define alive flag
        self.alive = threading.Event()
        self.alive.set()

        #setup logging
        logging.basicConfig(level=self.loglvl, filename='client.log', format='%(asctime)s %(name)s %(levelname)s: %(message)s', datefmt='%Y-%m-%d %H:%M:%S')
        self.log = logging.getLogger('CLIENT')



        def run(self):
            self.network.start()
            self.gui.initscreen()
            while self.alive.isSet():
                try:
                    task = self.tasks.get(True, 0.1)
                    self.log.debug('Got Task: ' + task.stype[task.type])
                    self.handlers[task.type](task)

                except Queue.Empty:
                    pass


        def addtask(self, task):
            self.tasks.put(task)

        def __clt_updates(self, task):
            raise NotImplemented()

        def __clt_input(self, task):
            pack = Packet(Packet.INPUT,task.data)
            self.network.cmd_q.put(NetworkCommand(NetworkCommand.SEND,pack))
            self.log.debug(':[H]Sent Command: ' + task.data)

        def __clt_lineup(self, task):
            self.gui.addline(task.data)
            self.log.debug(':[H]Line Update: ' + task.data)
  • 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-06-03T00:26:14+00:00Added an answer on June 3, 2026 at 12:26 am

    Double underscores in Python cause the Python name mangling to kick in at run time. Name mangling will prepend the class name to each method in the class that has a name starting with 2 underscores. If you want privateish methods without name mangling, use single underscore.

    As noted below in the comments, it looks like you also have an indentation problem. My guess is that you intend to be creating those methods as class members, but as the question has them here, they are actually indented under __init__.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

File /usr/local/lib/python3.0/cgi.py, line 477, in __init__ self.read_urlencoded() File /usr/local/lib/python3.0/cgi.py, line 577, in read_urlencoded self.strict_parsing):
File C:\Python25\lib\SocketServer.py, line 330, in __init__ self.server_bind() File C:\Python25\lib\BaseHTTPServer.py, line 101, in server_bind SocketServer.TCPServer.server_bind(self)
File /usr/local/lib/python2.5/site-packages/libxml2.py, line 1, in <module> import libxml2mod ImportError: /usr/local/lib/python2.5/site-packages/libxml2mod.so: undefined symbol:xmlTextReaderSetup >>> import
File: /home/USER/DIR/a http://www.here.is.a.hyper.link.net/ /home/USER/DIR/b http://www.here.is.another.hyper.link.net/ Need to remove all the odd lines in this
file.each_line do |line| #skip the first one/not a user 3.times { next } if
File C:\Users\Tom\Desktop\Tetris!\tetris.py, line 206, in typeSet Globals.blockArray[i].x.append(7) IndexError: list index out of range I
File foo.txt exists on the remote machine at: /home/user/foo.txt It doesn't exist on the
File C:\Program Files\Google\google_appengine\google\net\proto\ProtocolBuffer .py, line 436, in skipData raise ProtocolBufferDecodeError, corrupted google.net.proto.ProtocolBuffer.ProtocolBufferDecodeError: corrupted What's
File is sent to the client using Response.writefile and content diposition as inline. When
File foo has text: This| is a line. If I place the cursor at

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.