Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add command line parameter -P#4611

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
youknowone merged 5 commits intoRustPython:mainfromnaonus:main
Aug 30, 2023
Merged

Conversation

@naonus
Copy link
Contributor

@naonusnaonus commentedMar 2, 2023
edited by youknowone
Loading

It's not passed test case with errors below

AssertionError: '[]' != "['-P']"

  • []
  • ['-P']

#4541

utf8_mode:1,
int_max_str_digits: -1,
safe_path:false,
safe_path:settings.safe_path,
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Modified safe_path to be set from parameter

youknowone reacted with thumbs up emoji
Comment on lines 887 to 1029
# TODO: RUSTPYTHON
@unittest.expectedFailure
deftest_pythonsafepath_env(self):
# Test the PYTHONSAFEPATH environment variable
code="import sys; print(sys.flags.safe_path)"
env=dict(os.environ)
env.pop('PYTHONSAFEPATH',None)
args= (sys.executable,'-P',code)

proc=subprocess.run(args,stdout=subprocess.PIPE,
universal_newlines=True,env=env)
self.assertEqual(proc.stdout.rstrip(),'False')
self.assertEqual(proc.returncode,0,proc)

env['PYTHONSAFEPATH']='1'
proc=subprocess.run(args,stdout=subprocess.PIPE,
universal_newlines=True,env=env)
self.assertEqual(proc.stdout.rstrip(),'True')
self.assertEqual(proc.returncode,0,proc)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this from CPython?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

No, I just added it. I'll check CPython.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

This test is not existed in CPython. Is it better deleting this code ?

Copy link
Member

@youknowoneyouknowoneMar 2, 2023
edited
Loading

Choose a reason for hiding this comment

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

yes here, but moving to other place is good if the case is not yet covered by cpython unittest, .
BecauseLib is copy of cpython repository, we usually put our own test underextra_tests/snippets.

naonus reacted with thumbs up emoji
'verbose':'v',
'bytes_warning':'b',
'quiet':'q',
'safe_path':'P'
Copy link
Member

Choose a reason for hiding this comment

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

if subprocess.py is too old, rather than editing it yourself, could you try to update it by following the library update guideline on#4564?

Copy link
Member

Choose a reason for hiding this comment

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

done in#4981. We can now try and rebase after its merged and push this through too.

youknowone reacted with thumbs up emoji
@youknowoneyouknowone added the z-ls-2023Tag to track Line OSS Sprint 2023 labelMar 2, 2023

# TODO: RUSTPYTHON
@unittest.expectedFailure
#@unittest.expectedFailure
Copy link
Member

Choose a reason for hiding this comment

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

nit: remember to completely remove these comments

youknowone reacted with thumbs up emoji
@DimitrisJim
Copy link
Member

hey@naonus do you have time to follow along with this PR? If not, we can pick it up.

code="import sys; print(sys.flags.safe_path)"
env=dict(os.environ)
env.pop('PYTHONSAFEPATH',None)
args= (sys.executable,'-P',code)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
args= (sys.executable,'-P',code)
args= (sys.executable,'-P','-c',code)


proc=subprocess.run(args,stdout=subprocess.PIPE,
universal_newlines=True,env=env)
self.assertEqual(proc.stdout.rstrip(),'False')
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
self.assertEqual(proc.stdout.rstrip(),'False')
self.assertEqual(proc.stdout.rstrip(),'True')

Copy link
Member

@youknowoneyouknowone left a comment

Choose a reason for hiding this comment

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

Thank you for contributing!

@youknowoneyouknowone merged commitd4be55c intoRustPython:mainAug 30, 2023
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@DimitrisJimDimitrisJimDimitrisJim left review comments

@fanninpmfanninpmfanninpm left review comments

@youknowoneyouknowoneyouknowone approved these changes

Assignees

No one assigned

Labels

z-ls-2023Tag to track Line OSS Sprint 2023

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@naonus@DimitrisJim@youknowone@fanninpm

[8]ページ先頭

©2009-2025 Movatter.jp