Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@lorenzwalthert
Copy link
Contributor

Closes #2870. I also fixed a dedention issue in _inline_r_setup because if code has a different indention than the string we define there. R is indention insensitive but still good to have correct indention.

@lorenzwalthert
Copy link
Contributor Author

lorenzwalthert commented May 15, 2023

uff, some windows file issues. Here is what' ChatGPT says FWIW:

on windows, I am writing to a temp file with Python and then, I get 3221225477.

Details The error code `3221225477` corresponds to the hexadecimal value `0xC0000005`, which is a common Windows error code known as the "Access Violation" or "Segmentation Fault" error. It indicates that your program attempted to access memory that it does not have permission to access.

There can be various reasons why you might encounter this error when writing to a temporary file in Python on Windows. Here are a few possible causes and solutions:

  1. Insufficient permissions: Ensure that the user running the Python script has appropriate permissions to write to the specified temporary directory. Make sure the directory exists and the user has write access to it.

  2. Antivirus or security software interference: Some antivirus or security software might restrict write access to certain locations, including temporary directories. Temporarily disabling such software or configuring it to allow the Python script to write to the temporary directory could resolve the issue.

  3. File handle leakage: If you repeatedly open and write to temporary files without properly closing them, it can result in too many open file handles, causing resource exhaustion. Make sure to close the file handle explicitly using the close() method or by utilizing the with statement, as you have shown in your code snippet.

  4. File path issues: Double-check that the path you are using for the temporary file is correct and valid. If the path contains any special characters or non-standard characters, it might cause issues.

If none of these solutions resolve the issue, please provide more details about your code and the specific steps you are taking that lead to the error. Additionally, if there are any relevant error messages or stack traces accompanying the error code, including those would be helpful in further diagnosing the problem.

Help anyone? I am lost.

@asottile
Copy link
Member

it looks like R is segfaulting on windows -- no idea why -- there's no useful output to debug it. I think it might work better with a TemporaryDirectory so there aren't two things holding file handles? going to try that

@asottile asottile force-pushed the avoid-quote-write-to-tempfile branch from 4b4e02e to cd09c35 Compare May 17, 2023 22:08
Copy link
Member

@asottile asottile left a comment

Choose a reason for hiding this comment

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

@asottile asottile merged commit bcd8274 into pre-commit:main May 17, 2023
@lorenzwalthert lorenzwalthert deleted the avoid-quote-write-to-tempfile branch May 17, 2023 23:11
@lorenzwalthert
Copy link
Contributor Author

Perfect thank you.

jaypikay pushed a commit to jaypikay/doxy that referenced this pull request May 24, 2023
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [pre-commit](https://github.com/pre-commit/pre-commit) | dev-dependencies | patch | `3.3.1` -> `3.3.2` |

---

### Release Notes

<details>
<summary>pre-commit/pre-commit</summary>

### [`v3.3.2`](https://github.com/pre-commit/pre-commit/blob/HEAD/CHANGELOG.md#&#8203;332---2023-05-17)

[Compare Source](pre-commit/pre-commit@v3.3.1...v3.3.2)

\==================

##### Fixes

-   Work around `r` on windows sometimes double-un-quoting arguments.
    -   [#&#8203;2885](pre-commit/pre-commit#2885) PR by [@&#8203;lorenzwalthert](https://github.com/lorenzwalthert).
    -   [#&#8203;2870](pre-commit/pre-commit#2870) issue by [@&#8203;lorenzwalthert](https://github.com/lorenzwalthert).

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS42MS4wIiwidXBkYXRlZEluVmVyIjoiMzUuNjEuMCJ9-->

Co-authored-by: Renovate Bot <[email protected]>
Co-authored-by: JayPiKay <[email protected]>
Reviewed-on: https://git.goatpr0n.de/public/doxy/pulls/11
Co-authored-by: renovate <[email protected]>
Co-committed-by: renovate <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Avoid unquoting weirdness of Windows for language: r

2 participants