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

Error occurs when processing files with Japanese names #653

Open
kaniza opened this issue Sep 18, 2024 · 1 comment · May be fixed by #696
Open

Error occurs when processing files with Japanese names #653

kaniza opened this issue Sep 18, 2024 · 1 comment · May be fixed by #696

Comments

@kaniza
Copy link

kaniza commented Sep 18, 2024

I was trying to use the pkl command to process files with Japanese names. However, an error occurs when attempting to evaluate the file.

Information for Bug Report

  • pkl --version:
Pkl 0.26.3 (macOS 14.4.1, native)
  • Complete Error Message:
An unexpected error has occurred. Would you mind filing a bug report?

Steps to Reproduce

  1. Check the version of pkl:

    $ pkl --version
    Pkl 0.26.3 (macOS 14.4.1, native)
  2. Create a file en.pkl and check the content:

    $ cat en.pkl
    name = ""
  3. Evaluate the file with pkl:

    $ pkl eval en.pkl
    name = ""
  4. Copy the file and rename it to a Japanese name:

    $ cp en.pkl 日本語.pkl
  5. Attempt to evaluate the Japanese-named file:

    $ pkl eval 日本語.pkl
    An unexpected error has occurred. Would you mind filing a bug report?
@bioball
Copy link
Contributor

bioball commented Oct 11, 2024

Definitely a bug, thanks for the report!

HT154 added a commit to HT154/pkl that referenced this issue Oct 16, 2024
HT154 added a commit to HT154/pkl that referenced this issue Oct 16, 2024
If AstBuilder is processing UnaryMinus -> UnaryMinus -> IntLiteral, the "inner" UnaryMinus helpfully defers inversion to the IntLiteral and returns it directly.
The "_outer_" UnaryMinus, none the wiser, then does the exact same thing.
There needs to be a way to force only the inner-most UnaryMinus to delegate to the literal node, which seems tricky in context.

This is my (relatively naive) attempt at that, but this feels messy.
I think there's also a possible overflow edge case around minInt.

More than happy to take suggestions on a better way to handle this!

Closes apple#653
HT154 added a commit to HT154/pkl that referenced this issue Oct 16, 2024
If AstBuilder is processing UnaryMinus -> UnaryMinus -> IntLiteral, the "inner" UnaryMinus helpfully defers inversion to the IntLiteral and returns it directly.
The "_outer_" UnaryMinus, none the wiser, then does the exact same thing.
There needs to be a way to force only the inner-most UnaryMinus to delegate to the literal node, which seems tricky in context.

This is my (relatively naive) attempt at that, but this feels messy.
I think there's also a possible overflow edge case around minInt.

More than happy to take suggestions on a better way to handle this!

Closes apple#653
HT154 added a commit to HT154/pkl that referenced this issue Oct 16, 2024
HT154 added a commit to HT154/pkl that referenced this issue Oct 16, 2024
HT154 added a commit to HT154/pkl that referenced this issue Oct 16, 2024
HT154 added a commit to HT154/pkl that referenced this issue Oct 16, 2024
If AstBuilder is processing UnaryMinus -> UnaryMinus -> IntLiteral, the "inner" UnaryMinus helpfully defers inversion to the IntLiteral and returns it directly.
The "_outer_" UnaryMinus, none the wiser, then does the exact same thing.
There needs to be a way to force only the inner-most UnaryMinus to delegate to the literal node, which seems tricky in context.

This is my (relatively naive) attempt at that, but this feels messy.
I think there's also a possible overflow edge case around minInt.

More than happy to take suggestions on a better way to handle this!

Closes apple#653
HT154 added a commit to HT154/pkl that referenced this issue Oct 16, 2024
If AstBuilder is processing UnaryMinus -> UnaryMinus -> IntLiteral, the "inner" UnaryMinus helpfully defers inversion to the IntLiteral and returns it directly.
The "_outer_" UnaryMinus, none the wiser, then does the exact same thing.
There needs to be a way to force only the inner-most UnaryMinus to delegate to the literal node, which seems tricky in context.

This is my (relatively naive) attempt at that, but this feels messy.
I think there's also a possible overflow edge case around minInt.

More than happy to take suggestions on a better way to handle this!

Closes apple#653
HT154 added a commit to HT154/pkl that referenced this issue Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants