Github user JoshRosen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/10255#discussion_r49644612
  
    --- Diff: python/pyspark/shell.py ---
    @@ -76,4 +76,6 @@
     # which allows us to execute the user's PYTHONSTARTUP file:
     _pythonstartup = os.environ.get('OLD_PYTHONSTARTUP')
     if _pythonstartup and os.path.isfile(_pythonstartup):
    -    execfile(_pythonstartup)
    +    with open(_pythonstartup) as f:
    --- End diff --
    
    One minor consequence of this change is that the variable `f` is now 
defined in in the REPL, e.g. `f` will now point to a closed file. We could try 
to add some fancy logic to prevent this, but it would be equally brittle in the 
opposite direction. Therefore I'm fine with this change; it's extremely 
unlikely that user code in the REPL will take conditional actions based on 
whether `f` is defined.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to