ncoronado / tracshell

Automatically exported from code.google.com/p/tracshell
1 stars 0 forks source link

AttributeError when editing ticket #45

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Configure a Trac instance in ~/.tracshell
2. Connect using `tracshell`
3. `edit 645`, where 645 is a valid ticket number

What is the expected output? What do you see instead?
Expected to see $EDITOR window with existing ticket information. Actually saw 
backtrace:
Welcome to TracShell!
Type `help` for a list of commands
trac->> edit 645
Traceback (most recent call last):
  File "bin/tracshell", line 6, in <module>
    run()
  File "/usr/lib/python2.7/site-packages/tracshell/core.py", line 51, in run
    shell.start_shell(s, args)
  File "/usr/lib/python2.7/site-packages/tracshell/shell.py", line 74, in start_shell
    shell.cmdloop()
  File "/usr/lib64/python2.7/cmd.py", line 142, in cmdloop
    stop = self.onecmd(line)
  File "/usr/lib64/python2.7/cmd.py", line 219, in onecmd
    return func(arg)
  File "/usr/lib/python2.7/site-packages/tracshell/helpers.py", line 28, in wrapper
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/tracshell/shell.py", line 361, in do_edit
    for k, v in orig_data.iteritems()]
AttributeError: DateTime instance has no attribute 'rstrip'

What version of the product are you using? On what operating system?
r70 of tracshell, Trac 0.12.2 (non SSL), TracXMLRPC 1.1.2-r10706

Please provide any additional information below.
Used `pdb` to print value of `orig_data`:
(Pdb) orig_data
{'status': 'new', 'changetime': <DateTime '20111115T22:25:12' at 20fdc68>, 
'description': ... etc.
So it looks like the issue can be solved by simply casting v to `str` before 
calling `rstrip` on it )see attached patch).

Original issue reported on code.google.com by carlvant...@gmail.com on 16 Nov 2011 at 2:38

Attachments:

GoogleCodeExporter commented 8 years ago
There is a related error when submitting the edit (on closing $EDITOR):
Traceback (most recent call last):
  File "bin/tracshell", line 6, in <module>
    run()
  File "/usr/lib/python2.7/site-packages/tracshell/core.py", line 51, in run
    shell.start_shell(s, args)
  File "/usr/lib/python2.7/site-packages/tracshell/shell.py", line 74, in start_shell
    shell.cmdloop()
  File "/usr/lib64/python2.7/cmd.py", line 142, in cmdloop
    stop = self.onecmd(line)
  File "/usr/lib64/python2.7/cmd.py", line 219, in onecmd
    return func(arg)
  File "/usr/lib/python2.7/site-packages/tracshell/helpers.py", line 28, in wrapper
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/tracshell/shell.py", line 368, in do_edit
    if v in data[k]:
TypeError: 'in <string>' requires string as left operand, not instance

Updated patch attached

Original comment by carlvant...@gmail.com on 16 Nov 2011 at 2:46

Attachments: