From 6e763d04e8f3aaff9ef470fd69cd00944b196af5 Mon Sep 17 00:00:00 2001
From: Fenhl <fenhl@fenhl.net>
Date: Tue, 13 Feb 2018 07:50:47 +0000
Subject: [PATCH] Support any path-like object

---
 aionotify/base.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/aionotify/base.py b/aionotify/base.py
index 113f68d..c70e94b 100644
--- a/aionotify/base.py
+++ b/aionotify/base.py
@@ -5,6 +5,7 @@
 import asyncio.streams
 import collections
 import ctypes
+import os
 import struct
 
 from . import aioutils
@@ -23,7 +24,7 @@ def inotify_init(cls):
 
     @classmethod
     def inotify_add_watch(cls, fd, path, flags):
-        return _libc.inotify_add_watch(fd, path.encode('utf-8'), flags)
+        return _libc.inotify_add_watch(fd, os.fsencode(path), flags)
 
     @classmethod
     def inotify_rm_watch(cls, fd, wd):