From 202f9a1802c6843666a61d7bfd0b41cff87ecd99 Mon Sep 17 00:00:00 2001 From: Atsuo Ishimoto Date: Sun, 6 Jul 2025 01:34:02 +0900 Subject: [PATCH] test gemini-cli --- library/pathlib.po | 1048 ++++++++++++++++++++++++++++----------- tutorial/interpreter.po | 2 +- 2 files changed, 765 insertions(+), 285 deletions(-) diff --git a/library/pathlib.po b/library/pathlib.po index 6718cf008..dd2059a19 100644 --- a/library/pathlib.po +++ b/library/pathlib.po @@ -45,13 +45,11 @@ msgid "" "operations without I/O, and :ref:`concrete paths `, which " "inherit from pure paths but also provide I/O operations." msgstr "" -"このモジュールはファイルシステムのパスを表すクラスを提供していて、様々なオペ" -"レーティングシステムについての適切な意味論をそれらのクラスに持たせていま" -"す。\n" -"Path クラスは :ref:`純粋パス ` と :ref:`具象パス ` からなります。\n" -"純粋パスは I/O を伴わない純粋な計算操作を提供します。\n" -"具象パスは純粋パスを継承していますが、 I/O 操作も提供しています。" +"このモジュールは、さまざまなオペレーティングシステムに適したセマンティクスを持" +"つ、ファイルシステムパスを表すクラスを提供します。パスのクラスは、I/O を伴わ" +"ない純粋な計算操作を提供する :ref:`純粋パス ` と、純粋パスを継承" +"し、さらに I/O 操作も提供する :ref:`具象パス ` に分けられま" +"す。" #: ../../library/pathlib.rst:21 msgid "" @@ -62,6 +60,11 @@ msgid "" "PosixPath subclasses PurePosixPath and Path, and WindowsPath\n" "subclasses PureWindowsPath and Path." msgstr "" +"pathlib で利用可能なクラスを示す継承図。最も基本的なクラスは PurePath で、こ" +"れには PurePosixPath、PureWindowsPath、Path の3つの直接のサブクラスがありま" +"す。これらの4つのクラスに加えて、多重継承を使用する2つのクラスがあります:" +"PosixPath は PurePosixPath と Path をサブクラス化し、WindowsPath は " +"PureWindowsPath と Path をサブクラス化します。" #: ../../library/pathlib.rst:31 msgid "" @@ -70,15 +73,14 @@ msgid "" "instantiates a :ref:`concrete path ` for the platform the " "code is running on." msgstr "" -"あなたが今までこのモジュールを使用したことがない場合や、タスクに適しているの" -"がどのクラスかわからない場合は、 :class:`Path` はきっとあなたに必要なもので" -"しょう。\n" -":class:`Path` はコードが実行されているプラットフォーム用の :ref:`具象パス " -"` のインスタンスを作成します。" +"このモジュールをこれまで使ったことがない、あるいは自分のタスクにどのクラスが適" +"しているか分からない、という場合、おそらく必要になるのは :class:`Path` でしょ" +"う。これは、コードが実行されているプラットフォーム向けの :ref:`具象パス " +"` をインスタンス化します。" #: ../../library/pathlib.rst:35 msgid "Pure paths are useful in some special cases; for example:" -msgstr "純粋パスは、以下のようないくつかの特殊なケースで有用です:" +msgstr "純粋パスは、いくつかの特殊なケースで有用です。例えば:" #: ../../library/pathlib.rst:37 msgid "" @@ -86,9 +88,9 @@ msgid "" "You cannot instantiate a :class:`WindowsPath` when running on Unix, but you " "can instantiate :class:`PureWindowsPath`." msgstr "" -"Unix マシン上で Windows のパスを扱いたいとき (またはその逆)。Unix 上で実行し" -"ているときに :class:`WindowsPath` のインスタンスを作成することはできません" -"が、:class:`PureWindowsPath` なら可能になります。" +"Unix マシン上で Windows のパスを操作したい (あるいはその逆の) 場合。Unix 上で" +"実行しているときには :class:`WindowsPath` をインスタンス化できませんが、" +":class:`PureWindowsPath` ならインスタンス化できます。" #: ../../library/pathlib.rst:40 msgid "" @@ -96,28 +98,29 @@ msgid "" "accessing the OS. In this case, instantiating one of the pure classes may be " "useful since those simply don't have any OS-accessing operations." msgstr "" -"実際に OS にアクセスすることなしにパスを操作するだけのコードを確認したいと" -"き。この場合、純粋クラスのインスタンスを一つ作成すれば、それが OS にアクセス" -"することはないので便利です。" +"実際に OS にアクセスすることなく、パスの操作だけを行うコードにしたい場合。この" +"場合、純粋クラスは OS にアクセスする操作を一切持っていないので、そのインスタ" +"ンスを生成するのが便利です。" #: ../../library/pathlib.rst:45 msgid ":pep:`428`: The pathlib module -- object-oriented filesystem paths." msgstr "" -":pep:`428`: The pathlib module -- オブジェクト指向のファイルシステムパス。" +":pep:`428`: pathlib モジュール -- オブジェクト指向のファイルシステムパス。" #: ../../library/pathlib.rst:48 msgid "" "For low-level path manipulation on strings, you can also use the :mod:`os." "path` module." -msgstr "文字列による低水準のパス操作の場合は :mod:`os.path` も使用できます。" +msgstr "文字列に対する低レベルなパス操作には、:mod:`os.path` モジュールも利用できま" +"す。" #: ../../library/pathlib.rst:53 msgid "Basic use" -msgstr "基本的な使い方" +msgstr "基本的な使用法" #: ../../library/pathlib.rst:55 msgid "Importing the main class::" -msgstr "メインクラスをインポートします::" +msgstr "メインクラスのインポート:" #: ../../library/pathlib.rst:57 msgid ">>> from pathlib import Path" @@ -125,7 +128,7 @@ msgstr ">>> from pathlib import Path" #: ../../library/pathlib.rst:59 msgid "Listing subdirectories::" -msgstr "サブディレクトリの一覧を取得します::" +msgstr "サブディレクトリの一覧表示:" #: ../../library/pathlib.rst:61 msgid "" @@ -141,7 +144,7 @@ msgstr "" #: ../../library/pathlib.rst:66 msgid "Listing Python source files in this directory tree::" -msgstr "このディレクトリツリー内の Python ソースファイルの一覧を取得します::" +msgstr "このディレクトリツリー内の Python ソースファイルの一覧表示:" #: ../../library/pathlib.rst:68 msgid "" @@ -157,7 +160,7 @@ msgstr "" #: ../../library/pathlib.rst:73 msgid "Navigating inside a directory tree::" -msgstr "ディレクトリツリー内を移動します::" +msgstr "ディレクトリツリー内のナビゲーション:" #: ../../library/pathlib.rst:75 msgid "" @@ -168,10 +171,16 @@ msgid "" ">>> q.resolve()\n" "PosixPath('/etc/rc.d/init.d/halt')" msgstr "" +">>> p = Path('/etc')\n" +">>> q = p / 'init.d' / 'reboot'\n" +">>> q\n" +"PosixPath('/etc/init.d/reboot')\n" +">>> q.resolve()\n" +"PosixPath('/etc/rc.d/init.d/halt')" #: ../../library/pathlib.rst:82 msgid "Querying path properties::" -msgstr "パスのプロパティを問い合わせます::" +msgstr "パスのプロパティの問い合わせ:" #: ../../library/pathlib.rst:84 msgid "" @@ -180,10 +189,14 @@ msgid "" ">>> q.is_dir()\n" "False" msgstr "" +">>> q.exists()\n" +"True\n" +">>> q.is_dir()\n" +"False" #: ../../library/pathlib.rst:89 msgid "Opening a file::" -msgstr "ファイルを開きます::" +msgstr "ファイルを開く:" #: ../../library/pathlib.rst:91 msgid "" @@ -191,6 +204,9 @@ msgid "" "...\n" "'#!/bin/bash\\n'" msgstr "" +">>> with q.open() as f: f.readline()\n" +"...\n" +"'#!/bin/bash\\n'" #: ../../library/pathlib.rst:97 msgid "Exceptions" @@ -201,8 +217,8 @@ msgid "" "An exception inheriting :exc:`NotImplementedError` that is raised when an " "unsupported operation is called on a path object." msgstr "" -":exc:`NotImplementedError` を継承した例外です。パスオブジェクトがサポートして" -"いない操作を行おうとした時に送出されます。 " +":exc:`NotImplementedError` を継承した例外で、サポートされていない操作がパスオ" +"ブジェクトに対して呼び出されたときに送出されます。" #: ../../library/pathlib.rst:110 msgid "Pure paths" @@ -214,24 +230,26 @@ msgid "" "access a filesystem. There are three ways to access these classes, which we " "also call *flavours*:" msgstr "" -"純粋パスオブジェクトは実際にファイルシステムにアクセスしないパス操作処理を提" -"供します。これらのクラスにアクセスするには 3 つの方法があり、それらを *フレー" -"バー* と呼んでいます:" +"純粋パスオブジェクトは、実際にファイルシステムにアクセスしないパス操作処理を提" +"供します。これらのクラスにアクセスするには3つの方法があり、それらを *フレー" +"バー* とも呼びます:" #: ../../library/pathlib.rst:118 msgid "" "A generic class that represents the system's path flavour (instantiating it " "creates either a :class:`PurePosixPath` or a :class:`PureWindowsPath`)::" msgstr "" -"システムのパスのフレーバーを表すジェネリッククラスです (インスタンスを作成す" -"ることで :class:`PurePosixPath` または :class:`PureWindowsPath` のどちらかが" -"作成されます)::" +"システムのパスフレーバーを表すジェネリッククラスです (これをインスタンス化する" +"と :class:`PurePosixPath` または :class:`PureWindowsPath` のいずれかが作成さ" +"れます)::" #: ../../library/pathlib.rst:121 msgid "" ">>> PurePath('setup.py') # Running on a Unix machine\n" "PurePosixPath('setup.py')" msgstr "" +">>> PurePath('setup.py') # Unix マシンで実行\n" +"PurePosixPath('setup.py')" #: ../../library/pathlib.rst:124 msgid "" @@ -240,11 +258,9 @@ msgid "" "the :meth:`~os.PathLike.__fspath__` method returns a string, such as another " "path object::" msgstr "" -"*pathsegments* の各要素は、パスの構成要素を表す文字列か、パスオブジェクトなど" -"の、 :class:`os.PathLike` インターフェースを実装するオブジェクトである必要が" -"あります。\n" -":class:`os.PathLike` インターフェースでは、 :meth:`~os.PathLike.__fspath__` " -"メソッドが文字列を返します::" +"*pathsegments* の各要素には、パスセグメントを表す文字列か、:meth:`~os." +"PathLike.__fspath__` メソッドが文字列を返す :class:`os.PathLike` インターフェー" +"スを実装したオブジェクト (別のパスオブジェクトなど) を指定できます::" #: ../../library/pathlib.rst:129 msgid "" @@ -253,24 +269,30 @@ msgid "" ">>> PurePath(Path('foo'), Path('bar'))\n" "PurePosixPath('foo/bar')" msgstr "" +">>> PurePath('foo', 'some/path', 'bar')\n" +"PurePosixPath('foo/some/path/bar')\n" +">>> PurePath(Path('foo'), Path('bar'))\n" +"PurePosixPath('foo/bar')" #: ../../library/pathlib.rst:134 msgid "When *pathsegments* is empty, the current directory is assumed::" -msgstr "*pathsegments* が空のとき、現在のディレクトリとみなされます::" +msgstr "*pathsegments* が空の場合、カレントディレクトリとみなされます::" #: ../../library/pathlib.rst:136 msgid "" ">>> PurePath()\n" "PurePosixPath('.')" msgstr "" +">>> PurePath()\n" +"PurePosixPath('.')" #: ../../library/pathlib.rst:139 msgid "" "If a segment is an absolute path, all previous segments are ignored (like :" "func:`os.path.join`)::" msgstr "" -"あるパス構成要素が絶対パスである場合、それより前の要素はすべて無視されます (:" -"func:`os.path.join` と同様)::" +"セグメントが絶対パスの場合、それより前のセグメントはすべて無視されます (:func:" +"`os.path.join` と同様です)::" #: ../../library/pathlib.rst:142 msgid "" @@ -279,20 +301,26 @@ msgid "" ">>> PureWindowsPath('c:/Windows', 'd:bar')\n" "PureWindowsPath('d:bar')" msgstr "" +">>> PurePath('/etc', '/usr', 'lib64')\n" +"PurePosixPath('/usr/lib64')\n" +">>> PureWindowsPath('c:/Windows', 'd:bar')\n" +"PureWindowsPath('d:bar')" #: ../../library/pathlib.rst:147 msgid "" "On Windows, the drive is not reset when a rooted relative path segment (e." "g., ``r'\\foo'``) is encountered::" msgstr "" -"Windowsの場合、ルート相対パス (例えば ``r'\\foo'``) があってもドライブ名はそ" -"のまま変わりません::" +"Windows では、ルート指定された相対パスセグメント (例: ``r'\\foo'``) が現れて" +"もドライブはリセットされません::" #: ../../library/pathlib.rst:150 msgid "" ">>> PureWindowsPath('c:/Windows', '/Program Files')\n" "PureWindowsPath('c:/Program Files')" msgstr "" +">>> PureWindowsPath('c:/Windows', '/Program Files')\n" +"PureWindowsPath('c:/Program Files')" #: ../../library/pathlib.rst:153 msgid "" @@ -300,11 +328,9 @@ msgid "" "and leading double slashes (``'//'``) are not, since this would change the " "meaning of a path for various reasons (e.g. symbolic links, UNC paths)::" msgstr "" -"単一スラッシュと等価な複数スラッシュやシングルドットは簡略化されますが、ダブ" -"ルドット (``'..'``) や先頭に位置するダブルスラッシュ (``'//'``) は簡略化され" -"ません。\n" -"これは、様々な理由でパスの意味が簡略化した場合と異なってしまうからです (例: " -"シンボリックリンク、UNCパス)::" +"余分なスラッシュや単一ドットは畳み込まれますが、ダブルドット (``'..'``) や先頭" +"のダブルスラッシュ (``'//'``) は、様々な理由 (シンボリックリンクや UNC パスな" +"ど) でパスの意味を変えてしまうため、畳み込まれません::" #: ../../library/pathlib.rst:157 msgid "" @@ -317,6 +343,14 @@ msgid "" ">>> PurePath('foo/../bar')\n" "PurePosixPath('foo/../bar')" msgstr "" +">>> PurePath('foo//bar')\n" +"PurePosixPath('foo/bar')\n" +">>> PurePath('//foo/bar')\n" +"PurePosixPath('//foo/bar')\n" +">>> PurePath('foo/./bar')\n" +"PurePosixPath('foo/bar')\n" +">>> PurePath('foo/../bar')\n" +"PurePosixPath('foo/../bar')" #: ../../library/pathlib.rst:166 msgid "" @@ -324,49 +358,51 @@ msgid "" "``PurePosixPath('bar')``, which is wrong if ``foo`` is a symbolic link to " "another directory)" msgstr "" -"(通常 ``PurePosixPath('foo/../bar')`` は ``PurePosixPath('bar')`` と等価にな" -"りますが、``foo`` が他のディレクトリへのシンボリックリンクの場合は等価になり" -"ません)" +"(単純なアプローチでは ``PurePosixPath('foo/../bar')`` は " +"``PurePosixPath('bar')`` と等価になりますが、``foo`` が別のディレクトリへのシ" +"ンボリックリンクである場合は間違いです)" #: ../../library/pathlib.rst:170 msgid "" "Pure path objects implement the :class:`os.PathLike` interface, allowing " "them to be used anywhere the interface is accepted." msgstr "" -"純粋パスオブジェクトは :class:`os.PathLike` インターフェースを実装しており、" -"そのインターフェースを受理する箇所ならどこでも使用することができます。" +"純粋パスオブジェクトは :class:`os.PathLike` インターフェースを実装しているの" +"で、このインターフェースを受け付ける場所ならどこでも使用できます。" #: ../../library/pathlib.rst:173 msgid "Added support for the :class:`os.PathLike` interface." -msgstr ":class:`os.PathLike` インターフェースがサポートされました。" +msgstr ":class:`os.PathLike` インターフェースのサポートが追加されました。" #: ../../library/pathlib.rst:178 msgid "" "A subclass of :class:`PurePath`, this path flavour represents non-Windows " "filesystem paths::" msgstr "" -":class:`PurePath` のサブクラスです。このパスフレーバーは非 Windows パスを表し" -"ます::" +":class:`PurePath` のサブクラスで、このパスフレーバーは非 Windows のファイルシ" +"ステムパスを表します::" #: ../../library/pathlib.rst:181 msgid "" ">>> PurePosixPath('/etc/hosts')\n" "PurePosixPath('/etc/hosts')" msgstr "" +">>> PurePosixPath('/etc/hosts')\n" +"PurePosixPath('/etc/hosts')" #: ../../library/pathlib.rst:184 ../../library/pathlib.rst:196 #: ../../library/pathlib.rst:779 ../../library/pathlib.rst:789 #: ../../library/pathlib.rst:804 msgid "*pathsegments* is specified similarly to :class:`PurePath`." -msgstr "*pathsegments* の指定は :class:`PurePath` と同じです。" +msgstr "*pathsegments* は :class:`PurePath` と同様に指定します。" #: ../../library/pathlib.rst:188 msgid "" "A subclass of :class:`PurePath`, this path flavour represents Windows " "filesystem paths, including `UNC paths`_::" msgstr "" -":class:`PurePath` のサブクラスです。このパスフレーバー `UNC paths`_ を含む " -"Windows ファイルシステムパスを表します::" +":class:`PurePath` のサブクラスで、このパスフレーバーは `UNC paths`_ を含む " +"Windows のファイルシステムパスを表します::" #: ../../library/pathlib.rst:191 msgid "" @@ -375,18 +411,22 @@ msgid "" ">>> PureWindowsPath('//server/share/file')\n" "PureWindowsPath('//server/share/file')" msgstr "" +">>> PureWindowsPath('c:/', 'Users', 'Ximénez')\n" +"PureWindowsPath('c:/Users/Ximénez')\n" +">>> PureWindowsPath('//server/share/file')\n" +"PureWindowsPath('//server/share/file')" #: ../../library/pathlib.rst:200 msgid "" "Regardless of the system you're running on, you can instantiate all of these " "classes, since they don't provide any operation that does system calls." msgstr "" -"これらクラスはあらゆるシステムコールを行わないため、起動しているシステムにか" -"かわらずインスタンスを作成できます。" +"これらのクラスはシステムコールを行う操作を提供しないので、実行しているシステム" +"に関係なくインスタンス化できます。" #: ../../library/pathlib.rst:205 msgid "General properties" -msgstr "全般的な性質" +msgstr "一般的なプロパティ" #: ../../library/pathlib.rst:207 msgid "" @@ -394,10 +434,9 @@ msgid "" "comparable and orderable. These properties respect the flavour's case-" "folding semantics::" msgstr "" -"パスオブジェクトはイミュータブルで :term:`ハッシュ可能 ` です。同じ" -"フレーバーのパスオブジェクトは比較ならびに順序付け可能です。これらのプロパ" -"ティは、フレーバーのケースフォールディング (訳注: 比較のために正規化するこ" -"と、例えば全て大文字にする) のセマンティクスに従います。" +"パスはイミュータブルで :term:`ハッシュ可能 ` です。同じフレーバーのパ" +"スは比較および順序付けが可能です。これらのプロパティは、フレーバーの大文字小文" +"字の変換 (case-folding) セマンティクスに従います::" #: ../../library/pathlib.rst:211 msgid "" @@ -410,12 +449,18 @@ msgid "" ">>> PureWindowsPath('C:') < PureWindowsPath('d:')\n" "True" msgstr "" +">>> PurePosixPath('foo') == PurePosixPath('FOO')\n" +"False\n" +">>> PureWindowsPath('foo') == PureWindowsPath('FOO')\n" +"True\n" +">>> PureWindowsPath('FOO') in { PureWindowsPath('foo') }\n" +"True\n" +">>> PureWindowsPath('C:') < PureWindowsPath('d:')\n" +"True" #: ../../library/pathlib.rst:220 msgid "Paths of a different flavour compare unequal and cannot be ordered::" -msgstr "" -"異なるフレーバーのパスオブジェクト同士の比較は等価になることはなく、順序付け" -"もできません::" +msgstr "異なるフレーバーのパスは、等しくないと判定され、順序付けもできません::" #: ../../library/pathlib.rst:222 msgid "" @@ -427,6 +472,13 @@ msgid "" "TypeError: '<' not supported between instances of 'PureWindowsPath' and " "'PurePosixPath'" msgstr "" +">>> PureWindowsPath('foo') == PurePosixPath('foo')\n" +"False\n" +">>> PureWindowsPath('foo') < PurePosixPath('foo')\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"TypeError: '<' not supported between instances of 'PureWindowsPath' and " +"'PurePosixPath'" #: ../../library/pathlib.rst:231 msgid "Operators" @@ -439,11 +491,9 @@ msgid "" "the drive is not reset when the argument is a rooted relative path (e.g., " "``r'\\foo'``)::" msgstr "" -"スラッシュ演算子を使って、 :func:`os.path.join` のように子パスを作成すること" -"ができます。\n" -"スラッシュの右側が絶対パスである場合、左側のパスは無視されます。\n" -"Windows環境で、右側のパスがルート相対パス (例: ``r'\\foo'``) である場合、ドラ" -"イブ名はリセットされません::" +"スラッシュ演算子は :func:`os.path.join` のように子パスを作成するのに役立ちま" +"す。引数が絶対パスの場合、前のパスは無視されます。Windows では、引数がルート" +"指定された相対パス (例: ``r'\\foo'``) の場合、ドライブはリセットされません::" #: ../../library/pathlib.rst:238 msgid "" @@ -460,14 +510,26 @@ msgid "" ">>> PureWindowsPath('c:/Windows', '/Program Files')\n" "PureWindowsPath('c:/Program Files')" msgstr "" +">>> p = PurePath('/etc')\n" +">>> p\n" +"PurePosixPath('/etc')\n" +">>> p / 'init.d' / 'apache2'\n" +"PurePosixPath('/etc/init.d/apache2')\n" +">>> q = PurePath('bin')\n" +">>> '/usr' / q\n" +"PurePosixPath('/usr/bin')\n" +">>> p / '/an_absolute_path'\n" +"PurePosixPath('/an_absolute_path')\n" +">>> PureWindowsPath('c:/Windows', '/Program Files')\n" +"PureWindowsPath('c:/Program Files')" #: ../../library/pathlib.rst:251 msgid "" "A path object can be used anywhere an object implementing :class:`os." "PathLike` is accepted::" msgstr "" -":class:`os.PathLike` を実装したオブジェクトが受理できる箇所ならどこでも、パス" -"オブジェクトが使用できます::" +"パスオブジェクトは、:class:`os.PathLike` を実装したオブジェクトを受け付けると" +"ころならどこでも使えます::" #: ../../library/pathlib.rst:254 msgid "" @@ -476,6 +538,10 @@ msgid "" ">>> os.fspath(p)\n" "'/etc'" msgstr "" +">>> import os\n" +">>> p = PurePath('/etc')\n" +">>> os.fspath(p)\n" +"'/etc'" #: ../../library/pathlib.rst:259 msgid "" @@ -483,9 +549,9 @@ msgid "" "native form, e.g. with backslashes under Windows), which you can pass to any " "function taking a file path as a string::" msgstr "" -"パスオブジェクトの文字列表現はそのシステム自身の Raw ファイルシステムパス (ネ" -"イティブの形式、例えば Windows では区切り文字がバックスラッシュ) になり、文字" -"列としてファイルパスを取るあらゆる関数に渡すことができます::" +"パスの文字列表現は、生のファイルシステムパスそのものです (ネイティブな形式、例" +"えば Windows ではバックスラッシュ付き)。これを、ファイルパスを文字列として受" +"け取る任意の関数に渡すことができます::" #: ../../library/pathlib.rst:263 msgid "" @@ -496,43 +562,52 @@ msgid "" ">>> str(p)\n" "'c:\\\\Program Files'" msgstr "" +">>> p = PurePath('/etc')\n" +">>> str(p)\n" +"'/etc'\n" +">>> p = PureWindowsPath('c:/Program Files')\n" +">>> str(p)\n" +"'c:\\\\Program Files'" #: ../../library/pathlib.rst:270 msgid "" "Similarly, calling :class:`bytes` on a path gives the raw filesystem path as " "a bytes object, as encoded by :func:`os.fsencode`::" msgstr "" -"同様に、パスオブジェクトを :class:`bytes` で呼び出すと、Raw ファイルシステム" -"パスを :func:`os.fsencode` でエンコードされたバイト列オブジェクトで返します::" +"同様に、パスに対して :class:`bytes` を呼び出すと、:func:`os.fsencode` でエン" +"コードされた生のファイルシステムパスが bytes オブジェクトとして得られます::" #: ../../library/pathlib.rst:273 msgid "" ">>> bytes(p)\n" "b'/etc'" msgstr "" +">>> bytes(p)\n" +"b'/etc'" #: ../../library/pathlib.rst:277 msgid "" "Calling :class:`bytes` is only recommended under Unix. Under Windows, the " "unicode form is the canonical representation of filesystem paths." msgstr "" -":class:`bytes` での呼び出しは Unix 上での使用のみ推奨します。Windows では " -"Unicode 形式が標準的なファイルシステムパス表現になります。" +":class:`bytes` の呼び出しは Unix でのみ推奨されます。Windows では、Unicode 形" +"式がファイルシステムパスの標準的な表現です。" #: ../../library/pathlib.rst:282 msgid "Accessing individual parts" -msgstr "個別の構成要素へのアクセス" +msgstr "個々の部分へのアクセス" #: ../../library/pathlib.rst:284 msgid "" "To access the individual \"parts\" (components) of a path, use the following " "property:" msgstr "" -"パスの個別の \"構成要素\" へアクセスするには、以下のプロパティを使用します:" +"パスの個々の \"部分\" (コンポーネント) にアクセスするには、次のプロパティを使" +"用します:" #: ../../library/pathlib.rst:289 msgid "A tuple giving access to the path's various components::" -msgstr "パスのさまざまな構成要素へのアクセス手段を提供するタプルになります::" +msgstr "パスの様々な構成要素へのアクセスを提供するタプルです::" #: ../../library/pathlib.rst:291 msgid "" @@ -544,10 +619,16 @@ msgid "" ">>> p.parts\n" "('c:\\\\', 'Program Files', 'PSF')" msgstr "" +">>> p = PurePath('/usr/bin/python3')\n" +">>> p.parts\n" +"('/', 'usr', 'bin', 'python3')\n" +"\n" +">>> p = PureWindowsPath('c:/Program Files/PSF')\n" +"PureWindowsPath('c:/Program Files/PSF')" #: ../../library/pathlib.rst:299 msgid "(note how the drive and local root are regrouped in a single part)" -msgstr "(ドライブ名とローカルルートは単一要素にまとめられます)" +msgstr "(ドライブとローカルルートが単一の部分にまとめられていることに注意)" #: ../../library/pathlib.rst:303 msgid "Methods and properties" @@ -562,12 +643,12 @@ msgid "" "The implementation of the :mod:`os.path` module used for low-level path " "parsing and joining: either :mod:`posixpath` or :mod:`ntpath`." msgstr "" -"低レベルのパスのパースと結合に使用される :mod:`os.path` モジュールの実装。:" -"mod:`posixpath` または :mod:`ntpath`。" +"低レベルのパスのパースと結合に使われる :mod:`os.path` モジュールの実装です。" +":mod:`posixpath` または :mod:`ntpath` のいずれかです。" #: ../../library/pathlib.rst:320 msgid "A string representing the drive letter or name, if any::" -msgstr "ドライブ文字または名前を表す文字列があればそれになります::" +msgstr "ドライブ文字または名前を表す文字列 (もしあれば)::" #: ../../library/pathlib.rst:322 msgid "" @@ -578,20 +659,28 @@ msgid "" ">>> PurePosixPath('/etc').drive\n" "''" msgstr "" +">>> PureWindowsPath('c:/Program Files/').drive\n" +"'c:'\n" +">>> PureWindowsPath('/Program Files/').drive\n" +"''\n" +">>> PurePosixPath('/etc').drive\n" +"''" #: ../../library/pathlib.rst:329 msgid "UNC shares are also considered drives::" -msgstr "UNC 共有名もドライブとみなされます::" +msgstr "UNC 共有もドライブと見なされます::" #: ../../library/pathlib.rst:331 msgid "" ">>> PureWindowsPath('//host/share/foo.txt').drive\n" -"'\\\\\\\\host\\\\share'" +"'\\\\host\\share'" msgstr "" +">>> PureWindowsPath('//host/share/foo.txt').drive\n" +"'\\\\host\\share'" #: ../../library/pathlib.rst:336 msgid "A string representing the (local or global) root, if any::" -msgstr "ローカルまたはグローバルルートを表す文字列があればそれになります::" +msgstr "(ローカルまたはグローバルの) ルートを表す文字列 (もしあれば)::" #: ../../library/pathlib.rst:338 msgid "" @@ -602,24 +691,32 @@ msgid "" ">>> PurePosixPath('/etc').root\n" "'/'" msgstr "" +">>> PureWindowsPath('c:/Program Files/').root\n" +"'\\\\'\n" +">>> PureWindowsPath('c:Program Files/').root\n" +"''\n" +">>> PurePosixPath('/etc').root\n" +"'/'" #: ../../library/pathlib.rst:345 msgid "UNC shares always have a root::" -msgstr "UNC 共有名は常にルートを持ちます::" +msgstr "UNC 共有は常にルートを持ちます::" #: ../../library/pathlib.rst:347 msgid "" ">>> PureWindowsPath('//host/share').root\n" "'\\\\'" msgstr "" +">>> PureWindowsPath('//host/share').root\n" +"'\\\\'" #: ../../library/pathlib.rst:350 msgid "" "If the path starts with more than two successive slashes, :class:`~pathlib." "PurePosixPath` collapses them::" msgstr "" -":class:`~pathlib.PurePosixPath` でパスの先頭が3つ以上の連続したスラッシュで" -"ある場合、 余分なスラッシュは除去されます::" +"パスが3つ以上の連続したスラッシュで始まる場合、:class:`~pathlib.PurePosixPath` " +"はそれらを畳み込みます::" #: ../../library/pathlib.rst:353 msgid "" @@ -630,16 +727,22 @@ msgid "" ">>> PurePosixPath('////etc').root\n" "'/'" msgstr "" +">>> PurePosixPath('//etc').root\n" +"'//'\n" +">>> PurePosixPath('///etc').root\n" +"'/'\n" +">>> PurePosixPath('////etc').root\n" +"'/'" #: ../../library/pathlib.rst:362 msgid "" "This behavior conforms to *The Open Group Base Specifications Issue 6*, " "paragraph `4.11 Pathname Resolution `_:" +"onlinepubs/009695399/basedefs/xbd_chap04.html#tag_04_11}>`_: msgstr "" -"この挙動は、以下に示す、 *The Open Group Base Specifications Issue 6* の " -"`4.11 Pathname Resolution `_ に沿ったものです:" +"この挙動は、*The Open Group Base Specifications Issue 6* の `4.11 Pathname " +"Resolution `_ の段落に準拠しています:" #: ../../library/pathlib.rst:366 msgid "" @@ -647,10 +750,13 @@ msgid "" "an implementation-defined manner, although more than two leading slashes " "shall be treated as a single slash.\"*" msgstr "" +"*\"2つの連続したスラッシュで始まるパス名は、実装定義の方法で解釈される場合があ" +"りますが、3つ以上の先頭のスラッシュは単一のスラッシュとして扱わなければなりま" +"せん。\"*" #: ../../library/pathlib.rst:372 msgid "The concatenation of the drive and root::" -msgstr "ドライブとルートを結合した文字列になります::" +msgstr "ドライブとルートの連結です::" #: ../../library/pathlib.rst:374 msgid "" @@ -663,12 +769,19 @@ msgid "" ">>> PureWindowsPath('//host/share').anchor\n" "'\\\\\\\\host\\\\share\\\\'" msgstr "" +">>> PureWindowsPath('c:/Program Files/').anchor\n" +"'c:\\\\'\n" +">>> PureWindowsPath('c:Program Files/').anchor\n" +"'c:'\n" +">>> PurePosixPath('/etc').anchor\n" +"'/'\n" +">>> PureWindowsPath('//host/share').anchor\n" +"'\\\\\\\\host\\\\share\\\\'" #: ../../library/pathlib.rst:386 msgid "" "An immutable sequence providing access to the logical ancestors of the path::" -msgstr "" -"パスの論理的な上位パスにアクセスできるイミュータブルなシーケンスになります::" +msgstr "パスの論理的な祖先へのアクセスを提供するイミュータブルなシーケンスです::" #: ../../library/pathlib.rst:389 msgid "" @@ -680,18 +793,24 @@ msgid "" ">>> p.parents[2]\n" "PureWindowsPath('c:/')" msgstr "" +">>> p = PureWindowsPath('c:/foo/bar/setup.py')\n" +">>> p.parents[0]\n" +"PureWindowsPath('c:/foo/bar')\n" +">>> p.parents[1]\n" +"PureWindowsPath('c:/foo')\n" +">>> p.parents[2]\n" +"PureWindowsPath('c:/')" #: ../../library/pathlib.rst:397 msgid "" "The parents sequence now supports :term:`slices ` and negative index " "values." -msgstr "" -"parents シーケンスが、:term:`スライス ` と負のインデックスをサポートす" -"るようになりました。" +msgstr "parents シーケンスは :term:`スライス ` と負のインデックス値をサポー" +"トするようになりました。" #: ../../library/pathlib.rst:402 msgid "The logical parent of the path::" -msgstr "パスの論理的な上位パスになります::" +msgstr "パスの論理的な親です::" #: ../../library/pathlib.rst:404 msgid "" @@ -699,10 +818,13 @@ msgid "" ">>> p.parent\n" "PurePosixPath('/a/b/c')" msgstr "" +">>> p = PurePosixPath('/a/b/c/d')\n" +">>> p.parent\n" +"PurePosixPath('/a/b/c')" #: ../../library/pathlib.rst:408 msgid "You cannot go past an anchor, or empty path::" -msgstr "アンカーの位置を超えることや空のパスになる位置には対応していません::" +msgstr "アンカーや空のパスを越えることはできません::" #: ../../library/pathlib.rst:410 msgid "" @@ -713,10 +835,16 @@ msgid "" ">>> p.parent\n" "PurePosixPath('.')" msgstr "" +">>> p = PurePosixPath('/')\n" +">>> p.parent\n" +"PurePosixPath('/')\n" +">>> p = PurePosixPath('.')\n" +">>> p.parent\n" +"PurePosixPath('.')" #: ../../library/pathlib.rst:418 msgid "This is a purely lexical operation, hence the following behaviour::" -msgstr "これは純粋な字句操作であるため、以下のような挙動になります::" +msgstr "これは純粋に字句的な操作であるため、次のような動作になります::" #: ../../library/pathlib.rst:420 msgid "" @@ -724,6 +852,9 @@ msgid "" ">>> p.parent\n" "PurePosixPath('foo')" msgstr "" +">>> p = PurePosixPath('foo/..')\n" +">>> p.parent\n" +"PurePosixPath('foo')" #: ../../library/pathlib.rst:424 msgid "" @@ -731,23 +862,24 @@ msgid "" "to first call :meth:`Path.resolve` so as to resolve symlinks and eliminate " "``\"..\"`` components." msgstr "" -"任意のファイルシステムパスを上位方向に移動したい場合、シンボリックリンクの解" -"決や ``\"..\"`` 要素の除去のため、最初に :meth:`Path.resolve` を呼ぶことを推" -"奨します。" +"任意のファイルシステムパスを上方にたどりたい場合は、最初に :meth:`Path.resolve` " +"を呼び出してシンボリックリンクを解決し、``\"..\"`` コンポーネントを削除するこ" +"とをお勧めします。" #: ../../library/pathlib.rst:431 msgid "" "A string representing the final path component, excluding the drive and " "root, if any::" msgstr "" -"パス要素の末尾を表す文字列があればそれになります。ドライブやルートは含まれま" -"せん::" +"ドライブとルートを除いた、最後のパスコンポーネントを表す文字列 (もしあれば)::" #: ../../library/pathlib.rst:434 msgid "" ">>> PurePosixPath('my/library/setup.py').name\n" "'setup.py'" msgstr "" +">>> PurePosixPath('my/library/setup.py').name\n" +"'setup.py'" #: ../../library/pathlib.rst:437 msgid "UNC drive names are not considered::" @@ -760,10 +892,14 @@ msgid "" ">>> PureWindowsPath('//some/share').name\n" "''" msgstr "" +">>> PureWindowsPath('//some/share/setup.py').name\n" +"'setup.py'\n" +">>> PureWindowsPath('//some/share').name\n" +"''" #: ../../library/pathlib.rst:447 msgid "The last dot-separated portion of the final component, if any::" -msgstr "末尾の要素をドットで分割した最後の部分があれば、それになります::" +msgstr "最後のコンポーネントの、ドットで区切られた最後の部分 (もしあれば)::" #: ../../library/pathlib.rst:449 msgid "" @@ -774,18 +910,24 @@ msgid "" ">>> PurePosixPath('my/library').suffix\n" "''" msgstr "" +">>> PurePosixPath('my/library/setup.py').suffix\n" +"'.py'\n" +">>> PurePosixPath('my/library.tar.gz').suffix\n" +"'.gz'\n" +">>> PurePosixPath('my/library').suffix\n" +"''" #: ../../library/pathlib.rst:456 msgid "This is commonly called the file extension." -msgstr "一般的にはファイル拡張子と呼ばれています。" +msgstr "これは一般的にファイル拡張子と呼ばれます。" #: ../../library/pathlib.rst:460 ../../library/pathlib.rst:475 -msgid "A single dot (\"``.``\") is considered a valid suffix." -msgstr "" +msgid "A single dot (\"``.\"``) is considered a valid suffix." +msgstr "単一のドット (\"``.\"``) は有効なサフィックスと見なされます。" #: ../../library/pathlib.rst:464 msgid "A list of the path's suffixes, often called file extensions::" -msgstr "パスのサフィックス(ファイル拡張子)のリストです::" +msgstr "パスのサフィックス (しばしばファイル拡張子と呼ばれる) のリストです::" #: ../../library/pathlib.rst:466 msgid "" @@ -796,10 +938,16 @@ msgid "" ">>> PurePosixPath('my/library').suffixes\n" "[]" msgstr "" +">>> PurePosixPath('my/library.tar.gar').suffixes\n" +"['.tar', '.gar']\n" +">>> PurePosixPath('my/library.tar.gz').suffixes\n" +"['.tar', '.gz']\n" +">>> PurePosixPath('my/library').suffixes\n" +"[]" #: ../../library/pathlib.rst:480 msgid "The final path component, without its suffix::" -msgstr "パス要素の末尾から拡張子を除いたものになります::" +msgstr "最後のパスコンポーネントからサフィックスを除いたものです::" #: ../../library/pathlib.rst:482 msgid "" @@ -810,11 +958,17 @@ msgid "" ">>> PurePosixPath('my/library').stem\n" "'library'" msgstr "" +">>> PurePosixPath('my/library.tar.gz').stem\n" +"'library.tar'\n" +">>> PurePosixPath('my/library.tar').stem\n" +"'library'\n" +">>> PurePosixPath('my/library').stem\n" +"'library'" #: ../../library/pathlib.rst:492 msgid "" "Return a string representation of the path with forward slashes (``/``)::" -msgstr "フォワードスラッシュ (``/``) を使用したパスを表す文字列を返します::" +msgstr "パスをフォワードスラッシュ (``/``) で表現した文字列を返します::" #: ../../library/pathlib.rst:494 msgid "" @@ -824,14 +978,19 @@ msgid "" ">>> p.as_posix()\n" "'c:/windows'" msgstr "" +">>> p = PureWindowsPath('c:\\\\windows')\n" +">>> str(p)\n" +"'c:\\\\windows'\n" +">>> p.as_posix()\n" +"'c:/windows'" #: ../../library/pathlib.rst:503 msgid "" "Return whether the path is absolute or not. A path is considered absolute " "if it has both a root and (if the flavour allows) a drive::" msgstr "" -"パスが絶対パスかどうかを返します。パスが絶対パスとみなされるのは、ルートと " -"(フレーバーが許す場合) ドライブとの両方が含まれる場合です::" +"パスが絶対パスかどうかを返します。パスは、ルートと (フレーバーが許す場合は) ドラ" +"イブの両方を持つ場合に絶対パスと見なされます::" #: ../../library/pathlib.rst:506 msgid "" @@ -849,24 +1008,38 @@ msgid "" ">>> PureWindowsPath('//some/share').is_absolute()\n" "True" msgstr "" +">>> PurePosixPath('/a/b').is_absolute()\n" +"True\n" +">>> PurePosixPath('a/b').is_absolute()\n" +"False\n" +"\n" +">>> PureWindowsPath('c:/a/b').is_absolute()\n" +"True\n" +">>> PureWindowsPath('/a/b').is_absolute()\n" +"False\n" +">>> PureWindowsPath('c:').is_absolute()\n" +"False\n" +">>> PureWindowsPath('//some/share').is_absolute()\n" +"True" #: ../../library/pathlib.rst:523 msgid "Return whether or not this path is relative to the *other* path." -msgstr "" -"このパスが *other* パスに対して相対なのかそうでないのかの結果を返します。" +msgstr "このパスが *other* パスに対して相対的かどうかを返します。" #: ../../library/pathlib.rst:531 msgid "" "This method is string-based; it neither accesses the filesystem nor treats " "\"``..``\" segments specially. The following code is equivalent:" msgstr "" +"このメソッドは文字列ベースです。ファイルシステムにアクセスしたり、\"``..``\" " +"セグメントを特別扱いしたりはしません。次のコードは等価です:" #: ../../library/pathlib.rst:542 msgid "" "Passing additional arguments is deprecated; if supplied, they are joined " "with *other*." -msgstr "" -"追加の引数指定は非推奨となりました。指定された場合は *other* と連結されます。" +msgstr "追加の引数を渡すことは非推奨です。もし渡された場合、それらは *other* と結" +"合されます。" #: ../../library/pathlib.rst:547 msgid "" @@ -874,29 +1047,33 @@ msgid "" "reserved under Windows, ``False`` otherwise. With :class:`PurePosixPath`, " "``False`` is always returned." msgstr "" -":class:`PureWindowsPath` の場合はパスが Windows 上で予約されていれば " -"``True`` を返し、そうでなければ ``False`` を返します。:class:`PurePosixPath` " -"の場合は常に ``False`` を返します。" +":class:`PureWindowsPath` では、パスが Windows で予約済みと見なされる場合は " +"``True`` を、そうでない場合は ``False`` を返します。:class:`PurePosixPath` で" +"は、常に ``False`` が返されます。" #: ../../library/pathlib.rst:551 msgid "" "Windows path names that contain a colon, or end with a dot or a space, are " "considered reserved. UNC paths may be reserved." msgstr "" +"コロンを含む、またはドットかスペースで終わる Windows パス名は予約済みと見なさ" +"れます。UNC パスも予約されている場合があります。" #: ../../library/pathlib.rst:555 msgid "" "This method is deprecated; use :func:`os.path.isreserved` to detect reserved " "paths on Windows." msgstr "" +"このメソッドは非推奨です。Windows で予約済みパスを検出するには :func:`os.path." +"isreserved` を使用してください。" #: ../../library/pathlib.rst:561 msgid "" "Calling this method is equivalent to combining the path with each of the " "given *pathsegments* in turn::" msgstr "" -"このメソッドの呼び出しは、与えられた *pathsegments* のパスを順番に結合するこ" -"とと等価です。" +"このメソッドを呼び出すことは、パスと与えられた *pathsegments* のそれぞれを順" +"番に結合することと等価です::" #: ../../library/pathlib.rst:564 msgid "" @@ -909,14 +1086,22 @@ msgid "" ">>> PureWindowsPath('c:').joinpath('/Program Files')\n" "PureWindowsPath('c:/Program Files')" msgstr "" +">>> PurePosixPath('/etc').joinpath('passwd')\n" +"PurePosixPath('/etc/passwd')\n" +">>> PurePosixPath('/etc').joinpath(PurePosixPath('passwd'))\n" +"PurePosixPath('/etc/passwd')\n" +">>> PurePosixPath('/etc').joinpath('init.d', 'apache2')\n" +"PurePosixPath('/etc/init.d/apache2')\n" +">>> PureWindowsPath('c:').joinpath('/Program Files')\n" +"PureWindowsPath('c:/Program Files')" #: ../../library/pathlib.rst:576 msgid "" "Match this path against the provided glob-style pattern. Return ``True`` if " "matching is successful, ``False`` otherwise. For example::" msgstr "" -"現在のパスが glob 形式で与えられたパターンと一致したら ``True`` を、一致しな" -"ければ ``False`` を返します。例::" +"このパスを指定された glob 形式のパターンと照合します。一致した場合は ``True`` " +"を、そうでない場合は ``False`` を返します。例えば::" #: ../../library/pathlib.rst:579 msgid "" @@ -929,15 +1114,23 @@ msgid "" ">>> PurePath('/a/b/c.py').full_match('**/*.py')\n" "True" msgstr "" +">>> PurePath('a/b.py').full_match('a/*.py')\n" +"True\n" +">>> PurePath('a/b.py').full_match('*.py')\n" +"False\n" +">>> PurePath('/a/b/c.py').full_match('/a/**')\n" +"True\n" +">>> PurePath('/a/b/c.py').full_match('**/*.py')\n" +"True" #: ../../library/pathlib.rst:589 ../../library/pathlib.rst:1349 msgid ":ref:`pathlib-pattern-language` documentation." -msgstr ":ref:`pathlib-pattern-language` ドキュメント。" +msgstr ":ref:`pathlib-pattern-language` のドキュメントを参照してください。" #: ../../library/pathlib.rst:591 msgid "As with other methods, case-sensitivity follows platform defaults::" -msgstr "" -"他のメソッドと同様に、大文字小文字の区別はプラットフォームの設定に従います::" +msgstr "他のメソッドと同様に、大文字小文字の区別はプラットフォームのデフォルトに従" +"います::" #: ../../library/pathlib.rst:593 msgid "" @@ -946,21 +1139,24 @@ msgid "" ">>> PureWindowsPath('b.py').full_match('*.PY')\n" "True" msgstr "" +">>> PurePosixPath('b.py').full_match('*.PY')\n" +"False\n" +">>> PureWindowsPath('b.py').full_match('*.PY')\n" +"True" #: ../../library/pathlib.rst:598 msgid "" "Set *case_sensitive* to ``True`` or ``False`` to override this behaviour." -msgstr "" -" *case_sensitive* に ``True`` または ``False`` を設定することでデフォルトの動" -"作を上書きできます。" +msgstr "この動作を上書きするには、*case_sensitive* を ``True`` または ``False`` に設" +"定します。" #: ../../library/pathlib.rst:605 msgid "" "Match this path against the provided non-recursive glob-style pattern. " "Return ``True`` if matching is successful, ``False`` otherwise." msgstr "" -"現在のパスが非再帰の glob 形式で与えられたパターンと一致したら ``True`` を、" -"一致しなければ ``False`` を返します。" +"このパスを指定された非再帰的な glob 形式のパターンと照合します。一致した場合" +"は ``True`` を、そうでない場合は ``False`` を返します。" #: ../../library/pathlib.rst:608 msgid "" @@ -969,6 +1165,10 @@ msgid "" "\"``**``\" isn't supported (it acts like non-recursive \"``*``\"), and if a " "relative pattern is provided, then matching is done from the right::" msgstr "" +"このメソッドは :meth:`~PurePath.full_match` に似ていますが、空のパターンは許" +"可されず (:exc:`ValueError` が送出されます)、再帰的なワイルドカード " +"\"``**``\" はサポートされていません (非再帰的な \"``*``\" のように動作しま" +"す)。また、相対パターンが指定された場合、照合は右から行われます::" #: ../../library/pathlib.rst:613 msgid "" @@ -979,25 +1179,30 @@ msgid "" ">>> PurePath('/a/b/c.py').match('a/*.py')\n" "False" msgstr "" +">>> PurePath('a/b.py').match('*.py')\n" +"True\n" +">>> PurePath('/a/b/c.py').match('b/*.py')\n" +"True\n" +">>> PurePath('/a/b/c.py').match('a/*.py')\n" +"False" #: ../../library/pathlib.rst:620 ../../library/pathlib.rst:1368 #: ../../library/pathlib.rst:1393 msgid "The *pattern* parameter accepts a :term:`path-like object`." -msgstr "" -"*pattern* パラメタが :term:`path-like object` を受け付けるようになりました。" +msgstr "*pattern* パラメータは :term:`path-like object` を受け付けます。" #: ../../library/pathlib.rst:623 ../../library/pathlib.rst:1362 #: ../../library/pathlib.rst:1387 msgid "The *case_sensitive* parameter was added." -msgstr "*case_sensitive* 引数が追加されました。" +msgstr "*case_sensitive* パラメータが追加されました。" #: ../../library/pathlib.rst:629 msgid "" "Compute a version of this path relative to the path represented by *other*. " "If it's impossible, :exc:`ValueError` is raised::" msgstr "" -"*other* で表されたパスから現在のパスへの相対パスを返します。それが不可能だっ" -"た場合は :exc:`ValueError` が送出されます::" +"*other* で表されるパスに対するこのパスの相対パスを計算します。不可能な場合は " +":exc:`ValueError` が送出されます::" #: ../../library/pathlib.rst:632 msgid "" @@ -1014,6 +1219,18 @@ msgid "" "ValueError: '/etc/passwd' is not in the subpath of '/usr' OR one path is " "relative and the other is absolute." msgstr "" +">>> p = PurePosixPath('/etc/passwd')\n" +">>> p.relative_to('/')\n" +"PurePosixPath('etc/passwd')\n" +">>> p.relative_to('/etc')\n" +"PurePosixPath('passwd')\n" +">>> p.relative_to('/usr')\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +" File \"pathlib.py\", line 941, in relative_to\n" +" raise ValueError(error_message.format(str(self), str(formatted)))\n" +"ValueError: '/etc/passwd' is not in the subpath of '/usr' OR one path is " +"relative and the other is absolute." #: ../../library/pathlib.rst:644 msgid "" @@ -1022,10 +1239,10 @@ msgid "" "path. In all other cases, such as the paths referencing different drives, :" "exc:`ValueError` is raised.::" msgstr "" -"*walk_up* がFalseの場合(デフォルト)、パスは *other* から始まる必要がありま" -"す。引数に True を指定すると ``..`` を追加して相対パスを作成する場合がありま" -"す。異なるドライブを参照するなど、それ以外のケースでは :exc:`ValueError` が送" -"出されます。::" +"*walk_up* が False (デフォルト) の場合、パスは *other* で始まらなければなりま" +"せん。引数が True の場合、相対パスを形成するために ``..`` エントリが追加され" +"ることがあります。パスが異なるドライブを参照しているなど、その他のすべてのケー" +"スでは :exc:`ValueError` が送出されます::" #: ../../library/pathlib.rst:649 msgid "" @@ -1039,6 +1256,15 @@ msgid "" "ValueError: '/etc/passwd' is not on the same drive as 'foo' OR one path is " "relative and the other is absolute." msgstr "" +">>> p.relative_to('/usr', walk_up=True)\n" +"PurePosixPath('../etc/passwd')\n" +">>> p.relative_to('foo', walk_up=True)\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +" File \"pathlib.py\", line 941, in relative_to\n" +" raise ValueError(error_message.format(str(self), str(formatted)))\n" +"ValueError: '/etc/passwd' is not on the same drive as 'foo' OR one path is " +"relative and the other is absolute." #: ../../library/pathlib.rst:659 msgid "" @@ -1047,35 +1273,38 @@ msgid "" "*walk_up* option as it assumes that no symlinks are present in the path; " "call :meth:`~Path.resolve` first if necessary to resolve symlinks." msgstr "" +"この関数は :class:`PurePath` の一部であり、文字列を扱います。基盤となるファイ" +"ル構造をチェックしたりアクセスしたりはしません。これは、パスにシンボリックリン" +"クが存在しないことを前提としているため、*walk_up* オプションに影響を与える可" +"能性があります。必要に応じて、最初に :meth:`~Path.resolve` を呼び出してシンボ" +"リックリンクを解決してください。" #: ../../library/pathlib.rst:665 msgid "" "The *walk_up* parameter was added (old behavior is the same as " "``walk_up=False``)." -msgstr "" -"*walk_up* 引数が追加されました(``walk_up=False`` を指定すると以前の動作と同" -"じになります)。" +msgstr "*walk_up* パラメータが追加されました (古い動作は ``walk_up=False`` と同じ" +"です)。" #: ../../library/pathlib.rst:670 msgid "" "Passing additional positional arguments is deprecated; if supplied, they are " "joined with *other*." msgstr "" -"追加の位置引数の指定は非推奨となりました。指定された場合は *other* と連結され" -"ます。" +"追加の位置引数を渡すことは非推奨です。もし渡された場合、それらは *other* と結" +"合されます。" #: ../../library/pathlib.rst:675 msgid "" "Return a new path with the :attr:`name` changed. If the original path " "doesn't have a name, ValueError is raised::" msgstr "" -"現在のパスの :attr:`name` 部分を変更したパスを返します。オリジナルパスに :" -"attr:`name` 部分がない場合は ValueError が送出されます::" +"パスの :attr:`name` を変更した新しいパスを返します。元のパスに名前がない場合" +"は ValueError が送出されます::" #: ../../library/pathlib.rst:678 msgid "" ">>> p = PureWindowsPath('c:/Downloads/pathlib.tar.gz')\n" -">>> p.with_name('setup.py')\n" "PureWindowsPath('c:/Downloads/setup.py')\n" ">>> p = PureWindowsPath('c:/')\n" ">>> p.with_name('setup.py')\n" @@ -1086,22 +1315,30 @@ msgid "" " raise ValueError(\"%r has an empty name\" % (self,))\n" "ValueError: PureWindowsPath('c:/') has an empty name" msgstr "" +">>> p = PureWindowsPath('c:/Downloads/pathlib.tar.gz')\n" +"PureWindowsPath('c:/Downloads/setup.py')\n" +">>> p = PureWindowsPath('c:/')\n" +">>> p.with_name('setup.py')\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +" File \"/home/antoine/cpython/default/Lib/pathlib.py\", line 751, in " +"with_name\n" +" raise ValueError(\"%r has an empty name\" % (self,))\n" +"ValueError: PureWindowsPath('c:/') has an empty name" #: ../../library/pathlib.rst:692 msgid "" "Return a new path with the :attr:`stem` changed. If the original path " "doesn't have a name, ValueError is raised::" msgstr "" -"現在のパスの :attr:`stem` 部分を変更したパスを返します。オリジナルパスに :" -"attr:`stem` 部分がない場合は ValueError が送出されます::" +"パスの :attr:`stem` を変更した新しいパスを返します。元のパスに名前がない場合" +"は ValueError が送出されます::" #: ../../library/pathlib.rst:695 msgid "" ">>> p = PureWindowsPath('c:/Downloads/draft.txt')\n" -">>> p.with_stem('final')\n" "PureWindowsPath('c:/Downloads/final.txt')\n" ">>> p = PureWindowsPath('c:/Downloads/pathlib.tar.gz')\n" -">>> p.with_stem('lib')\n" "PureWindowsPath('c:/Downloads/lib.gz')\n" ">>> p = PureWindowsPath('c:/')\n" ">>> p.with_stem('')\n" @@ -1115,6 +1352,20 @@ msgid "" " raise ValueError(\"%r has an empty name\" % (self,))\n" "ValueError: PureWindowsPath('c:/') has an empty name" msgstr "" +">>> p = PureWindowsPath('c:/Downloads/draft.txt')\n" +"PureWindowsPath('c:/Downloads/final.txt')\n" +">>> p = PureWindowsPath('c:/Downloads/pathlib.tar.gz')\n" +"PureWindowsPath('c:/Downloads/lib.gz')\n" +">>> p = PureWindowsPath('c:/')\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +" File \"/home/antoine/cpython/default/Lib/pathlib.py\", line 861, in " +"with_stem\n" +" return self.with_name(stem + self.suffix)\n" +" File \"/home/antoine/cpython/default/Lib/pathlib.py\", line 851, in " +"with_name\n" +" raise ValueError(\"%r has an empty name\" % (self,))\n" +"ValueError: PureWindowsPath('c:/') has an empty name" #: ../../library/pathlib.rst:716 msgid "" @@ -1122,28 +1373,33 @@ msgid "" "doesn't have a suffix, the new *suffix* is appended instead. If the " "*suffix* is an empty string, the original suffix is removed::" msgstr "" -":attr:`suffix` を変更した新しいパスを返します。\n" -"元のパスに suffix が無かった場合、代わりに新しい *suffix* が追加されます。\n" -"*suffix* が空文字列だった場合、元の suffix は除去されます::" +"パスの :attr:`suffix` を変更した新しいパスを返します。元のパスにサフィックスが" +"ない場合は、新しい *suffix* が代わりに追加されます。*suffix* が空文字列の場合" +"は、元のサフィックスが削除されます::" #: ../../library/pathlib.rst:720 msgid "" ">>> p = PureWindowsPath('c:/Downloads/pathlib.tar.gz')\n" -">>> p.with_suffix('.bz2')\n" "PureWindowsPath('c:/Downloads/pathlib.tar.bz2')\n" ">>> p = PureWindowsPath('README')\n" -">>> p.with_suffix('.txt')\n" "PureWindowsPath('README.txt')\n" ">>> p = PureWindowsPath('README.txt')\n" -">>> p.with_suffix('')\n" "PureWindowsPath('README')" msgstr "" +">>> p = PureWindowsPath('c:/Downloads/pathlib.tar.gz')\n" +"PureWindowsPath('c:/Downloads/pathlib.tar.bz2')\n" +">>> p = PureWindowsPath('README')\n" +"PureWindowsPath('README.txt')\n" +">>> p = PureWindowsPath('README.txt')\n" +"PureWindowsPath('README')" #: ../../library/pathlib.rst:732 msgid "" -"A single dot (\"``.``\") is considered a valid suffix. In previous " +"A single dot (\"``.\"``) is considered a valid suffix. In previous " "versions, :exc:`ValueError` is raised if a single dot is supplied." msgstr "" +"単一のドット (\"``.\"``) は有効なサフィックスと見なされます。以前のバージョンで" +"は、単一のドットが指定されると :exc:`ValueError` が送出されました。" #: ../../library/pathlib.rst:738 msgid "" @@ -1152,6 +1408,10 @@ msgid "" "such as from :attr:`parent` and :meth:`relative_to`. Subclasses may override " "this method to pass information to derivative paths, for example::" msgstr "" +"与えられた *pathsegments* を結合して、同じ型の新しいパスオブジェクトを作成しま" +"す。このメソッドは、:attr:`parent` や :meth:`relative_to` からなど、派生パス" +"が作成されるたびに呼び出されます。サブクラスはこのメソッドをオーバーライドし" +"て、派生パスに情報を渡すことができます。例えば::" #: ../../library/pathlib.rst:743 msgid "" @@ -1169,6 +1429,20 @@ msgid "" "hosts = etc / 'hosts'\n" "print(hosts.session_id) # 42" msgstr "" +"from pathlib import PurePosixPath\n" +"\n" +"class MyPath(PurePosixPath):\n" +" def __init__(self, *pathsegments, session_id):\n" +" super().__init__(*pathsegments)\n" +" self.session_id = session_id\n" +"\n" +" def with_segments(self, *pathsegments):\n" +" return type(self)(*pathsegments, session_id=self.session_id)\n" +"\n" +"etc = MyPath('/etc', session_id=42)\n" +"hosts = etc / 'hosts'\n" +"print(hosts.session_id) # 42"} +``` #: ../../library/pathlib.rst:764 msgid "Concrete paths" @@ -1180,9 +1454,9 @@ msgid "" "operations provided by the latter, they also provide methods to do system " "calls on path objects. There are three ways to instantiate concrete paths:" msgstr "" -"具象パスは純粋パスクラスのサブクラスです。純粋パスが提供する操作に加え、パス" -"オブジェクト上でシステムコールを呼ぶメソッドも提供しています。具象パスのイン" -"スタンスを作成するには 3 つの方法があります:" +"具象パスは純粋パスクラスのサブクラスです。純粋パスが提供する操作に加えて、パス" +"オブジェクトに対してシステムコールを行うメソッドも提供します。具象パスをインス" +"タンス化するには3つの方法があります:" #: ../../library/pathlib.rst:772 msgid "" @@ -1190,22 +1464,24 @@ msgid "" "system's path flavour (instantiating it creates either a :class:`PosixPath` " "or a :class:`WindowsPath`)::" msgstr "" -":class:`PurePath` のサブクラスであり、システムのパスフレーバーの具象パスを表" -"します (このインスタンスの作成で :class:`PosixPath` か :class:`WindowsPath` " -"のどちらかが作成されます)::" +":class:`PurePath` のサブクラスで、システムのパスフレーバーの具象パスを表しま" +"す (これをインスタンス化すると :class:`PosixPath` または :class:`WindowsPath` " +"のいずれかが作成されます)::" #: ../../library/pathlib.rst:776 msgid "" ">>> Path('setup.py')\n" "PosixPath('setup.py')" msgstr "" +">>> Path('setup.py')\n" +"PosixPath('setup.py')" #: ../../library/pathlib.rst:783 msgid "" "A subclass of :class:`Path` and :class:`PurePosixPath`, this class " "represents concrete non-Windows filesystem paths::" msgstr "" -":class:`Path` および :class:`PurePosixPath` のサブクラスで、非 Windows ファイ" +":class:`Path` と :class:`PurePosixPath` のサブクラスで、非 Windows のファイ" "ルシステムの具象パスを表します::" #: ../../library/pathlib.rst:786 @@ -1213,36 +1489,40 @@ msgid "" ">>> PosixPath('/etc/hosts')\n" "PosixPath('/etc/hosts')" msgstr "" +">>> PosixPath('/etc/hosts')\n" +"PosixPath('/etc/hosts')" #: ../../library/pathlib.rst:791 msgid "" "Raises :exc:`UnsupportedOperation` on Windows. In previous versions, :exc:" "`NotImplementedError` was raised instead." msgstr "" -"Windows では :exc:`UnsupportedOperation` を送出します。以前のバージョンでは代" -"わりに :exc:`NotImplementedError` を送出していました。" +"Windows では :exc:`UnsupportedOperation` を送出します。以前のバージョンでは、" +"代わりに :exc:`NotImplementedError` が送出されていました。" #: ../../library/pathlib.rst:798 msgid "" "A subclass of :class:`Path` and :class:`PureWindowsPath`, this class " "represents concrete Windows filesystem paths::" msgstr "" -":class:`Path` および :class:`PureWindowsPath` のサブクラスで、Windows ファイ" -"ルシステムの具象パスを表します::" +":class:`Path` と :class:`PureWindowsPath` のサブクラスで、Windows のファイル" +"システムの具象パスを表します::" #: ../../library/pathlib.rst:801 msgid "" ">>> WindowsPath('c:/', 'Users', 'Ximénez')\n" "WindowsPath('c:/Users/Ximénez')" msgstr "" +">>> WindowsPath('c:/', 'Users', 'Ximénez')\n" +"WindowsPath('c:/Users/Ximénez')" #: ../../library/pathlib.rst:806 msgid "" "Raises :exc:`UnsupportedOperation` on non-Windows platforms. In previous " "versions, :exc:`NotImplementedError` was raised instead." msgstr "" -"Windows 以外のプラットフォームでは :exc:`UnsupportedOperation` を送出します。" -"以前のバージョンでは代わりに :exc:`NotImplementedError` を送出していました。" +"非 Windows プラットフォームでは :exc:`UnsupportedOperation` を送出します。以前" +"のバージョンでは、代わりに :exc:`NotImplementedError` が送出されていました。" #: ../../library/pathlib.rst:811 msgid "" @@ -1250,9 +1530,9 @@ msgid "" "(allowing system calls on non-compatible path flavours could lead to bugs or " "failures in your application)::" msgstr "" -"インスタンスを作成できるのはシステムと一致するフレーバーのみです (互換性のな" -"いパスフレーバーでのシステムコールの許可はバグやアプリケーションの異常終了の" -"原因になります)::" +"自分のシステムに対応するクラスフレーバーしかインスタンス化できません (互換性の" +"ないパスフレーバーでシステムコールを許可すると、アプリケーションのバグや障害に" +"つながる可能性があります)::" #: ../../library/pathlib.rst:815 msgid "" @@ -1270,42 +1550,63 @@ msgid "" " % (cls.__name__,))\n" "UnsupportedOperation: cannot instantiate 'WindowsPath' on your system" msgstr "" +">>> import os\n" +">>> os.name\n" +"'posix'\n" +">>> Path('setup.py')\n" +"PosixPath('setup.py')\n" +">>> PosixPath('setup.py')\n" +"PosixPath('setup.py')\n" +">>> WindowsPath('setup.py')\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +" File \"pathlib.py\", line 798, in __new__\n" +" % (cls.__name__,))\n" +"UnsupportedOperation: cannot instantiate 'WindowsPath' on your system" #: ../../library/pathlib.rst:829 msgid "" "Some concrete path methods can raise an :exc:`OSError` if a system call " "fails (for example because the path doesn't exist)." msgstr "" +"具象パスのメソッドの中には、システムコールが失敗した場合 (例えばパスが存在しな" +"い場合など) に :exc:`OSError` を送出するものがあります。" #: ../../library/pathlib.rst:834 msgid "Parsing and generating URIs" -msgstr "URIのパースと生成" +msgstr "URI のパースと生成" #: ../../library/pathlib.rst:836 msgid "" "Concrete path objects can be created from, and represented as, 'file' URIs " "conforming to :rfc:`8089`." msgstr "" +"具象パスオブジェクトは、:rfc:`8089` に準拠した 'file' URI から作成したり、'file' " +"URI として表現したりできます。" #: ../../library/pathlib.rst:841 msgid "" "File URIs are not portable across machines with different :ref:`filesystem " "encodings `." msgstr "" +"ファイル URI は、:ref:`ファイルシステムのエンコーディング ` が異なるマシン間では移植性がありません。" #: ../../library/pathlib.rst:846 msgid "Return a new path object from parsing a 'file' URI. For example::" -msgstr "'file' URIをパースして新しいパスオブジェクトを返します。例::" +msgstr "'file' URI をパースして新しいパスオブジェクトを返します。例::" #: ../../library/pathlib.rst:848 msgid "" ">>> p = Path.from_uri('file:///etc/hosts')\n" "PosixPath('/etc/hosts')" msgstr "" +">>> p = Path.from_uri('file:///etc/hosts')\n" +"PosixPath('/etc/hosts')" #: ../../library/pathlib.rst:851 msgid "On Windows, DOS device and UNC paths may be parsed from URIs::" -msgstr "" +msgstr "Windows では、DOS デバイスパスと UNC パスを URI からパースできます::" #: ../../library/pathlib.rst:853 msgid "" @@ -1314,10 +1615,14 @@ msgid "" ">>> p = Path.from_uri('file://server/share')\n" "WindowsPath('//server/share')" msgstr "" +">>> p = Path.from_uri('file:///c:/windows')\n" +"WindowsPath('c:/windows')\n" +">>> p = Path.from_uri('file://server/share')\n" +"WindowsPath('//server/share')" #: ../../library/pathlib.rst:858 msgid "Several variant forms are supported::" -msgstr "" +msgstr "いくつかの変形形式がサポートされています::" #: ../../library/pathlib.rst:860 msgid "" @@ -1330,12 +1635,22 @@ msgid "" ">>> p = Path.from_uri('file:/c|/windows')\n" "WindowsPath('c:/windows')" msgstr "" +">>> p = Path.from_uri('file:////server/share')\n" +"WindowsPath('//server/share')\n" +">>> p = Path.from_uri('file://///server/share')\n" +"WindowsPath('//server/share')\n" +">>> p = Path.from_uri('file:c:/windows')\n" +"WindowsPath('c:/windows')\n" +">>> p = Path.from_uri('file:/c|/windows')\n" +"WindowsPath('c:/windows')" #: ../../library/pathlib.rst:869 msgid "" ":exc:`ValueError` is raised if the URI does not start with ``file:``, or the " "parsed path isn't absolute." msgstr "" +"URI が ``file:`` で始まらない場合、またはパースされたパスが絶対パスでない場合" +"は :exc:`ValueError` が送出されます。" #: ../../library/pathlib.rst:874 msgid "" @@ -1343,14 +1658,18 @@ msgid "" "if the authority isn't empty or ``localhost``, then on Windows a UNC path is " "returned (as before), and on other platforms a :exc:`ValueError` is raised." msgstr "" +"URL の authority がローカルホスト名と一致する場合は破棄されます。そうでない場" +"合、authority が空でも ``localhost`` でもない場合は、Windows では (以前と同様" +"に) UNC パスが返され、その他のプラットフォームでは :exc:`ValueError` が送出さ" +"れます。" #: ../../library/pathlib.rst:883 msgid "" "Represent the path as a 'file' URI. :exc:`ValueError` is raised if the path " "isn't absolute." msgstr "" -" 'file' URI で表したパスを返します。絶対パスではない場合に :exc:`ValueError` " -"を送出します。" +"パスを 'file' URI として表現します。パスが絶対パスでない場合は :exc:`ValueError` " +"が送出されます。" #: ../../library/pathlib.rst:886 msgid "" @@ -1361,6 +1680,12 @@ msgid "" ">>> p.as_uri()\n" "'file:///c:/Windows'" msgstr "" +">>> p = PosixPath('/etc/passwd')\n" +">>> p.as_uri()\n" +"'file:///etc/passwd'\n" +">>> p = WindowsPath('c:/Windows')\n" +">>> p.as_uri()\n" +"'file:///c:/Windows'" #: ../../library/pathlib.rst:897 msgid "" @@ -1368,6 +1693,9 @@ msgid "" "possible but deprecated. The method's use of :func:`os.fsencode` makes it " "strictly impure." msgstr "" +"このメソッドを :class:`Path` ではなく :class:`PurePath` から呼び出すことは可能" +"ですが、非推奨です。このメソッドは :func:`os.fsencode` を使用するため、厳密に" +"は純粋ではありません。" #: ../../library/pathlib.rst:903 msgid "Expanding and resolving paths" @@ -1379,15 +1707,17 @@ msgid "" "by :func:`os.path.expanduser` with ``~`` construct). If the home directory " "can't be resolved, :exc:`RuntimeError` is raised." msgstr "" -"ユーザーのホームディレクトリ (:func:`os.path.expanduser` での ``~`` の返り" -"値) を表す新しいパスオブジェクトを返します。ホームディレクトリが解決できない" -"場合は、 :exc:`RuntimeError` を送出します。" +"ユーザーのホームディレクトリを表す新しいパスオブジェクトを返します (:func:`os." +"path.expanduser` が ``~`` を解釈して返すのと同じです)。ホームディレクトリが解" +"決できない場合は :exc:`RuntimeError` が送出されます。" #: ../../library/pathlib.rst:913 msgid "" ">>> Path.home()\n" "PosixPath('/home/antoine')" msgstr "" +">>> Path.home()\n" +"PosixPath('/home/antoine')" #: ../../library/pathlib.rst:921 msgid "" @@ -1395,9 +1725,9 @@ msgid "" "by :meth:`os.path.expanduser`. If a home directory can't be resolved, :exc:" "`RuntimeError` is raised." msgstr "" -"パス要素 ``~`` および ``~user`` を :meth:`os.path.expanduser` が返すように展" -"開した新しいパスオブジェクトを返します。ホームディレクトリが解決できない場合" -"は、 :exc:`RuntimeError` を送出します。" +":meth:`os.path.expanduser` が返すように、``~`` および ``~user`` 構造を展開し" +"た新しいパスを返します。ホームディレクトリが解決できない場合は :exc:`RuntimeError` " +"が送出されます。" #: ../../library/pathlib.rst:927 msgid "" @@ -1405,27 +1735,32 @@ msgid "" ">>> p.expanduser()\n" "PosixPath('/home/eric/films/Monty Python')" msgstr "" +">>> p = PosixPath('~/films/Monty Python')\n" +">>> p.expanduser()\n" +"PosixPath('/home/eric/films/Monty Python')" #: ../../library/pathlib.rst:936 msgid "" "Return a new path object representing the current directory (as returned by :" "func:`os.getcwd`)::" msgstr "" -"(:func:`os.getcwd` が返す) 現在のディレクトリを表す新しいパスオブジェクトを返" -"します::" +"カレントディレクトリを表す新しいパスオブジェクトを返します (:func:`os.getcwd` " +"が返すのと同じです)::" #: ../../library/pathlib.rst:939 msgid "" ">>> Path.cwd()\n" "PosixPath('/home/antoine/pathlib')" msgstr "" +">>> Path.cwd()\n" +"PosixPath('/home/antoine/pathlib')" #: ../../library/pathlib.rst:945 msgid "" "Make the path absolute, without normalization or resolving symlinks. Returns " "a new path object::" msgstr "" -"正規化やシンボリックリンクの解決をせずに、パスを絶対パスにします。新しいパス" +"正規化やシンボリックリンクの解決を行わずに、パスを絶対パスにします。新しいパス" "オブジェクトを返します::" #: ../../library/pathlib.rst:948 @@ -1436,14 +1771,19 @@ msgid "" ">>> p.absolute()\n" "PosixPath('/home/antoine/pathlib/tests')" msgstr "" +">>> p = Path('tests')\n" +">>> p\n" +"PosixPath('tests')\n" +">>> p.absolute()\n" +"PosixPath('/home/antoine/pathlib/tests')" #: ../../library/pathlib.rst:957 msgid "" "Make the path absolute, resolving any symlinks. A new path object is " "returned::" msgstr "" -"パスを絶対パスにし、あらゆるシンボリックリンクを解決します。新しいパスオブ" -"ジェクトが返されます::" +"パスを絶対パスにし、すべてのシンボリックリンクを解決します。新しいパスオブジェ" +"クトが返されます::" #: ../../library/pathlib.rst:960 msgid "" @@ -1453,14 +1793,18 @@ msgid "" ">>> p.resolve()\n" "PosixPath('/home/antoine/pathlib')" msgstr "" +">>> p = Path()\n" +">>> p\n" +"PosixPath('.')\n" +">>> p.resolve()\n" +"PosixPath('/home/antoine/pathlib')" #: ../../library/pathlib.rst:966 msgid "" "\"``..``\" components are also eliminated (this is the only method to do " "so)::" msgstr "" -"\"``..``\" 要素は除去されます (このような挙動を示すのはこのメソッドだけで" -"す)::" +"\"``..``\" コンポーネントも削除されます (これを行う唯一のメソッドです)::" #: ../../library/pathlib.rst:968 msgid "" @@ -1468,6 +1812,9 @@ msgid "" ">>> p.resolve()\n" "PosixPath('/home/antoine/pathlib/setup.py')" msgstr "" +">>> p = Path('docs/../setup.py')\n" +">>> p.resolve()\n" +"PosixPath('/home/antoine/pathlib/setup.py')" #: ../../library/pathlib.rst:972 msgid "" @@ -1476,10 +1823,13 @@ msgid "" "resolved as far as possible and any remainder is appended without checking " "whether it exists." msgstr "" +"パスが存在しないか、シンボリックリンクのループが検出され、かつ *strict* が " +"``True`` の場合、:exc:`OSError` が送出されます。*strict* が ``False`` の場" +"合、パスは可能な限り解決され、残りの部分は存在を確認せずに追記されます。" #: ../../library/pathlib.rst:977 msgid "The *strict* parameter was added (pre-3.6 behavior is strict)." -msgstr "*strict* 引数を追加しました(3.6以前の挙動は strict です)。" +msgstr "*strict* パラメータが追加されました (3.6 より前の挙動は strict です)。" #: ../../library/pathlib.rst:980 msgid "" @@ -1487,12 +1837,18 @@ msgid "" "strict mode, and no exception is raised in non-strict mode. In previous " "versions, :exc:`RuntimeError` is raised no matter the value of *strict*." msgstr "" +"シンボリックリンクのループは他のエラーと同様に扱われます: strict モードでは " +":exc:`OSError` が送出され、非 strict モードでは例外は送出されません。以前の" +"バージョンでは、*strict* の値に関係なく :exc:`RuntimeError` が送出されていま" +"した。" #: ../../library/pathlib.rst:988 msgid "" "Return the path to which the symbolic link points (as returned by :func:`os." "readlink`)::" -msgstr "( :func:`os.readlink` が返す) シンボリックリンクが指すパスを返します::" +msgstr "" +"シンボリックリンクが指すパスを返します (:func:`os.readlink` が返すのと同じで" +"す)::" #: ../../library/pathlib.rst:991 msgid "" @@ -1501,18 +1857,23 @@ msgid "" ">>> p.readlink()\n" "PosixPath('setup.py')" msgstr "" +">>> p = Path('mylink')\n" +">>> p.symlink_to('setup.py')\n" +">>> p.readlink()\n" +"PosixPath('setup.py')" #: ../../library/pathlib.rst:998 msgid "" "Raises :exc:`UnsupportedOperation` if :func:`os.readlink` is not available. " "In previous versions, :exc:`NotImplementedError` was raised." msgstr "" -":func:`os.readlink` が利用できない場合 :exc:`UnsupportedOperation` を送出しま" -"す。以前のバージョンでは :exc:`NotImplementedError` を送出していました。" +":func:`os.readlink` が利用できない場合は :exc:`UnsupportedOperation` を送出" +"します。以前のバージョンでは :exc:`NotImplementedError` が送出されていまし" +"た。" #: ../../library/pathlib.rst:1004 msgid "Querying file type and status" -msgstr "ファイルの種類とステータスを問い合わせる" +msgstr "ファイルの種類と状態の問い合わせ" #: ../../library/pathlib.rst:1008 msgid "" @@ -1524,9 +1885,9 @@ msgid "" msgstr "" ":meth:`~Path.exists`, :meth:`~Path.is_dir`, :meth:`~Path.is_file`, :meth:" "`~Path.is_mount`, :meth:`~Path.is_symlink`, :meth:`~Path.is_block_device`, :" -"meth:`~Path.is_char_device`, :meth:`~Path.is_socket` は、OSレベルで表現不能な" -"文字を含むパスに対して、例外を送出する代わりに ``False`` を返すようになりまし" -"た。 " +"meth:`~Path.is_char_device`, :meth:`~Path.is_fifo`, :meth:`~Path.is_socket` " +"は、OS レベルで表現できない文字を含むパスに対して、例外を送出する代わりに " +"``False`` を返すようになりました。" #: ../../library/pathlib.rst:1017 msgid "" @@ -1537,6 +1898,12 @@ msgid "" "etc. Use :meth:`~Path.stat` to retrieve the file status without suppressing " "exceptions." msgstr "" +"上記のメソッドは、オペレーティングシステムから :exc:`OSError` 例外を送出する" +"代わりに ``False`` を返すようになりました。以前のバージョンでは、ある種の " +":exc:`OSError` 例外は送出され、他のものは抑制されていました。新しい動作は " +":func:`os.path.exists`、:func:`os.path.isdir` などと一貫しています。例外を" +"抑制せずにファイルの状態を取得するには、:meth:`~Path.stat` を使用してくださ" +"い。" #: ../../library/pathlib.rst:1027 msgid "" @@ -1544,18 +1911,18 @@ msgid "" "path, like :func:`os.stat`. The result is looked up at each call to this " "method." msgstr "" -"(:func:`os.stat` と同様の) 現在のパスについて :class:`os.stat_result` オブ" -"ジェクトが含む情報を返します。値はそれぞれのメソッドを呼び出した時点のものに" -"なります。" +"このパスに関する情報を含む :class:`os.stat_result` オブジェクトを返します " +"(:func:`os.stat` と同様です)。結果はこのメソッドが呼び出されるたびに検索され" +"ます。" #: ../../library/pathlib.rst:1030 msgid "" "This method normally follows symlinks; to stat a symlink add the argument " "``follow_symlinks=False``, or use :meth:`~Path.lstat`." msgstr "" -"このメソッドは通常はシンボリックリンクをたどります。シンボリックリンクに対し" -"て stat したい場合は ``follow_symlinks=False`` とするか、 :meth:`~Path." -"lstat` を利用してください。" +"このメソッドは通常シンボリックリンクをたどります。シンボリックリンクの情報を取" +"得するには、引数 ``follow_symlinks=False`` を追加するか、:meth:`~Path.lstat` " +"を使用してください。" #: ../../library/pathlib.rst:1035 msgid "" @@ -1565,6 +1932,11 @@ msgid "" ">>> p.stat().st_mtime\n" "1327883547.852554" msgstr "" +">>> p = Path('setup.py')\n" +">>> p.stat().st_size\n" +"956\n" +">>> p.stat().st_mtime\n" +"1327883547.852554" #: ../../library/pathlib.rst:1041 ../../library/pathlib.rst:1071 #: ../../library/pathlib.rst:1085 ../../library/pathlib.rst:1099 @@ -1578,8 +1950,8 @@ msgid "" "Like :meth:`Path.stat` but, if the path points to a symbolic link, return " "the symbolic link's information rather than its target's." msgstr "" -":meth:`Path.stat` のように振る舞いますが、パスがシンボリックリンクを指してい" -"た場合、リンク先ではなくシンボリックリンク自身の情報を返します。" +":meth:`Path.stat` と同様ですが、パスがシンボリックリンクを指している場合は、" +"そのターゲットの情報ではなく、シンボリックリンク自身の情報を返します。" #: ../../library/pathlib.rst:1053 msgid "" @@ -1587,14 +1959,17 @@ msgid "" "``False`` will be returned if the path is invalid, inaccessible or missing. " "Use :meth:`Path.stat` to distinguish between these cases." msgstr "" +"パスが存在するファイルまたはディレクトリを指している場合は ``True`` を返しま" +"す。パスが無効、アクセス不能、または見つからない場合は ``False`` が返されま" +"す。これらのケースを区別するには :meth:`Path.stat` を使用してください。" #: ../../library/pathlib.rst:1057 msgid "" "This method normally follows symlinks; to check if a symlink exists, add the " "argument ``follow_symlinks=False``." msgstr "" -"このメソッドは通常はシンボリックリンクをたどります。シンボリックリンクが存在" -"するかを確認したい場合は ``follow_symlinks=False`` 引数を追加してください。" +"このメソッドは通常シンボリックリンクをたどります。シンボリックリンクが存在する" +"かどうかを確認するには、引数 ``follow_symlinks=False`` を追加してください。" #: ../../library/pathlib.rst:1062 msgid "" @@ -1607,6 +1982,14 @@ msgid "" ">>> Path('nonexistentfile').exists()\n" "False" msgstr "" +">>> Path('.').exists()\n" +"True\n" +">>> Path('setup.py').exists()\n" +"True\n" +">>> Path('/etc').exists()\n" +"True\n" +">>> Path('nonexistentfile').exists()\n" +"False" #: ../../library/pathlib.rst:1077 msgid "" @@ -1615,14 +1998,18 @@ msgid "" "something other than a regular file. Use :meth:`Path.stat` to distinguish " "between these cases." msgstr "" +"パスが通常のファイルを指している場合は ``True`` を返します。パスが無効、アクセ" +"ス不能、見つからない場合、または通常のファイル以外のものを指している場合は " +"``False`` が返されます。これらのケースを区別するには :meth:`Path.stat` を使用" +"してください。" #: ../../library/pathlib.rst:1082 msgid "" "This method normally follows symlinks; to exclude symlinks, add the argument " "``follow_symlinks=False``." msgstr "" -"このメソッドは通常はシンボリックリンクをたどります。シンボリックリンクを除外" -"するには ``follow_symlinks=False`` 引数を追加してください。" +"このメソッドは通常シンボリックリンクをたどります。シンボリックリンクを除外する" +"には、引数 ``follow_symlinks=False`` を追加してください。" #: ../../library/pathlib.rst:1091 msgid "" @@ -1631,14 +2018,18 @@ msgid "" "something other than a directory. Use :meth:`Path.stat` to distinguish " "between these cases." msgstr "" +"パスがディレクトリを指している場合は ``True`` を返します。パスが無効、アクセス" +"不能、見つからない場合、またはディレクトリ以外のものを指している場合は " +"``False`` が返されます。これらのケースを区別するには :meth:`Path.stat` を使用" +"してください。" #: ../../library/pathlib.rst:1096 msgid "" "This method normally follows symlinks; to exclude symlinks to directories, " "add the argument ``follow_symlinks=False``." msgstr "" -"このメソッドは通常はシンボリックリンクをたどります。ディレクトリへのシンボ" -"リックリンクを除外するには ``follow_symlinks=False`` 引数を追加してください。" +"このメソッドは通常シンボリックリンクをたどります。ディレクトリへのシンボリック" +"リンクを除外するには、引数 ``follow_symlinks=False`` を追加してください。" #: ../../library/pathlib.rst:1105 msgid "" @@ -1647,14 +2038,19 @@ msgid "" "or missing, or if it points to something other than a symbolic link. Use :" "meth:`Path.stat` to distinguish between these cases." msgstr "" +"パスがシンボリックリンクを指している場合は、たとえそのシンボリックリンクが壊れ" +"ていても ``True`` を返します。パスが無効、アクセス不能、見つからない場合、ま" +"たはシンボリックリンク以外のものを指している場合は ``False`` が返されます。こ" +"れらのケースを区別するには :meth:`Path.stat` を使用してください。" #: ../../library/pathlib.rst:1113 msgid "" "Return ``True`` if the path points to a junction, and ``False`` for any " "other type of file. Currently only Windows supports junctions." msgstr "" -"パスがジャンクションを指している場合は ``True`` を返し、それ以外の場合は " -"``False`` を返します。現在はWindowsのみジャンクションをサポートしています。" +"パスがジャンクションを指している場合は ``True`` を返し、その他の種類のファイル" +"の場合は ``False`` を返します。現在、ジャンクションをサポートしているのは " +"Windows のみです。" #: ../../library/pathlib.rst:1121 msgid "" @@ -1667,14 +2063,14 @@ msgid "" "letter root (e.g. ``c:\\``), a UNC share (e.g. ``\\\\server\\share``), or a " "mounted filesystem directory." msgstr "" -"パスがマウントポイント :dfn:`mount point` (ファイルシステムの中で異なるファイ" -"ルシステムがマウントされているところ) なら、 ``True`` を返します。POSIX で" -"は、この関数は *path* の親ディレクトリである :file:`path/..` が *path* と異な" -"るデバイス上にあるか、あるいは :file:`path/..` と *path* が同じデバイス上の同" -"じ i-node を指しているかをチェックします --- これによって全ての Unix 系システ" -"ムと POSIX 標準でマウントポイントが検出できます。Windowsでは、マウントポイン" -"トはドライブレターを持つルート(e.g. ``c:\\``)、共有 UNC(e.g. ``\\" -"\\server\\share``)またはマウントされたファイルシステムのディレクトリです。" +"パスが :dfn:`マウントポイント` (ファイルシステム内で別のファイルシステムがマウ" +"ントされている場所) である場合は ``True`` を返します。POSIX では、この関数は " +"*path* の親である :file:`path/..` が *path* とは異なるデバイス上にあるかどう" +"か、または :file:`path/..` と *path* が同じデバイス上の同じ i-node を指して" +"いるかどうかをチェックします --- これにより、すべての Unix および POSIX の変種" +"でマウントポイントが検出されるはずです。Windows では、マウントポイントはドライ" +"ブ文字のルート (例: ``c:\\``)、UNC 共有 (例: ``\\\\server\\share``)、また" +"はマウントされたファイルシステムのディレクトリと見なされます。" #: ../../library/pathlib.rst:1132 msgid "Windows support was added." @@ -1687,6 +2083,10 @@ msgid "" "something other than a Unix socket. Use :meth:`Path.stat` to distinguish " "between these cases." msgstr "" +"パスが Unix ソケットを指している場合は ``True`` を返します。パスが無効、アク" +"セス不能、見つからない場合、または Unix ソケット以外のものを指している場合は " +"``False`` が返されます。これらのケースを区別するには :meth:`Path.stat` を使用" +"してください。" #: ../../library/pathlib.rst:1145 msgid "" @@ -1694,6 +2094,9 @@ msgid "" "the path is invalid, inaccessible or missing, or if it points to something " "other than a FIFO. Use :meth:`Path.stat` to distinguish between these cases." msgstr "" +"パスが FIFO を指している場合は ``True`` を返します。パスが無効、アクセス不能、" +"見つからない場合、または FIFO 以外のものを指している場合は ``False`` が返され" +"ます。これらのケースを区別するには :meth:`Path.stat` を使用してください。" #: ../../library/pathlib.rst:1153 msgid "" @@ -1702,6 +2105,10 @@ msgid "" "something other than a block device. Use :meth:`Path.stat` to distinguish " "between these cases." msgstr "" +"パスがブロックデバイスを指している場合は ``True`` を返します。パスが無効、アク" +"セス不能、見つからない場合、またはブロックデバイス以外のものを指している場合は " +"``False`` が返されます。これらのケースを区別するには :meth:`Path.stat` を使用" +"してください。" #: ../../library/pathlib.rst:1161 msgid "" @@ -1710,6 +2117,10 @@ msgid "" "something other than a character device. Use :meth:`Path.stat` to " "distinguish between these cases." msgstr "" +"パスがキャラクターデバイスを指している場合は ``True`` を返します。パスが無効、" +"アクセス不能、見つからない場合、またはキャラクターデバイス以外のものを指してい" +"る場合は ``False`` が返されます。これらのケースを区別するには :meth:`Path.stat` " +"を使用してください。" #: ../../library/pathlib.rst:1169 msgid "" @@ -1717,17 +2128,17 @@ msgid "" "be either a Path object, or a string. The semantics are similar to :func:" "`os.path.samefile` and :func:`os.path.samestat`." msgstr "" -"このパスが参照するファイルが *other_path* (Path オブジェクトか文字列) と同じ" -"であれば ``True`` を、異なるファイルであれば ``False`` を返します。意味的に" -"は :func:`os.path.samefile` および :func:`os.path.samestat` と同じです。" +"このパスが *other_path* (Path オブジェクトまたは文字列) と同じファイルを指し" +"ているかどうかを返します。セマンティクスは :func:`os.path.samefile` および " +":func:`os.path.samestat` と似ています。" #: ../../library/pathlib.rst:1173 msgid "" "An :exc:`OSError` can be raised if either file cannot be accessed for some " "reason." msgstr "" -"なんらかの理由でどちらかのファイルにアクセスできない場合は :exc:`OSError` が" -"送出されます。" +"何らかの理由でどちらかのファイルにアクセスできない場合は、:exc:`OSError` が送" +"出される可能性があります。" #: ../../library/pathlib.rst:1178 msgid "" @@ -1738,6 +2149,12 @@ msgid "" ">>> p.samefile('spam')\n" "True" msgstr "" +">>> p = Path('spam')\n" +">>> q = Path('eggs')\n" +">>> p.samefile(q)\n" +"False\n" +">>> p.samefile('spam')\n" +"True" #: ../../library/pathlib.rst:1190 msgid "" @@ -1746,6 +2163,10 @@ msgid "" "help reduce the number of system calls needed when switching on file type. " "For example::" msgstr "" +"ファイルの種類情報を問い合わせることをサポートする :class:`~pathlib.types." +"PathInfo` オブジェクトです。このオブジェクトは、結果をキャッシュするメソッド" +"を公開しており、ファイルの種類によって処理を切り替える際に必要なシステムコー" +"ルの数を減らすのに役立ちます。例えば::" #: ../../library/pathlib.rst:1195 msgid "" @@ -1761,6 +2182,17 @@ msgid "" "...\n" "directory" msgstr "" +">>> p = Path('src')\n" +">>> if p.info.is_symlink():\n" +"... print('symlink')\n" +"... elif p.info.is_dir():\n" +"... print('directory')\n" +"... elif p.info.exists():\n" +"... print('something else')\n" +"... else:\n" +"... print('not found')\n" +"...\n" +"directory" #: ../../library/pathlib.rst:1207 msgid "" @@ -1769,6 +2201,9 @@ msgid "" "the parent directory. Merely accessing :attr:`Path.info` does not perform " "any filesystem queries." msgstr "" +"パスが :meth:`Path.iterdir` から生成された場合、この属性は親ディレクトリをス" +"キャンして得られたファイルの種類に関する情報で初期化されます。単に :attr:`Path." +"info` にアクセスするだけでは、ファイルシステムのクエリは実行されません。" #: ../../library/pathlib.rst:1212 msgid "" @@ -1777,16 +2212,21 @@ msgid "" "this attribute. There is no way to reset the cache; instead you can create a " "new path object with an empty info cache via ``p = Path(p)``." msgstr "" +"最新の情報を取得するには、この属性のメソッドではなく、:meth:`Path.is_dir`、" +":meth:`~Path.is_file`、:meth:`~Path.is_symlink` を呼び出すのが最善です。キャッ" +"シュをリセットする方法はありません。代わりに、``p = Path(p)`` を介して空の情" +"報キャッシュを持つ新しいパスオブジェクトを作成できます。" #: ../../library/pathlib.rst:1221 msgid "Reading and writing files" -msgstr "ファイルを読み書きする" +msgstr "ファイルの読み書き" #: ../../library/pathlib.rst:1226 msgid "" "Open the file pointed to by the path, like the built-in :func:`open` " "function does::" -msgstr "組み込み関数 :func:`open` のようにパスが指しているファイルを開きます::" +msgstr "" +"組み込みの :func:`open` 関数のよう、パスが指すファイルを開きます::" #: ../../library/pathlib.rst:1229 msgid "" @@ -1796,10 +2236,15 @@ msgid "" "...\n" "'#!/usr/bin/env python3\\n'" msgstr "" +">>> p = Path('setup.py')\n" +">>> with p.open() as f:\n" +"... f.readline()\n" +"...\n" +"'#!/usr/bin/env python3\\n'" #: ../../library/pathlib.rst:1238 msgid "Return the decoded contents of the pointed-to file as a string::" -msgstr "指定されたファイルの内容を文字列としてデコードして返します::" +msgstr "指されたファイルの内容をデコードして文字列として返します::" #: ../../library/pathlib.rst:1240 ../../library/pathlib.rst:1273 msgid "" @@ -1809,14 +2254,19 @@ msgid "" ">>> p.read_text()\n" "'Text file contents'" msgstr "" +">>> p = Path('my_text_file')\n" +">>> p.write_text('Text file contents')\n" +"18\n" +">>> p.read_text()\n" +"'Text file contents'" #: ../../library/pathlib.rst:1246 msgid "" "The file is opened and then closed. The optional parameters have the same " "meaning as in :func:`open`." msgstr "" -"ファイルを開いた後に閉じます。\n" -"オプションのパラメーターの意味は :func:`open` と同じです。" +"ファイルが開かれ、そして閉じられます。オプションのパラメータは :func:`open` と" +"同じ意味を持ちます。" #: ../../library/pathlib.rst:1251 ../../library/pathlib.rst:1284 msgid "The *newline* parameter was added." @@ -1824,7 +2274,8 @@ msgstr "*newline* パラメータが追加されました。" #: ../../library/pathlib.rst:1257 msgid "Return the binary contents of the pointed-to file as a bytes object::" -msgstr "指定されたファイルの内容をバイナリオブジェクトで返します::" +msgstr "指されたファイルの内容をバイナリコンテンツとして bytes オブジェクトで返しま" +"す::" #: ../../library/pathlib.rst:1259 ../../library/pathlib.rst:1293 msgid "" @@ -1834,45 +2285,48 @@ msgid "" ">>> p.read_bytes()\n" "b'Binary file contents'" msgstr "" +">>> p = Path('my_binary_file')\n" +">>> p.write_bytes(b'Binary file contents')\n" +"20\n" +">>> p.read_bytes()\n" +"b'Binary file contents'" #: ../../library/pathlib.rst:1270 msgid "" "Open the file pointed to in text mode, write *data* to it, and close the " "file::" msgstr "" -"指定されたファイルをテキストモードで開き、*data* を書き込み、ファイルを閉じま" -"す::" +"指されたファイルをテキストモードで開き、*data* を書き込み、ファイルを閉じます::" #: ../../library/pathlib.rst:1279 msgid "" "An existing file of the same name is overwritten. The optional parameters " "have the same meaning as in :func:`open`." msgstr "" -"同じ名前のファイルが存在する場合は上書きされます。オプションのパラメーターの" -"意味は :func:`open` と同じです。" +"同じ名前の既存のファイルは上書きされます。オプションのパラメータは :func:`open` " +"と同じ意味を持ちます。" #: ../../library/pathlib.rst:1290 msgid "" "Open the file pointed to in bytes mode, write *data* to it, and close the " "file::" msgstr "" -"指定されたファイルをバイトモードで開き、*data* を書き込み、ファイルを閉じま" -"す::" +"指されたファイルをバイトモードで開き、*data* を書き込み、ファイルを閉じます::" #: ../../library/pathlib.rst:1299 msgid "An existing file of the same name is overwritten." -msgstr "同じ名前のファイルがすでにあれば上書きされます。" +msgstr "同じ名前の既存のファイルは上書きされます。" #: ../../library/pathlib.rst:1305 msgid "Reading directories" -msgstr "ディレクトリを読む" +msgstr "ディレクトリの読み取り" #: ../../library/pathlib.rst:1309 msgid "" "When the path points to a directory, yield path objects of the directory " "contents::" msgstr "" -"パスがディレクトリを指していた場合、ディレクトリの内容のパスオブジェクトを " +"パスがディレクトリを指している場合、そのディレクトリの内容のパスオブジェクトを" "yield します::" #: ../../library/pathlib.rst:1312 @@ -1888,6 +2342,16 @@ msgid "" "PosixPath('docs/_static')\n" "PosixPath('docs/Makefile')" msgstr "" +">>> p = Path('docs')\n" +">>> for child in p.iterdir(): child\n" +"...\n" +"PosixPath('docs/conf.py')\n" +"PosixPath('docs/_templates')\n" +"PosixPath('docs/make.bat')\n" +"PosixPath('docs/index.rst')\n" +"PosixPath('docs/_build')\n" +"PosixPath('docs/_static')\n" +"PosixPath('docs/Makefile')" #: ../../library/pathlib.rst:1323 msgid "" @@ -1896,26 +2360,26 @@ msgid "" "directory after creating the iterator, it is unspecified whether a path " "object for that file is included." msgstr "" -"子の要素は任意の順番で yield されます。特殊なパスの ``'.'`` と ``'..'`` は含" -"まれません。イテレーターを生成したあとにディレクトリにファイルを削除または追" -"加した場合に、そのファイルのパスオブジェクトが含まれるかは定義されていませ" -"ん。" +"子は任意の順序で yield され、特別なエントリ ``'.'`` と ``'..'`` は含まれませ" +"ん。イテレータを作成した後にディレクトリからファイルが削除されたり、ディレクト" +"リに追加されたりした場合、そのファイルのパスオブジェクトが含まれるかどうかは未" +"定です。" #: ../../library/pathlib.rst:1328 msgid "" "If the path is not a directory or otherwise inaccessible, :exc:`OSError` is " "raised." msgstr "" -"パスがディレクトリでないかアクセスできない場合は :exc:`OSError` を送出しま" -"す。" +"パスがディレクトリでないか、アクセスできない場合は、:exc:`OSError` が送出され" +"ます。" #: ../../library/pathlib.rst:1334 msgid "" "Glob the given relative *pattern* in the directory represented by this path, " "yielding all matching files (of any kind)::" msgstr "" -"現在のパスが表すディレクトリ内で相対 *pattern* に一致する (あらゆる種類の) す" -"べてのファイルを yield します::" +"このパスが表すディレクトリ内で、指定された相対的な *pattern* を glob し、一致" +"するすべてのファイル (種類を問わず) を yield します::" #: ../../library/pathlib.rst:1337 msgid "" @@ -1931,6 +2395,17 @@ msgid "" " PosixPath('setup.py'),\n" " PosixPath('test_pathlib.py')]" msgstr "" +">>> sorted(Path('.').glob('*.py'))\n" +"[PosixPath('pathlib.py'), PosixPath('setup.py'), PosixPath('test_pathlib." +"py')]\n" +">>> sorted(Path('.').glob('*/*.py'))\n" +"[PosixPath('docs/conf.py')]\n" +">>> sorted(Path('.').glob('**/*.py'))\n" +"[PosixPath('build/lib/pathlib.py'),\n" +" PosixPath('docs/conf.py'),\n" +" PosixPath('pathlib.py'),\n" +" PosixPath('setup.py'),\n" +" PosixPath('test_pathlib.py')]" #: ../../library/pathlib.rst:1351 msgid "" @@ -1939,11 +2414,11 @@ msgid "" "typically, case-sensitive on POSIX, and case-insensitive on Windows. Set " "*case_sensitive* to ``True`` or ``False`` to override this behaviour." msgstr "" -"デフォルトまたは *case_sensitive* キーワード専用引数に ``None`` を指定した場" -"合、このメソッドはパスの一致判定にプラットフォームに依存した大文字小文字の" -"ルールを使用します。一般的にPOSIXは大文字と小文字を区別し、Windowsは区別しま" -"せん。*case_sensitive* を ``True`` または ``False`` に設定するとこの動作を上" -"書きします。" +"デフォルトで、またはキーワード専用引数 *case_sensitive* が ``None`` に設定さ" +"れている場合、このメソッドはプラットフォーム固有の大文字小文字の規則を使用し" +"てパスを照合します。通常、POSIX では大文字と小文字を区別し、Windows では区別" +"しません。この動作を上書きするには、*case_sensitive* を ``True`` または " +"``False`` に設定します。" #: ../../library/pathlib.rst:1356 msgid "" @@ -1951,18 +2426,18 @@ msgid "" "``False``, this method follows symlinks except when expanding \"``**``\" " "wildcards. Set *recurse_symlinks* to ``True`` to always follow symlinks." msgstr "" -"デフォルトまたは *recurse_symlinks* キーワード専用引数が ``False`` に設定さ" -"れた場合、このメソッドは \"``**``\" ワイルドカードの展開時にシンボリックリン" -"クをたどりません。*recurse_symlinks* を ``True`` に設定すると、つねにシンボ" -"リックリンクをたどります。" +"デフォルトで、またはキーワード専用引数 *recurse_symlinks* が ``False`` に設" +"定されている場合、このメソッドは \"``**``\" ワイルドカードを展開する場合を除" +"き、シンボリックリンクをたどります。常にシンボリックリンクをたどるには、" +"*recurse_symlinks* を ``True`` に設定します。" #: ../../library/pathlib.rst:1360 msgid "" "Raises an :ref:`auditing event ` ``pathlib.Path.glob`` with " "arguments ``self``, ``pattern``." msgstr "" -"引数 ``self``, ``pattern`` を指定して :ref:`監査イベント ` " -"``pathlib.Path.glob`` を送出します。 " +"引数 ``self``, ``pattern`` を持つ :ref:`監査イベント ` " +"``pathlib.Path.glob`` を送出します。" #: ../../library/pathlib.rst:1365 ../../library/pathlib.rst:1390 msgid "The *recurse_symlinks* parameter was added." @@ -1974,30 +2449,35 @@ msgid "" "suppressed. In previous versions, such exceptions are suppressed in many " "cases, but not all." msgstr "" +"ファイルシステムのスキャンから送出された :exc:`OSError` 例外はすべて抑制され" +"ます。以前のバージョンでは、そのような例外は多くの場合抑制されていましたが、す" +"べてではありませんでした。" #: ../../library/pathlib.rst:1379 msgid "" "Glob the given relative *pattern* recursively. This is like calling :func:" "`Path.glob` with \"``**/``\" added in front of the *pattern*." msgstr "" -"与えられた相対 *pattern* で再帰的に Glob します。:func:`Path.glob` で " -"*pattern* の前に \"``**/``\" をつけ呼び出した場合と似ています。" +"指定された相対的な *pattern* を再帰的に glob します。これは、*pattern* の前" +"に \"``**/``\" を付けて :func:`Path.glob` を呼び出すのと似ています。" #: ../../library/pathlib.rst:1383 msgid ":ref:`pathlib-pattern-language` and :meth:`Path.glob` documentation." -msgstr ":ref:`pathlib-pattern-language` と :meth:`Path.glob` のドキュメント。" +msgstr ":ref:`pathlib-pattern-language` と :meth:`Path.glob` のドキュメントを参照し" +"てください。" #: ../../library/pathlib.rst:1385 msgid "" "Raises an :ref:`auditing event ` ``pathlib.Path.rglob`` with " "arguments ``self``, ``pattern``." msgstr "" -"引数 ``self``, ``pattern`` を指定して :ref:`監査イベント ` " -"``pathlib.Path.rglob`` を送出します。 " +"引数 ``self``, ``pattern`` を持つ :ref:`監査イベント ` " +"``pathlib.Path.rglob`` を送出します。" #: ../../library/pathlib.rst:1399 msgid "" "Generate the file names in a directory tree by walking the tree either top-" + "down or bottom-up." msgstr "" diff --git a/tutorial/interpreter.po b/tutorial/interpreter.po index dfdd9ac03..f81314df1 100644 --- a/tutorial/interpreter.po +++ b/tutorial/interpreter.po @@ -46,7 +46,7 @@ msgstr "" #: ../../tutorial/interpreter.rst:17 msgid "python3.14" -msgstr "" +msgstr "python3.14" #: ../../tutorial/interpreter.rst:21 msgid ""