Opened 3 months ago

Closed 3 months ago

#26535 closed defect (fixed)

Appveyor fails test_ntor.sh and test_hs_ntor.sh

Reported by: asn Owned by: nickm
Priority: High Milestone: Tor: 0.3.4.x-final
Component: Core Tor/Tor Version:
Severity: Normal Keywords: tor-ci appveyor 034-must python3
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

FAIL: src/test/test_ntor.sh
2571===========================
2572
2573Traceback (most recent call last):
2574  File "C:/projects/tor/i686-w64-mingw32/../src/test/ntor_ref.py", line 402, in <module>
2575    test_tor()
2576  File "C:/projects/tor/i686-w64-mingw32/../src/test/ntor_ref.py", line 368, in test_tor
2577    c2s_msg, c_state = tor_client1(node_id, pubkey_B)
2578  File "C:/projects/tor/i686-w64-mingw32/../src/test/ntor_ref.py", line 347, in tor_client1
2579    stdout=subprocess.PIPE)
2580  File "C:\msys64\mingw32\lib\python3.6\subprocess.py", line 709, in __init__
2581    restore_signals, start_new_session)
2582  File "C:\msys64\mingw32\lib\python3.6\subprocess.py", line 971, in _execute_child
2583    args = list2cmdline(args)
2584  File "C:\msys64\mingw32\lib\python3.6\subprocess.py", line 461, in list2cmdline
2585    needquote = (" " in arg) or ("\t" in arg) or not arg
2586TypeError: a bytes-like object is required, not 'str'
2587OK
2588FAIL src/test/test_ntor.sh (exit status: 1)
2589
2590

FAIL: src/test/test_hs_ntor.sh
2591==============================
2592
2593DONE: python dance [b'Cc\x0e"k\'*\xc4\x8a\x18\xc2\xfcN\xac\x8e(\xaa\x14\xb1\xccqqCN"\x9f\x9b\xd5W@\x94O']
2594Traceback (most recent call last):
2595  File "C:/projects/tor/i686-w64-mingw32/../src/test/hs_ntor_ref.py", line 424, in <module>
2596    do_little_t_tor_ntor_test()
2597  File "C:/projects/tor/i686-w64-mingw32/../src/test/hs_ntor_ref.py", line 310, in do_little_t_tor_ntor_test
2598    client_ephemeral_enc_privkey, subcredential)
2599  File "C:/projects/tor/i686-w64-mingw32/../src/test/hs_ntor_ref.py", line 248, in tor_client1
2600    stdout=subprocess.PIPE)
2601  File "C:\msys64\mingw32\lib\python3.6\subprocess.py", line 709, in __init__
2602    restore_signals, start_new_session)
2603  File "C:\msys64\mingw32\lib\python3.6\subprocess.py", line 971, in _execute_child
2604    args = list2cmdline(args)
2605  File "C:\msys64\mingw32\lib\python3.6\subprocess.py", line 461, in list2cmdline
2606    needquote = (" " in arg) or ("\t" in arg) or not arg
2607TypeError: a bytes-like object is required, not 'str'
2608FAIL src/test/test_hs_ntor.sh (exit status: 1)
2609
2610

Child Tickets

Change History (13)

comment:1 Changed 3 months ago by dgoulet

Component: Core Tor/TorDNSELCore Tor/Tor

comment:2 Changed 3 months ago by nickm

I wonder if this is related to our recent change in #26372.

If so we might need to backport a fix for this.

comment:3 Changed 3 months ago by nickm

Priority: MediumHigh

comment:4 Changed 3 months ago by teor

Yeah, python3 considers str to be Unicode, and bytes to be, well, bytes.

comment:5 Changed 3 months ago by nickm

I'm surprised that this isn't affecting other platforms, though. Why would this be windows-only?

comment:6 in reply to:  5 Changed 3 months ago by catalyst

Replying to nickm:

I'm surprised that this isn't affecting other platforms, though. Why would this be windows-only?

Maybe python2, not python3, is installed as python on most non-Windows platforms by default? (or at least the ones we run CI on?)

comment:7 Changed 3 months ago by nickm

FWIW, this code works for me on Linux with both Python2 and Python3. So whatever is going on here, it's a Windows-specific python thing.

comment:8 Changed 3 months ago by nickm

So ahf confirms that Python 3 on Windows does not accept the bytes() type on subprocess.Popen. (Python 3.6.5.) And I can confirm that on Linux it does.

Last edited 3 months ago by nickm (previous) (diff)

comment:9 Changed 3 months ago by nickm

Owner: set to nickm
Status: newaccepted

comment:10 Changed 3 months ago by nickm

Status: acceptedneeds_review

Possible fixes in bug26535_029 and bug26535_032. Respective PRs at https://github.com/torproject/tor/pull/198 and https://github.com/torproject/tor/pull/199 .

comment:11 Changed 3 months ago by nickm

Keywords: 034-must python3 added

comment:12 Changed 3 months ago by teor

Status: needs_reviewmerge_ready

These patches have passed the Windows appveyor CI, and they look good to me.
Linux CI on travis also passed.

comment:13 Changed 3 months ago by nickm

Resolution: fixed
Status: merge_readyclosed

Merged to maint-0.2.9 and maint-0.3.2 respectively, then forward.

Note: See TracTickets for help on using tickets.