# \[Python\]\[EY7\] Fails tests but seems to be working localy?

**URL:** <https://forum.codecrafters.io/t/python-ey7-fails-tests-but-seems-to-be-working-localy/12710>\
**Category:** Challenges\
**Tags:** challenge:interpreter\
**Created:** [June 27, 2025, 2:15pm UTC](https://forum.codecrafters.io/t/python-ey7-fails-tests-but-seems-to-be-working-localy/12710 "2025-06-27T14:15:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zeviraty](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/zeviraty/32/13507_2.png) [@Zeviraty](https://forum.codecrafters.io/u/Zeviraty)\
**Post date:** [June 27, 2025, 2:15pm UTC](https://forum.codecrafters.io/t/python-ey7-fails-tests-but-seems-to-be-working-localy/12710/1 "2025-06-27T14:15:25Z")

</div>

> **[GitHub - Zeviraty/cc-interperter](https://github.com/Zeviraty/cc-interperter)**
>
> Contribute to Zeviraty/cc-interperter development by creating an account on GitHub.

```auto
[compile] Moved ./.codecrafters/run.sh → ./your_program.sh
[compile] Compilation successful.
[tester::#EY7] Running tests for Stage #EY7 (Scanning: Identifiers)
[tester::#EY7] [test-1] Running test case: 1
[tester::#EY7] [test-1] Writing contents to ./test.lox:
[tester::#EY7] [test-1.lox] bar baz
[tester::#EY7] [test-1] $ ./your_program.sh tokenize test.lox
[your_program] IDENTIFIER bar null
[your_program] IDENTIFIER null
[your_program] EOF null
[tester::#EY7] [test-1] ✓ IDENTIFIER bar null
[tester::#EY7] [test-1] 𐄂 IDENTIFIER null
[tester::#EY7] [test-1] Expected line #2 on stdout to be "IDENTIFIER baz null", got "IDENTIFIER null"
[tester::#EY7] [test-1] Test failed (try setting 'debug: true' in your codecrafters.yml to see more details)

```

but when i try the same thing localy:

```auto
IDENTIFIER bar null
IDENTIFIER baz null
EOF null

```

it works with the exact same content in the file

---

<div class="post-metadata">

**Author:** ![andy1li](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/andy1li/32/10_2.png) [@andy1li](https://forum.codecrafters.io/u/andy1li)\
**Post date:** [July 1, 2025, 10:38pm UTC](https://forum.codecrafters.io/t/python-ey7-fails-tests-but-seems-to-be-working-localy/12710/4 "2025-07-01T22:38:24Z")

</div>

Hey @Zeviraty, looks like the code isn’t handling the case where there’s **no trailing newline** :

 ![image](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/2X/9/9a1dea05b2de947acaf7be90fc026a7fd70900a1.png)

 ![image](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/2X/a/abfeade4fe500fa5e95be77c1e5ae52eb77399de.png)

---

<div class="post-metadata">

**Author:** ![andy1li](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/andy1li/32/10_2.png) [@andy1li](https://forum.codecrafters.io/u/andy1li)\
**Post date:** [July 8, 2025, 5:15pm UTC](https://forum.codecrafters.io/t/python-ey7-fails-tests-but-seems-to-be-working-localy/12710/6 "2025-07-08T17:15:19Z")

</div>

Closing this thread due to inactivity. If you still need assistance, feel free to reopen or start a new discussion!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/3X/7/0/700657133935c15703e22c7c8870394f6e6dc27d.svg) [@system](https://forum.codecrafters.io/u/system)\
**Post date:** [July 13, 2025, 5:16pm UTC](https://forum.codecrafters.io/t/python-ey7-fails-tests-but-seems-to-be-working-localy/12710/7 "2025-07-13T17:16:13Z")

</div>

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.
