From patchwork Tue Jan 9 21:39:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 83694 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A4A3238582BF for ; Tue, 9 Jan 2024 21:40:43 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 10EF43858C66 for ; Tue, 9 Jan 2024 21:40:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 10EF43858C66 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 10EF43858C66 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704836410; cv=none; b=Y34mCVNqEJ9XWU+ay/SUlTE19ikDpE79Xy4/3ka10fYga7DLAqgavPQddkSf/bPvj2JjyxOiAfl8NW8c3KY/SO/zoBllqNJ1/XBfvs0gOhmxRpIwOz7gAdO5XbIEuJRVEVcJe/apeONhiEGYESrmRUa7j2qgcBYHvKoeI8Dshyc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704836410; c=relaxed/simple; bh=qiPUOWfG+DyX70PQtOsBDAMeSXbhO3GA7BM/WVF2lq4=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=RiDlv3Qd+mSc/Uwsxjb8FiihqyS10nru0ydmPIMVwW2wJRy8dUVDeg2Ifx0dMiouf0x5sdZMob0DBGUNRUDT6qZXfi+Wfo9IYZ6+BKR4vw0aB61U9xZvReP1AlNovgtPA0ZO9Olg1JbrnKDaoJeTHphmWHfHe95sYctJ4GnAaLA= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704836407; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=QbQ1v/MpUIb/2nBR97ouK+9Uj+rJfZ+FEVxuJ8GEt8E=; b=Gr3fcoT6IZLZaBw6xQv2vDlHj2u7uqn7Cc6+gAz6nsMKLW88kBvisuNXsTe9NeChpHlQYY bKRJLYPixKkQDS7MM7kFsbgrFhgOUUhz2FXwrrXhEPIWoAj8/KbWqhd9ul2FcwygNFh2Y9 n/nxEmlcT5wcGcOv5kwyUtZPF1sonIo= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-595-SAOXNRw4Pc6G3TNF--_S8A-1; Tue, 09 Jan 2024 16:40:00 -0500 X-MC-Unique: SAOXNRw4Pc6G3TNF--_S8A-1 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-40e479a51e4so12272525e9.0 for ; Tue, 09 Jan 2024 13:40:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704836398; x=1705441198; h=mime-version:message-id:subject:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=QbQ1v/MpUIb/2nBR97ouK+9Uj+rJfZ+FEVxuJ8GEt8E=; b=ZqZt7KWikxBaKG8bGm0+SU0FwV7hGdI74F2a0wg2PCotV8HkcQbf6gIf1lg+yfK579 vMI9j7hAC1jsBlGK3Jn0xxXGYRccLvexFizwJ0NZAT97UvhQnXxzMZ5l08K63QZa4/nd jzxg60YNzJhRt2wPBjUGWGLIlZ7Xh6qHyBFhEwKf0ZGH8sdODWaeaQ/a97cAKKTcavvK bwM/OOZ+TH5coJ/3B3qcZA+iol1tYazbJw+WehIPZKG7PF7thVIqT6OSzfkUr+JLUhSk Zwp8RawJNEQdIDKtJhhIXPAEn7/eYglx9SL7YA6kXNew8mzjn+w48IxKmhiPa3OHDzw0 y3kg== X-Gm-Message-State: AOJu0YxKoeYksu0be6qn7OE6HueCMNXcsDo31zk+m8dhn2MuiI9KqGi5 LrqG83nCq6+m7i03QEbXYbDDI69AxvnMtJUcP3C8gtrCBZRPT6zwTeS8QtcAACHtOPrLRLMb64y XJjGKvIHmt37TCaMvX0YmqHV/rC9sEIiv94FuOJW3ozVDsTxC+hpfn/5kuRLL1spycUV8XGcYWw vR51dmeIw1zuY63RE= X-Received: by 2002:a05:600c:a4b:b0:40e:4613:daae with SMTP id c11-20020a05600c0a4b00b0040e4613daaemr67520wmq.30.1704836398610; Tue, 09 Jan 2024 13:39:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IHGRJBoMhQ/KlAw52bvXWPAo7EkFkd2YZrW/u4g+KYw8jBnKJ4Djnec5ob7mL/Kl68fjcfhhg== X-Received: by 2002:a05:600c:a4b:b0:40e:4613:daae with SMTP id c11-20020a05600c0a4b00b0040e4613daaemr67515wmq.30.1704836398297; Tue, 09 Jan 2024 13:39:58 -0800 (PST) Received: from digraph.polyomino.org.uk (digraph.polyomino.org.uk. [2001:8b0:bf73:93f7::51bb:e332]) by smtp.gmail.com with ESMTPSA id s11-20020a05600c45cb00b0040e395cd20bsm16034698wmo.7.2024.01.09.13.39.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 13:39:58 -0800 (PST) Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.95) (envelope-from ) id 1rNJoq-00HMYW-KZ for libc-alpha@sourceware.org; Tue, 09 Jan 2024 21:39:32 +0000 Date: Tue, 9 Jan 2024 21:39:32 +0000 (UTC) From: Joseph Myers To: libc-alpha@sourceware.org Subject: Fix deprecated utcnow() usage in build-many-glibcs.py Message-ID: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-14.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Running build-many-glibcs.py with Python 3.12 or later produces a warning: build-many-glibcs.py:566: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC). build_time = datetime.datetime.utcnow() Replace with datetime.datetime.now(datetime.timezone.utc) (the datetime.UTC constant is new in 3.11, so not suitable for use in this script at present). diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py index 7e0b90be89..87a42e4aef 100755 --- a/scripts/build-many-glibcs.py +++ b/scripts/build-many-glibcs.py @@ -563,7 +563,7 @@ class Context(object): print(config.name, config.compiler.name) return self.clear_last_build_state(action) - build_time = datetime.datetime.utcnow() + build_time = datetime.datetime.now(datetime.timezone.utc) if action == 'host-libraries': build_components = ('gmp', 'mpfr', 'mpc') old_components = ()