Advertisement
Guest User

Untitled

a guest
Feb 12th, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.56 KB | None | 0 0
  1. In [1]: exec_wait(agwlib.send_V,1,'CR7ALW','CQ',['WIDE-2'])
  2. <class 'str'>
  3. ---------------------------------------------------------------------------
  4. TypeError                                 Traceback (most recent call last)
  5. D:\Documentos\Python\APRS\tests.py in <module>()
  6. ----> 1 exec_wait(agwlib.send_V,1,'CR7ALW','CQ',['WIDE-2'])
  7.  
  8. D:\Documentos\Python\APRS\tests.py in exec_wait(func, *args)
  9.      37
  10.      38 def exec_wait(func,*args):
  11. ---> 39     data=func(*args)
  12.      40     print(data)
  13.      41     s.send(data)
  14.  
  15. D:\Documentos\Python\APRS\agwlib.py in send_V(port, self, other, VIA, PID)
  16.     189         VIA_data+=str.encode(elem)+b'\x00'
  17.     190     print(type(other))
  18. --> 191     return pack(port, self, other, VIA_data, PID)
  19.     192
  20.     193 def send_c(port, self, other, PID):
  21.  
  22. D:\Documentos\Python\APRS\agwlib.py in pack(Port, DataKind, CallFrom, CallTo, data, PID)
  23.      75     packet+=b'\x00' #Reserved
  24.      76     packet+=packCall(CallFrom)
  25. ---> 77     packet+=packCall(CallTo)
  26.      78     packet+=struct.pack('<I', len(data)) #32 uint, data_len
  27.      79     packet+=b'\x00\x00\x00\x00' #User(reserved) 32 bits unsigned integer, not used. Reserved for future use
  28.  
  29. D:\Documentos\Python\APRS\agwlib.py in packCall(call)
  30.      56 #Basic functions----------------------------------------------------------------
  31.      57 def packCall(call):
  32. ---> 58     result=str.encode(call)
  33.      59     while len(result)<10: #10 Acording to the API
  34.      60         result+=b'\x00'
  35.  
  36. TypeError: descriptor 'encode' requires a 'str' object but received a 'bytes'
  37.  
  38. In [2]:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement