Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
Trac
Trac
  • Project overview
    • Project overview
    • Details
    • Activity
  • Issues 246
    • Issues 246
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Operations
    • Operations
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Create a new issue
  • Issue Boards

GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

  • Legacy
  • TracTrac
  • Issues
  • #12225

Closed
Open
Opened Jun 07, 2014 by Trac@tracbot

arm fails to start upon invalid attempt to concatenate int and string

The stack trace is:

Traceback (most recent call last):
  File "./run_arm", line 49, in <module>
    main()
  File "./run_arm", line 18, in main
    arm.starter.main()
  File "/home/pmezard/dev/arm/arm/starter.py", line 94, in main
    curses.wrapper(arm.controller.start_arm)
  File "/usr/lib/python2.6/curses/wrapper.py", line 43, in wrapper
    return func(stdscr, *args, **kwds)
  File "/home/pmezard/dev/arm/arm/controller.py", line 640, in start_arm
    control.redraw(False)
  File "/home/pmezard/dev/arm/arm/controller.py", line 436, in redraw
    panel_impl.redraw(force)
  File "/home/pmezard/dev/arm/arm/util/panel.py", line 428, in redraw
    self.draw(self.max_x, self.max_y)
  File "/home/pmezard/dev/arm/arm/header_panel.py", line 254, in draw
    for label in (self.vals.nickname, " - " + my_address, ":" + self.vals.or_port, dir_port_label):
TypeError: cannot concatenate 'str' and 'int' objects

A possible fix:

commit 57c20fed78a263930e6774f7de47747a1861728a
Author: Patrick Mezard <patrick@mezard.eu>
Date:   Sat Jun 7 23:20:06 2014 +0200

    Fix invalid or_port type formatting when making labels

diff --git a/arm/header_panel.py b/arm/header_panel.py
index 0c7e669..94cf893 100644
--- a/arm/header_panel.py
+++ b/arm/header_panel.py
@@ -251,7 +251,7 @@ class HeaderPanel(panel.Panel, threading.Thread):
 
       dir_port_label = ", Dir Port: %s" % self.vals.dir_port if self.vals.dir_port != "0" else ""
 
-      for label in (self.vals.nickname, " - " + my_address, ":" + self.vals.or_port, dir_port_label):
+      for label in (self.vals.nickname, " - " + my_address, ":%d" % self.vals.or_port, dir_port_label):
         if x + len(label) <= left_width:
           self.addstr(1, x, label)
           x += len(label)

I suppose it comes from:

return [(addr, int(port)) for (addr, port) in proxy_addrs]

done when generating listeners lists in stem. But I understand nothing about the code.

Trac:
Username: pmezard

To upload designs, you'll need to enable LFS and have admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: legacy/trac#12225