Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Fix build script and test failures with python3 build #700

Merged
merged 1 commit into from
Aug 6, 2020

Conversation

kxl-adsk
Copy link

@kxl-adsk kxl-adsk commented Aug 6, 2020

Build script was failing to run when executed with python3:

Traceback (most recent call last):
  File "build.py", line 602, in <module>
    BuildAndInstall(context, context.buildArgs, context.stagesArgs)
  File "build.py", line 369, in BuildAndInstall
    RunCMake(context, extraArgs, stagesArgs)
  File "build.py", line 275, in RunCMake
    extraArgs=(" ".join(extraArgs) if extraArgs else "")))
  File "build.py", line 148, in Run
    logfile.write(l.encode("utf8"))
TypeError: write() argument must be str, not bytes

Similarly, a new regression test testMayaUsdLayerEditorCommands.MayaUsdLayerEditorCommandsTestCase was failing:

3: ======================================================================
3: ERROR: testSubLayerEditing (testMayaUsdLayerEditorCommands.MayaUsdLayerEditorCommandsTestCase)
3: test 'mayaUsdLayerEditor' command
3: ----------------------------------------------------------------------
3: Traceback (most recent call last):
3:   File "/Users/ligenzk/Dev/usd/_workspace/Maya_USD/build/RelWithDebInfo/test/lib/testMayaUsdLayerEditorCommands.py", line 203, in testSubLayerEditing
3:     testUsdFile.write(str(DUMMY_FILE_TEXT))
3:   File "/Users/ligenzk/Dev/maya/builds/main/maya/build/RelWithDebInfo/runTime/Maya.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python37.zip/tempfile.py", line 481, in func_wrapper
3:     return func(*args, **kwargs)
3: TypeError: a bytes-like object is required, not 'str'
3: 
3: ----------------------------------------------------------------------

In both cases, we either open the stream in wrong mode or pass bytes when expecting a string.

@kxl-adsk kxl-adsk requested a review from seando-adsk August 6, 2020 10:17
@kxl-adsk kxl-adsk added the build Related to building maya-usd repository label Aug 6, 2020
@kxl-adsk kxl-adsk merged commit 37b91c5 into dev Aug 6, 2020
@kxl-adsk kxl-adsk deleted the kxl-adsk/python3_build_and_test_fixes branch August 6, 2020 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Related to building maya-usd repository
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants