View Issue Details

IDProjectCategoryView StatusLast Update
0005094GNUnetfile-sharing servicepublic2018-06-07 00:24
ReporterHeiko Stamer Assigned ToChristian Grothoff  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionopen 
Platformx86_64OSGentoo 
Product VersionGit master 
Target Version0.11.0pre66Fixed in Version0.11.0pre66 
Summary0005094: test_gnunet_fs_psd.py: make check fails due to illegal character
DescriptionFAIL: test_gnunet_fs_psd.py
===========================

Traceback (most recent call last):
  File "./test_gnunet_fs_psd.py", line 64, in <module>
    s.expect ("stdout", re.compile (r'gnunet-download -o "test_gnunet_fs_rec_data.tgz" gnunet://fs/chk/2ZMHKPV74CB6GB1GFKQRR95BXJQA2SER25FN48GAW7WSBPA0GDEM5Y74V1ZJHM0NA6919TVW376BHTFDRE3RYS0KRY92M1QJVKPHFCR\.49BT3V5C10KA1695JF71FCT8ZZG4JMJSH04BD9CT22R6KEM915A7CEST17RD0QYTHXV5M4HHEGJMEZSFRDB7JAYC0EMJAN2V781E9DG\.17822\r?\n'))
  File "../../contrib/gnunet_pyexpect.py", line 59, in expect
    m = r.search (stream.decode(), flags)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 297: ordinal not in range(128)
FAIL test_gnunet_fs_psd.py (exit status: 1)
TagsNo tags attached.

Activities

Christian Grothoff

2017-07-18 23:01

manager   ~0012347

I cannot reproduce this. What OS and what character sets are you using? Is there actually an odd character on disk in that file on your system?

Heiko Stamer

2017-07-19 07:06

reporter   ~0012348

My test system is Gentoo Linux and LANG="de_DE.utf8". However, the default encoding for python 2.x is set to 'ascii'; I guess GNUnet expect 'utf8':

Python 2.7.13 (default, Apr 4 2017, 11:28:40)
[GCC 5.4.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> reload(sys)
<module 'sys' (built-in)>
>>> sys.getdefaultencoding()
'ascii'

I found a similar question here: https://stackoverflow.com/questions/21129020/how-to-fix-unicodedecodeerror-ascii-codec-cant-decode-byte

Christian Grothoff

2017-07-20 10:06

manager   ~0012357

Indeed, we do use UTF8 for all the code. I'll read up on how to fix this.

Christian Grothoff

2017-07-21 14:17

manager   ~0012361

The test passes on my system. I checked, and for my Python 2.7 the default character set is ASCII, and the test does pass. Also, I tried iconv to convert the source file from utf8 to ascii -- the conversion didn't change a single letter, so the characters are already in ascii.

So not sure what I can do here, as I cannot reproduce it.

Heiko Stamer

2017-07-22 22:35

reporter   ~0012362

Inserting the following lines into test_gnunet_fs_psd.py.in works for me:

reload(sys)
sys.setdefaultencoding('utf8')

However, now the test fails with the following message:

Failed to find `\s*description: Test archive\r?\n' in stdout, which is is ` Datum der Veröffentlichung: Sa Jul 22 22:15:58 2017
                    MIME-Typ: application/x-tar
                      Format: GNU tar format
           embedded filename: dir/a/INSTALL
                Beschreibung: Test archive
           embedded filename: dir/b/NEWS
           embedded filename: dir/NEWS
           embedded filename: dir/a/
           embedded filename: dir/b/
           embedded filename: dir/

'
FAIL test_gnunet_fs_psd.py (exit status: 2)

Christian Grothoff

2017-07-24 18:55

manager   ~0012365

The latter failure should be fixed in Git master, please just 'git pull'.

Christian Grothoff

2017-07-24 18:57

manager   ~0012366

Added patch as suggested in Git b669f8b6b..09d06d08c

Issue History

Date Modified Username Field Change
2017-06-25 17:57 Heiko Stamer New Issue
2017-07-18 23:01 Christian Grothoff Note Added: 0012347
2017-07-18 23:01 Christian Grothoff Assigned To => Christian Grothoff
2017-07-18 23:01 Christian Grothoff Status new => feedback
2017-07-19 07:06 Heiko Stamer Note Added: 0012348
2017-07-19 07:06 Heiko Stamer Status feedback => assigned
2017-07-20 10:06 Christian Grothoff Note Added: 0012357
2017-07-21 14:17 Christian Grothoff Status assigned => feedback
2017-07-21 14:17 Christian Grothoff Note Added: 0012361
2017-07-22 22:35 Heiko Stamer Note Added: 0012362
2017-07-22 22:35 Heiko Stamer Status feedback => assigned
2017-07-24 18:55 Christian Grothoff Note Added: 0012365
2017-07-24 18:57 Christian Grothoff Note Added: 0012366
2017-07-24 18:57 Christian Grothoff Status assigned => resolved
2017-07-24 18:57 Christian Grothoff Fixed in Version => 0.11.0pre66
2017-07-24 18:57 Christian Grothoff Target Version => 0.11.0pre66
2018-06-07 00:24 Christian Grothoff Status resolved => closed