jfrog / nexus2artifactory

NexusToArtifactory - A tool designed to ease migration from Sonatype Nexus to JFrog Artifactory.
Apache License 2.0
67 stars 54 forks source link

Unhandled exception in line 105 of Progress.py#render #47

Closed Smasherr closed 4 years ago

Smasherr commented 4 years ago

I have a mirrored instance of Nexus with Nexus2Artifactory installed on it, running in a docker container. Inside of that container I started a session of GNU Screen, to have the migration running as a background task and independently from my network connection. That migration took about 20 hours, so I reattached to the screen session on the next day. I saw that the migration was executed successfully (apart from several errors) and I wanted to quit the tool by pressing "q". But then this exception occured:

2019-10-21 09:23:08,582 [MainThread] [ERROR] (root:30) - Error running Nexus migration tool:
Traceback (most recent call last):
  File "./NexusToArtifactory.py", line 27, in initInteractive
    win.show()
  File "/nexus2artifactory/nex2art/core/Menu.py", line 179, in show
    if self.runact(sel, sel['act']): return
  File "/nexus2artifactory/nex2art/core/Menu.py", line 203, in runact
    elif hasattr(act, '__call__'): cont = self.showCall(sel, act)
  File "/nexus2artifactory/nex2art/core/Menu.py", line 223, in showCall
    cont = act(sel)
  File "/nexus2artifactory/nex2art/menu/Main.py", line 64, in runmigration
    status, msg = Progress(self.scr).show(self.scr.state.todict())
  File "/nexus2artifactory/nex2art/core/Progress.py", line 39, in show
    self.render(result)
  File "/nexus2artifactory/nex2art/core/Progress.py", line 105, in render
    while chr(self.scr.getch(self.scr.win)) != 'q': pass
ValueError: chr() arg not in range(256)
2019-10-21 09:23:08,637 [MainThread] [INFO] (root:33) - Terminating Nexus migration tool.

Currently I cannot reproduce it, I am not really sure what exact key sequence of keys I pressed. It seems there is a try to cast the input to a character, but my terminal sent some sequens which wasn't a character. Maybe an alternative should be found for the function chr.

DarthFennec commented 4 years ago

Merged your PR, thanks! It definitely seems like that will fix it.