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

build.py: fix to support Python 3.8.2 #359

Merged
merged 1 commit into from
May 2, 2020

Conversation

modos189
Copy link
Contributor

@modos189 modos189 commented Apr 23, 2020

@modos189 modos189 added bug Something isn't working development general development issue labels Apr 23, 2020
@modos189 modos189 requested a review from johnd0e April 23, 2020 22:55
@@ -17,7 +17,7 @@ def run_python(cmd):
cmd = Path(__file__).with_name(cmd)
if not cmd.is_file():
raise UserWarning(f'no such file: {original}')
return run_path(cmd)
return run_path(str(cmd))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I was sure that I fixed similar issue previously..
Could you provide sample case to reproduce this bug?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, just add these lines to build:

        'post_build': [
            'web_meta_gen.py'
        ]

using python3.8, it causes an error:

Traceback (most recent call last):
  File "build.py", line 171, in <module>
    backup_and_run()
  File "build.py", line 87, in backup_and_run
    iitc_build(source, workdir, deps_list=deps_list)
  File "build.py", line 65, in iitc_build
    run_cmds(settings.post_build, source, outdir)
  File "build.py", line 38, in run_cmds
    module = run_python(Path(cmd))
  File "build.py", line 20, in run_python
    return run_path(cmd)
  File "/usr/lib/python3.8/runpy.py", line 262, in run_path
    code, fname = _get_code_from_file(run_name, path_name)
  File "/usr/lib/python3.8/runpy.py", line 232, in _get_code_from_file
    with io.open_code(fname) as f:
TypeError: open_code() argument 'path' must be str, not PosixPath

Copy link
Contributor

@johnd0e johnd0e May 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, it's weird.
I have Python 3.8.0.
And have these lines in localbuildsettings.py:

        'post_build': [
            'web_meta_gen.py',

And when I run build.py I see no problems:

IITC build: local
Generating meta for build: local

web_server_local.py Outdated Show resolved Hide resolved
@johnd0e
Copy link
Contributor

johnd0e commented May 2, 2020

This was broken in 3.8.1, and fixed back in 3.8.3 (RC).
More info is here: https://bugs.python.org/issue39517

@johnd0e johnd0e merged commit e3c22b7 into IITC-CE:master May 2, 2020
@johnd0e johnd0e changed the title Fixes to support Python 3.8 build.py: fix to support Python 3.8.2 May 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working development general development issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants