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

Python 3 fixes - add open() backport stage 2 #6291

Merged
merged 23 commits into from Aug 4, 2018

Conversation

Projects
None yet
2 participants
@Eric-Arellano
Copy link
Contributor

Eric-Arellano commented Aug 2, 2018

Ensures these folders use Python 3 semantics for opening files.

  • src/backend/codegen
  • src/backend/docgen
  • src/backend/graph_info
  • src/backend/jvm
  • src/backend/native
  • src/backend/project_info
  • src/backend/python
  • src/reporting/
  • src/rules
  • src/scm/
  • src/source/
  • src/stats/
  • src/subsystem/
  • src/task/
  • src/util/
  • test/ (root)
  • test/tasks
  • test/testutils

These also were mostly ported in stage 1, but I realized the subfolders weren't ported:

  • src/pantsd/
  • src/java/
  • src/net/
  • src/engine/

Ignores safe_open()

util/dirutil.py was not ported because it's safe_open() function is used throughout the codebase. That will be a separate PR.

--

See #6290 for stage 1.

@stuhood

stuhood approved these changes Aug 4, 2018

Copy link
Member

stuhood left a comment

This one is epic. Thanks a ton Eric.

#
# `self.settings.outfile` can also be `io.StringIO` instead of an std stream, in which case it only
# accepts unicode, so `s` does not need to be modified.
if PY2 and 'std' in str(self.settings.outfile):

This comment has been minimized.

@stuhood

stuhood Aug 4, 2018

Member

It would be good to loop back and see whether there is a more reliable way to do this... would you mind including a TODO in your next PR?

@stuhood stuhood merged commit 46d5cb9 into pantsbuild:master Aug 4, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

stuhood added a commit that referenced this pull request Aug 6, 2018

Python 3 fixes - add open() backport to safe_open() (#6304)
Final stage of adding Python 3 open semantics. Builds off of #6291, #6295, and #6290.

@Eric-Arellano Eric-Arellano deleted the Eric-Arellano:py3-fixes_open-stage2 branch Aug 11, 2018

CMLivingston pushed a commit to CMLivingston/pants that referenced this pull request Aug 27, 2018

Python 3 fixes - add open() backport stage 2 (pantsbuild#6291)
Ensures these folders use Python 3 semantics for opening files.

- src/backend/codegen
- src/backend/docgen
- src/backend/graph_info
- src/backend/jvm
- src/backend/native
- src/backend/project_info
- src/backend/python
- src/reporting/
- src/rules
- src/scm/
- src/source/
- src/stats/
- src/subsystem/
- src/task/
- src/util/
- test/ (root)
- test/tasks
- test/testutils

These also were mostly ported in stage 1, but I realized the subfolders weren't ported:
- src/pantsd/
- src/java/
- src/net/
- src/engine/

### Ignores safe_open()
`util/dirutil.py` was not ported because it's `safe_open()` function is used throughout the codebase. That will be a separate PR.

--

See pantsbuild#6290 for stage 1.

CMLivingston pushed a commit to CMLivingston/pants that referenced this pull request Aug 27, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment