Hi Edd,

On Thu, 13 Dec 2018, Edd Barrett wrote:

> Port-wise, I have one comment. I'd remove NO_TEST=Yes. Although there are no
> tests, it still succeeds to invoke the test target. If tests are added in a
> later release, we will run them without having to flip NO_TEST.

Ok, I'll remove it.

> I found a crash:
> ...
> VF-1>
> [1] Floodgap Systems gopher root/
> [2] Enter new search keywords <INP>
> [3] Folders/directories are least accurate! (and other notes)
> [4] Refining your query
> [5] France/
> [6] France/
> [7] FFDN: A Federation of DIY-ISPs in France and Belgium/
> Traceback (most recent call last):
>   File "/usr/local/bin/vf1", line 11, in <module>
>     load_entry_point('VF-1==0.0.10', 'console_scripts', 'vf1')()
>   File "/usr/local/lib/python3.6/site-packages/vf1.py", line 1004, in main
>     gc.cmdloop()
>   File "/usr/local/lib/python3.6/cmd.py", line 138, in cmdloop
>     stop = self.onecmd(line)
>   File "/usr/local/lib/python3.6/cmd.py", line 204, in onecmd
>     return self.emptyline()
>   File "/usr/local/lib/python3.6/site-packages/vf1.py", line 796, in emptyline
>     self.show_lookup(offset=i, end=i+10)
>   File "/usr/local/lib/python3.6/site-packages/vf1.py", line 500, in 
> show_lookup
>     print(self._format_gopheritem(n+offset+1, gi, name, url))
> UnicodeEncodeError: 'ascii' codec can't encode character '\u2013' in position 
> 9: ordinal not in range(128)
> --->8---

It crashes trying to show a unicode char on what would be result "8":

[8] 2018 – bitreichcon in Rodez, France/

I have no problems on my machine with that, so I've been reading the
README.md and it has something about encodings:

"""
## Text encoding

VF-1 attempts to decode the content received for any text-based item types
(e.g. 0, 1, 7, h) as UTF-8.  Most content in gopherspace is ASCII-encoded, and
since UTF-8 is backward compatible with ASCII, this will generally "just work".
If the received content *cannot* be decoded as UTF-8, one of two possible
things will happen.

If the [chardet](https://pypi.python.org/pypi/chardet) Python module is
installed on your system, VF-1 will use it to attempt to automatically detect
the encoding used and decode the text appropriately.  Note that pip etc. will
not install chardet for you when you install VF-1, as VF-1 does not formally
depend on chardet.  It uses it opportunistically, so that it can still be
easily installed and used on systems where chardet is not / cannot be installed.

If chardet is not installed, or if chardet cannot identify an encoding with
confidence exceeding 0.5, VF-1 will attempt to fall back to a single,
user-specified alternative encoding.  This encoding can be set with, e.g.:

```
VF-1> set encoding koi8-r
```

The default fall back encoding is iso-8559-1, which is used by the popular
gopher site floodgap.com.  If you routinely visit gopher sites encoded with some
other encoding, consider using an RC file (see below) to automatically set your
alternative encoding at start up.
"""

So, given this, should I make it dependent on textproc/py-chardet ? or
should be enough with the "set this on your rc file" thing ?

Cheers,

-- 
Paco Esteban
https://onna.be/gpgkey.asc

Reply via email to