Giter Club home page Giter Club logo

arc4's People

Contributors

manicmaniac avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

arc4's Issues

Passing unicode string to key or data leads mysterious errors

Currently all methods including constructor defined in ARC4 accepts not only bytes but also unicode str.
However passing a unicode str to ARC4 methods requires developers to be very careful like the following example.

>>> from arc4 import ARC4
>>> with open('key-in-utf-8.txt') as f:
...     arc4 = ARC4(f.read())
>>> with open('cipher-utf-8.txt') as f:
...     print(arc4.decrypt(f.read()))  # success
>>> with open('cipher-latin-1.txt') as f:
...     print(arc4.decrypt(f.read()))  # failure
Traceback (most recent call last):
  File "/path/to/script.py", line 7, in <module>
    print(arc4.decrypt(f.read()))
  File "/path/to/python3.9/lib/python3.9/codecs.py", line 322, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf4 in position 3: invalid continuation byte

The example is too simple for experienced developers to make a mistake but once someone changed the text file's encoding, or the print function is called from another module, it could be difficult to find the root cause.

So I will add changes to have ARC4 accept only bytes in future releases.
As a first step, arc4 0.3.0 will warn DeprecationWarning when users pass unicode str to any public methods or constructor of ARC4.
Thereafter maybe in arc4 1.0.0, it will be officially unsupported.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

github-actions
.github/workflows/benchmark.yml
  • actions/checkout v4@692973e3d937129bcbf40652eb9f2f61becf3332
  • actions/setup-python v5
  • actions/upload-artifact v4
  • exuanbo/actions-deploy-gist v1
  • ubuntu 22.04
.github/workflows/release.yml
  • actions/checkout v4@692973e3d937129bcbf40652eb9f2f61becf3332
  • actions/setup-python v5
  • actions/upload-artifact v4
  • actions/checkout v4@692973e3d937129bcbf40652eb9f2f61becf3332
  • actions/setup-python v5
  • actions/upload-artifact v4
  • actions/checkout v4@692973e3d937129bcbf40652eb9f2f61becf3332
  • actions/upload-artifact v4
  • actions/setup-python v5
  • actions/download-artifact v4
  • ubuntu 22.04
  • ubuntu 22.04
  • ubuntu 22.04
.github/workflows/test.yml
  • actions/checkout v4@692973e3d937129bcbf40652eb9f2f61becf3332
  • actions/setup-python v5
  • actions/upload-artifact v4
  • actions/download-artifact v4
  • actions/checkout v4@692973e3d937129bcbf40652eb9f2f61becf3332
  • ubuntu 22.04
  • ubuntu 22.04

  • Check this box to trigger a request for Renovate to run again on this repository

Failure on install.

Logs:

Collecting arc4
  Using cached arc4-0.0.2.tar.gz (3.7 kB)
Building wheels for collected packages: arc4
  Building wheel for arc4 (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'c:\users\alexc\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\alexc\\AppData\\Local\\Temp\\pip-install-_daxeifk\\arc4\\setup.py'"'"'; __file__='"'"'C:\\Users\\alexc\\AppData\\Local\\Temp\\pip-install-_daxeifk\\arc4\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\alexc\AppData\Local\Temp\pip-wheel-hxscnlko'
       cwd: C:\Users\alexc\AppData\Local\Temp\pip-install-_daxeifk\arc4\
  Complete output (12 lines):
  running bdist_wheel
  running build
  running build_ext
  building 'arc4' extension
  creating build
  creating build\temp.win32-3.8
  creating build\temp.win32-3.8\Release
  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\users\alexc\appdata\local\programs\python\python38-32\include -Ic:\users\alexc\appdata\local\programs\python\python38-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /Tcarc4.c /Fobuild\temp.win32-3.8\Release\arc4.obj -O3
  cl : Command line warning D9002 : ignoring unknown option '-O3'
  arc4.c
  c:\users\alexc\appdata\local\programs\python\python38-32\include\pyconfig.h(59): fatal error C1083: Cannot open include file: 'io.h': No such file or directory
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.26.28801\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2
  ----------------------------------------
  ERROR: Failed building wheel for arc4
  Running setup.py clean for arc4
Failed to build arc4
DEPRECATION: Could not build wheels for arc4 which do not use PEP 517. pip will fall back to legacy 'setup.py install' for these. pip 21.0 will remove support for this functionality. A possible replacement is to fix the wheel build issue reported above. You can find discussion regarding this at https://github.com/pypa/pip/issues/8368.
Installing collected packages: arc4
    Running setup.py install for arc4 ... error
    ERROR: Command errored out with exit status 1:
     command: 'c:\users\alexc\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\alexc\\AppData\\Local\\Temp\\pip-install-_daxeifk\\arc4\\setup.py'"'"'; __file__='"'"'C:\\Users\\alexc\\AppData\\Local\\Temp\\pip-install-_daxeifk\\arc4\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\alexc\AppData\Local\Temp\pip-record-a0ya45_6\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\alexc\appdata\local\programs\python\python38-32\Include\arc4'
         cwd: C:\Users\alexc\AppData\Local\Temp\pip-install-_daxeifk\arc4\
    Complete output (12 lines):
    running install
    running build
    running build_ext
    building 'arc4' extension
    creating build
    creating build\temp.win32-3.8
    creating build\temp.win32-3.8\Release
    C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\users\alexc\appdata\local\programs\python\python38-32\include -Ic:\users\alexc\appdata\local\programs\python\python38-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /Tcarc4.c /Fobuild\temp.win32-3.8\Release\arc4.obj -O3
    cl : Command line warning D9002 : ignoring unknown option '-O3'
    arc4.c
    c:\users\alexc\appdata\local\programs\python\python38-32\include\pyconfig.h(59): fatal error C1083: Cannot open include file: 'io.h': No such file or directory
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.26.28801\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\alexc\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\alexc\\AppData\\Local\\Temp\\pip-install-_daxeifk\\arc4\\setup.py'"'"'; __file__='"'"'C:\\Users\\alexc\\AppData\\Local\\Temp\\pip-install-_daxeifk\\arc4\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\alexc\AppData\Local\Temp\pip-record-a0ya45_6\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\alexc\appdata\local\programs\python\python38-32\Include\arc4' Check the logs for full command output.```

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.