Skip to content

x.py no longer works with Python 3 #42085

New issue

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

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

Already on GitHub? # to your account

Closed
mjkillough opened this issue May 18, 2017 · 6 comments
Closed

x.py no longer works with Python 3 #42085

mjkillough opened this issue May 18, 2017 · 6 comments
Labels
T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@mjkillough
Copy link
Contributor

Recent changes to x.py have stopped it from working when run with Python 3:

[rust] $ python x.py
Updating submodules
Traceback (most recent call last):
  File "x.py", line 20, in <module>
    bootstrap.main()
  File "/home/mjk/Code/rust/src/bootstrap/bootstrap.py", line 684, in main
    bootstrap()
  File "/home/mjk/Code/rust/src/bootstrap/bootstrap.py", line 662, in bootstrap
    rb.update_submodules()
  File "/home/mjk/Code/rust/src/bootstrap/bootstrap.py", line 566, in update_submodules
    path = line[1:].split(' ')[1]
TypeError: a bytes-like object is required, not 'str'
[rust] $ python --version
Python 3.6.1
[rust] $ git rev-parse HEAD
6af8c6c7d1173f68addbf51560e6a009b30c9a93

It works when run with Python 2.

I had a quick look at fixing it, but it looks like the fix would need testing on Windows (due to console encoding shenanigans) and I don't have a Windows machine available right now.

@steveklabnik
Copy link
Member

I'd be happy to test on windows if you can send over the patch

@projektir
Copy link
Contributor

@mjkillough I'm curious, have you been successful using Python 3 in general? I was never able to get the full test suite to work when using Python 3, and there seemed a decent amount of work to do to have both Python 2 and 3 supported for the entire suite.

@nagisa nagisa mentioned this issue May 18, 2017
@steveklabnik steveklabnik added A-build T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels May 18, 2017
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this issue May 18, 2017
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this issue May 18, 2017
frewsxcv added a commit to frewsxcv/rust that referenced this issue May 18, 2017
@mjkillough
Copy link
Contributor Author

@steveklabnik - Thanks, but @nagisa has beat me to it.

@projektir - I think I was able to build and run the full test suite, but you've made me doubt myself. :) I'll double-check when I'm back at my computer.

@mjkillough
Copy link
Contributor Author

mjkillough commented May 19, 2017

@projektir - FWIW, with the PR that fixes x.py, python3 x.py test seems to succeed apart from this:

tidy check (x86_64-unknown-linux-gnu)


command did not execute successfully: "/home/mjk/Code/rust/build/x86_64-unknown-linux-gnu/stage0-tools/x86_64-unknown-linux-gnu/release/tidy" "/home/mjk/Code/rust/src" "--no-vendor"
expected success, got: exit code: 1

I'm not sure what's going on there, but I don't think it's related to Python.

Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this issue May 19, 2017
@projektir
Copy link
Contributor

@mjkillough interesting. Those are tidy failures, I got them too when I tried a different run, they're indeed unrelated (probably). Btw, why are you using python3 here, when, previously, you were using python, and it had version Python 3.6.1?

@mjkillough
Copy link
Contributor Author

@projektir - I am not sure why I used python3. Both python and python3 are the same 3.6.1 binary on my system.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants