Opened 3 years ago

Closed 14 months ago

#18660 closed defect (fixed)

OSX's man command lacks '--encoding' argument

Reported by: Sebastian Owned by: atagar
Priority: Low Milestone:
Component: Core Tor/Stem Version:
Severity: Normal Keywords: utils
Cc: cc@… Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description (last modified by atagar)

On OSX the 'man' command lacks an '--encoding' argument which we use to normalize some of the results. As a result stem.manual.from_man and stem.manual.from_remote don't have all the fields available on other platforms.

For now a couple unit tests are disabled on OSX due to this.

Child Tickets

Change History (21)

comment:1 Changed 3 years ago by atagar

Component: - Select a componentStem
Owner: set to atagar

comment:2 Changed 3 years ago by atagar

Thanks Sebastian! Pushed something that should fix this, mind giving it a whirl?

comment:3 Changed 3 years ago by atagar

Resolution: fixed
Status: newclosed

This fix really should do the trick so resolving. Feel free to reopen if it doesn't do the trick. :)

comment:4 Changed 3 years ago by Sebastian

Unfortunately:

  File "/tor-git/stem/test/unit/manual.py", line 137, in test_parsing_with_example
    self.assertEqual('tor - The second-generation onion router', manual.name)
AssertionError: 'tor - The second-generation onion router' != ''

comment:5 Changed 3 years ago by Sebastian

Resolution: fixed
Status: closedreopened

comment:6 Changed 3 years ago by atagar

Description: modified (diff)
Keywords: utils added
Priority: MediumLow
Status: reopenednew
Summary: test_parsing_with_example, test_parsing_with_unknown_options, test_saving_manual failures on OSXOSX's man command lacks '--encoding' argument

comment:7 Changed 15 months ago by ewong

pardon me, but this isn't just an OSX issue. I use slackware-current, and
--encoding=ascii doesn't work. man version = 1.6g.

What version has --encoding=ascii (or -E ascii)?

comment:8 in reply to:  7 Changed 15 months ago by yawning

Replying to ewong:

pardon me, but this isn't just an OSX issue. I use slackware-current, and
--encoding=ascii doesn't work. man version = 1.6g.

What version has --encoding=ascii (or -E ascii)?

http://www.nongnu.org/man-db/

comment:11 Changed 15 months ago by atagar

Resolution: fixed
Status: newclosed

Thanks ewong! Pushed your branch with some little tweaks.

comment:13 Changed 15 months ago by atagar

Oops! My bad, thanks for the catch. Pushed.

comment:14 Changed 15 months ago by ewong

nope.. my bad.. https://github.com/ewongbb/stem/tree/t18660_3 really sorry for this.

comment:15 Changed 15 months ago by ewong

Cc: cc@… added

comment:16 Changed 15 months ago by atagar

No worries in the least. Thanks again for the patches! They're much appreciated. :)

comment:17 Changed 15 months ago by ewong

Resolution: fixed
Status: closedreopened

the test_from_man_when_manual_is_unavailable() test needs to also include
the patch() line for HAS_ENCODING_ARG. otherwise, it'll still run
and since the resulting command = 'man -P cat tor' (on bsd, mac and slackware),
won't be equal to 'man --encoding=ascii -P cat tor' .. it'll fail.

https://github.com/ewongbb/stem/tree/fix_test_from_man_unavailable

this should fix it.

comment:18 Changed 15 months ago by ewong

Status: reopenedneeds_review

comment:19 Changed 15 months ago by atagar

Thanks Edmund! Fix pushed.

comment:20 in reply to:  4 Changed 14 months ago by ewong

Replying to Sebastian:

Unfortunately:

  File "/tor-git/stem/test/unit/manual.py", line 137, in test_parsing_with_example
    self.assertEqual('tor - The second-generation onion router', manual.name)
AssertionError: 'tor - The second-generation onion router' != ''

Is this still happening? I remember having this but it's now gone. (don't
even remember which fixed that).

comment:21 Changed 14 months ago by atagar

Resolution: fixed
Status: needs_reviewclosed

Oops! My bad, I should've resolved this. :)

Note: See TracTickets for help on using tickets.