我正在使用Windows上的python 2.7和keyring-3.2.1创建一个应用程序.在我的eclipse上的python代码中,我使用了
import keyring
keyring.set_password("service","jsonkey",json_res)
json_res= keyring.get_password("service","jsonkey")
Run Code Online (Sandbox Code Playgroud)
工作正常,因为我在密钥环中存储json响应.但是,当我使用py2exe将python代码转换为exe时,它会在制作dist时显示导入错误密钥环.请建议如何在py2exe中包含密钥环.
Traceback (most recent call last):
File "APP.py", line 8, in <module>
File "keyring\__init__.pyc", line 12, in <module>
File "keyring\core.pyc", line 15, in <module>
File "keyring\util\platform_.pyc", line 4, in <module>
File "keyring\util\platform.pyc", line 29, in <module>
AttributeError: 'module' object has no attribute 'system'
Run Code Online (Sandbox Code Playgroud)
platform_.py代码是:
from __future__ import absolute_import
import os
import platform
def _data_root_Windows():
try:
root = os.environ['LOCALAPPDATA']
except KeyError:
# Windows XP
root = os.path.join(os.environ['USERPROFILE'], 'Local Settings')
return os.path.join(root, 'Python …Run Code Online (Sandbox Code Playgroud) 我使用mercurial密钥环扩展将密码存储到BitBucket上的远程存储库,所以每次推送到远程存储库时我都不必输入密码.具有讽刺意味的是,每当我需要访问它时,它会要求我输入密码来解锁密钥环; 从而完全减轻了我对它的目的.我究竟做错了什么?
在我的全局mercurial配置(〜/ .hgrc)中,我有以下几行:
[extensions]
hgext.mercurial_keyring = /etc/mercurial/mercurial_keyring.py
Run Code Online (Sandbox Code Playgroud)
在我的repo mercurial config(.hg/hgrc)中,我有:
[paths]
default = https://username@bitbucket.org/username/repo
Run Code Online (Sandbox Code Playgroud)
例:
> hg out
> comparing with https://username@bitbucket.org/username/repo
> Please enter password for encrypted keyring:
Run Code Online (Sandbox Code Playgroud)
我已经尝试卸载密钥环并再次尝试.我也玩过我在网上找到的配置设置无济于事.关于mercurial,我也找不到关于加密密钥环和非加密密钥环的任何内容.
我怎样才能获得它,以便在我对远程仓库执行操作时根本不需要输入密码?
我在python中创建一个需要存储密钥的应用程序.我使用密钥环模块来存储密钥.我使用python-2.7和osx 10.8.5与密钥环3.2(easy_install密钥环).代码在eclipse上正常运行,但是当我使用py2app将代码转换为应用程序时,它显示错误的MYAPP错误打开控制台终止
import keyring
keyring.set_password("title","section","keys")
res= keyring.get_password("title","section")
Run Code Online (Sandbox Code Playgroud)
我在键入"python setup.py py2app"时包含终端响应废料,同时通过py2app制作dist
byte-compiling /Library/Python/2.7/site-packages/keyring-3.2-py2.7.egg/keyring/__init__.py to keyring/__init__.pyc
creating /Users/fis/Desktop/build/bdist.macosx-10.8-intel/python2.7-semi_standalone/app/collect/keyring
byte-compiling /Library/Python/2.7/site-packages/keyring-3.2-py2.7.egg/keyring/backend.py to keyring/backend.pyc
byte-compiling /Library/Python/2.7/site-packages/keyring-3.2-py2.7.egg/keyring/core.py to keyring/core.pyc
byte-compiling /Library/Python/2.7/site-packages/keyring-3.2-py2.7.egg/keyring/errors.py to keyring/errors.pyc
byte-compiling /Library/Python/2.7/site-packages/keyring-3.2-py2.7.egg/keyring/getpassbackend.py to keyring/getpassbackend.pyc
byte-compiling /Library/Python/2.7/site-packages/keyring-3.2-py2.7.egg/keyring/py27compat.py to keyring/py27compat.pyc
byte-compiling /Library/Python/2.7/site-packages/keyring-3.2-py2.7.egg/keyring/util/__init__.py to keyring/util/__init__.pyc
creating /Users/fis/Desktop/build/bdist.macosx-10.8-intel/python2.7-semi_standalone/app/collect/keyring/util
byte-compiling /Library/Python/2.7/site-packages/keyring-3.2-py2.7.egg/keyring/util/platform_.py to keyring/util/platform_.pyc
byte-compiling /Library/Python/2.7/site-packages/keyring-3.2-py2.7.egg/keyring/util/properties.py to keyring/util/properties.pyc
byte-compiling /Library/Python/2.7/site-packages/pathtools-0.1.2-py2.7.egg/pathtools/__init__.pyc to pathtools/__init__.pyc
creating /Users/fis/Desktop/build/bdist.macosx-10.8-intel/python2.7-semi_standalone/app/collect/pathtools
Run Code Online (Sandbox Code Playgroud) 我做了以下事情:
hg clone ... somelink.to.repo.in.hg ... Giga
cd Giga
ls(...它显示giga目录中存在giga.txt文件)
vi giga.txt(...做了一些改动..)
hg commit -m"byte"
hg out(得到以下错误)
** unknown exception encountered, details follow
** report bug details to http://mercurial.selenic.com/bts/
** or mercurial@selenic.com
** Mercurial Distributed SCM (version 1.5)
** Extensions loaded: acl, bugzilla, children, churn, color, convert, extdiff, fetch, gpg, graphlog, hgcia, hgk, highlight, interhg, keyword, mercurial_keyring, mq, notify, pager, patchbomb, progress, purge, rebase, record, relink, schemes, share, transplant, zeroconf
Traceback (most recent call last):
File "/usr/bin/hg", line 27, in …Run Code Online (Sandbox Code Playgroud) 我在Windows XP上运行TortoiseHg。我启用了mercurial_keyring扩展程序。
通过mercurial_keyring扩展名存储密码后,是否可以删除密码?
一个典型的用例是:
用户A在远程存储库上没有推送特权。位于同一位置的用户B确实具有推送特权。用户B在用户A的计算机上输入其用户名和密码,以允许进行推送。
如何从用户A的计算机中删除用户B的凭据?
我试图在 .hgrc 文件中插入包含我的用户名和密码的 Mercurial_keyring 文件,但它不存在于 Windows 上的我的用户目录中。我已经安装了 tortoise hg,甚至在命令提示符下检查了它是否已正确安装,但我仍然没有 .hgrc 文件夹。
谁能告诉我这可能是什么原因?
谢谢
有人可以告诉我为什么我最后没有发现任何变化吗?
另外,我收到一条烦人的消息:“ .hg/hgrc 中未指定用户名。密钥环将不会被使用。 ”
版本工具:HG最新版本 服务器:Linux 工作空间:~/2012WS
LinuxServer123:~/2012WS # hg 克隆 http://LinuxServer123/hg/GigaTest/
.hg/hgrc 中未指定用户名。将不会使用钥匙圈。
需要http授权
领域:Mercurial 存储库
用户: u123456
密码:
目标目录:GigaTest
请求所有更改
添加变更集
添加清单
添加文件更改
添加了 14 个变更集,其中对 575 个文件进行了 585 项更改(+1 个头)
更新了 2 个文件,合并了 0 个文件,删除了 0 个文件,0 个文件未解决
更新到分支默认值
0 个文件已更新、0 个文件已合并、0 个文件已删除、0 个文件未解决
LinuxServer123:~/2012WS #
LinuxServer123:~/2012WS # cd GigaTest/
LinuxServer123:~/2012WS/GigaTest # ls -tlr
总计 12
-rw-r--r-- 1 root root 25 Jan 10 16:36 hello.py
-rw-r--r-- 1 root root 25 Jan 10 16:36 HELLO-UP.PY
drwxr-xr-x 4 … mercurial ×5
python ×2
tortoisehg ×2
credentials ×1
directory ×1
json ×1
ldap ×1
linux ×1
macos ×1
output ×1
push ×1
py2exe ×1
python-2.7 ×1
windows ×1