-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
OSError: [Errno 22] Invalid argument on Windows #829
Comments
Anything < The second one will invariably fail. I haven't looked into it, but maybe this could be re-implemented by subtracting a |
Hi @Mattwmaster58 , What version of Python and what version/architecture of Windows are you using? |
I've created a branch that tests The build is passing on appveyor https://ci.appveyor.com/project/joke2k/faker/builds/20961012, so we'll need more detail about your system in order to find a way to reproduce this bug. |
Windows 10, Python 3.7.1
…On Wed, Dec 12, 2018 at 10:22 AM Flavio Curella ***@***.***> wrote:
I've created a branch that tests .date_between(start_date="-49y",
end_date="today") at #881 <#881>.
The build is passing on appveyor
https://ci.appveyor.com/project/joke2k/faker/builds/20961012, so we'll
need more detail about your system in order to find a way to reproduce this
bug.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#829 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AZHfLezeygnc2xjB4i88mH84o-4S2E-Dks5u4TtkgaJpZM4XHzE7>
.
--
*Either I will find a way, or I will make one.** - Phillip Sydney*
|
@Mattwmaster58 I'm assuming 64 bit architecture? |
@Mattwmaster58 AppVeyor can test under Windows Server 2012 R2 or Windows Server 2016 (https://www.appveyor.com/docs/windows-images-software/#operating-system), but not on Windows 10. The first step is to add Windows 10 to our CI infrastructure somehow, so that we can actually reproduce the bug now and for the future. |
It looks the error is caused by calling `datetime.fromtimestamp` with
anything < 0. On Windows 10 x64/Python 3.7.1 it throws an OS Error, but on
my linux box it works fine. Is there a way to completely factor out the use
of `fromtimestamp`?
|
This almost works, but timezones strike again (The expected result is 7 hours off, my timezone is UTC-7:00)
I don't really see another straighforward approach when |
As of Nov 11, 2020, I'm still running into the same issue with Windows 10 2003 with Python 3.9.0 and faker 4.14.2 How do you suggest I fix this in the meantime? |
@Loucool111 It's been a while since I've worked with the lib, but maybe play around with my suggestion above and get something that is timezone agnostic. Once you get that down submit a PR. |
This is a wild guess, but having ran into this issue while debugging an unrelated project [0], I am wondering whether the culprit may be some characters that are not permitted as Windows filenames (such as say colons). Here is the (potentially) relevant StackOverflow answer: https://stackoverflow.com/questions/43196750/python-oserror-errno-22-invalid-argument Cheers! |
In some cases random dates generated by faker fail on Windows.
There was another issue on this, but it was closed and a stack trace was asked. It was issue #460
I have the stack trace included.
Unfortunately I don't have the exact line where it fails, because there are several in my code, and the stack trace doesn't say which statement is the direct cause, but here are all of the fake dates in my code:
Steps to reproduce
This occurs randomly, propably when the randomly chosen date is out of specific bounds.
Please refer to #460 for further details.
Expected behavior
A random date should be assigned
Actual behavior
OSError: [Errno 22] Invalid argument
stack trace
The text was updated successfully, but these errors were encountered: