1

How would I convert these lines (originally python-2.7) to Python-3.5:

DELETE                           = 0x00010000L
READ_CONTROL                     = 0x00020000L
WRITE_DAC                        = 0x00040000L
WRITE_OWNER                      = 0x00080000L
SYNCHRONIZE                      = 0x00100000L
STANDARD_RIGHTS_REQUIRED         = 0x000F0000L
STANDARD_RIGHTS_READ             = READ_CONTROL
STANDARD_RIGHTS_WRITE            = READ_CONTROL
STANDARD_RIGHTS_EXECUTE          = READ_CONTROL
STANDARD_RIGHTS_ALL              = 0x001F0000L
SPECIFIC_RIGHTS_ALL              = 0x0000FFFFL

These lines just retrun Syntax error on python-3.5

1
  • Remove the L at the end of the hex literals Commented Oct 5, 2016 at 0:19

1 Answer 1

1

Python 3 no longer has a distinction between a long and regular int.

Just remove the L at the end of the hex literals and you are good to go:

>>> STANDARD_RIGHTS_ALL              = 0x001F0000
>>> STANDARD_RIGHTS_ALL 
2031616
>>> hex(STANDARD_RIGHTS_ALL )
'0x1f0000'
Sign up to request clarification or add additional context in comments.

1 Comment

Ah... Why did they change it?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.