waldenner / robotframework

Automatically exported from code.google.com/p/robotframework
Apache License 2.0
0 stars 0 forks source link

Files without extension inside test data directories crash execution #580

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Jybot fails to run the test suite with this exception:

[ ERROR ] Unexpected error: ValueError: need more than 1 value to unpack

As it doesn't return any other useful information I can't solve it by myself.

I tried to debug this issue with Pydev in Eclipse, but I do not even reach my 
first breakpoint in runner.py:307

pydev debugger: starting
[ ERROR ] Unexpected error: ValueError: need more than 1 value to unpack

Environment: WinXP 64bit with Jython 2.5.1 

Original issue reported on code.google.com by kai.hack...@gmail.com on 28 Jun 2010 at 9:58

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
ignore my last entry. I attached the robot syslog output

Original comment by kai.hack...@gmail.com on 28 Jun 2010 at 10:35

Attachments:

GoogleCodeExporter commented 9 years ago
Analyzing that syslog a bit by myself I found that it may not like the way I 
started the jybot.bat:

C:\workspace\iE2-5.0.0-SNAPSHOT\Automated 
Testing>C:\Java\jython-2.5.1\bin\jybot.bat .

It tries to split the '.' ...

So I tried it with 

C:\workspace\iE2-5.0.0-SNAPSHOT\Automated 
Testing>C:\Java\jython-2.5.1\bin\jybot.bat 
"C:\workspace\iE2-5.0.0-SNAPSHOT\Automated Testing\"

which caused this output in attachment

Original comment by kai.hack...@gmail.com on 28 Jun 2010 at 10:41

Attachments:

GoogleCodeExporter commented 9 years ago
As you can probably see in the log it seems to misinterpret the '\"' at the end 
of the argument as an escaped quote. as I said this is M$ Windows environment 
and I need the quotes to supply a command line argument containing spaces - as 
the path does.

All this worked perfectly in earlier release.

Original comment by kai.hack...@gmail.com on 28 Jun 2010 at 10:44

GoogleCodeExporter commented 9 years ago
Problem found:

In parsing/populators.py:160 one tries to split the file into base and 
extension - this line causes the ValueError problem if there is a file in the 
tested directory that has no extension.

To repeat this problem run jybot with a data source folder where there is a 
file without extension.

Original comment by kai.hack...@gmail.com on 29 Jun 2010 at 3:33

GoogleCodeExporter commented 9 years ago
Solution: 

Modified class FromDirectoryPopulator in parsing/populators.py:
Fixed methods _is_init_file and _is_ignored to test first before splitting. 

Code attached.

Original comment by kai.hack...@gmail.com on 29 Jun 2010 at 3:54

Attachments:

GoogleCodeExporter commented 9 years ago
The issue from comment #3/#4 is most probably a jython 2.5.1 issue as the 
argument is already invalid in sys.argv.

Original comment by kai.hack...@gmail.com on 29 Jun 2010 at 4:11

GoogleCodeExporter commented 9 years ago
Created issue on jython tracker: http://bugs.jython.org/msg5852

Original comment by kai.hack...@gmail.com on 29 Jun 2010 at 4:41

GoogleCodeExporter commented 9 years ago
Am I correct that there are two separate problems in this issue?

1) Files without extension crash the execution with ValueError. This is 
interpreter and os independent bug and easy to reproduce:

$ echo foo > foo
$ pybot .
[ ERROR ] Unexpected error: ValueError: need more than 1 value to unpack

2) On Windows quoted arguments are handled incorrectly by Jython. I don't have 
Windows machine to test this, but I don't think we could/should do anything for 
it on RF side anyway.

Kai, did you notice Oti had commended http://bugs.jython.org/issue1624 and 
asked for more information? Jython 2.5.2 is currently on beta and if you can 
help fixing the issue the fix could still make the final version.

The problem with files without extensions is pretty severe and needs to be 
fixed in RF 2.5.1. If you Kai want to help a bit more, creating a patch from 
you fix would make reviewing it easier. Not a big deal in this particular case, 
though.

Original comment by pekka.klarck on 29 Jun 2010 at 7:39

GoogleCodeExporter commented 9 years ago
Pekka,

I have communicated with Oti in the jython tracker and he was able to reproduce 
it. He's now looking into it.

Here's a diff file for the first issue.

Original comment by kai.hack...@gmail.com on 1 Jul 2010 at 11:56

Attachments:

GoogleCodeExporter commented 9 years ago
Fixed with tests in r3788. Decided to use os.path.splitext instead of splitting 
from '.'.

Original comment by pekka.klarck on 2 Jul 2010 at 10:04

GoogleCodeExporter commented 9 years ago

Original comment by pekka.klarck on 2 Jul 2010 at 10:05

GoogleCodeExporter commented 9 years ago
Issue 581 has been merged into this issue.

Original comment by pekka.klarck on 7 Jul 2010 at 9:22