Skip to content

Commit 9cfc4fc

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 2c87303 + 4ca483e commit 9cfc4fc

File tree

134 files changed

+16796
-3949
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+16796
-3949
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
- name: Run Pyright
3939
uses: jakebailey/pyright-action@v1
4040
with:
41-
version: '1.1.316'
41+
version: '1.1.394'
4242
warnings: false
4343
no-comments: ${{ matrix.python-version != '3.x' }}
4444

README.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ Installing
2727

2828
To install the library without full voice support, you can just run the following command:
2929

30+
.. note::
31+
32+
A `Virtual Environment <https://docs.python.org/3/library/venv.html>`__ is recommended to install
33+
the library, especially on Linux where the system Python is externally managed and restricts which
34+
packages you can install on it.
35+
36+
3037
.. code:: sh
3138
3239
# Linux/macOS

discord/__init__.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
__author__ = 'Rapptz'
1414
__license__ = 'MIT'
1515
__copyright__ = 'Copyright 2015-present Rapptz'
16-
__version__ = '2.4.0a'
16+
__version__ = '2.6.0a'
1717

1818
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
1919

@@ -69,6 +69,10 @@
6969
from .components import *
7070
from .threads import *
7171
from .automod import *
72+
from .poll import *
73+
from .soundboard import *
74+
from .subscription import *
75+
from .presences import *
7276

7377

7478
class VersionInfo(NamedTuple):
@@ -79,8 +83,14 @@ class VersionInfo(NamedTuple):
7983
serial: int
8084

8185

82-
version_info: VersionInfo = VersionInfo(major=2, minor=4, micro=0, releaselevel='alpha', serial=0)
86+
version_info: VersionInfo = VersionInfo(major=2, minor=6, micro=0, releaselevel='alpha', serial=0)
8387

8488
logging.getLogger(__name__).addHandler(logging.NullHandler())
8589

90+
# This is a backwards compatibility hack and should be removed in v3
91+
# Essentially forcing the exception to have different base classes
92+
# In the future, this should only inherit from ClientException
93+
if len(MissingApplicationID.__bases__) == 1:
94+
MissingApplicationID.__bases__ = (app_commands.AppCommandError, ClientException)
95+
8696
del logging, NamedTuple, Literal, VersionInfo

discord/__main__.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
import argparse
3030
import sys
31-
from pathlib import Path
31+
from pathlib import Path, PurePath, PureWindowsPath
3232

3333
import discord
3434
import importlib.metadata
@@ -225,8 +225,14 @@ def to_path(parser: argparse.ArgumentParser, name: str, *, replace_spaces: bool
225225
)
226226
if len(name) <= 4 and name.upper() in forbidden:
227227
parser.error('invalid directory name given, use a different one')
228+
path = PurePath(name)
229+
if isinstance(path, PureWindowsPath) and path.drive:
230+
drive, rest = path.parts[0], path.parts[1:]
231+
transformed = tuple(map(lambda p: p.translate(_translation_table), rest))
232+
name = drive + '\\'.join(transformed)
228233

229-
name = name.translate(_translation_table)
234+
else:
235+
name = name.translate(_translation_table)
230236
if replace_spaces:
231237
name = name.replace(' ', '-')
232238
return Path(name)

0 commit comments

Comments
 (0)