HUE-9152 [filebrowser] Fix operations on directories with Cyrillic names

Review Request #14777 — Created Feb. 15, 2020 and submitted

yingc
hue
hdfs_plus_sign
HUE-9152
johan, ranade, romain, weixia
commit 6e8041bd89d7d6976142718a484b006b93649801 (HEAD -> hdfs_plus_sign)
Author: Ying Chen <yingchen@cloudera.com>
Date:   Fri Feb 14 17:38:38 2020 -0800

    HUE-9152 [filebrowser] Fix operations on directories with Cyrillic names

:100644 100644 8b6c1f015d... 21b8cd4ffe... M    apps/filebrowser/src/filebrowser/views.py
:100644 100644 d0aebba9bb... bb1335cb3e... M    apps/filebrowser/src/filebrowser/views_test.py
:100644 100644 0b5338c335... 856e90477a... M    desktop/libs/aws/src/aws/s3/upload.py
:100644 100644 219e74ac17... 29afdcd737... M    desktop/libs/azure/src/azure/abfs/upload.py
:100644 100644 79622be062... 9b529d8031... M    desktop/libs/hadoop/src/hadoop/fs/webhdfs.py


  • 0
  • 0
  • 7
  • 1
  • 8
Description From Last Updated
romain
  1. Really nice one!

  2. How about putting all the 'urllib_unquote(uploaded_file.name.encode('utf-8')).decode('utf-8')'

    into a little util? e.g.

    def unquote_url(url):
    return urllib_unquote(url.encode('utf-8')).decode('utf-8')

  3. Anyway to reuse the same as https://github.com/cloudera/hue/blob/master/desktop/libs/hadoop/src/hadoop/fs/webhdfs.py#L237?

  4. Put some chinese in the name?

  5. employés_file.txt?

  6. 
      
yingc
romain
  1. Ship It!
  2. 
      
yingc
romain
  1. Curious if smart_unicode() would work instead of the if, but if not Ship it!

  2. Could we indent to make it easier to read? e.g.

    request.fs.create(
    request.fs.join(
    urllib_unquote(path.encode('utf-8') if not isinstance(path, str) else path),
    urllib_unquote(name.encode('utf-8') if not isinstance(name, str) else name)
    )
    )

    Using force_unicode() or smart_unicode() instead does not work?

  3. desktop/libs/aws/src/aws/s3/upload.py (Diff revision 3)
     
     

    if dst_parts:

  4. if dst_parts

  5. 
      
yingc
romain
  1. 
      
  2. apps/filebrowser/src/filebrowser/views.py (Diff revision 4)
     
     
     

    unquote_url not needed here?

    (.decode('utf-8') problematic?)

    1. it conflict with def state(...)
  3. 
      
yingc
Review request changed

Status: Closed (submitted)

Loading...