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

Fixes #3148: Python 3.10 Deprecation Warnings #3150

Merged
merged 2 commits into from
Mar 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions luigi/target.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def run(self):
with self.output().temporary_path() as self.temp_output_path:
run_some_external_command(output_path=self.temp_output_path)
"""
num = random.randrange(0, 1e10)
num = random.randrange(0, 10000000000)
slashless_path = self.path.rstrip('/').rstrip("\\")
_temp_path = '{}-luigi-tmp-{:010}{}'.format(
slashless_path,
Expand Down Expand Up @@ -328,7 +328,7 @@ def close(self):
self.move_to_final_destination()

def generate_tmp_path(self, path):
return os.path.join(tempfile.gettempdir(), 'luigi-s3-tmp-%09d' % random.randrange(0, 1e10))
return os.path.join(tempfile.gettempdir(), 'luigi-s3-tmp-%09d' % random.randrange(0, 10000000000))

def move_to_final_destination(self):
raise NotImplementedError()
Expand Down
4 changes: 3 additions & 1 deletion luigi/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,9 @@ def run(self):

if self.use_multiprocessing:
# Need to have different random seeds if running in separate processes
random.seed((os.getpid(), time.time()))
processID = os.getpid()
currentTime = time.time()
random.seed((processID, currentTime))

status = FAILED
expl = ''
Expand Down