Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not Support Other Unicode Character Like Chinese Character. #82

Closed
wywincl opened this issue Sep 7, 2016 · 13 comments
Closed

Does not Support Other Unicode Character Like Chinese Character. #82

wywincl opened this issue Sep 7, 2016 · 13 comments

Comments

@wywincl
Copy link

wywincl commented Sep 7, 2016

my directory:
Topsuite
| --- Testsuite1
| --- Testsuite2-测试2.robot

and exec:
pabot --processes 2 Topsuite

here are error info:

[ ERROR ] Suite 'Topsuite' contains no tests in suite 'Topsuite.Testsuite2-娴嬭瘯2'.

Try --help for usage @InFormation.


I think it's relate to #81

@mkorpela
Copy link
Owner

Thank you for reporting this

@cs-awater
Copy link

hope solve soon...

@mkorpela
Copy link
Owner

mkorpela commented Jan 1, 2017

I am unable to reproduce the problem on my OSX machine.
This most likely is related to terminal encoding, thus I need to know which it is in order to reproduce the problem - assuming this is still a valid issue.

python
Python 2.7.10 (default, Jul 30 2016, 19:40:32) 
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.stdout.encoding
'UTF-8'

Thus I need to know what the previous thing is in problem case.

@wywincl
Copy link
Author

wywincl commented Jan 2, 2017

My platform is windows 7.
and sys.stdout.encoding is cp936.

And I do this in Linux, it work well , I think maybe the problem is caused by terminal encoding.

@mkorpela
Copy link
Owner

mkorpela commented Jan 2, 2017

@wywincl what does the following return:

python                                
Python 2.7.10 (default, Jul 30 2016, 19:40:32) 
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import locale
>>> locale.getpreferredencoding()
'UTF-8'

@wywincl
Copy link
Author

wywincl commented Jan 2, 2017

@mkorpela , also cp936 in my windows system.

Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec  5 2015, 20:40:30) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.stdout.encoding
'cp936'
>>> import locale
>>> locale.getpreferredencoding()
'cp936'
>>>

@pekkaklarck
Copy link

Getting correct encoding from the system is annoyingly hard. I recommend looking how RF itself does it. Could also use its utils directly.

@mkorpela
Copy link
Owner

mkorpela commented Jan 3, 2017

@wywincl Could you clone this repository and test if change 96cb656 fixed the problem?

git clone git@github.com:mkorpela/pabot.git
cd pabot
python setup.py install

@wywincl
Copy link
Author

wywincl commented Jan 4, 2017

@mkorpela

resolved in this version.
Here is the output info.

D:\auto_test_code\robot\pabot\build\lib\pabot>python -m pabot --processes 4 topsuite
2017-01-04 16:08:05.589000 [PID:23340] [2] EXECUTING Topsuite.Testsuite1
2017-01-04 16:08:05.589000 [PID:25476] [0] EXECUTING Topsuite.2Suite.Testsuite4
2017-01-04 16:08:05.589000 [PID:26300] [1] EXECUTING Topsuite.2Suite.Testsuite5-测试5
2017-01-04 16:08:05.590000 [PID:25908] [3] EXECUTING Topsuite.Testsuite2-测试2
2017-01-04 16:08:06.313000 [PID:25908] [3] PASSED Topsuite.Testsuite2-测试2 in 0.7 seconds
2017-01-04 16:08:06.315000 [PID:23980] [3] EXECUTING Topsuite.Testsuite3
2017-01-04 16:08:06.392000 [PID:25476] [0] PASSED Topsuite.2Suite.Testsuite4 in 0.8 seconds
2017-01-04 16:08:06.413000 [PID:26300] [1] PASSED Topsuite.2Suite.Testsuite5-测试5 in 0.8 seconds
2017-01-04 16:08:06.422000 [PID:23340] [2] PASSED Topsuite.Testsuite1 in 0.8 seconds
2017-01-04 16:08:06.917000 [PID:23980] [3] PASSED Topsuite.Testsuite3 in 0.6 seconds
Output:  D:\auto_test_code\robot\pabot\build\lib\pabot\output.xml
Log:     D:\auto_test_code\robot\pabot\build\lib\pabot\log.html
Report:  D:\auto_test_code\robot\pabot\build\lib\pabot\report.html
Elapsed time: 0 minutes 1.766 seconds

D:\auto_test_code\robot\pabot\build\lib\pabot>python
Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec  5 2015, 20:40:30) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.stdout.encoding
'cp936'
>>>

but when run python setup.py install
it log this error:

removing 'build\bdist.win-amd64\egg' (and everything under it)
Traceback (most recent call last):
  File "setup.py", line 33, in <module>
    install_requires=['robotframework', 'robotremoteserver'])
  File "C:\Python27\lib\distutils\core.py", line 151, in setup
    dist.run_commands()
  File "C:\Python27\lib\distutils\dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
    cmd_obj.run()
  File "C:\Python27\lib\site-packages\setuptools\command\install.py", line 67, in run
    self.do_egg_install()
  File "C:\Python27\lib\site-packages\setuptools\command\install.py", line 117, in do_egg_install
    cmd.run()
  File "C:\Python27\lib\site-packages\setuptools\command\easy_install.py", line 411, in run
    self.easy_install(spec, not self.no_deps)
  File "C:\Python27\lib\site-packages\setuptools\command\easy_install.py", line 644, in easy_install
    with self._tmpdir() as tmpdir:
  File "C:\Python27\lib\contextlib.py", line 17, in __enter__
    return self.gen.next()
  File "C:\Python27\lib\site-packages\setuptools\command\easy_install.py", line 633, in _tmpdir
    tmpdir = tempfile.mkdtemp(prefix=six.u("easy_install-"))
  File "C:\Python27\lib\tempfile.py", line 337, in mkdtemp
    file = _os.path.join(dir, prefix + name + suffix)
  File "C:\Python27\lib\ntpath.py", line 85, in join
    result_path = result_path + p_path
  File "C:\Python27\lib\encodings\utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xcd in position 7: invalid continuation byte

@mkorpela
Copy link
Owner

mkorpela commented Jan 4, 2017

Thank you @wywincl !

@mkorpela
Copy link
Owner

mkorpela commented Jan 4, 2017

Ok. Version 0.35 is now out. Could you test @wywincl that it can be installed and solves the issue?

@mkorpela mkorpela closed this as completed Jan 4, 2017
@wywincl
Copy link
Author

wywincl commented Jan 5, 2017

@mkorpela , I run pip install -U robotframework-pabot==0.35 on my Window 7 Chinese version, And it has been installed successfully.

Also Can deal with the Unicode Character.

I test it both in windows and linux platform.

Thank's for resolving the problem. @mkorpela

@mkorpela
Copy link
Owner

mkorpela commented Jan 5, 2017

Thank you for reporting the issue and testing that the fix worked!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants